From jm.horschig at donders.ru.nl Mon Feb 3 09:10:39 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 09:10:39 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: Message-ID: <52EF4EFF.3010304@donders.ru.nl> Hi Joram, this might be a stupid question, but is there a grandavg{1}.anatomy field at all? Best, Jörn On 1/31/2014 12:44 PM, Joram van Driel wrote: > Hi all, > > I'm trying to plot the grand average of a source analysis. However no > matter what I try, the result of ft_sourcegrandaverage keeps giving me > only the functional data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell structure): > > temp = zeros([length(nsubjects) size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one subject one condition > customavg.avg.pow = squeeze(mean(temp,1)); % and replace power with > the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Feb 3 09:19:35 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 09:19:35 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> Message-ID: <52EF5117.6070700@donders.ru.nl> Hi Victoria, is there anything wrong with the code you used below? By smoothing, do you refer to smoothing in the frequency domain? Best, Jörn On 1/30/2014 11:33 AM, Victoria Schröder wrote: > Hello > > I am currently working on a freqanalysis as a first step to do a > connectivityanalysis. I am a bit unsure about the method to use for > the freqanalysis. My stimuli are very long: between 29 and 30 sec. In > total i have 4 stimuli per condition and 2 seperate conditions. I am > looking at the beta range so fairly low frequencies. > > this is my code: > Am i using the right taper and method. Should i smooth the data? and > if so, what should such a smoothing parameter depend on? > > %fourier analysis > cfg=[]; > cfg.output='fourier'; > cfg.method='mtmfft'; > cfg.foi=[12:30]; > cfg.taper='hanning'; > cfg.keeptrials='yes'; > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > frefourier=ft_freqanalysis(cfg,data_clean); > > > %coherence analysis > cfg=[]; > cfg.method='coh'; > cfg.channelcmb={'B3' 'C15' > 'B3' 'C10' > 'B23' 'C15' > 'B23' 'C10'} > coherence=ft_connectivityanalysis(cfg, frefourier); > > > Thank you very much for the suggestions! > Best > Victoria > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From joramvandriel at gmail.com Mon Feb 3 09:59:20 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 3 Feb 2014 09:59:20 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: <52EF4EFF.3010304@donders.ru.nl> References: <52EF4EFF.3010304@donders.ru.nl> Message-ID: Hi Jörn, Not a stupid question at all, because indeed there isn't. I thought that was the problem too; I already tried putting the .anatomy field of one of the (normalized) subjects into the grandavg structure, but that resulted in a bunch of errors due to an error in the cornerpoints function. This is how the grandavg structure looks like after ft_sourcegrandaverage (fieldtrip version 20140127): pos: [7109137x3 double] dim: [181 217 181] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' inside: [1550519x1 double] outside: [5558618x1 double] df: [7109137x1 double] cfg: [1x1 struct] This my cfg: grandavg = cell(1,2); cfg = []; cfg.parameter = 'avg.pow'; cfg.keepindividual = 'no'; grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition 1 grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition 2 Hope you can find out what the problem is..! Thanks a lot, Joram On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Joram, > > this might be a stupid question, but is there a grandavg{1}.anatomy field > at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > >> Hi all, >> >> I'm trying to plot the grand average of a source analysis. However no >> matter what I try, the result of ft_sourcegrandaverage keeps giving me only >> the functional data, no anatomy. >> >> My cfg for ft_sourceplot is: >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'no'; >> cfg.funparameter = 'avg.pow'; >> cfg.maskparameter = cfg.funparameter; >> cfg.funcolorlim = [0 0.2]; >> cfg.opacitylim = [0 0.2]; >> cfg.opacitymap = 'rampup'; >> >> ft_sourceplot(cfg,grandavg{1}) >> >> I thus created my own grandaverage, like this (where sourceDiffAll{:,:} >> is a subject-by-condition cell structure): >> >> temp = zeros([length(nsubjects) size(sourceDiffAll{1,1}.avg.pow)]); >> for s=1:length(nsubjects) >> temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - >> sourceDiffAll{s,1}.avg.pow; % create condition contrast >> end >> customavg = sourceDiffAll{1,1}; % just copy one subject one condition >> customavg.avg.pow = squeeze(mean(temp,1)); % and replace power with the >> grand average power condition-contrast >> >> Now using ft_sourceplot on customavg works just fine. >> Any idea of what's going wrong with ft_sourceplot on >> ft_sourcegrandaverage? >> Thanks! >> >> - Joram >> >> >> -- >> Joram van Driel, MSc. >> PhD student @ University of Amsterdam >> Brain & Cognition @ Department of Psychology >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Mon Feb 3 10:56:34 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 10:56:34 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: <52EF4EFF.3010304@donders.ru.nl> Message-ID: <52EF67D2.1050208@donders.ru.nl> Hi Joram, you probably need to interpolate to a template and then put the pos and dim field from the template you used in the source structure. You do not have to interpolate, but then make sure that the dimensions of your anatomy match the dimensions of your sourcemodel. Not sure if you followed any tutorial, but this is a good one: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended Best, Jörn On 2/3/2014 9:59 AM, Joram van Driel wrote: > Hi Jörn, > Not a stupid question at all, because indeed there isn't. I thought > that was the problem too; I already tried putting the .anatomy field > of one of the (normalized) subjects into the grandavg structure, but > that resulted in a bunch of errors due to an error in the cornerpoints > function. > This is how the grandavg structure looks like after > ft_sourcegrandaverage (fieldtrip version 20140127): > > pos: [7109137x3 double] > dim: [181 217 181] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > inside: [1550519x1 double] > outside: [5558618x1 double] > df: [7109137x1 double] > cfg: [1x1 struct] > > This my cfg: > > grandavg = cell(1,2); > cfg = []; > cfg.parameter = 'avg.pow'; > cfg.keepindividual = 'no'; > grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition 1 > grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition 2 > > Hope you can find out what the problem is..! > > Thanks a lot, > Joram > > > > On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" > > wrote: > > Hi Joram, > > this might be a stupid question, but is there a > grandavg{1}.anatomy field at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > > Hi all, > > I'm trying to plot the grand average of a source analysis. > However no matter what I try, the result of > ft_sourcegrandaverage keeps giving me only the functional > data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell structure): > > temp = zeros([length(nsubjects) > size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one subject one > condition > customavg.avg.pow = squeeze(mean(temp,1)); % and replace power > with the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From victorias at dsv.su.se Mon Feb 3 11:15:07 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Mon, 03 Feb 2014 11:15:07 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF5117.6070700@donders.ru.nl> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> Message-ID: <087550bc51e8099724e221be5016154f@dsv.su.se> Dear Jörn, the code works but i dont know whether my data is logical and whether i decided to use the right method etc. My trials are pretty long (approx 30 sec but all are not the same length) and i am interested in beta frequency. First, it is not really clear to me whether i should use cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the latter calculates the FFT for shorter self-specified time windows to look at changes in power over time. Is that right? however, if i have more stimuli for one condition, how is the time component then taken into account? does mtmconvol take all trials of one condition and average the the power for each time window over all trials? Or is each trial treated seperatly? Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq when using cfg.taper='hanning'? As i understand hanning if appropriate for lower freuquencies so i should use this taper to assess beta frequencies. Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? Thank you a lot for the help Best Victoria 2014-02-03 09:19 skrev Jörn M. Horschig: > Hi Victoria, > > is there anything wrong with the code you used below? By smoothing, > do you refer to smoothing in the frequency domain? > > Best, > Jörn > > > On 1/30/2014 11:33 AM, Victoria Schröder wrote: >> Hello >> >> I am currently working on a freqanalysis as a first step to do a >> connectivityanalysis. I am a bit unsure about the method to use for >> the freqanalysis. My stimuli are very long: between 29 and 30 sec. In >> total i have 4 stimuli per condition and 2 seperate conditions. I am >> looking at the beta range so fairly low frequencies. >> >> this is my code: >> Am i using the right taper and method. Should i smooth the data? and >> if so, what should such a smoothing parameter depend on? >> >> %fourier analysis >> cfg=[]; >> cfg.output='fourier'; >> cfg.method='mtmfft'; >> cfg.foi=[12:30]; >> cfg.taper='hanning'; >> cfg.keeptrials='yes'; >> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >> frefourier=ft_freqanalysis(cfg,data_clean); >> >> >> %coherence analysis >> cfg=[]; >> cfg.method='coh'; >> cfg.channelcmb={'B3' 'C15' >> 'B3' 'C10' >> 'B23' 'C15' >> 'B23' 'C10'} >> coherence=ft_connectivityanalysis(cfg, frefourier); >> >> >> Thank you very much for the suggestions! >> Best >> Victoria >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From jm.horschig at donders.ru.nl Mon Feb 3 11:42:06 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 03 Feb 2014 11:42:06 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <087550bc51e8099724e221be5016154f@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> Message-ID: <52EF727E.2080902@donders.ru.nl> Hi Victoria, you might want to read the relevant part of the walkthrough for your questions on mtmconvol and mtmfft: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis Then, also doing this tutorial might help in understanding what the different methods are doing: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis And lastly, to shortly answer your questions, see below ;) On 2/3/2014 11:15 AM, Victoria Schröder wrote: > Dear Jörn, Hi ;) > > the code works but i dont know whether my data is logical and whether > i decided to use the right method etc. maybe you should try to get into one of the FieldTrip courses :) This might tremendously help you in understanding what's being done and why. Otherwise, try to read as much as you can, read methods of papers and discuss with your supervisor and colleagues. Of course, on the mailing list we also like to help a lot. > > My trials are pretty long (approx 30 sec but all are not the same > length) and i am interested in beta frequency. > > First, it is not really clear to me whether i should use > cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the > latter calculates the FFT for shorter self-specified time windows to > look at changes in power over time. Is that right? yep, about right. > however, if i have more stimuli for one condition, how is the time > component then taken into account? it depends on how you segmented your data. FieldTrip is just transforming your preprocessed data, so whatever you put in is what you get out. > does mtmconvol take all trials of one condition and average the the > power for each time window over all trials? Or is each trial treated > seperatly? depends on whether you specify cfg.keeptrials = 'yes' or 'no' > > Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq > when using cfg.taper='hanning'? no, a hanning taper is always a single taper. Only when combining multiple tapers you can effectively smooth in the frequency domain. this is implemented as taper='dpss' > As i understand hanning if appropriate for lower freuquencies so i > should use this taper to assess beta frequencies. this is a rule of thumb, but there is nothing wrong with using multitapering for lower frequencies. It depends on what you expect from your data and what you want to achieve. > > Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? this depends on the frequencies you are interested in. I wouldn't trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. > > Thank you a lot for the help you're welcome, hope this helps > Best > Victoria Likewise, Jörn > > > 2014-02-03 09:19 skrev Jörn M. Horschig: >> Hi Victoria, >> >> is there anything wrong with the code you used below? By smoothing, >> do you refer to smoothing in the frequency domain? >> >> Best, >> Jörn >> >> >> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>> Hello >>> >>> I am currently working on a freqanalysis as a first step to do a >>> connectivityanalysis. I am a bit unsure about the method to use for >>> the freqanalysis. My stimuli are very long: between 29 and 30 sec. >>> In total i have 4 stimuli per condition and 2 seperate conditions. I >>> am looking at the beta range so fairly low frequencies. >>> >>> this is my code: >>> Am i using the right taper and method. Should i smooth the data? and >>> if so, what should such a smoothing parameter depend on? >>> >>> %fourier analysis >>> cfg=[]; >>> cfg.output='fourier'; >>> cfg.method='mtmfft'; >>> cfg.foi=[12:30]; >>> cfg.taper='hanning'; >>> cfg.keeptrials='yes'; >>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>> frefourier=ft_freqanalysis(cfg,data_clean); >>> >>> >>> %coherence analysis >>> cfg=[]; >>> cfg.method='coh'; >>> cfg.channelcmb={'B3' 'C15' >>> 'B3' 'C10' >>> 'B23' 'C15' >>> 'B23' 'C10'} >>> coherence=ft_connectivityanalysis(cfg, frefourier); >>> >>> >>> Thank you very much for the suggestions! >>> Best >>> Victoria >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Mon Feb 3 11:38:21 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 3 Feb 2014 11:38:21 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <087550bc51e8099724e221be5016154f@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> Message-ID: Dear Victoria, Those are all very good questions. It might be very beneficial for you to go through the following tutorial once: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis I think many of the questions you have will be answered along the way. If not (or if you've already read the tutorial), feel free to ask of course! Best, Eelke On 3 February 2014 11:15, Victoria Schröder wrote: > Dear Jörn, > > the code works but i dont know whether my data is logical and whether i > decided to use the right method etc. > > My trials are pretty long (approx 30 sec but all are not the same length) > and i am interested in beta frequency. > > First, it is not really clear to me whether i should use cfg.method=mtmfft > or cfg.method=mtmconvol. As i understand , the latter calculates the FFT > for shorter self-specified time windows to look at changes in power over > time. Is that right? however, if i have more stimuli for one condition, how > is the time component then taken into account? does mtmconvol take all > trials of one condition and average the the power for each time window over > all trials? Or is each trial treated seperatly? > > Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq when > using cfg.taper='hanning'? As i understand hanning if appropriate for lower > freuquencies so i should use this taper to assess beta frequencies. > > Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? > > Thank you a lot for the help > Best > Victoria > > > 2014-02-03 09:19 skrev Jörn M. Horschig: > >> Hi Victoria, >> >> is there anything wrong with the code you used below? By smoothing, >> do you refer to smoothing in the frequency domain? >> >> Best, >> Jörn >> >> >> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>> >>> Hello >>> >>> I am currently working on a freqanalysis as a first step to do a >>> connectivityanalysis. I am a bit unsure about the method to use for the >>> freqanalysis. My stimuli are very long: between 29 and 30 sec. In total i >>> have 4 stimuli per condition and 2 seperate conditions. I am looking at the >>> beta range so fairly low frequencies. >>> >>> this is my code: >>> Am i using the right taper and method. Should i smooth the data? and if >>> so, what should such a smoothing parameter depend on? >>> >>> %fourier analysis >>> cfg=[]; >>> cfg.output='fourier'; >>> cfg.method='mtmfft'; >>> cfg.foi=[12:30]; >>> cfg.taper='hanning'; >>> cfg.keeptrials='yes'; >>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>> frefourier=ft_freqanalysis(cfg,data_clean); >>> >>> >>> %coherence analysis >>> cfg=[]; >>> cfg.method='coh'; >>> cfg.channelcmb={'B3' 'C15' >>> 'B3' 'C10' >>> 'B23' 'C15' >>> 'B23' 'C10'} >>> coherence=ft_connectivityanalysis(cfg, frefourier); >>> >>> >>> Thank you very much for the suggestions! >>> Best >>> Victoria >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 victorias at dsv.su.se Mon Feb 3 12:14:07 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Mon, 03 Feb 2014 12:14:07 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF727E.2080902@donders.ru.nl> References: "<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> Message-ID: <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> Thank Jörn, Thank for the advice for the tutorials but i have already looked at them a lot. Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged power over trials? what happens then when the trials do not have the same length? and a last question :) what does cfg.toi depend on ? in the tutorial time frequency analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the case? I hope this should be it for now Best Victoria 2014-02-03 11:42 skrev Jörn M. Horschig: > Hi Victoria, > > you might want to read the relevant part of the walkthrough for your > questions on mtmconvol and mtmfft: > http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis > > Then, also doing this tutorial might help in understanding what the > different methods are doing: > http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis > > And lastly, to shortly answer your questions, see below ;) > > On 2/3/2014 11:15 AM, Victoria Schröder wrote: >> Dear Jörn, > Hi ;) > >> >> the code works but i dont know whether my data is logical and >> whether i decided to use the right method etc. > maybe you should try to get into one of the FieldTrip courses :) This > might tremendously help you in understanding what's being done and > why. Otherwise, try to read as much as you can, read methods of > papers > and discuss with your supervisor and colleagues. Of course, on the > mailing list we also like to help a lot. >> >> My trials are pretty long (approx 30 sec but all are not the same >> length) and i am interested in beta frequency. >> >> First, it is not really clear to me whether i should use >> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >> latter calculates the FFT for shorter self-specified time windows to >> look at changes in power over time. Is that right? yep, about right. > >> however, if i have more stimuli for one condition, how is the time >> component then taken into account? it depends on how you segmented >> your data. FieldTrip is just transforming your preprocessed data, so >> whatever you put in is what you get out. > >> does mtmconvol take all trials of one condition and average the the >> power for each time window over all trials? Or is each trial treated >> seperatly? > depends on whether you specify cfg.keeptrials = 'yes' or 'no' >> >> Say i would use cfg.method=mtmfft do i need to specify a >> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >> always a single taper. Only when combining multiple tapers you can >> effectively smooth in the frequency domain. this is implemented as >> taper='dpss' > >> As i understand hanning if appropriate for lower freuquencies so i >> should use this taper to assess beta frequencies. > this is a rule of thumb, but there is nothing wrong with using > multitapering for lower frequencies. It depends on what you expect > from your data and what you want to achieve. >> >> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? > this depends on the frequencies you are interested in. I wouldn't > trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. > >> >> Thank you a lot for the help > you're welcome, hope this helps >> Best >> Victoria > Likewise, > Jörn > >> >> >> 2014-02-03 09:19 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> is there anything wrong with the code you used below? By smoothing, >>> do you refer to smoothing in the frequency domain? >>> >>> Best, >>> Jörn >>> >>> >>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>> Hello >>>> >>>> I am currently working on a freqanalysis as a first step to do a >>>> connectivityanalysis. I am a bit unsure about the method to use for >>>> the freqanalysis. My stimuli are very long: between 29 and 30 sec. >>>> In total i have 4 stimuli per condition and 2 seperate conditions. I >>>> am looking at the beta range so fairly low frequencies. >>>> >>>> this is my code: >>>> Am i using the right taper and method. Should i smooth the data? >>>> and if so, what should such a smoothing parameter depend on? >>>> >>>> %fourier analysis >>>> cfg=[]; >>>> cfg.output='fourier'; >>>> cfg.method='mtmfft'; >>>> cfg.foi=[12:30]; >>>> cfg.taper='hanning'; >>>> cfg.keeptrials='yes'; >>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>> >>>> >>>> %coherence analysis >>>> cfg=[]; >>>> cfg.method='coh'; >>>> cfg.channelcmb={'B3' 'C15' >>>> 'B3' 'C10' >>>> 'B23' 'C15' >>>> 'B23' 'C10'} >>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>> >>>> >>>> Thank you very much for the suggestions! >>>> Best >>>> Victoria >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From joramvandriel at gmail.com Mon Feb 3 12:19:52 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 3 Feb 2014 12:19:52 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: <52EF67D2.1050208@donders.ru.nl> References: <52EF4EFF.3010304@donders.ru.nl> <52EF67D2.1050208@donders.ru.nl> Message-ID: Hi Jörn, Hi Joram, > > you probably need to interpolate to a template and then put the pos and > dim field from the template you used in the source structure. With source structure you mean the result from ft_sourcegrandaverage? That already has a pos and dim field. Or the subject individual source structures, *after* ft_sourceinterpolate but *before* ft_volumenormalise? > You do not have to interpolate, but then make sure that the dimensions of > your anatomy match the dimensions of your sourcemodel. > I'm not sure what you mean here. I did for each subject ft_sourceinterpolate and ft_volumenormalise. Shouldn't then ft_sourcegrandaverage give me something that I could plot with ft_sourceplot? Or am I asking too much of FieldTrip right now :) According to the regular beamforming tutorial this should be possible. But I will try the steps from the extended tutorial (and this one might be useful as well: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) and see how far that brings me! Thanks, Joram > > Not sure if you followed any tutorial, but this is a good one: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended > > Best, > Jörn > > > > On 2/3/2014 9:59 AM, Joram van Driel wrote: > >> Hi Jörn, >> Not a stupid question at all, because indeed there isn't. I thought that >> was the problem too; I already tried putting the .anatomy field of one of >> the (normalized) subjects into the grandavg structure, but that resulted in >> a bunch of errors due to an error in the cornerpoints function. >> This is how the grandavg structure looks like after ft_sourcegrandaverage >> (fieldtrip version 20140127): >> >> pos: [7109137x3 double] >> dim: [181 217 181] >> avg: [1x1 struct] >> var: [1x1 struct] >> dimord: 'voxel' >> inside: [1550519x1 double] >> outside: [5558618x1 double] >> df: [7109137x1 double] >> cfg: [1x1 struct] >> >> This my cfg: >> >> grandavg = cell(1,2); >> cfg = []; >> cfg.parameter = 'avg.pow'; >> cfg.keepindividual = 'no'; >> grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition >> 1 >> grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition >> 2 >> >> Hope you can find out what the problem is..! >> >> Thanks a lot, >> Joram >> >> >> >> On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" < >> jm.horschig at donders.ru.nl > wrote: >> >> Hi Joram, >> >> this might be a stupid question, but is there a >> grandavg{1}.anatomy field at all? >> >> Best, >> Jörn >> >> >> On 1/31/2014 12:44 PM, Joram van Driel wrote: >> >> Hi all, >> >> I'm trying to plot the grand average of a source analysis. >> However no matter what I try, the result of >> ft_sourcegrandaverage keeps giving me only the functional >> data, no anatomy. >> >> My cfg for ft_sourceplot is: >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'no'; >> cfg.funparameter = 'avg.pow'; >> cfg.maskparameter = cfg.funparameter; >> cfg.funcolorlim = [0 0.2]; >> cfg.opacitylim = [0 0.2]; >> cfg.opacitymap = 'rampup'; >> >> ft_sourceplot(cfg,grandavg{1}) >> >> I thus created my own grandaverage, like this (where >> sourceDiffAll{:,:} is a subject-by-condition cell structure): >> >> temp = zeros([length(nsubjects) >> size(sourceDiffAll{1,1}.avg.pow)]); >> for s=1:length(nsubjects) >> temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - >> sourceDiffAll{s,1}.avg.pow; % create condition contrast >> end >> customavg = sourceDiffAll{1,1}; % just copy one subject one >> condition >> customavg.avg.pow = squeeze(mean(temp,1)); % and replace power >> with the grand average power condition-contrast >> >> Now using ft_sourceplot on customavg works just fine. >> Any idea of what's going wrong with ft_sourceplot on >> ft_sourcegrandaverage? >> Thanks! >> >> - Joram >> >> >> -- Joram van Driel, MSc. >> PhD student @ University of Amsterdam >> Brain & Cognition @ Department of Psychology >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Mon Feb 3 13:37:44 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 13:37:44 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: <52EF4EFF.3010304@donders.ru.nl> <52EF67D2.1050208@donders.ru.nl> Message-ID: <52EF8D98.5030202@donders.ru.nl> Hi Joram, the (regular) beamforming tutorial is dealing only with the single subject case. The extended sets the stage for averaging over subjects as well. I think all of your questions will be answered when you went through that one. Otherwise, feel free to ask any questions that remain open ;) Best, Jörn On 2/3/2014 12:19 PM, Joram van Driel wrote: > Hi Jörn, > > Hi Joram, > > you probably need to interpolate to a template and then put the > pos and dim field from the template you used in the source structure. > > > With source structure you mean the result from ft_sourcegrandaverage? > That already has a pos and dim field. Or the subject individual source > structures, *after* ft_sourceinterpolate but *before* ft_volumenormalise? > > You do not have to interpolate, but then make sure that the > dimensions of your anatomy match the dimensions of your sourcemodel. > > > I'm not sure what you mean here. I did for each subject > ft_sourceinterpolate and ft_volumenormalise. Shouldn't then > ft_sourcegrandaverage give me something that I could plot with > ft_sourceplot? Or am I asking too much of FieldTrip right now :) > According to the regular beamforming tutorial this should be possible. > > But I will try the steps from the extended tutorial (and this one > might be useful as well: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > and see how far that brings me! > > Thanks, > Joram > > > Not sure if you followed any tutorial, but this is a good one: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended > > Best, > Jörn > > > > On 2/3/2014 9:59 AM, Joram van Driel wrote: > > Hi Jörn, > Not a stupid question at all, because indeed there isn't. I > thought that was the problem too; I already tried putting the > .anatomy field of one of the (normalized) subjects into the > grandavg structure, but that resulted in a bunch of errors due > to an error in the cornerpoints function. > This is how the grandavg structure looks like after > ft_sourcegrandaverage (fieldtrip version 20140127): > > pos: [7109137x3 double] > dim: [181 217 181] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > inside: [1550519x1 double] > outside: [5558618x1 double] > df: [7109137x1 double] > cfg: [1x1 struct] > > This my cfg: > > grandavg = cell(1,2); > cfg = []; > cfg.parameter = 'avg.pow'; > cfg.keepindividual = 'no'; > grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % > condition 1 > grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % > condition 2 > > Hope you can find out what the problem is..! > > Thanks a lot, > Joram > > > > On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" > > >> wrote: > > Hi Joram, > > this might be a stupid question, but is there a > grandavg{1}.anatomy field at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > > Hi all, > > I'm trying to plot the grand average of a source analysis. > However no matter what I try, the result of > ft_sourcegrandaverage keeps giving me only the functional > data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell > structure): > > temp = zeros([length(nsubjects) > size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one > subject one > condition > customavg.avg.pow = squeeze(mean(temp,1)); % and > replace power > with the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > > > > Tel: +31-(0)24-36-68493 > > > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Feb 3 13:40:55 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 03 Feb 2014 13:40:55 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> References: "<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> Message-ID: <52EF8E57.6060207@donders.ru.nl> Hi Victoria, On 2/3/2014 12:14 PM, Victoria Schröder wrote: > Thank Jörn, > > Thank for the advice for the tutorials but i have already looked at > them a lot. > > Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged > power over trials? Well, it might sound obvious, but if you say 'yes' to keep trials, you keep the trials, whereas if you say 'no' you do not keep the trials and instead get an average. > what happens then when the trials do not have the same length? The average will be made with all data that is available. If some trials go to 30s but all trials go to 29s, then the average of the last one second is made of less data then the first 29s. This is a crucial point for doing statistics as the degrees of freedom, signal-to noise ration etc. will be different for different time points. > > and a last question :) > > what does cfg.toi depend on ? in the tutorial time frequency analysis > this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the > case? it depends on what time you are interested in and how much memory (and cpu time aka patience) you got. Good luck ;) Best, Jörn > > I hope this should be it for now > Best > Victoria > > > 2014-02-03 11:42 skrev Jörn M. Horschig: >> Hi Victoria, >> >> you might want to read the relevant part of the walkthrough for your >> questions on mtmconvol and mtmfft: >> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >> >> Then, also doing this tutorial might help in understanding what the >> different methods are doing: >> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >> >> And lastly, to shortly answer your questions, see below ;) >> >> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>> Dear Jörn, >> Hi ;) >> >>> >>> the code works but i dont know whether my data is logical and >>> whether i decided to use the right method etc. >> maybe you should try to get into one of the FieldTrip courses :) This >> might tremendously help you in understanding what's being done and >> why. Otherwise, try to read as much as you can, read methods of papers >> and discuss with your supervisor and colleagues. Of course, on the >> mailing list we also like to help a lot. >>> >>> My trials are pretty long (approx 30 sec but all are not the same >>> length) and i am interested in beta frequency. >>> >>> First, it is not really clear to me whether i should use >>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>> latter calculates the FFT for shorter self-specified time windows to >>> look at changes in power over time. Is that right? yep, about right. >> >>> however, if i have more stimuli for one condition, how is the time >>> component then taken into account? it depends on how you segmented >>> your data. FieldTrip is just transforming your preprocessed data, so >>> whatever you put in is what you get out. >> >>> does mtmconvol take all trials of one condition and average the the >>> power for each time window over all trials? Or is each trial treated >>> seperatly? >> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>> >>> Say i would use cfg.method=mtmfft do i need to specify a >>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >>> always a single taper. Only when combining multiple tapers you can >>> effectively smooth in the frequency domain. this is implemented as >>> taper='dpss' >> >>> As i understand hanning if appropriate for lower freuquencies so i >>> should use this taper to assess beta frequencies. >> this is a rule of thumb, but there is nothing wrong with using >> multitapering for lower frequencies. It depends on what you expect >> from your data and what you want to achieve. >>> >>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >> this depends on the frequencies you are interested in. I wouldn't >> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >> >>> >>> Thank you a lot for the help >> you're welcome, hope this helps >>> Best >>> Victoria >> Likewise, >> Jörn >> >>> >>> >>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>> Hi Victoria, >>>> >>>> is there anything wrong with the code you used below? By smoothing, >>>> do you refer to smoothing in the frequency domain? >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>> Hello >>>>> >>>>> I am currently working on a freqanalysis as a first step to do a >>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>> for the freqanalysis. My stimuli are very long: between 29 and 30 >>>>> sec. In total i have 4 stimuli per condition and 2 seperate >>>>> conditions. I am looking at the beta range so fairly low frequencies. >>>>> >>>>> this is my code: >>>>> Am i using the right taper and method. Should i smooth the data? >>>>> and if so, what should such a smoothing parameter depend on? >>>>> >>>>> %fourier analysis >>>>> cfg=[]; >>>>> cfg.output='fourier'; >>>>> cfg.method='mtmfft'; >>>>> cfg.foi=[12:30]; >>>>> cfg.taper='hanning'; >>>>> cfg.keeptrials='yes'; >>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>> >>>>> >>>>> %coherence analysis >>>>> cfg=[]; >>>>> cfg.method='coh'; >>>>> cfg.channelcmb={'B3' 'C15' >>>>> 'B3' 'C10' >>>>> 'B23' 'C15' >>>>> 'B23' 'C10'} >>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>> >>>>> >>>>> Thank you very much for the suggestions! >>>>> Best >>>>> Victoria >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jkhartshorne at gmail.com Mon Feb 3 22:19:41 2014 From: jkhartshorne at gmail.com (Joshua Hartshorne) Date: Mon, 3 Feb 2014 16:19:41 -0500 Subject: [FieldTrip] Interactions Message-ID: Hi Eric, I tried the simulations as you suggested. Rather I simulated several different types of 2X2 datasets. For all of them, permutation analysis worked just fine. Of course, it's possible that I'm doing something wrong, so I'd appreciate your feedback. Here's how I created the data: *between/between*. Normally-distributed data in each of 4 cells. The effect size for e1 and e2 were each set to 1, with a SD of 1. The interaction (if present) was .75 with an SD of 1. There were 40 subjects per cell. *within/within. *For each participant, I generated a random intercept (M=0, SD=.25) and random slopes for both e1 and e2 (M=1, SD=.25) and for the interaction, if present (M=.75, SD=.25). Having generated that, for each participant in each condition, I drew a single sample where the mean was the sum of the effects just listed and the SD=1. *within/between. *The first factor was within subjects and the second was between. Each subject had a random intercept (SD=.25) and a random slope for factor 1 (M=1, SD=.25). The subjects in Level 1 for both factors had a random intercept (M=.75, SD=.25). The between-subject factor was 1. As above, I then generated a single datapoint from a normal distribution (M=1, SD=1). In each case, I ran 500 simulations with an interaction and 500 without. For each, I analyzed either with an ANOVA (ezANOVA in R) or a 500-sample permutation test, as follows: Permutations respected the structure of the data. So in the between/between case, condition labels were permuted freely. In the within/within case, for each subject, I randomly flipped the levels of each factor, preserving structure. That is, each subject had two cells where factor 1 was 0 and two where factor 1 was 1. If the codes switched, both the 1s were turned to 0s and both the 0s were turned to 1s. The same was done for Factor 2. I dealt with the within/between data in an analogous fashion, with the constraint that the same number of subjects be in the each of the between-subject conditions. Having done my permuting, I then calculated the F-stat for the interaction. I then compared the actual F-stat against the resulting distribution. The short description of the result is I got basically the same results for the permutation tests and the ANOVA. For instance, in the within/within case, when there was an actual interaction in the generative model, I got an average p-value of .0844 using ezANOVA and .0858 using permutations. The Type II error was .318 and .312, respectively. When there was no interaction, I got average p-values of .5052 and .5066, respectively, and a Type I error of .036 and .038, respectively. I got analogous results for between/between and within/within. Incidentally, I understand that it isn't strictly necessary to permute condition codes for both factors. But it doesn't seem to do any harm, either. I actually tried the within/between case permuting only the between factor, with similar results. Thanks, Josh On Sun, Jan 26, 2014 at 4:44 AM, wrote: > Hi Steve and Josh, > > > Josh writes > > > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > > and it would be great to see it. > > In general, questions like these are very hard to answer satisfactorily on > a > discussion list. It is dealt with much more easily in person, say at one of > the Fieldtrip courses. However, let me give it a try. > > To prove that something does not work it suffices to produces a single > example that shows the contrary. > > Try the following: > > Generate random data in a 2-by-2 between-subjects design (say, normally > distributed within every cell). Add large main effects (relative to the > within-cell variance; say, MS_beween 50 times larger than MS_within) and no > interaction effect. Take a small number of subjects (say, 5 per cell). Now, > calculate a permutation p-value for the interaction-effect F-statistic by > permuting across all 4 cells. Do this for a large number of simulated data > set. My prediction is that, on average, the F-statistic p-value is less > than > 0.05, which it should be (because there is no interaction effect). > > I have not run this simulation study myself. Let me know if it does not > produce the predicted result. (I cannot guarantee that I'm not missing > something when producing this recipe.) > > > > Best, > > Eric > > > > > > > > -----Original Message----- > > From: Stephen Politzer-Ahles [mailto:politzerahless at gmail.com] > > Sent: zondag 26 januari 2014 8:25 > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] interactions > > > > Hi Josh, > > > > Have you seen this [admittedly pretty old now] message from the > > archives: http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > > January/003447.html > > ? My understanding was that it is ok to test interactions in within- > > subjects designs, and that you could do it by faking a dataset that > > represents the interaction (step 3 in that message) and then doing a > > dependent samples t-test. I had never heard before that interactions > > can't be tested in a within-subjects design, but also it's been a long > > time since I've looked at this issue--I'd definitely be interested to > > hear if this is no longer the recommended way to test interactions. I > > have seen messages saying that it doesn't work for between-subjects > > designs (e.g. > > http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > > September/004244.html), > > but I'm not sure if that's still current. Hopefully someone on the list > > can offer more insight about the second question. > > > > Best, > > Steve > > > > > > > > Message: 2 > > > Date: Fri, 24 Jan 2014 10:54:10 -0500 > > > From: Joshua Hartshorne > > > To: fieldtrip at science.ru.nl > > > Subject: [FieldTrip] interactions > > > Message-ID: > > > > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > > > Hi List! > > > > > > I have seen around a dozen comments in the archives that interactions > > > can't be tested by permutation for within-subject designs. I haven't > > > been able to find a thread that explains why not. It seems like in a > > > 2x2 design, you could still pick one of the conditions and permute > > the > > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > > and it would be great to see it. > > > > > > Similarly, for the mixed design, why permute the between-subject > > labels? > > > Why not permute the within-subject labels instead? Actually, why not > > > do both? I follow the reasoning why permuting both is overkill, but > > > not why it's wrong. > > > > > > If someone could explain, it would be much appreciated. Knowing what > > > to do is good, but it would be even better to understand why. > > > > > > Thanks, > > > Josh > > > -------------- next part -------------- An HTML attachment was > > > scrubbed... > > > URL: > > > > > > b885cb4a/attachment-0001.html> > > > > > > > ------------------------------ > > Message: 2 > Date: Sun, 26 Jan 2014 10:43:58 +0100 > From: Azeez Adebimpe > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group > level > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi Chaitanya , > I would suggest you try analyitcs instead of montecarlo and use stat= > ft_sourcestatitics(cfg, source1a, source2a .................., > source1b,source2b.............);a and b are for the conditions. > Azeez Adebimpe > > > Date: Sun, 26 Jan 2014 09:46:03 +0100 > From: chaitanya.pro at gmail.com > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level > > Hi Eelke, > > No significant results then in my data. I wonder how my boss takes it :P. > Anyway, thanks for your help on a Sunday that too. > >From your reply I also understand that the code doesn't have any mistakes > :) > > =============================================== > > > > Best RegardsChaitanya Srinivas Lanka > > > Wiss. Mitarbeiter PhD Student > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > Eberhard Karls University Eberhard Karls > University > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > D-72076 Tuebingen D-72074 Tuebingen > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > On Sun, Jan 26, 2014 at 9:40 AM, Eelke Spaak > wrote: > > Hi Chaitanya, > stat.prob reflects the 'p-values' resulting from your statistical test. So > voxels expressing e.g. stat.prob < 0.05 should be considered reflecting a > significant difference between conditions. The NaNs correspond to voxels > outside the brain. > > > Since stat.mask is all zeros (which by default is just stat.prob < 0.05), > this indicates there are no significant differences between your > conditions. There is nothing we can help you with in this respect :) > > > Best,Eelke > > On 26 January 2014 09:06, Chaitanya Srinivas > wrote: > > > Hi Eelke, > > I looked at the stat.stat values if that is what you mean. There > are some NaNs , but also some values. Similarly in stat.prob, there are > some 1's. The stat.mask is all zeros as you say. > > > > > Any further suggestions from you? > Thank you > > =============================================== > > > > Best RegardsChaitanya Srinivas Lanka > > > > > Wiss. Mitarbeiter PhD Student > > > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > > > Eberhard Karls University Eberhard Karls > University > > > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > > > D-72076 Tuebingen D-72074 Tuebingen > > > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > > > On Sun, Jan 26, 2014 at 8:53 AM, Eelke Spaak > wrote: > > > > Dear Chaitanya, > Perhaps an obvious question: do you find any significant differences in > the statistics step (inspect the stat structure)? If not, the mask will > consist of all zeroes, hence giving you a 'blank' plot. > > > > > Best,Eelke > > On 26 January 2014 08:46, Chaitanya Srinivas > wrote: > > > > > Dear fieldtrip users, > I would like to do sourcestatistics on a group level with eeg data. I have > a > pre and post intervention measurement for each of my 10 subjects > . After source reconstruction using an DICS beamformer > and volume normalization, I calculated the sourcegrandaverage for the pre > and > post condition and i have avg.pow for each subject. > > However, when I use the grandaverage results in ft_sourcestatistics in the > configuration shown below and plot the result I just get a blank anatomical > mri. It only runs with cfg.parameter="pow" .I tried with cfg.parameter = > 'avg.pow' it doesnt run. > Do I have to set any additional parameters or am I making some mistake? > > > cfg=[]; > cfg.dim = grandAVGsourcePre.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > > nsubj=length(sourcePre.trial); > cfg.design(1,:) = [1:nsubj 1:nsubj]; > cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; > cfg.uvar = 1; > cfg.ivar = 2; > stat = ft_sourcestatistics(cfg, grandAVGsourcePre, grandAVGsourcePost); > and next interpolation > > cfg = []; > > > > > > cfg.voxelcoord = 'no'; > cfg.parameter = 'mask'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > > > > > > mask = > ft_sourceinterpolate(cfg,stat,mri); > statplot.mask = mask.mask; > > > and then for plotting > > > > > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'stat'; > cfg.maskparameter = 'mask'; > cfg.funcolorlim = [-0.1 0.1]; > cfg.opacitylim = [-0.1 0.1]; > figure > ft_sourceplot(cfg, statplot); > > > > > > > > > > > > > > > > > > > > =============================================== > > > > > > > > Best RegardsChaitanya Srinivas Lanka > > Wiss. Mitarbeiter PhD Student > > > > > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > > > > > Eberhard Karls University Eberhard Karls > University > > > > > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > > > > > D-72076 Tuebingen D-72074 Tuebingen > > > > > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140126/9c7c30c0/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: image.png > Type: image/png > Size: 23195 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140126/9c7c30c0/attachment.png > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 38, Issue 49 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa.filevich at gmail.com Tue Feb 4 10:36:56 2014 From: elisa.filevich at gmail.com (elisa filevich) Date: Tue, 4 Feb 2014 10:36:56 +0100 Subject: [FieldTrip] FFT on a single concatenate trial Message-ID: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Dear all, I'm doing frequency tagging on relatively short epochs. My frequency components are clearly there, but the signal-to-noise ratio is very low. In order to improve SNR, I want to try to concatenate the individual trials (with the appropriate epoch length to keep the frequency constant). I simply concatenated all trial and timepoints vectors into a single trial structure, and I now have may data in a structure that has the following fields: appended = label: {1x22 cell} fsample: 512 elec: [1x1 struct] trial: [22x157990 single] time: [1x157990 double] I then run the FFT below, and I get the following error: error('the data does not contain a dimord, but it also does not resemble raw or component data'); Is it possible to run FFT on a single trial? Is there a way to work around this? Best Elisa cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 5:.5:35; cfg.keeptrials = 'no'; FFThann = ft_freqanalysis(cfg, epoched); -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Feb 4 10:44:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 4 Feb 2014 10:44:34 +0100 Subject: [FieldTrip] FFT on a single concatenate trial In-Reply-To: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> References: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Message-ID: Dear Elisa, Raw data is represented with time axes and trials in a cell array (one element per trial), so if you do appended.trial = {appended.trial}; appended.time = {appended.time}; it should work. Best, Eelke On 4 February 2014 10:36, elisa filevich wrote: > Dear all, > > I'm doing frequency tagging on relatively short epochs. My frequency > components are clearly there, but the signal-to-noise ratio is very low. In > order to improve SNR, I want to try to concatenate the individual trials > (with the appropriate epoch length to keep the frequency constant). > > I simply concatenated all trial and timepoints vectors into a single trial > structure, and I now have may data in a structure that has the following > fields: > > > appended = > > label: {1x22 cell} > fsample: 512 > elec: [1x1 struct] > trial: [22x157990 single] > time: [1x157990 double] > > > I then run the FFT below, and I get the following error: > > error('the data does not contain a dimord, but it also does not resemble > raw or component data'); > > Is it possible to run FFT on a single trial? Is there a way to work around > this? > > Best > Elisa > > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'all'; > cfg.method = 'mtmfft'; > cfg.taper = 'hanning'; > cfg.foi = 5:.5:35; > cfg.keeptrials = 'no'; > FFThann = ft_freqanalysis(cfg, epoched); > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From elisa.filevich at gmail.com Tue Feb 4 11:01:29 2014 From: elisa.filevich at gmail.com (elisa filevich) Date: Tue, 4 Feb 2014 11:01:29 +0100 Subject: [FieldTrip] FFT on a single concatenate trial In-Reply-To: References: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Message-ID: <2221B484-313D-4870-ACD3-28A8FDE2BDD1@gmail.com> It did work, many thanks! On Feb 4, 2014, at 10:44 AM, Eelke Spaak wrote: > Dear Elisa, > > Raw data is represented with time axes and trials in a cell array (one > element per trial), so if you do > > appended.trial = {appended.trial}; > appended.time = {appended.time}; > > it should work. > > Best, > Eelke > > On 4 February 2014 10:36, elisa filevich wrote: >> Dear all, >> >> I'm doing frequency tagging on relatively short epochs. My frequency >> components are clearly there, but the signal-to-noise ratio is very low. In >> order to improve SNR, I want to try to concatenate the individual trials >> (with the appropriate epoch length to keep the frequency constant). >> >> I simply concatenated all trial and timepoints vectors into a single trial >> structure, and I now have may data in a structure that has the following >> fields: >> >> >> appended = >> >> label: {1x22 cell} >> fsample: 512 >> elec: [1x1 struct] >> trial: [22x157990 single] >> time: [1x157990 double] >> >> >> I then run the FFT below, and I get the following error: >> >> error('the data does not contain a dimord, but it also does not resemble >> raw or component data'); >> >> Is it possible to run FFT on a single trial? Is there a way to work around >> this? >> >> Best >> Elisa >> >> >> cfg = []; >> cfg.output = 'pow'; >> cfg.channel = 'all'; >> cfg.method = 'mtmfft'; >> cfg.taper = 'hanning'; >> cfg.foi = 5:.5:35; >> cfg.keeptrials = 'no'; >> FFThann = ft_freqanalysis(cfg, epoched); >> >> >> >> _______________________________________________ >> 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 Feb 4 12:16:34 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 4 Feb 2014 12:16:34 +0100 (CET) Subject: [FieldTrip] Interactions In-Reply-To: References: Message-ID: <004e01cf219a$8eb3ec30$ac1bc490$@maris@psych.ru.nl> Hi Josh, You may have found something that is worth exploring. However, it will be challenge to provide a formal proof of the fact that the permutation analysis provides false alarm rate control under the null hypothesis of no interaction effect. The crucial design here is the full between-subjects design, because for the other designs a valid permutation analysis exists (as demonstrated by formal proof). I would embark on a testing-the-limits simulation study: between/between. Normally-distributed data in each of 4 cells. The effect size for e1 and e2 were each set to 1, with a SD of 1. The interaction (if present) was .75 with an SD of 1. There were 40 subjects per cell. Set the effect sizes to 20, reduce the number of subjects to 5 per cell, and simulate data without an interaction effect. I'm curious how the simulated false alarm rate of the permutation test looks like. (After this email, I will not continue this discussion any further. It is becoming a scientific project; interesting though .) Best, Eric within/within. For each participant, I generated a random intercept (M=0, SD=.25) and random slopes for both e1 and e2 (M=1, SD=.25) and for the interaction, if present (M=.75, SD=.25). Having generated that, for each participant in each condition, I drew a single sample where the mean was the sum of the effects just listed and the SD=1. within/between. The first factor was within subjects and the second was between. Each subject had a random intercept (SD=.25) and a random slope for factor 1 (M=1, SD=.25). The subjects in Level 1 for both factors had a random intercept (M=.75, SD=.25). The between-subject factor was 1. As above, I then generated a single datapoint from a normal distribution (M=1, SD=1). In each case, I ran 500 simulations with an interaction and 500 without. For each, I analyzed either with an ANOVA (ezANOVA in R) or a 500-sample permutation test, as follows: Permutations respected the structure of the data. So in the between/between case, condition labels were permuted freely. In the within/within case, for each subject, I randomly flipped the levels of each factor, preserving structure. That is, each subject had two cells where factor 1 was 0 and two where factor 1 was 1. If the codes switched, both the 1s were turned to 0s and both the 0s were turned to 1s. The same was done for Factor 2. I dealt with the within/between data in an analogous fashion, with the constraint that the same number of subjects be in the each of the between-subject conditions. Having done my permuting, I then calculated the F-stat for the interaction. I then compared the actual F-stat against the resulting distribution. The short description of the result is I got basically the same results for the permutation tests and the ANOVA. For instance, in the within/within case, when there was an actual interaction in the generative model, I got an average p-value of .0844 using ezANOVA and .0858 using permutations. The Type II error was .318 and .312, respectively. When there was no interaction, I got average p-values of .5052 and .5066, respectively, and a Type I error of .036 and .038, respectively. I got analogous results for between/between and within/within. Incidentally, I understand that it isn't strictly necessary to permute condition codes for both factors. But it doesn't seem to do any harm, either. I actually tried the within/between case permuting only the between factor, with similar results. Thanks, Josh On Sun, Jan 26, 2014 at 4:44 AM, wrote: Hi Steve and Josh, Josh writes > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > and it would be great to see it. In general, questions like these are very hard to answer satisfactorily on a discussion list. It is dealt with much more easily in person, say at one of the Fieldtrip courses. However, let me give it a try. To prove that something does not work it suffices to produces a single example that shows the contrary. Try the following: Generate random data in a 2-by-2 between-subjects design (say, normally distributed within every cell). Add large main effects (relative to the within-cell variance; say, MS_beween 50 times larger than MS_within) and no interaction effect. Take a small number of subjects (say, 5 per cell). Now, calculate a permutation p-value for the interaction-effect F-statistic by permuting across all 4 cells. Do this for a large number of simulated data set. My prediction is that, on average, the F-statistic p-value is less than 0.05, which it should be (because there is no interaction effect). I have not run this simulation study myself. Let me know if it does not produce the predicted result. (I cannot guarantee that I'm not missing something when producing this recipe.) Best, Eric > -----Original Message----- > From: Stephen Politzer-Ahles [mailto:politzerahless at gmail.com] > Sent: zondag 26 januari 2014 8:25 > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] interactions > > Hi Josh, > > Have you seen this [admittedly pretty old now] message from the > archives: http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > January/003447.html > ? My understanding was that it is ok to test interactions in within- > subjects designs, and that you could do it by faking a dataset that > represents the interaction (step 3 in that message) and then doing a > dependent samples t-test. I had never heard before that interactions > can't be tested in a within-subjects design, but also it's been a long > time since I've looked at this issue--I'd definitely be interested to > hear if this is no longer the recommended way to test interactions. I > have seen messages saying that it doesn't work for between-subjects > designs (e.g. > http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > September/004244.html), > but I'm not sure if that's still current. Hopefully someone on the list > can offer more insight about the second question. > > Best, > Steve > > > > > Message: 2 > > Date: Fri, 24 Jan 2014 10:54:10 -0500 > > From: Joshua Hartshorne > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] interactions > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi List! > > > > I have seen around a dozen comments in the archives that interactions > > can't be tested by permutation for within-subject designs. I haven't > > been able to find a thread that explains why not. It seems like in a > > 2x2 design, you could still pick one of the conditions and permute > the > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > and it would be great to see it. > > > > Similarly, for the mixed design, why permute the between-subject > labels? > > Why not permute the within-subject labels instead? Actually, why not > > do both? I follow the reasoning why permuting both is overkill, but > > not why it's wrong. > > > > If someone could explain, it would be much appreciated. Knowing what > > to do is good, but it would be even better to understand why. > > > > Thanks, > > Josh > > -------------- next part -------------- An HTML attachment was > > scrubbed... > > URL: > > > b885cb4a/attachment-0001.html> > > ------------------------------ Message: 2 Date: Sun, 26 Jan 2014 10:43:58 +0100 From: Azeez Adebimpe To: FieldTrip discussion list Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Chaitanya , I would suggest you try analyitcs instead of montecarlo and use stat= ft_sourcestatitics(cfg, source1a, source2a .................., source1b,source2b.............);a and b are for the conditions. Azeez Adebimpe Date: Sun, 26 Jan 2014 09:46:03 +0100 From: chaitanya.pro at gmail.com To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level Hi Eelke, No significant results then in my data. I wonder how my boss takes it :P. Anyway, thanks for your help on a Sunday that too. >From your reply I also understand that the code doesn't have any mistakes :) =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== On Sun, Jan 26, 2014 at 9:40 AM, Eelke Spaak wrote: Hi Chaitanya, stat.prob reflects the 'p-values' resulting from your statistical test. So voxels expressing e.g. stat.prob < 0.05 should be considered reflecting a significant difference between conditions. The NaNs correspond to voxels outside the brain. Since stat.mask is all zeros (which by default is just stat.prob < 0.05), this indicates there are no significant differences between your conditions. There is nothing we can help you with in this respect :) Best,Eelke On 26 January 2014 09:06, Chaitanya Srinivas wrote: Hi Eelke, I looked at the stat.stat values if that is what you mean. There are some NaNs , but also some values. Similarly in stat.prob, there are some 1's. The stat.mask is all zeros as you say. Any further suggestions from you? Thank you =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== On Sun, Jan 26, 2014 at 8:53 AM, Eelke Spaak wrote: Dear Chaitanya, Perhaps an obvious question: do you find any significant differences in the statistics step (inspect the stat structure)? If not, the mask will consist of all zeroes, hence giving you a 'blank' plot. Best,Eelke On 26 January 2014 08:46, Chaitanya Srinivas wrote: Dear fieldtrip users, I would like to do sourcestatistics on a group level with eeg data. I have a pre and post intervention measurement for each of my 10 subjects . After source reconstruction using an DICS beamformer and volume normalization, I calculated the sourcegrandaverage for the pre and post condition and i have avg.pow for each subject. However, when I use the grandaverage results in ft_sourcestatistics in the configuration shown below and plot the result I just get a blank anatomical mri. It only runs with cfg.parameter="pow" .I tried with cfg.parameter = 'avg.pow' it doesnt run. Do I have to set any additional parameters or am I making some mistake? cfg=[]; cfg.dim = grandAVGsourcePre.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; nsubj=length(sourcePre.trial); cfg.design(1,:) = [1:nsubj 1:nsubj]; cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; cfg.uvar = 1; cfg.ivar = 2; stat = ft_sourcestatistics(cfg, grandAVGsourcePre, grandAVGsourcePost); and next interpolation cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'mask'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; mask = ft_sourceinterpolate(cfg,stat,mri); statplot.mask = mask.mask; and then for plotting cfg = []; cfg.method = 'slice'; cfg.funparameter = 'stat'; cfg.maskparameter = 'mask'; cfg.funcolorlim = [-0.1 0.1]; cfg.opacitylim = [-0.1 0.1]; figure ft_sourceplot(cfg, statplot); =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 38, Issue 49 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Tue Feb 4 14:52:58 2014 From: barbara.schorr at uni-ulm.de (Barbara Schorr) Date: Tue, 04 Feb 2014 14:52:58 +0100 Subject: [FieldTrip] Plotting fieldtrip porcessed data with EMEGS Message-ID: <52F0F0B9.8020102@uni-ulm.de> Dear Fieldtripers, I would like to make graphics (topoplots) of ERP data I processed in fieldtrip. For first visualization I usually just use ft_topoplotTFR. Now I want to try EMEGS and the implemented 3D plots. I am not sure how to import my timelocked data into EMEGS. Can anybody help? I also asked the EMEGS developers for help, but I thought I also try it here, because maybe someone else already did this. I hope I was clear enough, and I would appreciate any help. Best regards, Barbara Schorr -- Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm Therapiezentrum Burgau Kapuzinerstraße 34 89331 Burgau From julian.keil at gmail.com Tue Feb 4 16:07:05 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 4 Feb 2014 16:07:05 +0100 Subject: [FieldTrip] Plotting fieldtrip porcessed data with EMEGS In-Reply-To: <52F0F0B9.8020102@uni-ulm.de> References: <52F0F0B9.8020102@uni-ulm.de> Message-ID: Dear Barbara, as far as I remember, the easies way to interact with EMEGS is using ASCII-Files, which you then convert to their own SCADS format. I'm pretty sure there is a function for this (ascii2scads.m or something). So the way to go - as long as it's just for visualization - would be: * Export your Grand Average (.avg field in your ERP data) as ASCII with rows for channels and colums for time points. * Convert ASCII files to SCADS * Load SCADS to EMEGS Note, that you need a 3d Sensor position file in order to plot the EMEGS data. Good Luck, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 04.02.2014 um 14:52 schrieb Barbara Schorr: > Dear Fieldtripers, > > I would like to make graphics (topoplots) of ERP data I processed in fieldtrip. For first visualization I usually just use ft_topoplotTFR. Now I want to try EMEGS and the implemented 3D plots. > I am not sure how to import my timelocked data into EMEGS. Can anybody help? I also asked the EMEGS developers for help, but I thought I also try it here, because maybe someone else already did this. > I hope I was clear enough, and I would appreciate any help. > > Best regards, > Barbara Schorr > > > -- > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > Therapiezentrum Burgau > Kapuzinerstraße 34 > 89331 Burgau > > _______________________________________________ > 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 ivano_triggiani at yahoo.it Tue Feb 4 18:01:07 2014 From: ivano_triggiani at yahoo.it (Ivano Triggiani) Date: Tue, 4 Feb 2014 17:01:07 +0000 (GMT) Subject: [FieldTrip] Still about channel repair Message-ID: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> Hi Fieldtrippers, I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: cfg                = []; replace_channels   = ft_channelselection('gui',hdr.label); cfg.badchannel     = replace_channels; cfg.layout         = 'EEG_layout.lay'; cfg.method         = 'triangulation'; cfg.elecfile       = 'EEG_cap.sfp'; cfg.neighbours     = neighbours; cfg.trials         = 'all'; elec.label         = hdr.label; data.elec          = ft_prepare_layout(cfg); repaired_data      = ft_channelrepair(cfg,rawdataout);   but it returns: ??? Error using ==> ft_channelrepair at 92 the data should contain either an electrode or a gradiometer definition I cannot find into documentation what it means. I guess I have to specify the kind of measurement (EEG/MEG), but where? Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? Thanks a lot, Ivano ------------------------------------------------------------------------ "No man can wear one face to himself and another to the multitude, without finally getting bewildered as to which one is true." Nathaniel Hawthorne -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 4 18:08:37 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 4 Feb 2014 18:08:37 +0100 Subject: [FieldTrip] Still about channel repair In-Reply-To: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> References: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62@donders.ru.nl> Hi Ivano, Please have a look at the link attached. http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > Hi Fieldtrippers, > > I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: > cfg = []; > replace_channels = ft_channelselection('gui',hdr.label); > cfg.badchannel = replace_channels; > cfg.layout = 'EEG_layout.lay'; > cfg.method = 'triangulation'; > cfg.elecfile = 'EEG_cap.sfp'; > cfg.neighbours = neighbours; > cfg.trials = 'all'; > elec.label = hdr.label; > data.elec = ft_prepare_layout(cfg); > repaired_data = ft_channelrepair(cfg,rawdataout); > > but it returns: > ??? Error using ==> ft_channelrepair at 92 > the data should contain either an electrode or a gradiometer definition > > I cannot find into documentation what it means. > I guess I have to specify the kind of measurement (EEG/MEG), but where? > Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? > > Thanks a lot, > > Ivano > ------------------------------------------------------------------------ > > > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkhartshorne at gmail.com Tue Feb 4 20:32:38 2014 From: jkhartshorne at gmail.com (Joshua Hartshorne) Date: Tue, 4 Feb 2014 14:32:38 -0500 Subject: [FieldTrip] Interactions In-Reply-To: <4CD13553-340E-4104-B84E-CE018C4AB241@gmail.com> References: <52f0cc13.48d30e0a.1197.ffff8e6bSMTPIN_ADDED_BROKEN@mx.google.com> <4CD13553-340E-4104-B84E-CE018C4AB241@gmail.com> Message-ID: Hi Eric, I tried effect sizes of 20 and 4 subjects per condition. With 200 iterations, the false alarm rate was *lower* for permutations (.02) than for a standard ANOVA (.025). For good measure, I also tried with effect sizes of 10, with the same result (.02 vs. .03). I still don't see what the problem would be. I always understood that the main thing permutation tests need is exchangeability, and it doesn't get much more exchangeable than in a between/between design. I'm reading the original work now, though, so maybe I'll discover something. Josh On Tue, Feb 4, 2014 at 6:16 AM, Eric Maris wrote: > Hi Josh, > > > > You may have found something that is worth exploring. However, it will be > challenge to provide a formal proof of the fact that the permutation > analysis provides false alarm rate control under the null hypothesis of no > interaction effect. The crucial design here is the full between-subjects > design, because for the other designs a valid permutation analysis exists > (as demonstrated by formal proof). > > > > I would embark on a testing-the-limits simulation study: > > > > *between/between*. Normally-distributed data in each of 4 cells. The > effect size for e1 and e2 were each set to 1, with a SD of 1. The > interaction (if present) was .75 with an SD of 1. There were 40 subjects > per cell. > > > > Set the effect sizes to 20, reduce the number of subjects to 5 per cell, > and simulate data without an interaction effect. I'm curious how the > simulated false alarm rate of the permutation test looks like. > > > > (After this email, I will not continue this discussion any further. It is > becoming a scientific project; interesting though ...) > > > > Best, > > > > Eric > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivano_triggiani at yahoo.it Wed Feb 5 10:25:44 2014 From: ivano_triggiani at yahoo.it (Ivano Triggiani) Date: Wed, 5 Feb 2014 09:25:44 +0000 (GMT) Subject: [FieldTrip] Still about channel repair (jan-mathijs schoffelen) In-Reply-To: References: Message-ID: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> Dear Jan-Mathijs, Thanks a lot for you quick answer, but I can assure you that I read every document before sending any boring message to community :-D . I prepared that electrodes position file (although it is not so clear how to prepare channels position file!), but I don't understand where it has to be declared... I searched for some template scripts but nothing seems to help. My problem seems easy. I have a bad channel (P3 referred to AFz, from standard 10-10 System), and I want to 'repair' it...  Ivano   ------------------------------------------------------------------------ "No man can wear one face to himself and another to the multitude, without finally getting bewildered as to which one is true." Nathaniel Hawthorne ------------------------------ Message: 4 Date: Tue, 4 Feb 2014 18:08:37 +0100 From: jan-mathijs schoffelen To: Fieldtrip List Subject: Re: [FieldTrip] Still about channel repair Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62 at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Ivano, Please have a look at the link attached. http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > Hi Fieldtrippers, > > I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: > cfg                = []; > replace_channels  = ft_channelselection('gui',hdr.label); > cfg.badchannel    = replace_channels; > cfg.layout        = 'EEG_layout.lay'; > cfg.method        = 'triangulation'; > cfg.elecfile      = 'EEG_cap.sfp'; > cfg.neighbours    = neighbours; > cfg.trials        = 'all'; > elec.label        = hdr.label; > data.elec          = ft_prepare_layout(cfg); > repaired_data      = ft_channelrepair(cfg,rawdataout); >  > but it returns: > ??? Error using ==> ft_channelrepair at 92 > the data should contain either an electrode or a gradiometer definition > > I cannot find into documentation what it means. > I guess I have to specify the kind of measurement (EEG/MEG), but where? > Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? > > Thanks a lot, > > Ivano > ------------------------------------------------------------------------ > > > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From victorias at dsv.su.se Wed Feb 5 12:40:56 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Wed, 05 Feb 2014 12:40:56 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF8E57.6060207@donders.ru.nl> References: "\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: Dear Jörn, I still am dealing with finding the right cfg.toi when doing a time frequency analysis. Depending on the time resolution i get NaN values in the first matrixes in the resulting powspctrm and crsspctrm. It seems that for the first times selected there is no data. If i choose a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start below 1 i get Nan values. This is my code for the analysis. I would appreciate some concrete advice and suggestions why i run into this problem. % time-frequency analysis cfg = []; cfg.output = 'powandcsd'; % different for convol than for fft cfg.channel={'C15' 'C10' 'B23' 'B3'}; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.trials=data_clean.trialinfo(:,1) < 20; cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' 'B13' 'D31' 'B11'}; cfg.channelcmb={'C29' 'D23' 'C29' 'D31' 'C29' 'D29' 'C31' 'D23' 'C31' 'D31' 'C31' 'D29' 'C26' 'D23' 'C26' 'D31' 'C26' 'D29' 'C16' 'B26' 'C16' 'B11' 'C16' 'B13' 'C13' 'B26' 'C13' 'B11' 'C13' 'B13' 'C9' 'B26' 'C9' 'B11' 'C9' 'B13'} ; cfg.foi = 12:2:30; % 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:0.05:1; freq_convol = ft_freqanalysis(cfg, data_clean); Thank you a lot Victoria 2014-02-03 13:40 skrev Jörn M. Horschig: > Hi Victoria, > > On 2/3/2014 12:14 PM, Victoria Schröder wrote: >> Thank Jörn, >> >> Thank for the advice for the tutorials but i have already looked at >> them a lot. >> >> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >> averaged power over trials? Well, it might sound obvious, but if you >> say 'yes' to keep trials, you keep the trials, whereas if you say 'no' >> you do not keep the trials and instead get an average. > >> what happens then when the trials do not have the same length? > The average will be made with all data that is available. If some > trials go to 30s but all trials go to 29s, then the average of the > last one second is made of less data then the first 29s. This is a > crucial point for doing statistics as the degrees of freedom, > signal-to noise ration etc. will be different for different time > points. > >> >> and a last question :) >> >> what does cfg.toi depend on ? in the tutorial time frequency >> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is >> that the case? > it depends on what time you are interested in and how much memory > (and cpu time aka patience) you got. > > Good luck ;) > Best, > Jörn > >> >> I hope this should be it for now >> Best >> Victoria >> >> >> 2014-02-03 11:42 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> you might want to read the relevant part of the walkthrough for >>> your >>> questions on mtmconvol and mtmfft: >>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>> >>> Then, also doing this tutorial might help in understanding what the >>> different methods are doing: >>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>> >>> And lastly, to shortly answer your questions, see below ;) >>> >>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>> Dear Jörn, >>> Hi ;) >>> >>>> >>>> the code works but i dont know whether my data is logical and >>>> whether i decided to use the right method etc. >>> maybe you should try to get into one of the FieldTrip courses :) >>> This >>> might tremendously help you in understanding what's being done and >>> why. Otherwise, try to read as much as you can, read methods of >>> papers >>> and discuss with your supervisor and colleagues. Of course, on the >>> mailing list we also like to help a lot. >>>> >>>> My trials are pretty long (approx 30 sec but all are not the same >>>> length) and i am interested in beta frequency. >>>> >>>> First, it is not really clear to me whether i should use >>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>> latter calculates the FFT for shorter self-specified time windows to >>>> look at changes in power over time. Is that right? yep, about right. >>> >>>> however, if i have more stimuli for one condition, how is the time >>>> component then taken into account? it depends on how you segmented >>>> your data. FieldTrip is just transforming your preprocessed data, so >>>> whatever you put in is what you get out. >>> >>>> does mtmconvol take all trials of one condition and average the >>>> the power for each time window over all trials? Or is each trial >>>> treated seperatly? >>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>> >>>> Say i would use cfg.method=mtmfft do i need to specify a >>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >>>> always a single taper. Only when combining multiple tapers you can >>>> effectively smooth in the frequency domain. this is implemented as >>>> taper='dpss' >>> >>>> As i understand hanning if appropriate for lower freuquencies so i >>>> should use this taper to assess beta frequencies. >>> this is a rule of thumb, but there is nothing wrong with using >>> multitapering for lower frequencies. It depends on what you expect >>> from your data and what you want to achieve. >>>> >>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>> this depends on the frequencies you are interested in. I wouldn't >>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>> >>>> >>>> Thank you a lot for the help >>> you're welcome, hope this helps >>>> Best >>>> Victoria >>> Likewise, >>> Jörn >>> >>>> >>>> >>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>> Hi Victoria, >>>>> >>>>> is there anything wrong with the code you used below? By >>>>> smoothing, >>>>> do you refer to smoothing in the frequency domain? >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> >>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>> Hello >>>>>> >>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>>> for the freqanalysis. My stimuli are very long: between 29 and 30 >>>>>> sec. In total i have 4 stimuli per condition and 2 seperate >>>>>> conditions. I am looking at the beta range so fairly low >>>>>> frequencies. >>>>>> >>>>>> this is my code: >>>>>> Am i using the right taper and method. Should i smooth the data? >>>>>> and if so, what should such a smoothing parameter depend on? >>>>>> >>>>>> %fourier analysis >>>>>> cfg=[]; >>>>>> cfg.output='fourier'; >>>>>> cfg.method='mtmfft'; >>>>>> cfg.foi=[12:30]; >>>>>> cfg.taper='hanning'; >>>>>> cfg.keeptrials='yes'; >>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>> >>>>>> >>>>>> %coherence analysis >>>>>> cfg=[]; >>>>>> cfg.method='coh'; >>>>>> cfg.channelcmb={'B3' 'C15' >>>>>> 'B3' 'C10' >>>>>> 'B23' 'C15' >>>>>> 'B23' 'C10'} >>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>> >>>>>> >>>>>> Thank you very much for the suggestions! >>>>>> Best >>>>>> Victoria >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>>> >>>>> -- Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From eelke.spaak at donders.ru.nl Wed Feb 5 12:45:56 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 5 Feb 2014 12:45:56 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: Dear Victoria, Please have a look here: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans Best, Eelke On 5 February 2014 12:40, Victoria Schröder wrote: > Dear Jörn, > > I still am dealing with finding the right cfg.toi when doing a time > frequency analysis. Depending on the time resolution i get NaN values in the > first matrixes in the resulting powspctrm and crsspctrm. It seems that for > the first times selected there is no data. If i choose a cfg.toi 1:0.05:2 > then i get no Nan values but as soon as I start below 1 i get Nan values. > > This is my code for the analysis. I would appreciate some concrete advice > and suggestions why i run into this problem. > > % time-frequency analysis > cfg = []; > cfg.output = 'powandcsd'; % different for convol than for fft > > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.trials=data_clean.trialinfo(:,1) < 20; > cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' 'B13' > 'D31' 'B11'}; > cfg.channelcmb={'C29' 'D23' > 'C29' 'D31' > 'C29' 'D29' > 'C31' 'D23' > 'C31' 'D31' > 'C31' 'D29' > 'C26' 'D23' > 'C26' 'D31' > 'C26' 'D29' > 'C16' 'B26' > 'C16' 'B11' > 'C16' 'B13' > 'C13' 'B26' > 'C13' 'B11' > 'C13' 'B13' > 'C9' 'B26' > 'C9' 'B11' > 'C9' 'B13'} ; > cfg.foi = 12:2:30; % 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:0.05:1; > freq_convol = ft_freqanalysis(cfg, data_clean); > > Thank you a lot > Victoria > > > 2014-02-03 13:40 skrev Jörn M. Horschig: > >> Hi Victoria, >> >> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>> >>> Thank Jörn, >>> >>> Thank for the advice for the tutorials but i have already looked at them >>> a lot. >>> >>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged >>> power over trials? Well, it might sound obvious, but if you say 'yes' to >>> keep trials, you keep the trials, whereas if you say 'no' you do not keep >>> the trials and instead get an average. >> >> >>> what happens then when the trials do not have the same length? >> >> The average will be made with all data that is available. If some >> trials go to 30s but all trials go to 29s, then the average of the >> last one second is made of less data then the first 29s. This is a >> crucial point for doing statistics as the degrees of freedom, >> signal-to noise ration etc. will be different for different time >> points. >> >>> >>> and a last question :) >>> >>> what does cfg.toi depend on ? in the tutorial time frequency analysis >>> this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the case? >> >> it depends on what time you are interested in and how much memory >> (and cpu time aka patience) you got. >> >> Good luck ;) >> Best, >> Jörn >> >>> >>> I hope this should be it for now >>> Best >>> Victoria >>> >>> >>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>> >>>> Hi Victoria, >>>> >>>> you might want to read the relevant part of the walkthrough for your >>>> questions on mtmconvol and mtmfft: >>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>> >>>> Then, also doing this tutorial might help in understanding what the >>>> different methods are doing: >>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>> >>>> And lastly, to shortly answer your questions, see below ;) >>>> >>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>> >>>>> Dear Jörn, >>>> >>>> Hi ;) >>>> >>>>> >>>>> the code works but i dont know whether my data is logical and whether i >>>>> decided to use the right method etc. >>>> >>>> maybe you should try to get into one of the FieldTrip courses :) This >>>> might tremendously help you in understanding what's being done and >>>> why. Otherwise, try to read as much as you can, read methods of papers >>>> and discuss with your supervisor and colleagues. Of course, on the >>>> mailing list we also like to help a lot. >>>>> >>>>> >>>>> My trials are pretty long (approx 30 sec but all are not the same >>>>> length) and i am interested in beta frequency. >>>>> >>>>> First, it is not really clear to me whether i should use >>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the latter >>>>> calculates the FFT for shorter self-specified time windows to look at >>>>> changes in power over time. Is that right? yep, about right. >>>> >>>> >>>>> however, if i have more stimuli for one condition, how is the time >>>>> component then taken into account? it depends on how you segmented your >>>>> data. FieldTrip is just transforming your preprocessed data, so whatever you >>>>> put in is what you get out. >>>> >>>> >>>>> does mtmconvol take all trials of one condition and average the the >>>>> power for each time window over all trials? Or is each trial treated >>>>> seperatly? >>>> >>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>> >>>>> >>>>> Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq >>>>> when using cfg.taper='hanning'? no, a hanning taper is always a single >>>>> taper. Only when combining multiple tapers you can effectively smooth in the >>>>> frequency domain. this is implemented as taper='dpss' >>>> >>>> >>>>> As i understand hanning if appropriate for lower freuquencies so i >>>>> should use this taper to assess beta frequencies. >>>> >>>> this is a rule of thumb, but there is nothing wrong with using >>>> multitapering for lower frequencies. It depends on what you expect >>>> from your data and what you want to achieve. >>>>> >>>>> >>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>>> >>>> this depends on the frequencies you are interested in. I wouldn't >>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>>> >>>>> >>>>> Thank you a lot for the help >>>> >>>> you're welcome, hope this helps >>>>> >>>>> Best >>>>> Victoria >>>> >>>> Likewise, >>>> Jörn >>>> >>>>> >>>>> >>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>> >>>>>> Hi Victoria, >>>>>> >>>>>> is there anything wrong with the code you used below? By smoothing, >>>>>> do you refer to smoothing in the frequency domain? >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>> >>>>>>> Hello >>>>>>> >>>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>>> connectivityanalysis. I am a bit unsure about the method to use for the >>>>>>> freqanalysis. My stimuli are very long: between 29 and 30 sec. In total i >>>>>>> have 4 stimuli per condition and 2 seperate conditions. I am looking at the >>>>>>> beta range so fairly low frequencies. >>>>>>> >>>>>>> this is my code: >>>>>>> Am i using the right taper and method. Should i smooth the data? and >>>>>>> if so, what should such a smoothing parameter depend on? >>>>>>> >>>>>>> %fourier analysis >>>>>>> cfg=[]; >>>>>>> cfg.output='fourier'; >>>>>>> cfg.method='mtmfft'; >>>>>>> cfg.foi=[12:30]; >>>>>>> cfg.taper='hanning'; >>>>>>> cfg.keeptrials='yes'; >>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>> >>>>>>> >>>>>>> %coherence analysis >>>>>>> cfg=[]; >>>>>>> cfg.method='coh'; >>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>> 'B3' 'C10' >>>>>>> 'B23' 'C15' >>>>>>> 'B23' 'C10'} >>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>> >>>>>>> >>>>>>> Thank you very much for the suggestions! >>>>>>> Best >>>>>>> Victoria >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>>> >>>>>> >>>>>> -- Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>>> >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 jm.horschig at donders.ru.nl Wed Feb 5 12:47:46 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 05 Feb 2014 12:47:46 +0100 Subject: [FieldTrip] Still about channel repair (jan-mathijs schoffelen) In-Reply-To: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> References: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> Message-ID: <52F224E2.9080908@donders.ru.nl> Hi Ivano, your input seems a bit ambigious and wrong. First of, try using a new FieldTrip version. Second, you specify cfg.elecfile, then you set data.elec to some layout, and finally you do not use the data variable but rawdataout as your input to ft_channelrepair. Resolving these issues and, let me repeat, updating to a new FT version, will resolve your issues. Buono fortuna, Jörn On 2/5/2014 10:25 AM, Ivano Triggiani wrote: > Dear Jan-Mathijs, > > Thanks a lot for you quick answer, but I can assure you that I read > every document before sending any boring message to community :-D . > I prepared that electrodes position file (although it is not so clear > how to prepare channels position file!), but I don't understand where > it has to be declared... I searched for some template scripts but > nothing seems to help. > My problem seems easy. I have a bad channel (P3 referred to AFz, from > standard 10-10 System), and I want to 'repair' it... > > Ivano > > ------------------------------------------------------------------------ > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > > > > ------------------------------ > > Message: 4 > Date: Tue, 4 Feb 2014 18:08:37 +0100 > From: jan-mathijs schoffelen > > To: Fieldtrip List > > Subject: Re: [FieldTrip] Still about channel repair > Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62 at donders.ru.nl > > > Content-Type: text/plain; charset="us-ascii" > > Hi Ivano, > Please have a look at the link attached. > > http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described > > Best, > Jan-Mathijs > > On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > > > Hi Fieldtrippers, > > > > I read many answers about problems on channel repair, but still > something miss me to understand hot to fix a channel. I tried with: > > cfg = []; > > replace_channels = ft_channelselection('gui',hdr.label); > > cfg.badchannel = replace_channels; > > cfg.layout = 'EEG_layout.lay'; > > cfg.method = 'triangulation'; > > cfg.elecfile = 'EEG_cap.sfp'; > > cfg.neighbours = neighbours; > > cfg.trials = 'all'; > > elec.label = hdr.label; > > data.elec = ft_prepare_layout(cfg); > > repaired_data = ft_channelrepair(cfg,rawdataout); > > > > but it returns: > > ??? Error using ==> ft_channelrepair at 92 > > the data should contain either an electrode or a gradiometer definition > > > > I cannot find into documentation what it means. > > I guess I have to specify the kind of measurement (EEG/MEG), but where? > > Furthermore I read the docs about electrode position , channel > position and so on, but can we get some example? > > > > Thanks a lot, > > > > Ivano > > ------------------------------------------------------------------------ > > > > > > > > > > "No man can wear one face to himself > > and another to the multitude, > > without finally getting bewildered > > as to which one is true." > > > > > > Nathaniel Hawthorne > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Wed Feb 5 12:49:38 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Wed, 05 Feb 2014 12:49:38 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: References: "\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: <52F22552.3030109@donders.ru.nl> Hi Victoria, see: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans?s[]=tfr&s[]=nan and: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis These should answer your question ;) Best, Jörn On 2/5/2014 12:40 PM, Victoria Schröder wrote: > Dear Jörn, > > I still am dealing with finding the right cfg.toi when doing a time > frequency analysis. Depending on the time resolution i get NaN values > in the first matrixes in the resulting powspctrm and crsspctrm. It > seems that for the first times selected there is no data. If i choose > a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start > below 1 i get Nan values. > > This is my code for the analysis. I would appreciate some concrete > advice and suggestions why i run into this problem. > > % time-frequency analysis > cfg = []; > cfg.output = 'powandcsd'; % different for convol than for fft > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.trials=data_clean.trialinfo(:,1) < 20; > cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' > 'B13' 'D31' 'B11'}; > cfg.channelcmb={'C29' 'D23' > 'C29' 'D31' > 'C29' 'D29' > 'C31' 'D23' > 'C31' 'D31' > 'C31' 'D29' > 'C26' 'D23' > 'C26' 'D31' > 'C26' 'D29' > 'C16' 'B26' > 'C16' 'B11' > 'C16' 'B13' > 'C13' 'B26' > 'C13' 'B11' > 'C13' 'B13' > 'C9' 'B26' > 'C9' 'B11' > 'C9' 'B13'} ; > cfg.foi = 12:2:30; % 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:0.05:1; > freq_convol = ft_freqanalysis(cfg, data_clean); > > Thank you a lot > Victoria > > > 2014-02-03 13:40 skrev Jörn M. Horschig: >> Hi Victoria, >> >> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>> Thank Jörn, >>> >>> Thank for the advice for the tutorials but i have already looked at >>> them a lot. >>> >>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >>> averaged power over trials? Well, it might sound obvious, but if you >>> say 'yes' to keep trials, you keep the trials, whereas if you say >>> 'no' you do not keep the trials and instead get an average. >> >>> what happens then when the trials do not have the same length? >> The average will be made with all data that is available. If some >> trials go to 30s but all trials go to 29s, then the average of the >> last one second is made of less data then the first 29s. This is a >> crucial point for doing statistics as the degrees of freedom, >> signal-to noise ration etc. will be different for different time >> points. >> >>> >>> and a last question :) >>> >>> what does cfg.toi depend on ? in the tutorial time frequency >>> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why >>> is that the case? >> it depends on what time you are interested in and how much memory >> (and cpu time aka patience) you got. >> >> Good luck ;) >> Best, >> Jörn >> >>> >>> I hope this should be it for now >>> Best >>> Victoria >>> >>> >>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>> Hi Victoria, >>>> >>>> you might want to read the relevant part of the walkthrough for your >>>> questions on mtmconvol and mtmfft: >>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>> >>>> Then, also doing this tutorial might help in understanding what the >>>> different methods are doing: >>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>> >>>> And lastly, to shortly answer your questions, see below ;) >>>> >>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>> Dear Jörn, >>>> Hi ;) >>>> >>>>> >>>>> the code works but i dont know whether my data is logical and >>>>> whether i decided to use the right method etc. >>>> maybe you should try to get into one of the FieldTrip courses :) This >>>> might tremendously help you in understanding what's being done and >>>> why. Otherwise, try to read as much as you can, read methods of papers >>>> and discuss with your supervisor and colleagues. Of course, on the >>>> mailing list we also like to help a lot. >>>>> >>>>> My trials are pretty long (approx 30 sec but all are not the same >>>>> length) and i am interested in beta frequency. >>>>> >>>>> First, it is not really clear to me whether i should use >>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>>> latter calculates the FFT for shorter self-specified time windows >>>>> to look at changes in power over time. Is that right? yep, about >>>>> right. >>>> >>>>> however, if i have more stimuli for one condition, how is the time >>>>> component then taken into account? it depends on how you segmented >>>>> your data. FieldTrip is just transforming your preprocessed data, >>>>> so whatever you put in is what you get out. >>>> >>>>> does mtmconvol take all trials of one condition and average the >>>>> the power for each time window over all trials? Or is each trial >>>>> treated seperatly? >>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>> >>>>> Say i would use cfg.method=mtmfft do i need to specify a >>>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper >>>>> is always a single taper. Only when combining multiple tapers you >>>>> can effectively smooth in the frequency domain. this is >>>>> implemented as taper='dpss' >>>> >>>>> As i understand hanning if appropriate for lower freuquencies so i >>>>> should use this taper to assess beta frequencies. >>>> this is a rule of thumb, but there is nothing wrong with using >>>> multitapering for lower frequencies. It depends on what you expect >>>> from your data and what you want to achieve. >>>>> >>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>>> this depends on the frequencies you are interested in. I wouldn't >>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>>> >>>>> >>>>> Thank you a lot for the help >>>> you're welcome, hope this helps >>>>> Best >>>>> Victoria >>>> Likewise, >>>> Jörn >>>> >>>>> >>>>> >>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>> Hi Victoria, >>>>>> >>>>>> is there anything wrong with the code you used below? By smoothing, >>>>>> do you refer to smoothing in the frequency domain? >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>> Hello >>>>>>> >>>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>>>> for the freqanalysis. My stimuli are very long: between 29 and >>>>>>> 30 sec. In total i have 4 stimuli per condition and 2 seperate >>>>>>> conditions. I am looking at the beta range so fairly low >>>>>>> frequencies. >>>>>>> >>>>>>> this is my code: >>>>>>> Am i using the right taper and method. Should i smooth the data? >>>>>>> and if so, what should such a smoothing parameter depend on? >>>>>>> >>>>>>> %fourier analysis >>>>>>> cfg=[]; >>>>>>> cfg.output='fourier'; >>>>>>> cfg.method='mtmfft'; >>>>>>> cfg.foi=[12:30]; >>>>>>> cfg.taper='hanning'; >>>>>>> cfg.keeptrials='yes'; >>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>> >>>>>>> >>>>>>> %coherence analysis >>>>>>> cfg=[]; >>>>>>> cfg.method='coh'; >>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>> 'B3' 'C10' >>>>>>> 'B23' 'C15' >>>>>>> 'B23' 'C10'} >>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>> >>>>>>> >>>>>>> Thank you very much for the suggestions! >>>>>>> Best >>>>>>> Victoria >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>>> >>>>>> -- Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From victorias at dsv.su.se Wed Feb 5 12:57:31 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Wed, 05 Feb 2014 12:57:31 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52F22552.3030109@donders.ru.nl> References: "\"\\\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\\\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>\" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se>" <52EF8E57.6060207@donders.ru.nl> <52F22552.3030109@donders.ru.nl> Message-ID: <9d84b751ebbaefe3ace5c3405cbc9a7c@dsv.su.se> Dear Eelke and Jörn Yes, this really answers my question. Really cool! Thanks Victoria 2014-02-05 12:49 skrev Jörn M. Horschig: > Hi Victoria, > > see: > > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans?s[]=tfr&s[]=nan > and: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis > > These should answer your question ;) > > Best, > Jörn > > On 2/5/2014 12:40 PM, Victoria Schröder wrote: >> Dear Jörn, >> >> I still am dealing with finding the right cfg.toi when doing a time >> frequency analysis. Depending on the time resolution i get NaN values >> in the first matrixes in the resulting powspctrm and crsspctrm. It >> seems that for the first times selected there is no data. If i choose >> a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start >> below 1 i get Nan values. >> >> This is my code for the analysis. I would appreciate some concrete >> advice and suggestions why i run into this problem. >> >> % time-frequency analysis >> cfg = []; >> cfg.output = 'powandcsd'; % different for convol than for fft >> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >> cfg.method = 'mtmconvol'; >> cfg.taper = 'hanning'; >> cfg.keeptrials = 'yes'; >> cfg.trials=data_clean.trialinfo(:,1) < 20; >> cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' >> 'B13' 'D31' 'B11'}; >> cfg.channelcmb={'C29' 'D23' >> 'C29' 'D31' >> 'C29' 'D29' >> 'C31' 'D23' >> 'C31' 'D31' >> 'C31' 'D29' >> 'C26' 'D23' >> 'C26' 'D31' >> 'C26' 'D29' >> 'C16' 'B26' >> 'C16' 'B11' >> 'C16' 'B13' >> 'C13' 'B26' >> 'C13' 'B11' >> 'C13' 'B13' >> 'C9' 'B26' >> 'C9' 'B11' >> 'C9' 'B13'} ; >> cfg.foi = 12:2:30; % 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:0.05:1; >> freq_convol = ft_freqanalysis(cfg, data_clean); >> >> Thank you a lot >> Victoria >> >> >> 2014-02-03 13:40 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>>> Thank Jörn, >>>> >>>> Thank for the advice for the tutorials but i have already looked >>>> at them a lot. >>>> >>>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >>>> averaged power over trials? Well, it might sound obvious, but if you >>>> say 'yes' to keep trials, you keep the trials, whereas if you say >>>> 'no' you do not keep the trials and instead get an average. >>> >>>> what happens then when the trials do not have the same length? >>> The average will be made with all data that is available. If some >>> trials go to 30s but all trials go to 29s, then the average of the >>> last one second is made of less data then the first 29s. This is a >>> crucial point for doing statistics as the degrees of freedom, >>> signal-to noise ration etc. will be different for different time >>> points. >>> >>>> >>>> and a last question :) >>>> >>>> what does cfg.toi depend on ? in the tutorial time frequency >>>> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why >>>> is that the case? >>> it depends on what time you are interested in and how much memory >>> (and cpu time aka patience) you got. >>> >>> Good luck ;) >>> Best, >>> Jörn >>> >>>> >>>> I hope this should be it for now >>>> Best >>>> Victoria >>>> >>>> >>>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>>> Hi Victoria, >>>>> >>>>> you might want to read the relevant part of the walkthrough for >>>>> your >>>>> questions on mtmconvol and mtmfft: >>>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>>> >>>>> Then, also doing this tutorial might help in understanding what >>>>> the >>>>> different methods are doing: >>>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>>> >>>>> And lastly, to shortly answer your questions, see below ;) >>>>> >>>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>>> Dear Jörn, >>>>> Hi ;) >>>>> >>>>>> >>>>>> the code works but i dont know whether my data is logical and >>>>>> whether i decided to use the right method etc. >>>>> maybe you should try to get into one of the FieldTrip courses :) >>>>> This >>>>> might tremendously help you in understanding what's being done >>>>> and >>>>> why. Otherwise, try to read as much as you can, read methods of >>>>> papers >>>>> and discuss with your supervisor and colleagues. Of course, on >>>>> the >>>>> mailing list we also like to help a lot. >>>>>> >>>>>> My trials are pretty long (approx 30 sec but all are not the >>>>>> same length) and i am interested in beta frequency. >>>>>> >>>>>> First, it is not really clear to me whether i should use >>>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>>>> latter calculates the FFT for shorter self-specified time windows >>>>>> to look at changes in power over time. Is that right? yep, about >>>>>> right. >>>>> >>>>>> however, if i have more stimuli for one condition, how is the >>>>>> time component then taken into account? it depends on how you >>>>>> segmented your data. FieldTrip is just transforming your >>>>>> preprocessed data, so whatever you put in is what you get out. >>>>> >>>>>> does mtmconvol take all trials of one condition and average the >>>>>> the power for each time window over all trials? Or is each trial >>>>>> treated seperatly? >>>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>>> >>>>>> Say i would use cfg.method=mtmfft do i need to specify a >>>>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper >>>>>> is always a single taper. Only when combining multiple tapers you >>>>>> can effectively smooth in the frequency domain. this is >>>>>> implemented as taper='dpss' >>>>> >>>>>> As i understand hanning if appropriate for lower freuquencies so >>>>>> i should use this taper to assess beta frequencies. >>>>> this is a rule of thumb, but there is nothing wrong with using >>>>> multitapering for lower frequencies. It depends on what you >>>>> expect >>>>> from your data and what you want to achieve. >>>>>> >>>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is >>>>>> appropriate? >>>>> this depends on the frequencies you are interested in. I wouldn't >>>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least >>>>> 300ms. >>>>> >>>>>> >>>>>> Thank you a lot for the help >>>>> you're welcome, hope this helps >>>>>> Best >>>>>> Victoria >>>>> Likewise, >>>>> Jörn >>>>> >>>>>> >>>>>> >>>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>>> Hi Victoria, >>>>>>> >>>>>>> is there anything wrong with the code you used below? By >>>>>>> smoothing, >>>>>>> do you refer to smoothing in the frequency domain? >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> >>>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>>> Hello >>>>>>>> >>>>>>>> I am currently working on a freqanalysis as a first step to do >>>>>>>> a connectivityanalysis. I am a bit unsure about the method to >>>>>>>> use for the freqanalysis. My stimuli are very long: between 29 >>>>>>>> and 30 sec. In total i have 4 stimuli per condition and 2 >>>>>>>> seperate conditions. I am looking at the beta range so fairly >>>>>>>> low frequencies. >>>>>>>> >>>>>>>> this is my code: >>>>>>>> Am i using the right taper and method. Should i smooth the >>>>>>>> data? and if so, what should such a smoothing parameter depend >>>>>>>> on? >>>>>>>> >>>>>>>> %fourier analysis >>>>>>>> cfg=[]; >>>>>>>> cfg.output='fourier'; >>>>>>>> cfg.method='mtmfft'; >>>>>>>> cfg.foi=[12:30]; >>>>>>>> cfg.taper='hanning'; >>>>>>>> cfg.keeptrials='yes'; >>>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>>> >>>>>>>> >>>>>>>> %coherence analysis >>>>>>>> cfg=[]; >>>>>>>> cfg.method='coh'; >>>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>>> 'B3' 'C10' >>>>>>>> 'B23' 'C15' >>>>>>>> 'B23' 'C10'} >>>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>>> >>>>>>>> >>>>>>>> Thank you very much for the suggestions! >>>>>>>> Best >>>>>>>> Victoria >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>>> >>>>>>> -- Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> -- Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From joramvandriel at gmail.com Wed Feb 5 13:10:16 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 5 Feb 2014 13:10:16 +0100 Subject: [FieldTrip] cluster-based permutation stats with combined-planar neuromag data Message-ID: Hi all, I want to do statistics on frequency domain MEG data using cluster-based permutation testing, but I get stuck with the neighbour construction. I have Neuromag data, 204 sensors (excluding magnetometers), on which I did frequency analysis, after which I used ft_combineplanar to get a final set of 102 sensors. I have two freq cell structures corresponding to 2 conditions, 10 subjects each (within-subject design). I know the layout, template and neighbour approach for Neuromag is tricky because of the different sensor types, but here's what I did: cfg = []; cfg_lay.layout = 'neuromag306cmb.lay'; cfg_lay.grad = freq{1}.grad; cfg_neighb.layout = ft_prepare_layout(cfg_lay,freq{1}); cfg_neighb.method = 'template'; cfg_neighb.template = 'neuromag306cmb_neighb.mat'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb,freq{1}); cfg.minnbchan = 2; ... And then the cfg continues with standard settings for cluster-based permutation testing. When I run: stat = ft_freqstatistics(cfg, freq{2}, freq{1}); I get the error: ??? Error using ==> findcluster at 56 invalid dimension of spatdimneighbstructmat Error in ==> clusterstat at 185 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> ft_statistics_montecarlo at 361 [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in ==> ft_freqstatistics at 323 [stat, cfg] = statmethod(cfg, dat, cfg.design); I digged into these embedded functions but can't wrap my head around what went wrong. The later constructed cfg.connectivity seems to be empty; my guess is that produces channeighbstructmat to be empty, which produces the error. The output of ft_prepare_layout says there are on average 6.8 neighbours per channel, and the result of ft_neighbourplot looks perfectly fine: [image: Inline image 1] [image: Inline image 2] Does anybody have a suggestion how to tackle this problem? Any help is much appreciated! Thanks, Joram -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 25532 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 22254 bytes Desc: not available URL: From i.e.j.de.vries at student.vu.nl Wed Feb 5 13:29:33 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 5 Feb 2014 12:29:33 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Wed Feb 5 13:38:09 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 5 Feb 2014 12:38:09 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> p.s. And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? Greetings ________________________________ From: Vries, I.E.J. de Sent: 05 February 2014 13:29 To: fieldtrip at science.ru.nl Subject: corticomuscular and intermuscular coherence Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Feb 5 14:02:27 2014 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 5 Feb 2014 14:02:27 +0100 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> Message-ID: Dear Ingmar, I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: > p.s. > > And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? > > Greetings > > From: Vries, I.E.J. de > Sent: 05 February 2014 13:29 > To: fieldtrip at science.ru.nl > Subject: corticomuscular and intermuscular coherence > > Dear Fieldtrippers, > > I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. > My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... > > Thanks in advance, > Greetings, > Ingmar > _______________________________________________ > 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 albenin at mail.ru Wed Feb 5 15:57:47 2014 From: albenin at mail.ru (=?UTF-8?B?0JDQu9C10LrRgdC10Lkg0JHQtdC90LjQvQ==?=) Date: Wed, 05 Feb 2014 18:57:47 +0400 Subject: [FieldTrip] =?utf-8?q?Statistics_on_freq_data?= Message-ID: <1391612267.921368498@f293.i.mail.ru> Dear Fieldtripers, First of all big thanks for a wonderful tool and support! I have some questions about cluster based permutation test on TF data. I perform a between-trials experiment and want to search differences say on frequencies 10-30Hz and latencies 200-1200 ms from onset. So I need to explore these ranges for possible differencies in powerspectrum. When I use for example cfg.latency          = [0.2 1.2]; cfg.frequency        = [10 30]; I find no significant clusters, and lowest p_value is very high, say 0,8. But when I try to look at smaller time/frequency areas, like cfg.latency          = [0.2 0.3]; cfg.frequency        = [15 16]; There can be one or two significant clusters with p_values<0.01. So my question is: does the algorithm look for the whole specified TF window like 0.2-1.2s   10-30Hz and tries to find significant difference based on the whole length of interval? This could explain why there are no significant clusters on bigger windows. Such clusters appear when we shorten the toi and foi - it's much more probable to find differences at smaller scales. So the next question is: what should I do to explore the whole number of frequencies and latencies? Shall I run a loop with parameters like this: Iteration 1 cfg.latency          = [0.2 0.3]; cfg.frequency        = [15 16]; Iteration 2 cfg.latency          = [0.3 0.4]; cfg.frequency        = [15 16]; ... and so on? Or maybe I do not understand something in basis of method? BTW, I've read all tutorials and appropriate papers like Nonparametric statistical testing of EEG, but could not find the answer. Thanks in advance, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From edueeg at gmail.com Wed Feb 5 17:54:37 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Wed, 5 Feb 2014 14:54:37 -0200 Subject: [FieldTrip] eeglab2fieldtrip segmented data Message-ID: <722C334C-5EA5-43FD-BD0D-F493D42718DA@gmail.com> Hello There, I am trying to export continuous data segmented in EEGLab (using the eeg_rejepochs function) to fieldtrip using eeglab2fieldtrip, but it does not seem to correctly understand the segmentation done in EEGLab, issuing a warning that "the data does not contain a trial definition" and another stating that "reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous dataset" (which I know they're not) Has anybody gone through something similar and can help me figure out how to solve this, please? many thanks eduardo From sviter33 at gmail.com Thu Feb 6 13:01:02 2014 From: sviter33 at gmail.com (=?KOI8-R?B?7NXLz9HOz9cg7cHL08nN?=) Date: Thu, 6 Feb 2014 16:01:02 +0400 Subject: [FieldTrip] Coherence statistics between two groups of subjects Message-ID: Can anyone help me to understand the best way to calculate coherence of continuous data and compare results for two groups of subjects? The problem is that length of records is not equal for different subjects and for every subject I have several files. However, total length of records is not less than 30 s (Fs=500 Hz). I want to be sure that unequal length is not effect on results of statistical comparison between groups. Is it better to process these files separately and then average results or use ft_appenddata for each subject's files before the analysis? My second question is how to make a statistical test on the results of ft_connectivityanalysis between two groups of subjects. I have read all mail archive about this topic but with no progress. May anyone provide simple code example? Thenks for your help, Maxim Lukoyanov J. Researcher, NNMST -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Feb 6 14:22:50 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 06 Feb 2014 14:22:50 +0100 Subject: [FieldTrip] Gradiometer definition after ft_appenddata Message-ID: <52F38CAA.5070301@uni-tuebingen.de> Dear all, I have a question concerning ft_appenddata dropping the gradiometer definition to make sure one is not using a grad definition that does not fit the data (see [1] for an earlier quick discussion). I have an MEG data set in which some subjects had a short break during recording. The fiducial markers remained in place during the break. For each of these subjects, I would like to define trials in both data parts and then append them before doing further analysis. Is it valid to use the first part's grad definition for the combined data set? The grad definitions in the two parts are not identical. I assume this is because the subjects moved during the break and the grad definition is in relation to the fiducial markers at recording onset? Thanks in advance for your help! All the best, Jens P.S.: Sorry in case there is information on that on the fieldtrip website. I could only find an earlier quick exchange on this mailinglist: [1] http://mailman.science.ru.nl/pipermail/fieldtrip/2013-April/006405.html Here, Eelke Spaak said one can attach gradiometer data as long as one is sure it's the correct one. But how do I know it is correct? ...and the general info about the grad definitions: [2] http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described From i.e.j.de.vries at student.vu.nl Fri Feb 7 00:51:10 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Thu, 6 Feb 2014 23:51:10 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Hi Julian, Thanks for the reply. Yes I understand coherence of 1 time series is not possible, but I figured if you have a long enough trial and separate this in enough time windows, you could calculate the average coherence (so not time-resolved) over the whole trial. Anyway I have 10 trials per condition so I'll never calculate the coherence for a single trial. cheers, Ingmar ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: 05 February 2014 14:02 To: FieldTrip discussion list Subject: Re: [FieldTrip] corticomuscular and intermuscular coherence Dear Ingmar, I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: p.s. And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? Greetings ________________________________ From: Vries, I.E.J. de Sent: 05 February 2014 13:29 To: fieldtrip at science.ru.nl Subject: corticomuscular and intermuscular coherence Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar _______________________________________________ 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 julian.keil at gmail.com Fri Feb 7 10:22:01 2014 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 7 Feb 2014 10:22:01 +0100 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Message-ID: Hi Ingmar, it is definitively possible to cut your long (15 s) trials into smaller segments (i.e. 2 s) using ft_redefinetrial. The input would look something like this, in case you haven't tried this: for t = 1:length(in.trials) % loop over trials cfg=[]; cfg.trials = t; % only take on trial at a time cfg.length = 2; % length of the new trials cfg.overlap = .5 % How much of trial n should overlap with trial n+1 out{t} = ft_redefinetrial(cfg,in); % This gives you an output of your 90 trials, cut into smaller "sub trials" end This way, you could actually compute the coherence of each of your 90 long trials separately. However, I'm not sure if this is correct at all or not oversampling your data. If anyone objects, please correct me! Best, Julian Am 07.02.2014 um 00:51 schrieb Vries, I.E.J. de: > Hi Julian, > > Thanks for the reply. Yes I understand coherence of 1 time series is not possible, but I figured if you have a long enough trial and separate this in enough time windows, you could calculate the average coherence (so not time-resolved) over the whole trial. Anyway I have 10 trials per condition so I'll never calculate the coherence for a single trial. > > cheers, > Ingmar > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] > Sent: 05 February 2014 14:02 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] corticomuscular and intermuscular coherence > > Dear Ingmar, > > I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. > > In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: > > Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 > > In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. > > Best, > > Julian > > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: > >> p.s. >> >> And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? >> >> Greetings >> >> From: Vries, I.E.J. de >> Sent: 05 February 2014 13:29 >> To: fieldtrip at science.ru.nl >> Subject: corticomuscular and intermuscular coherence >> >> Dear Fieldtrippers, >> >> I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. >> My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... >> >> Thanks in advance, >> Greetings, >> Ingmar >> _______________________________________________ >> 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 aaron.schurger at gmail.com Fri Feb 7 12:43:04 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Fri, 7 Feb 2014 12:43:04 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output Message-ID: Hi, I am running a time-frequency analysis using ft_freqanalysis with the wavelet method. I assume that the output in each frequency band is temporally aligned to the midpoint of the wavelet (thinking in terms of convolution): i.e. the power value that I get at time 0.300, for a given frequency f, is precisely the dot product of f's wavelet CENTERED at 0.300 sec in the data. Is that correct? If so, how can I ask for the output of freqanalysis to be time aligned to the leading edge of the wavelet rather than the center? I.e. I want to make sure that each point in the output only has information about the past and knows nothing about the future, with respect to that time. Is there a simple way to do this? Thanks! Aaron -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From eelke.spaak at donders.ru.nl Fri Feb 7 12:56:13 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 7 Feb 2014 12:56:13 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi Aaron, Indeed, the value you get at t = 0.3 will correspond to the wavelet (or, equivalently, the time window that was tapered and Fourier-transformed) centered at that time point. So if your time window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched from t = 0.1 to t = 0.5 s. There is no default option to align the time points of interest to an edge of the wavelet. However, there is a very straightforward solution to what you are asking: if you want to make sure that the wavelet 'knows nothing' of the future after e.g. t = 0.5s, then only consider the time points up to and including t = 0.3s for any subsequent analyses. (Or more general up to t = tA - W/2, where tA is the point of interest beyond which no info can bleed into the wavelet, and W is the window length.) Best, Eelke On 7 February 2014 12:43, Aaron Schurger wrote: > Hi, > I am running a time-frequency analysis using ft_freqanalysis with the > wavelet method. I assume that the output in each frequency band is > temporally aligned to the midpoint of the wavelet (thinking in terms > of convolution): i.e. the power value that I get at time 0.300, for a > given frequency f, is precisely the dot product of f's wavelet > CENTERED at 0.300 sec in the data. Is that correct? If so, how can I > ask for the output of freqanalysis to be time aligned to the leading > edge of the wavelet rather than the center? I.e. I want to make sure > that each point in the output only has information about the past and > knows nothing about the future, with respect to that time. Is there a > simple way to do this? > Thanks! > Aaron > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Fri Feb 7 17:03:40 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Fri, 7 Feb 2014 11:03:40 -0500 Subject: [FieldTrip] ft_regressconfound Message-ID: Dear all, I am using regressconfound on Neuromag data. In CTF data, data for coil1, coil2 and coil3 are generated and then circumcenter function is called to compute 3 translational and 3 rotational dof. Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT channels that provide quarternion parameters q1 through q6, where q4,q5 and q6 are translations in x, y and z directions. I am using these q4,q5 and q6 to directly compute the rotational orientations (using the last part of the circumcenter.m script). It is said regressconfound must be used as a last step prior to stats. I have 4 blocks of data for each subject. Which option below should I follow? 1. Apply regress confound separately to four blocks? But, then I have to average these four blocks once again using ft_timelockanalysis, then grand average using ft_timelockgrandaverage before computing stats. 2. Or should I append the four blocks first, then perform regressconfound? In this case, I directly go to grandaverage and stats. Any suggestion is appreciated. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Fri Feb 7 17:39:17 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Fri, 7 Feb 2014 17:39:17 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi, Eelke, Thank you for your reply - that is very helpful indeed. One question remains then: how do I know what W is for each frequency band? I think W will of course depend on the frequency (in the case of morlet wavelets), being shorter for higher frequencies and longer for lower frequencies. I know that wavelets are defined in terms of the standard deviation of the envelope, but the window itself of course extends out beyond 1 std of the envelope, to some point beyond where the wavelet tapers to zero (I guess). So, if you know how I can compute W for any arbitrary frequency band, in the case of morlet wavelets, I would be very grateful. Thanks again! Aaron On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: > Hi Aaron, > > Indeed, the value you get at t = 0.3 will correspond to the wavelet > (or, equivalently, the time window that was tapered and > Fourier-transformed) centered at that time point. So if your time > window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched > from t = 0.1 to t = 0.5 s. > > There is no default option to align the time points of interest to an > edge of the wavelet. However, there is a very straightforward solution > to what you are asking: if you want to make sure that the wavelet > 'knows nothing' of the future after e.g. t = 0.5s, then only consider > the time points up to and including t = 0.3s for any subsequent > analyses. (Or more general up to t = tA - W/2, where tA is the point > of interest beyond which no info can bleed into the wavelet, and W is > the window length.) > > Best, > Eelke > > On 7 February 2014 12:43, Aaron Schurger wrote: >> Hi, >> I am running a time-frequency analysis using ft_freqanalysis with the >> wavelet method. I assume that the output in each frequency band is >> temporally aligned to the midpoint of the wavelet (thinking in terms >> of convolution): i.e. the power value that I get at time 0.300, for a >> given frequency f, is precisely the dot product of f's wavelet >> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >> ask for the output of freqanalysis to be time aligned to the leading >> edge of the wavelet rather than the center? I.e. I want to make sure >> that each point in the output only has information about the past and >> knows nothing about the future, with respect to that time. Is there a >> simple way to do this? >> Thanks! >> Aaron >> >> -- >> Aaron Schurger, PhD >> Senior researcher >> Laboratory of Cognitive Neuroscience >> Brain-Mind Institute, Department of Life Sciences >> École Polytechnique Fédérale de Lausanne >> Station 19, AI 2101 >> 1015 Lausanne, Switzerland >> +41 21 693 1771 >> aaron.schurger at epfl.ch >> http://lnco.epfl.ch/ >> >> _______________________________________________ >> 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 -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From eelke.spaak at donders.ru.nl Fri Feb 7 17:57:31 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 7 Feb 2014 17:57:31 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi Aaron, I had been assuming you were using cfg.method = 'mtmconvol', which does an implicit wavelet convolution, but lets you specify the parameters in terms of a window length, taper to use, and smoothing parameter (if using slepian taper sequence). Mtmconvol is the method I would almost always use, as it provides a greater degree of control over and flexibility in the parameters. However, now I understand you might be using cfg.method = 'wavelet'. Could you post the entire cfg you are using for ft_freqanalysis? Best, Eelke On 7 February 2014 17:39, Aaron Schurger wrote: > Hi, Eelke, > Thank you for your reply - that is very helpful indeed. One question > remains then: how do I know what W is for each frequency band? I think > W will of course depend on the frequency (in the case of morlet > wavelets), being shorter for higher frequencies and longer for lower > frequencies. I know that wavelets are defined in terms of the standard > deviation of the envelope, but the window itself of course extends out > beyond 1 std of the envelope, to some point beyond where the wavelet > tapers to zero (I guess). So, if you know how I can compute W for any > arbitrary frequency band, in the case of morlet wavelets, I would be > very grateful. > Thanks again! > Aaron > > On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: >> Hi Aaron, >> >> Indeed, the value you get at t = 0.3 will correspond to the wavelet >> (or, equivalently, the time window that was tapered and >> Fourier-transformed) centered at that time point. So if your time >> window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched >> from t = 0.1 to t = 0.5 s. >> >> There is no default option to align the time points of interest to an >> edge of the wavelet. However, there is a very straightforward solution >> to what you are asking: if you want to make sure that the wavelet >> 'knows nothing' of the future after e.g. t = 0.5s, then only consider >> the time points up to and including t = 0.3s for any subsequent >> analyses. (Or more general up to t = tA - W/2, where tA is the point >> of interest beyond which no info can bleed into the wavelet, and W is >> the window length.) >> >> Best, >> Eelke >> >> On 7 February 2014 12:43, Aaron Schurger wrote: >>> Hi, >>> I am running a time-frequency analysis using ft_freqanalysis with the >>> wavelet method. I assume that the output in each frequency band is >>> temporally aligned to the midpoint of the wavelet (thinking in terms >>> of convolution): i.e. the power value that I get at time 0.300, for a >>> given frequency f, is precisely the dot product of f's wavelet >>> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >>> ask for the output of freqanalysis to be time aligned to the leading >>> edge of the wavelet rather than the center? I.e. I want to make sure >>> that each point in the output only has information about the past and >>> knows nothing about the future, with respect to that time. Is there a >>> simple way to do this? >>> Thanks! >>> Aaron >>> >>> -- >>> Aaron Schurger, PhD >>> Senior researcher >>> Laboratory of Cognitive Neuroscience >>> Brain-Mind Institute, Department of Life Sciences >>> École Polytechnique Fédérale de Lausanne >>> Station 19, AI 2101 >>> 1015 Lausanne, Switzerland >>> +41 21 693 1771 >>> aaron.schurger at epfl.ch >>> http://lnco.epfl.ch/ >>> >>> _______________________________________________ >>> 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 > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From edueeg at gmail.com Fri Feb 7 17:56:52 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Fri, 7 Feb 2014 14:56:52 -0200 Subject: [FieldTrip] ft_channelrepair layout problem Message-ID: Hello all, I am having dificulties with the function ft_channelrepair because one of it's inputs must be cfg.elec (electrode positions) but I can't figure out how to convert my layout (I have it as an ascii .lay as well as .mat with the "lay" struct) to the proper format for ft_channelrepair Already tried the tutorials and ft_readsens and ft_datatype_sens but unfortunately I am still having trouble to solve this Can anyone help me out please?? many thanks eduardo From a.stolk at fcdonders.ru.nl Fri Feb 7 17:59:49 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 7 Feb 2014 17:59:49 +0100 (CET) Subject: [FieldTrip] ft_regressconfound In-Reply-To: Message-ID: <1180822759.5206965.1391792389190.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, It is indeed recommended to use ft_regressconfound as a last step prior to statistical assessment. It will remove trial-by-trial variance in the neural data that can be attributed to trial-by-trial variance in head position. The latter is approximated with regressors containing trial-by-trial information on head positions deviating from the session/experiment mean. Because the head position timeseries is mean-subtracted, the mean neural activity over trials is not affected by ft_regressconfound; only the variance over trials is, which should result in a cleaner representation of the data. In order to estimate the contribution of different head positions to the neural data, ft_regressconfound relies on general linear modeling. Applying ft_regressconfound to the four blocks separately (your option 1) will involve four different model estimations and their associated errors. Because these errors may differ per estimation, the quality of treatment of the neural data may also differ per block. This will not affect the mean neural activity in each block, but it may affect the grand mean over all four blocks as for trials in one block more contribution from head position may be regressed out than for another. Applying ft_regressconfound on the data of the four blocks together (your option 2), will not affect the grand mean over the trials from all four blocks. It will reduce the influence of head movement on trial-by-trial variance in neural activity. This can be for better, or for worse: namely, if there are consistent differences in head positions between two conditions (captured in those four blocks), it may bring the means of neural activity evoked in these two conditions closer to each other, reducing effect sizes. In fact, the employment of ft_regressconfound allows one to make a good case that an observed effect (i.e. differential neural activity between the two conditions) cannot be attributed to differences in head positions when recording those conditions (note that the same analysis could also be performed with eye-movement related activity, or any other measure of a potential confound). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Vrijdag 7 februari 2014 17:03:40 > Onderwerp: [FieldTrip] ft_regressconfound > Dear all, > I am using regressconfound on Neuromag data. In CTF data, data for > coil1, coil2 and coil3 are generated and then circumcenter function is > called to compute 3 translational and 3 rotational dof. > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > channels that provide quarternion parameters q1 through q6, where > q4,q5 and q6 are translations in x, y and z directions. I am using > these q4,q5 and q6 to directly compute the rotational orientations > (using the last part of the circumcenter.m script). > It is said regressconfound must be used as a last step prior to stats. > I have 4 blocks of data for each subject. Which option below should I > follow? > 1. Apply regress confound separately to four blocks? But, then I have > to average these four blocks once again using ft_timelockanalysis, > then grand average using ft_timelockgrandaverage before computing > stats. > 2. Or should I append the four blocks first, then perform > regressconfound? In this case, I directly go to grandaverage and > stats. > Any suggestion is appreciated. > Thanks, > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Sat Feb 8 10:33:01 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Sat, 8 Feb 2014 10:33:01 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi, Eelke, Sure, here it is: cfg=[]; cfg.method = 'wavelet'; % or 'tfr' cfg.toi = []; cfg.foi = [1:12,14:2:30,35:5:100]; cfg.width = 7; cfg.gwidth = 5; cfg.trials = btn; I would be keen on using the mtmconvol method, but then I have to decide how to choose all of the parameters. Any guidelines? Thanks! Aaron On Fri, Feb 7, 2014 at 5:57 PM, Eelke Spaak wrote: > Hi Aaron, > > I had been assuming you were using cfg.method = 'mtmconvol', which > does an implicit wavelet convolution, but lets you specify the > parameters in terms of a window length, taper to use, and smoothing > parameter (if using slepian taper sequence). Mtmconvol is the method I > would almost always use, as it provides a greater degree of control > over and flexibility in the parameters. However, now I understand you > might be using cfg.method = 'wavelet'. Could you post the entire cfg > you are using for ft_freqanalysis? > > Best, > Eelke > > On 7 February 2014 17:39, Aaron Schurger wrote: >> Hi, Eelke, >> Thank you for your reply - that is very helpful indeed. One question >> remains then: how do I know what W is for each frequency band? I think >> W will of course depend on the frequency (in the case of morlet >> wavelets), being shorter for higher frequencies and longer for lower >> frequencies. I know that wavelets are defined in terms of the standard >> deviation of the envelope, but the window itself of course extends out >> beyond 1 std of the envelope, to some point beyond where the wavelet >> tapers to zero (I guess). So, if you know how I can compute W for any >> arbitrary frequency band, in the case of morlet wavelets, I would be >> very grateful. >> Thanks again! >> Aaron >> >> On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: >>> Hi Aaron, >>> >>> Indeed, the value you get at t = 0.3 will correspond to the wavelet >>> (or, equivalently, the time window that was tapered and >>> Fourier-transformed) centered at that time point. So if your time >>> window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched >>> from t = 0.1 to t = 0.5 s. >>> >>> There is no default option to align the time points of interest to an >>> edge of the wavelet. However, there is a very straightforward solution >>> to what you are asking: if you want to make sure that the wavelet >>> 'knows nothing' of the future after e.g. t = 0.5s, then only consider >>> the time points up to and including t = 0.3s for any subsequent >>> analyses. (Or more general up to t = tA - W/2, where tA is the point >>> of interest beyond which no info can bleed into the wavelet, and W is >>> the window length.) >>> >>> Best, >>> Eelke >>> >>> On 7 February 2014 12:43, Aaron Schurger wrote: >>>> Hi, >>>> I am running a time-frequency analysis using ft_freqanalysis with the >>>> wavelet method. I assume that the output in each frequency band is >>>> temporally aligned to the midpoint of the wavelet (thinking in terms >>>> of convolution): i.e. the power value that I get at time 0.300, for a >>>> given frequency f, is precisely the dot product of f's wavelet >>>> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >>>> ask for the output of freqanalysis to be time aligned to the leading >>>> edge of the wavelet rather than the center? I.e. I want to make sure >>>> that each point in the output only has information about the past and >>>> knows nothing about the future, with respect to that time. Is there a >>>> simple way to do this? >>>> Thanks! >>>> Aaron >>>> >>>> -- >>>> Aaron Schurger, PhD >>>> Senior researcher >>>> Laboratory of Cognitive Neuroscience >>>> Brain-Mind Institute, Department of Life Sciences >>>> École Polytechnique Fédérale de Lausanne >>>> Station 19, AI 2101 >>>> 1015 Lausanne, Switzerland >>>> +41 21 693 1771 >>>> aaron.schurger at epfl.ch >>>> http://lnco.epfl.ch/ >>>> >>>> _______________________________________________ >>>> 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 >> >> >> >> -- >> Aaron Schurger, PhD >> Senior researcher >> Laboratory of Cognitive Neuroscience >> Brain-Mind Institute, Department of Life Sciences >> École Polytechnique Fédérale de Lausanne >> Station 19, AI 2101 >> 1015 Lausanne, Switzerland >> +41 21 693 1771 >> aaron.schurger at epfl.ch >> http://lnco.epfl.ch/ >> >> _______________________________________________ >> 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 -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From jm.horschig at donders.ru.nl Mon Feb 10 09:24:28 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 10 Feb 2014 09:24:28 +0100 Subject: [FieldTrip] ft_channelrepair layout problem In-Reply-To: References: Message-ID: <52F88CBC.7090804@donders.ru.nl> Hi Eduardo, it might help if you read in one of the template sensor descriptions (FieldTrip/template/electrode/) and check http://fieldtrip.fcdonders.nl/reference/ft_datatype_sens to get an idea what you need and what to do. Maybe there even is already an electrode template available for you. Best, Jörn On 2/7/2014 5:56 PM, Eduardo Schenberg wrote: > Hello all, > > I am having dificulties with the function ft_channelrepair because one of it's inputs must be cfg.elec (electrode positions) but I can't figure out how to convert my layout (I have it as an ascii .lay as well as .mat with the "lay" struct) to the proper format for ft_channelrepair > > Already tried the tutorials and ft_readsens and ft_datatype_sens but unfortunately I am still having trouble to solve this > > Can anyone help me out please?? > > many thanks > > eduardo > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From bingshuo.li at student.uni-tuebingen.de Mon Feb 10 15:05:51 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Mon, 10 Feb 2014 15:05:51 +0100 Subject: [FieldTrip] TMS-EEG Decay Artifact Message-ID: Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Mon Feb 10 15:24:39 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 10 Feb 2014 15:24:39 +0100 (CET) Subject: [FieldTrip] TMS-EEG Decay Artifact In-Reply-To: References: Message-ID: <007f01cf266b$d5524ad0$7ff6e070$@herring@fcdonders.ru.nl> Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the 'evil' decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Feb 10 17:02:34 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 10 Feb 2014 11:02:34 -0500 Subject: [FieldTrip] ft_regressconfound Message-ID: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> Dear Arjen Thanks for your prompt response. I understand your point regarding using ft_regressconfound with all 4 blocks together. I think that makes more sense. I have another question. I understand ft_regressconfound must be the last step. However, can time frequency calculation be done on data after employing regressconfound? Or would you suggest doing trial by trial time frequency calculation, then compensate using regressconfound and then compute timelock? Is there a reason not to do the former way? Thanks, Raghavan Dear Raghavan, It is indeed recommended to use ft_regressconfound as a last step prior to statistical assessment. It will remove trial-by-trial variance in the neural data that can be attributed to trial-by-trial variance in head position. The latter is approximated with regressors containing trial-by-trial information on head positions deviating from the session/experiment mean. Because the head position timeseries is mean-subtracted, the mean neural activity over trials is not affected by ft_regressconfound; only the variance over trials is, which should result in a cleaner representation of the data. In order to estimate the contribution of different head positions to the neural data, ft_regressconfound relies on general linear modeling. Applying ft_regressconfound to the four blocks separately (your option 1) will involve four different model estimations and their associated errors. Because these errors may differ per estimation, the quality of treatment of the neural data may also differ per block. This will not affect the mean neural activity in each block, but it may affect the grand mean over all four blocks as for trials in one block more contribution from head position may be regressed out than for another. Applying ft_regressconfound on the data of the four blocks together (your option 2), will not affect the grand mean over the trials from all four blocks. It will reduce the influence of head movement on trial-by-trial variance in neural activity. This can be for better, or for worse: namely, if there are consistent differences in head positions between two conditions (captured in those four blocks), it may bring the means of neural activity evoked in these two conditions closer to each other, reducing effect sizes. In fact, the employment of ft_regressconfound allows one to make a good case that an observed effect (i.e. differential neural activity between the two conditions) cannot be attributed to differences in head positions when recording those conditions (note that the same analysis could also be performed with eye-movement related activity, or any other measure of a potential confound). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Vrijdag 7 februari 2014 17:03:40 > Onderwerp: [FieldTrip] ft_regressconfound > Dear all, > I am using regressconfound on Neuromag data. In CTF data, data for > coil1, coil2 and coil3 are generated and then circumcenter function is > called to compute 3 translational and 3 rotational dof. > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > channels that provide quarternion parameters q1 through q6, where > q4,q5 and q6 are translations in x, y and z directions. I am using > these q4,q5 and q6 to directly compute the rotational orientations > (using the last part of the circumcenter.m script). > It is said regressconfound must be used as a last step prior to stats. > I have 4 blocks of data for each subject. Which option below should I > follow? > 1. Apply regress confound separately to four blocks? But, then I have > to average these four blocks once again using ft_timelockanalysis, > then grand average using ft_timelockgrandaverage before computing > stats. > 2. Or should I append the four blocks first, then perform > regressconfound? In this case, I directly go to grandaverage and > stats. > Any suggestion is appreciated. > Thanks, > Raghavan From cmoisello at gmail.com Mon Feb 10 18:03:06 2014 From: cmoisello at gmail.com (Clara Moisello) Date: Mon, 10 Feb 2014 12:03:06 -0500 Subject: [FieldTrip] question about ft_statfun_actvsblT Message-ID: Hello Fieldtrip community, I have a question re: ft_statfun_actvsblT What I would like to do is to identify electrodes whose power changes significantly from baseline at SINGLE subject level, i.e. across trials instead than across subjects. I was thinking that the function above would answer my needs, but I realized that it is probably meant for a between-subject type of comparison. Could someone shed some light on the issue, or has addressed the issue in any other way? Thanks! Clara -- Clara Moisello, PhD Dept Physiology, Pharmacology & Neuroscience City College of New York Harris Hall - Room 202 phone: +12126507487 fax: +12126507726 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Feb 10 19:13:58 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Mon, 10 Feb 2014 19:13:58 +0100 (CET) Subject: [FieldTrip] ft_regressconfound In-Reply-To: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> Message-ID: <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, > I have another question. I understand ft_regressconfound must be the > last > step. However, can time frequency calculation be done on data after > employing regressconfound? Or would you suggest doing trial by trial > time > frequency calculation, then compensate using regressconfound and then > compute timelock? Is there a reason not to do the former way? I would recommend doing the latter, provided that you meant to say 'compute statistics' instead of 'compute timelock'. When ft_regressconfound is applied to raw/ERF data, trial-by-trial adjustments are made to the data, according to explained variance by head movements (and thus differences in distances to the sensors). Subsequently performing time frequency analysis on this data may give a distorted view of signal frequency powers. Note that if a source reconstruction analysis is also one of your follow-up steps, it is recommended to do this on the 'original' data, and then use ft_regressconfound at the source level. See 'Practical issues' on this page for the rationale behind this: http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis In sum, ft_regressconfound is best used as a last step prior ft_xxxstatistics. Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Maandag 10 februari 2014 17:02:34 > Onderwerp: Re: [FieldTrip] ft_regressconfound > Dear Arjen > Thanks for your prompt response. I understand your point regarding > using > ft_regressconfound with all 4 blocks together. I think that makes more > sense. > I have another question. I understand ft_regressconfound must be the > last > step. However, can time frequency calculation be done on data after > employing regressconfound? Or would you suggest doing trial by trial > time > frequency calculation, then compensate using regressconfound and then > compute timelock? Is there a reason not to do the former way? > > Thanks, > Raghavan > > Dear Raghavan, It is indeed recommended to use ft_regressconfound as a > last > step prior to statistical assessment. It will remove trial-by-trial > variance > in the neural data that can be attributed to trial-by-trial variance > in head > position. The latter is approximated with regressors containing > trial-by-trial information on head positions deviating from the > session/experiment mean. Because the head position timeseries is > mean-subtracted, the mean neural activity over trials is not affected > by > ft_regressconfound; only the variance over trials is, which should > result in > a cleaner representation of the data. In order to estimate the > contribution > of different head positions to the neural data, ft_regressconfound > relies on > general linear modeling. Applying ft_regressconfound to the four > blocks > separately (your option 1) will involve four different model > estimations and > their associated errors. Because these errors may differ per > estimation, the > quality of treatment of the neural data may also differ per block. > This will > not affect the mean neural activity in each block, but it may affect > the > grand mean over all four blocks as for trials in one block more > contribution > from head position may be regressed out than for another. Applying > ft_regressconfound on the data of the four blocks together (your > option 2), > will not affect the grand mean over the trials from all four blocks. > It will > reduce the influence of head movement on trial-by-trial variance in > neural > activity. This can be for better, or for worse: namely, if there are > consistent differences in head positions between two conditions > (captured in > those four blocks), it may bring the means of neural activity evoked > in > these two conditions closer to each other, reducing effect sizes. In > fact, > the employment of ft_regressconfound allows one to make a good case > that an > observed effect (i.e. differential neural activity between the two > conditions) cannot be attributed to differences in head positions when > recording those conditions (note that the same analysis could also be > performed with eye-movement related activity, or any other measure of > a > potential confound). Hope this helps, Arjen ----- Oorspronkelijk > bericht > ----- > > Van: "Raghavan Gopalakrishnan" > > Aan: fieldtrip at science.ru.nl > > Verzonden: Vrijdag 7 februari 2014 17:03:40 > > Onderwerp: [FieldTrip] ft_regressconfound > > Dear all, > > I am using regressconfound on Neuromag data. In CTF data, data for > > coil1, coil2 and coil3 are generated and then circumcenter function > > is > > called to compute 3 translational and 3 rotational dof. > > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > > channels that provide quarternion parameters q1 through q6, where > > q4,q5 and q6 are translations in x, y and z directions. I am using > > these q4,q5 and q6 to directly compute the rotational orientations > > (using the last part of the circumcenter.m script). > > It is said regressconfound must be used as a last step prior to > > stats. > > I have 4 blocks of data for each subject. Which option below should > > I > > follow? > > 1. Apply regress confound separately to four blocks? But, then I > > have > > to average these four blocks once again using ft_timelockanalysis, > > then grand average using ft_timelockgrandaverage before computing > > stats. > > 2. Or should I append the four blocks first, then perform > > regressconfound? In this case, I directly go to grandaverage and > > stats. > > Any suggestion is appreciated. > > Thanks, > > Raghavan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl From e.maris at psych.ru.nl Mon Feb 10 21:14:27 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 10 Feb 2014 21:14:27 +0100 (CET) Subject: [FieldTrip] question about ft_statfun_actvsblT In-Reply-To: References: Message-ID: <060301cf269c$af87a5d0$0e96f170$@maris@psych.ru.nl> Hi Laura, What I would like to do is to identify electrodes whose power changes significantly from baseline at SINGLE subject level, i.e. across trials instead than across subjects. I was thinking that the function above would answer my needs, but I realized that it is probably meant for a between-subject type of comparison. Could someone shed some light on the issue, or has addressed the issue in any other way? No problem. You can do this. Have a look here: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq, and in particular in the section "Within-trials experiments". Best, Eric Maris Thanks! Clara -- Clara Moisello, PhD Dept Physiology, Pharmacology & Neuroscience City College of New York Harris Hall - Room 202 phone: +12126507487 fax: +12126507726 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Tue Feb 11 16:16:23 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Tue, 11 Feb 2014 15:16:23 +0000 Subject: [FieldTrip] Issue with ft_databrowser Message-ID: <52FA3EC7.9010600@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Tue Feb 11 16:54:01 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Tue, 11 Feb 2014 16:54:01 +0100 (CET) Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <52FA3EC7.9010600@glasgow.ac.uk> Message-ID: <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> Hi May, The first possible options is that you need to use Matlab2011b - anything more updated can lead to a change in calculations (which may not give an error) or a crash (which might be what is happening). However, I'm not the most familiar with the output below, if this is not the solution I'm sure someone else can help. Best, Nietzsche ----- Original Message ----- > From: "Heng-Ru May Tan" > To: fieldtrip at science.ru.nl > Sent: Tuesday, 11 February, 2014 4:16:23 PM > Subject: [FieldTrip] Issue with ft_databrowser > Hello, > > I have been unable to use ft_databrowser today to view ICA components; > which is slightly strange. It used to work... > I have just installed fieldtrip-20140210 and using Matlab13b on 64bit > machine -- which led to repeated crash issue, as with > fieldtrip-20140114 which I tried on Matlab12a and 13b. > > Does anyone have any ideas as to what could lead to the problem? > Quoted below is structure of input compASSR and what Matlab spewed > when attempting to continue. > > Thanks in advance, > May > > > > > >> compASSR > > compASSR = > > fsample: 1.0172e+03 > time: {1x104 cell} > trial: {1x104 cell} > topo: [233x50 double] > unmixing: [50x233 double] > label: {50x1 cell} > topolabel: {233x1 cell} > sampleinfo: [104x2 double] > cfg: [1x1 struct] > > > > >> cfg=[]; > > % cfg.channel=[{'MEG'} badChansList]; > cfg.continuous = 'yes'; > cfg.channels = [1:10]; > cfg.layout = '4D248.lay'; > cfg.viewmode = 'component'; > >> ft_databrowser(cfg,compASSR) > reading layout from file 4D248.lay > the call to "ft_prepare_layout" took 0 seconds > the input is component data with 50 components and 233 original > channels > detected 0 visual artifacts > > ------------------------------------------------------------------------ > Access violation detected at Tue Feb 11 14:54:01 2014 > ------------------------------------------------------------------------ > > Configuration: > Crash Decoding : Disabled > Default Encoding : windows-1252 > MATLAB Architecture: win64 > MATLAB Root : C:\Program Files\MATLAB\R2013b > MATLAB Version : 8.2.0.701 (R2013b) > Operating System : Microsoft Windows 7 > Processor ID : x86 Family 6 Model 26 Stepping 5, GenuineIntel > Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java > HotSpot(TM) 64-Bit Server VM mixed mode > Window System : Version 6.1 (Build 7601: Service Pack 1) > > Fault Count: 1 > > > Abnormal termination: > Access violation > > Register State (from fault): > RAX = 00000000000001a4 RBX = 0000000027620080 > RCX = 00000000000262de RDX = 00000000000001b2 > RSP = 0000000004023340 RBP = 000000000000007e > RSI = 00000001240fbcd0 RDI = 00000001394eb996 > > R8 = 00000000000262de R9 = 0000000000000230 > R10 = 0000000000000000 R11 = 0000000004023418 > R12 = 0000000000f206cd R13 = 00000000a4f5fe90 > R14 = 000000000002635c R15 = 00000000000006c8 > > RIP = 0000000006583211 EFL = 00010216 > > CS = 0033 FS = 0053 GS = 002b > > Stack Trace (from fault): > [ 0] 0x0000000006583211 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02896401 > RenderEngineBase::~RenderEngineBase+00148801 > [ 1] 0x00000000064fc8ae C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02345134 text_to_pixel+00005038 > [ 2] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 3] 0x000000000646573d C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01726269 > renderAnimatedKids+00000509 > [ 4] 0x000000000646a5ad C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01746349 getARDonAxis+00010413 > [ 5] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 6] 0x000000000648c51a C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01885466 > FigureSetVisualAutoMode+00001594 > [ 7] 0x00000000064912ed C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01905389 > UIJ_CreatePeerWindow+00001789 > [ 8] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 9] 0x0000000006589358 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02921304 > RenderEngineBase::~RenderEngineBase+00173704 > [ 10] 0x000000000648df14 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01892116 > FigureSetVisualAutoMode+00008244 > [ 11] 0x000000000648df8d C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01892237 > FigureSetVisualAutoMode+00008365 > [ 12] 0x00000000060db67f C:\Program > Files\MATLAB\R2013b\bin\win64\libmwgui.dll+00439935 > wm_ExposeFcn_Pre_Optional+00000303 > [ 13] 0x000000006b6fae14 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00175636 > GetframeJava+00001124 > [ 14] 0x000000006b6fcd5e C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00183646 > UIJ_IsWindowShowing+00000430 > [ 15] 0x000000006b6feab8 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191160 > UIJ_clearWaitForResize+00002472 > [ 16] 0x000000006b6febcd C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191437 > UIJ_ExposeFcn+00000141 > [ 17] 0x000000006b6d3bce C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015310 > UIJ_MarkEventFinished+00005998 > [ 18] 0x000000006b6d3c20 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015392 > UIJ_MarkEventFinished+00006080 > [ 19] 0x000000006b6f795c C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00162140 > uij::JavaDraw2D::paintQuadStrip+00001500 > [ 20] 0x000000006c68ae38 C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00241208 > uddSetListenerRecursionWarning+00000680 > [ 21] 0x000000006c68b48c C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00242828 > UDListenerManagerHost::notifyEvent+00000076 > [ 22] 0x000000006c6838dd C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00211165 > UDEventInfo::send+00000093 > [ 23] 0x000000006b2f7d7f C:\Program > Files\MATLAB\R2013b\bin\win64\udd_mi.dll+00032127 > MErrorException::operator=+00027919 > [ 24] 0x000000006b01fa96 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > UIW_IsUserMessage+00000086 > [ 25] 0x000000006b020175 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > UIW_SetGLIMUserMsg+00000117 > [ 26] 0x000000006b0201f9 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > UIW_SetGLIMUserMsg+00000249 > [ 27] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > GetMenuBarInfo+00000638 > [ 28] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > SystemParametersInfoW+00000235 > [ 29] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > IsProcessDPIAware+00000465 > [ 30] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > KiUserCallbackDispatcher+00000031 > [ 31] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > PeekMessageW+00000186 > [ 32] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > GetKeyState+00000238 > [ 33] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > PeekMessageA+00000087 > [ 34] 0x000000006aff94db C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > UIW_SetCurrentDialog+00000731 > [ 35] 0x000000006b021632 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > ws_FreeSystemFont+00000482 > [ 36] 0x000000006f156600 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > [ 37] 0x000000006f156fc5 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > [ 38] 0x000000006f157e10 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > [ 39] 0x000000006f160596 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > sysq::removeProcessPendingEventsHook+00010998 > [ 40] 0x000000006f16089a C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > svWS_ProcessPendingEvents+00000138 > [ 41] 0x00000000064937f0 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01914864 > hgWaitforbuttonpress+00001552 > [ 42] 0x000000018000d7ff C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00055295 > Mfh_file::dispatch_fh+00001167 > [ 43] 0x000000018000ddb7 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00056759 > Mfunction_handle::dispatch+00000487 > [ 44] 0x0000000004e96a81 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > inFunctionHandleInterface::DestroyWorkspace+00308737 > [ 45] 0x0000000004e9303e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00471102 > inFunctionHandleInterface::DestroyWorkspace+00293822 > [ 46] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 47] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 48] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 49] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 50] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 51] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 52] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 53] 0x0000000004e6c634 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00312884 > inFunctionHandleInterface::DestroyWorkspace+00135604 > [ 54] 0x0000000004e7fa37 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00391735 > inFunctionHandleInterface::DestroyWorkspace+00214455 > [ 55] 0x0000000004e9dc4f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00515151 > inFunctionHandleInterface::DestroyWorkspace+00337871 > [ 56] 0x0000000004e86639 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00419385 > inFunctionHandleInterface::DestroyWorkspace+00242105 > [ 57] 0x0000000004e8feaf C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00458415 > inFunctionHandleInterface::DestroyWorkspace+00281135 > [ 58] 0x0000000004e92e23 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00470563 > inFunctionHandleInterface::DestroyWorkspace+00293283 > [ 59] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 60] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 61] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 62] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 63] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 64] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 65] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 66] 0x0000000004e96a81 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > inFunctionHandleInterface::DestroyWorkspace+00308737 > [ 67] 0x0000000004f20657 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01050199 > inEachVisibleName+00015383 > [ 68] 0x0000000004e946c2 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00476866 > inFunctionHandleInterface::DestroyWorkspace+00299586 > [ 69] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 70] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 71] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 72] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 73] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 74] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 75] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 76] 0x0000000004f3438e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01131406 > inSetWorkSpaces+00001262 > [ 77] 0x0000000004f406f5 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01181429 > SetInterpreter+00000325 > [ 78] 0x0000000004f42cb5 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191093 > inEvalCmd+00008789 > [ 79] 0x0000000004f42c82 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191042 > inEvalCmd+00008738 > [ 80] 0x0000000004f42c47 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01190983 > inEvalCmd+00008679 > [ 81] 0x000000000532ad0c C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05287180 > inMexPutVariable+00008364 > [ 82] 0x000000000532b066 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05288038 > inMexPutVariable+00009222 > [ 83] 0x000000000532b49e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289118 > inMexPutVariable+00010302 > [ 84] 0x000000000532b7dc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289948 > inMexPutVariable+00011132 > [ 85] 0x000000000523ff91 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+04325265 > inEvalCmdWithLocalReturn+00000065 > [ 86] 0x000000006c71be9d C:\Program > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00048797 > mnDebugPrompt+00000109 > [ 87] 0x000000006c71cf7f C:\Program > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00053119 > mnParser+00000735 > [ 88] 0x000000006e4ff4b4 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00193716 > mcrInstance::mnParser_on_interpreter_thread+00000036 > [ 89] 0x000000006e4e44b0 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083120 > mcr::runtime::setInterpreterThreadToCurrent+00029472 > [ 90] 0x000000006e4e4510 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083216 > mcr::runtime::setInterpreterThreadToCurrent+00029568 > [ 91] 0x000000006b01fa96 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > UIW_IsUserMessage+00000086 > [ 92] 0x000000006b020175 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > UIW_SetGLIMUserMsg+00000117 > [ 93] 0x000000006b0201f9 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > UIW_SetGLIMUserMsg+00000249 > [ 94] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > GetMenuBarInfo+00000638 > [ 95] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > SystemParametersInfoW+00000235 > [ 96] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > IsProcessDPIAware+00000465 > [ 97] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > KiUserCallbackDispatcher+00000031 > [ 98] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > PeekMessageW+00000186 > [ 99] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > GetKeyState+00000238 > [100] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > PeekMessageA+00000087 > [101] 0x000000006aff94db C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > UIW_SetCurrentDialog+00000731 > [102] 0x000000006b021632 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > ws_FreeSystemFont+00000482 > [103] 0x000000006f156600 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > [104] 0x000000006f156fc5 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > [105] 0x000000006f157e10 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > [106] 0x000000006f160596 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > sysq::removeProcessPendingEventsHook+00010998 > [107] 0x000000006f16089a C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > svWS_ProcessPendingEvents+00000138 > [108] 0x000000006e4e552d C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00087341 > mcr::runtime::setInterpreterThreadToCurrent+00033693 > [109] 0x000000006e4e57fb C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00088059 > mcr::runtime::setInterpreterThreadToCurrent+00034411 > [110] 0x000000006e4d9545 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00038213 > mcrInstantiationError::operator=+00003221 > [111] 0x000000006e4dc872 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00051314 > mcr_invoke_on_interpreter_thread+00001602 > [112] 0x000000006e4e98e6 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00104678 mcrDesktopMain+00000230 > [113] 0x0000000140004f0b C:\Program > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00020235 > [114] 0x0000000140006a07 C:\Program > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00027143 > [115] 0x0000000076cb652d C:\Windows\system32\kernel32.dll+00091437 > BaseThreadInitThunk+00000013 > [116] 0x0000000076dec541 C:\Windows\SYSTEM32\ntdll.dll+00181569 > RtlUserThreadStart+00000033 > > > If this problem is reproducible, please submit a Service Request via: > http://www.mathworks.com/support/contact_us/ > > A technical support engineer might contact you with further > information. > > Thank you for your help.** This crash report has been saved to disk as > C:\Users\######\AppData\Local\Temp\matlab_crash_dump.11620-1 ** > > > Error using setappdata > Invalid object handle > > Error in ft_databrowser>redraw_cb (line 1896) > setappdata(h, 'opt', opt); > > Error in ft_databrowser (line 676) > redraw_cb(h); > > [Please exit and restart MATLAB]>> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From alik.widge at gmail.com Tue Feb 11 17:11:54 2014 From: alik.widge at gmail.com (Alik Widge) Date: Tue, 11 Feb 2014 11:11:54 -0500 Subject: [FieldTrip] ft_timelockgrandaverage -- bug or as-designed? Message-ID: I have encountered a behavior with ft_timelockgrandaverage that seems to me to be a bug, but I'm not quite sure. Hence why I am asking here and not just filing a bug. I'm using the attached .mat, and you can replicate the behavior with: cfg = []; cfg.channel = 'all'; cfg.keepindividual = 'no'; cfg.method = 'within'; out_data = ft_timelockgrandaverage(cfg,Dstruct.on.MSITOnset.global.x{:}); This will crash due to an array dimension mismatch. It does so because my different subjects/blocks in x{:} have different numbers of samples. Up around line 147, the ft_ function goes through varargin{:} and cuts down the averaged variable (in my case, 'avg') so that it has the same number of samples in each of the varargin{:} data structures. The thing that I feel is a bug: it cuts the data, (expressed as varargin{i}.(cfg.parameter) ), but it does NOT similarly cut the variance ( varargin{i}.var ) or the per-timepoint DOF ( varargin{i}.dof ). As a result, when it gets to line 193 and tries to do avgmat(s, :, :) = varargin{s}.(cfg.parameter).*varargin{s}.dof; the (cfg.parameter) and dof matrices are now of different sizes, and we crash. I can add my desired behavior to a local copy of the function and keep working, but would appreciate some advice on whether this is actually a bug, or somehow a design feature that I've failed to understand. Alik Widge alik.widge at gmail.com (206) 866-5435 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 11 17:24:24 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 11 Feb 2014 17:24:24 +0100 Subject: [FieldTrip] ft_timelockgrandaverage -- bug or as-designed? In-Reply-To: References: Message-ID: <693C3ECE-ABE6-4E18-88B5-08D5E2354109@donders.ru.nl> Dear Alik, Thanks for reporting this. To me it sounds indeed like a bug. It would be great if you could file this as such on our bugzilla bug-tracking system. www.bugzilla.fcdonders.nl. If you create yourself an account and file a new bug, with the contents of this e-mail, we can take it from there. If you already have a fixed version of the code, feel free to attach it as attachment to the bug ;-). Best wishes, Jan-Mathijs On Feb 11, 2014, at 5:11 PM, Alik Widge wrote: > I have encountered a behavior with ft_timelockgrandaverage that seems to me to be a bug, but I'm not quite sure. Hence why I am asking here and not just filing a bug. I'm using the attached .mat, and you can replicate the behavior with: > > cfg = []; > cfg.channel = 'all'; > cfg.keepindividual = 'no'; > cfg.method = 'within'; > > out_data = ft_timelockgrandaverage(cfg,Dstruct.on.MSITOnset.global.x{:}); > > > This will crash due to an array dimension mismatch. It does so because my different subjects/blocks in x{:} have different numbers of samples. Up around line 147, the ft_ function goes through varargin{:} and cuts down the averaged variable (in my case, 'avg') so that it has the same number of samples in each of the varargin{:} data structures. > The thing that I feel is a bug: it cuts the data, (expressed as varargin{i}.(cfg.parameter) ), but it does NOT similarly cut the variance ( varargin{i}.var ) or the per-timepoint DOF ( varargin{i}.dof ). As a result, when it gets to line 193 and tries to do > > avgmat(s, :, :) = varargin{s}.(cfg.parameter).*varargin{s}.dof; > > the (cfg.parameter) and dof matrices are now of different sizes, and we crash. > > I can add my desired behavior to a local copy of the function and keep working, but would appreciate some advice on whether this is actually a bug, or somehow a design feature that I've failed to understand. > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From elmeri.syrjanen at gmail.com Tue Feb 11 17:25:55 2014 From: elmeri.syrjanen at gmail.com (=?ISO-8859-1?Q?Elmeri_Syrj=E4nen?=) Date: Tue, 11 Feb 2014 17:25:55 +0100 Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> References: <52FA3EC7.9010600@glasgow.ac.uk> <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear May, this is a reported bug that appeared sometime in September in the fieldtrip code. Here's the bugzilla thread: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2316 /elmeri On Tue, Feb 11, 2014 at 4:54 PM, Lam, Nietzsche wrote: > Hi May, > > The first possible options is that you need to use Matlab2011b - anything > more updated can lead to a change in calculations (which may not give an > error) or a crash (which might be what is happening). However, I'm not the > most familiar with the output below, if this is not the solution I'm sure > someone else can help. > > Best, > Nietzsche > > ----- Original Message ----- > > From: "Heng-Ru May Tan" > > To: fieldtrip at science.ru.nl > > Sent: Tuesday, 11 February, 2014 4:16:23 PM > > Subject: [FieldTrip] Issue with ft_databrowser > > Hello, > > > > I have been unable to use ft_databrowser today to view ICA components; > > which is slightly strange. It used to work... > > I have just installed fieldtrip-20140210 and using Matlab13b on 64bit > > machine -- which led to repeated crash issue, as with > > fieldtrip-20140114 which I tried on Matlab12a and 13b. > > > > Does anyone have any ideas as to what could lead to the problem? > > Quoted below is structure of input compASSR and what Matlab spewed > > when attempting to continue. > > > > Thanks in advance, > > May > > > > > > > > > > >> compASSR > > > > compASSR = > > > > fsample: 1.0172e+03 > > time: {1x104 cell} > > trial: {1x104 cell} > > topo: [233x50 double] > > unmixing: [50x233 double] > > label: {50x1 cell} > > topolabel: {233x1 cell} > > sampleinfo: [104x2 double] > > cfg: [1x1 struct] > > > > > > > > >> cfg=[]; > > > > % cfg.channel=[{'MEG'} badChansList]; > > cfg.continuous = 'yes'; > > cfg.channels = [1:10]; > > cfg.layout = '4D248.lay'; > > cfg.viewmode = 'component'; > > >> ft_databrowser(cfg,compASSR) > > reading layout from file 4D248.lay > > the call to "ft_prepare_layout" took 0 seconds > > the input is component data with 50 components and 233 original > > channels > > detected 0 visual artifacts > > > > ------------------------------------------------------------------------ > > Access violation detected at Tue Feb 11 14:54:01 2014 > > ------------------------------------------------------------------------ > > > > Configuration: > > Crash Decoding : Disabled > > Default Encoding : windows-1252 > > MATLAB Architecture: win64 > > MATLAB Root : C:\Program Files\MATLAB\R2013b > > MATLAB Version : 8.2.0.701 (R2013b) > > Operating System : Microsoft Windows 7 > > Processor ID : x86 Family 6 Model 26 Stepping 5, GenuineIntel > > Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java > > HotSpot(TM) 64-Bit Server VM mixed mode > > Window System : Version 6.1 (Build 7601: Service Pack 1) > > > > Fault Count: 1 > > > > > > Abnormal termination: > > Access violation > > > > Register State (from fault): > > RAX = 00000000000001a4 RBX = 0000000027620080 > > RCX = 00000000000262de RDX = 00000000000001b2 > > RSP = 0000000004023340 RBP = 000000000000007e > > RSI = 00000001240fbcd0 RDI = 00000001394eb996 > > > > R8 = 00000000000262de R9 = 0000000000000230 > > R10 = 0000000000000000 R11 = 0000000004023418 > > R12 = 0000000000f206cd R13 = 00000000a4f5fe90 > > R14 = 000000000002635c R15 = 00000000000006c8 > > > > RIP = 0000000006583211 EFL = 00010216 > > > > CS = 0033 FS = 0053 GS = 002b > > > > Stack Trace (from fault): > > [ 0] 0x0000000006583211 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02896401 > > RenderEngineBase::~RenderEngineBase+00148801 > > [ 1] 0x00000000064fc8ae C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02345134 text_to_pixel+00005038 > > [ 2] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 3] 0x000000000646573d C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01726269 > > renderAnimatedKids+00000509 > > [ 4] 0x000000000646a5ad C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01746349 getARDonAxis+00010413 > > [ 5] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 6] 0x000000000648c51a C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01885466 > > FigureSetVisualAutoMode+00001594 > > [ 7] 0x00000000064912ed C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01905389 > > UIJ_CreatePeerWindow+00001789 > > [ 8] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 9] 0x0000000006589358 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02921304 > > RenderEngineBase::~RenderEngineBase+00173704 > > [ 10] 0x000000000648df14 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01892116 > > FigureSetVisualAutoMode+00008244 > > [ 11] 0x000000000648df8d C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01892237 > > FigureSetVisualAutoMode+00008365 > > [ 12] 0x00000000060db67f C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwgui.dll+00439935 > > wm_ExposeFcn_Pre_Optional+00000303 > > [ 13] 0x000000006b6fae14 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00175636 > > GetframeJava+00001124 > > [ 14] 0x000000006b6fcd5e C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00183646 > > UIJ_IsWindowShowing+00000430 > > [ 15] 0x000000006b6feab8 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191160 > > UIJ_clearWaitForResize+00002472 > > [ 16] 0x000000006b6febcd C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191437 > > UIJ_ExposeFcn+00000141 > > [ 17] 0x000000006b6d3bce C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015310 > > UIJ_MarkEventFinished+00005998 > > [ 18] 0x000000006b6d3c20 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015392 > > UIJ_MarkEventFinished+00006080 > > [ 19] 0x000000006b6f795c C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00162140 > > uij::JavaDraw2D::paintQuadStrip+00001500 > > [ 20] 0x000000006c68ae38 C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00241208 > > uddSetListenerRecursionWarning+00000680 > > [ 21] 0x000000006c68b48c C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00242828 > > UDListenerManagerHost::notifyEvent+00000076 > > [ 22] 0x000000006c6838dd C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00211165 > > UDEventInfo::send+00000093 > > [ 23] 0x000000006b2f7d7f C:\Program > > Files\MATLAB\R2013b\bin\win64\udd_mi.dll+00032127 > > MErrorException::operator=+00027919 > > [ 24] 0x000000006b01fa96 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > > UIW_IsUserMessage+00000086 > > [ 25] 0x000000006b020175 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > > UIW_SetGLIMUserMsg+00000117 > > [ 26] 0x000000006b0201f9 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > > UIW_SetGLIMUserMsg+00000249 > > [ 27] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > > GetMenuBarInfo+00000638 > > [ 28] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > > SystemParametersInfoW+00000235 > > [ 29] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > > IsProcessDPIAware+00000465 > > [ 30] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > > KiUserCallbackDispatcher+00000031 > > [ 31] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > > PeekMessageW+00000186 > > [ 32] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > > GetKeyState+00000238 > > [ 33] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > > PeekMessageA+00000087 > > [ 34] 0x000000006aff94db C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > > UIW_SetCurrentDialog+00000731 > > [ 35] 0x000000006b021632 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > > ws_FreeSystemFont+00000482 > > [ 36] 0x000000006f156600 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > > [ 37] 0x000000006f156fc5 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > > [ 38] 0x000000006f157e10 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > > [ 39] 0x000000006f160596 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > > sysq::removeProcessPendingEventsHook+00010998 > > [ 40] 0x000000006f16089a C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > > svWS_ProcessPendingEvents+00000138 > > [ 41] 0x00000000064937f0 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01914864 > > hgWaitforbuttonpress+00001552 > > [ 42] 0x000000018000d7ff C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00055295 > > Mfh_file::dispatch_fh+00001167 > > [ 43] 0x000000018000ddb7 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00056759 > > Mfunction_handle::dispatch+00000487 > > [ 44] 0x0000000004e96a81 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > > inFunctionHandleInterface::DestroyWorkspace+00308737 > > [ 45] 0x0000000004e9303e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00471102 > > inFunctionHandleInterface::DestroyWorkspace+00293822 > > [ 46] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 47] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 48] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 49] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 50] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 51] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 52] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 53] 0x0000000004e6c634 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00312884 > > inFunctionHandleInterface::DestroyWorkspace+00135604 > > [ 54] 0x0000000004e7fa37 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00391735 > > inFunctionHandleInterface::DestroyWorkspace+00214455 > > [ 55] 0x0000000004e9dc4f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00515151 > > inFunctionHandleInterface::DestroyWorkspace+00337871 > > [ 56] 0x0000000004e86639 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00419385 > > inFunctionHandleInterface::DestroyWorkspace+00242105 > > [ 57] 0x0000000004e8feaf C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00458415 > > inFunctionHandleInterface::DestroyWorkspace+00281135 > > [ 58] 0x0000000004e92e23 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00470563 > > inFunctionHandleInterface::DestroyWorkspace+00293283 > > [ 59] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 60] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 61] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 62] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 63] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 64] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 65] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 66] 0x0000000004e96a81 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > > inFunctionHandleInterface::DestroyWorkspace+00308737 > > [ 67] 0x0000000004f20657 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01050199 > > inEachVisibleName+00015383 > > [ 68] 0x0000000004e946c2 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00476866 > > inFunctionHandleInterface::DestroyWorkspace+00299586 > > [ 69] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 70] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 71] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 72] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 73] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 74] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 75] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 76] 0x0000000004f3438e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01131406 > > inSetWorkSpaces+00001262 > > [ 77] 0x0000000004f406f5 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01181429 > > SetInterpreter+00000325 > > [ 78] 0x0000000004f42cb5 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191093 > > inEvalCmd+00008789 > > [ 79] 0x0000000004f42c82 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191042 > > inEvalCmd+00008738 > > [ 80] 0x0000000004f42c47 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01190983 > > inEvalCmd+00008679 > > [ 81] 0x000000000532ad0c C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05287180 > > inMexPutVariable+00008364 > > [ 82] 0x000000000532b066 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05288038 > > inMexPutVariable+00009222 > > [ 83] 0x000000000532b49e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289118 > > inMexPutVariable+00010302 > > [ 84] 0x000000000532b7dc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289948 > > inMexPutVariable+00011132 > > [ 85] 0x000000000523ff91 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+04325265 > > inEvalCmdWithLocalReturn+00000065 > > [ 86] 0x000000006c71be9d C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00048797 > > mnDebugPrompt+00000109 > > [ 87] 0x000000006c71cf7f C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00053119 > > mnParser+00000735 > > [ 88] 0x000000006e4ff4b4 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00193716 > > mcrInstance::mnParser_on_interpreter_thread+00000036 > > [ 89] 0x000000006e4e44b0 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083120 > > mcr::runtime::setInterpreterThreadToCurrent+00029472 > > [ 90] 0x000000006e4e4510 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083216 > > mcr::runtime::setInterpreterThreadToCurrent+00029568 > > [ 91] 0x000000006b01fa96 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > > UIW_IsUserMessage+00000086 > > [ 92] 0x000000006b020175 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > > UIW_SetGLIMUserMsg+00000117 > > [ 93] 0x000000006b0201f9 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > > UIW_SetGLIMUserMsg+00000249 > > [ 94] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > > GetMenuBarInfo+00000638 > > [ 95] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > > SystemParametersInfoW+00000235 > > [ 96] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > > IsProcessDPIAware+00000465 > > [ 97] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > > KiUserCallbackDispatcher+00000031 > > [ 98] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > > PeekMessageW+00000186 > > [ 99] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > > GetKeyState+00000238 > > [100] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > > PeekMessageA+00000087 > > [101] 0x000000006aff94db C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > > UIW_SetCurrentDialog+00000731 > > [102] 0x000000006b021632 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > > ws_FreeSystemFont+00000482 > > [103] 0x000000006f156600 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > > [104] 0x000000006f156fc5 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > > [105] 0x000000006f157e10 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > > [106] 0x000000006f160596 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > > sysq::removeProcessPendingEventsHook+00010998 > > [107] 0x000000006f16089a C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > > svWS_ProcessPendingEvents+00000138 > > [108] 0x000000006e4e552d C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00087341 > > mcr::runtime::setInterpreterThreadToCurrent+00033693 > > [109] 0x000000006e4e57fb C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00088059 > > mcr::runtime::setInterpreterThreadToCurrent+00034411 > > [110] 0x000000006e4d9545 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00038213 > > mcrInstantiationError::operator=+00003221 > > [111] 0x000000006e4dc872 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00051314 > > mcr_invoke_on_interpreter_thread+00001602 > > [112] 0x000000006e4e98e6 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00104678 mcrDesktopMain+00000230 > > [113] 0x0000000140004f0b C:\Program > > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00020235 > > [114] 0x0000000140006a07 C:\Program > > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00027143 > > [115] 0x0000000076cb652d C:\Windows\system32\kernel32.dll+00091437 > > BaseThreadInitThunk+00000013 > > [116] 0x0000000076dec541 C:\Windows\SYSTEM32\ntdll.dll+00181569 > > RtlUserThreadStart+00000033 > > > > > > If this problem is reproducible, please submit a Service Request via: > > http://www.mathworks.com/support/contact_us/ > > > > A technical support engineer might contact you with further > > information. > > > > Thank you for your help.** This crash report has been saved to disk as > > C:\Users\######\AppData\Local\Temp\matlab_crash_dump.11620-1 ** > > > > > > Error using setappdata > > Invalid object handle > > > > Error in ft_databrowser>redraw_cb (line 1896) > > setappdata(h, 'opt', opt); > > > > Error in ft_databrowser (line 676) > > redraw_cb(h); > > > > [Please exit and restart MATLAB]>> > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > 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 Heng-RuMay.Tan at glasgow.ac.uk Tue Feb 11 18:02:51 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Tue, 11 Feb 2014 17:02:51 +0000 Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <52FA3EC7.9010600@glasgow.ac.uk> References: <52FA3EC7.9010600@glasgow.ac.uk> Message-ID: <52FA57BB.50402@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed Feb 12 08:47:38 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 12 Feb 2014 08:47:38 +0100 Subject: [FieldTrip] ft_regressconfound In-Reply-To: <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> References: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Dear Raghavan, I've followed your conversation with Arjen with great interest. Although I have worked with the headposition based on the location coils in the CTF system, I am now working with an Elekta Neuromag Vectorview system. I would be very interested to hear how you approach this issue using Maxfilter and cHPI in the Neuromag setup. And not only me - I'm sure the Neuromag / FieldTrip community would greatly appreciate your experience and approach. Please let me know if you are willing to share your procedure. Best wishes, Stephen On 10 February 2014 19:13, Stolk, A. (Arjen) wrote: > Dear Raghavan, > > > I have another question. I understand ft_regressconfound must be the > > last > > step. However, can time frequency calculation be done on data after > > employing regressconfound? Or would you suggest doing trial by trial > > time > > frequency calculation, then compensate using regressconfound and then > > compute timelock? Is there a reason not to do the former way? > > I would recommend doing the latter, provided that you meant to say > 'compute statistics' instead of 'compute timelock'. When ft_regressconfound > is applied to raw/ERF data, trial-by-trial adjustments are made to the > data, according to explained variance by head movements (and thus > differences in distances to the sensors). Subsequently performing time > frequency analysis on this data may give a distorted view of signal > frequency powers. > > Note that if a source reconstruction analysis is also one of your > follow-up steps, it is recommended to do this on the 'original' data, and > then use ft_regressconfound at the source level. See 'Practical issues' on > this page for the rationale behind this: > > > http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis > > In sum, ft_regressconfound is best used as a last step prior > ft_xxxstatistics. > > Yours, > Arjen > > > ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" > > Aan: fieldtrip at science.ru.nl > > Verzonden: Maandag 10 februari 2014 17:02:34 > > Onderwerp: Re: [FieldTrip] ft_regressconfound > > Dear Arjen > > Thanks for your prompt response. I understand your point regarding > > using > > ft_regressconfound with all 4 blocks together. I think that makes more > > sense. > > I have another question. I understand ft_regressconfound must be the > > last > > step. However, can time frequency calculation be done on data after > > employing regressconfound? Or would you suggest doing trial by trial > > time > > frequency calculation, then compensate using regressconfound and then > > compute timelock? Is there a reason not to do the former way? > > > > Thanks, > > Raghavan > > > > Dear Raghavan, It is indeed recommended to use ft_regressconfound as a > > last > > step prior to statistical assessment. It will remove trial-by-trial > > variance > > in the neural data that can be attributed to trial-by-trial variance > > in head > > position. The latter is approximated with regressors containing > > trial-by-trial information on head positions deviating from the > > session/experiment mean. Because the head position timeseries is > > mean-subtracted, the mean neural activity over trials is not affected > > by > > ft_regressconfound; only the variance over trials is, which should > > result in > > a cleaner representation of the data. In order to estimate the > > contribution > > of different head positions to the neural data, ft_regressconfound > > relies on > > general linear modeling. Applying ft_regressconfound to the four > > blocks > > separately (your option 1) will involve four different model > > estimations and > > their associated errors. Because these errors may differ per > > estimation, the > > quality of treatment of the neural data may also differ per block. > > This will > > not affect the mean neural activity in each block, but it may affect > > the > > grand mean over all four blocks as for trials in one block more > > contribution > > from head position may be regressed out than for another. Applying > > ft_regressconfound on the data of the four blocks together (your > > option 2), > > will not affect the grand mean over the trials from all four blocks. > > It will > > reduce the influence of head movement on trial-by-trial variance in > > neural > > activity. This can be for better, or for worse: namely, if there are > > consistent differences in head positions between two conditions > > (captured in > > those four blocks), it may bring the means of neural activity evoked > > in > > these two conditions closer to each other, reducing effect sizes. In > > fact, > > the employment of ft_regressconfound allows one to make a good case > > that an > > observed effect (i.e. differential neural activity between the two > > conditions) cannot be attributed to differences in head positions when > > recording those conditions (note that the same analysis could also be > > performed with eye-movement related activity, or any other measure of > > a > > potential confound). Hope this helps, Arjen ----- Oorspronkelijk > > bericht > > ----- > > > Van: "Raghavan Gopalakrishnan" > > > Aan: fieldtrip at science.ru.nl > > > Verzonden: Vrijdag 7 februari 2014 17:03:40 > > > Onderwerp: [FieldTrip] ft_regressconfound > > > Dear all, > > > I am using regressconfound on Neuromag data. In CTF data, data for > > > coil1, coil2 and coil3 are generated and then circumcenter function > > > is > > > called to compute 3 translational and 3 rotational dof. > > > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > > > channels that provide quarternion parameters q1 through q6, where > > > q4,q5 and q6 are translations in x, y and z directions. I am using > > > these q4,q5 and q6 to directly compute the rotational orientations > > > (using the last part of the circumcenter.m script). > > > It is said regressconfound must be used as a last step prior to > > > stats. > > > I have 4 blocks of data for each subject. Which option below should > > > I > > > follow? > > > 1. Apply regress confound separately to four blocks? But, then I > > > have > > > to average these four blocks once again using ft_timelockanalysis, > > > then grand average using ft_timelockgrandaverage before computing > > > stats. > > > 2. Or should I append the four blocks first, then perform > > > regressconfound? In this case, I directly go to grandaverage and > > > stats. > > > Any suggestion is appreciated. > > > Thanks, > > > Raghavan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > 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 gopalar.ccf at gmail.com Thu Feb 13 16:18:59 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 13 Feb 2014 10:18:59 -0500 Subject: [FieldTrip] timelock statistics Message-ID: Dear all, I have a question regarding statistics. I am doing cluster analysis using monte carlo. I have 2 conditions (cond-1 and cond-2). Each condition has 3 sub-conditions that are temporally separated (lets say cond-1a/2a, cond-1b/2b and cond-1c/2c). I did the statistics 1. on cond-1 vs cond-2 as a whole. 2. cond-1a vs cond-2a, cond-1b vs cond-2b and cond-1c vs 2c separately after splitting the conditions cond-1 and cond-2 using ft_selectdata. I was expecting the answers from #1 and #2 above to be the same. #2 showed one significant cluster in each of the three individual comparisons, totaling 3 clusters. However, #1 above showed only one significant cluster corresponding to one of the three individual cluster in #2. Can anyone explain why results are different? Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From werkle at mpib-berlin.mpg.de Thu Feb 13 17:12:04 2014 From: werkle at mpib-berlin.mpg.de (MWB) Date: Thu, 13 Feb 2014 17:12:04 +0100 Subject: [FieldTrip] PhD-position at the Max Planck Institute for HUman Development, Berlin In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Message-ID: <52FCEED4.2030805@mpib-berlin.mpg.de> Dear colleagues, the project "Cognitive and Neural Dynamics of Memory Across the Lifespan (CONMEM) at the Center for Lifespan Psychology, Max Planck Institute for Human Development, Berlin, is seeking applications for a Predoctoral Research Fellow. Please see the details about the available position in the attached PDF-file. Best regards, Markus Werkle-Bergner -- ************************************************************** Dr. rer. nat. Markus Werkle-Bergner, Dipl. Psych. Research Scientist Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Announcement_2014_V1.pdf Type: application/pdf Size: 189067 bytes Desc: PhD_Announcement_2014_V1.pdf URL: From kai.hwang at gmail.com Thu Feb 13 18:57:03 2014 From: kai.hwang at gmail.com (Kai Hwang) Date: Thu, 13 Feb 2014 12:57:03 -0500 Subject: [FieldTrip] Postdoctoral Position, Pittsburgh Message-ID: Postdoctoral Position Laboratory of Neurocognitive Development Department of Psychiatry University of Pittsburgh, Pennsylvania Principal investigator: Bea Luna, Ph.D. Applicants are invited for a funded postdoctoral position at the University of Pittsburgh investigating cognitive development using a multimodal neuroimaging approach combining fMRI, DTI, MEG, and behavioral testing. We are looking for exceptional Ph.D. researchers with prior experience in MEG/EEG methodology and neuroimaging data analyses. Inherent interest in developmental cognitive neuroscience is a plus. Potential projects will involve investigating the development of functional brain networks supporting cognitive control and/or cognitive-affect interactions during adolescence. Applicants should be willing to commit to a minimum two year appointment. Applicants will be reviewed on an on-going basis until the position is filled. Applicants should send a CV, statement of research interest and contact information of three referees to Dr. Bea Luna (lunab at upmc.edu). -------------- next part -------------- An HTML attachment was scrubbed... URL: From ericksonb.eng at gmail.com Thu Feb 13 22:14:32 2014 From: ericksonb.eng at gmail.com (Erickson) Date: Thu, 13 Feb 2014 16:14:32 -0500 Subject: [FieldTrip] 10-05 Electrode File co-registration Message-ID: List, In the documentation, two pages appear to conflict concerning the head model to which the standard_1005.elc electrode location file is co-registered to. http://fieldtrip.fcdonders.nl/template/electrode advises that the standard_1005.elc file is coregistered to a spherical head model (with coordinates in MNI space). (see the link to http://www.ncbi.nlm.nih.gov/pubmed/11275545on this page) http://fieldtrip.fcdonders.nl/template/headmodel appears to contradict this by stating that the standard_1005.elc file's positions are co-registered to MNI space geometry based on the Colin27 model (which is exactly what I'm looking for). However this page also says that the segmentation is based on the same paper as I linked above. Perhaps I do not understand what is meant by a segmentation. Are these electrode positions (in the file standard_1005.elc) referenced to a spherical head model or to the Colin27 model? Your time is very appreciated! Brian Erickson Ph.D. candidate, ACBS Program Drexel University Psychology Department ericksonb.eng at gmail.com 215 760 7253 -------------- next part -------------- An HTML attachment was scrubbed... URL: From catanese.julien at gmail.com Thu Feb 13 23:18:30 2014 From: catanese.julien at gmail.com (Julien Catanese) Date: Thu, 13 Feb 2014 17:18:30 -0500 Subject: [FieldTrip] ft_connectivityanalysis for one long trial In-Reply-To: References: Message-ID: It works fine if I artificially slice the data into trials. (nb: MATLAB's mscohere() works fine without chopping into trials, so I was guessing it was also possible with the fieldtrip functions, but apparently not, sorry about that, not a big deal). Julien C On Wed, Jan 22, 2014 at 1:22 PM, Julien Catanese wrote: > > Hi dear FieldTrip community, > > I'm trying to get the coherence spectrum between 2 LFP signals (based on > the tutorial: "Analysis of sensor- and source-level connectivity"). > > This is sleep data, so I have only one long "trial" generated with > ft_redefinetrial(). > > I can run ft_freqanalysis() without problems, but both for 'mtmconvol' and > 'mtmfft' the next step, ft_connectivityanalysis(), fails: > > 1/ using 'mtmconvol': the cohspctrum consists of all '1' (the same > happens when using 'fourier' instead of 'powandcsd') > 2/ using 'mtmfft': "Error using ft_connectivityplot (line 99) the data > should have a dimord of chan_chan_freq or chancmb_freq" > > How can I get a coherence spectrum for this data? Do I have to > artificially chop it up into say, 2-second "fake trials"? > > notice that MATLAB's mscohere() works fine on the same data (so data are > ok). > > > > More details below: > > 1/ using mtmconvol : > > %% starting point: loaded data > data = > hdr: [1x1 struct] > label: {'LFP1' 'LFP2'} > time: {[1x200000 double]} > trial: {[2x200000 double]} > fsample: 2000 > cfg: [1x1 struct] > sampleinfo: [1 200000] > > %% make one long trial > cfg = []; > cfg.trl = [1 200000 0]; > data_faketrl = ft_redefinetrial(cfg,data); > > %% do frequqency anlaysis > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 1:1:150; > cfg.t_ftimwin = ones(size(cfg.foi)).*2; % 2-second window > cfg.toi = 0:1:10; > cfg.keeptrials = 'yes'; > cfg.channel = {'LFP1', 'LFP2'}; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> freq = ft_freqanalysis(cfg, data_faketrl) > > freq = > label: {'LFP1' 'LFP2'} > dimord: 'rpt_chan_freq_time' > freq: [1x150 double] > time: [0 1 2 3 4 5 6 7 8 9 10] > powspctrm: [4-D double] > labelcmb: {'LFP1' 'LFP2'} > crsspctrm: [4-D double] > cumtapcnt: [1x150 double] > cfg: [1x1 struct] > > %% coherence spectrum has all ones > cfg = []; > cfg.method = 'coh'; > coh = ft_connectivityanalysis(cfg, freq); > > coh = > > labelcmb: {'LFP1' 'LFP2'} > dimord: 'chan_freq_time' > cohspctrm: [1x150x11 double] > freq: [1x150 double] > time: [0 1 2 3 4 5 6 7 8 9 10] > dof: 150 > cfg: [1x1 struct] > > % coh.cohspctrm(:,:,2:end) is all ones --> fail > > 2/ using mtmfft: > %% > cfg = []; > cfg.output = 'powandcsd' > cfg.method = 'mtmfft'; > cfg.taper = 'hanning'; > cfg.foi = 1:1:150; > cfg.channel = {'LFP1', 'LFP2'}; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> freq = ft_freqanalysis(cfg, data_faketrl) > > freq = > > label: {'LFP1' 'LFP2'} > dimord: 'rpt_chan_freq' > freq: [1x150 double] > powspctrm: [1x2x150 double] > labelcmb: {'LFP1' 'LFP2'} > crsspctrm: [1x1x150 double] > cumsumcnt: 200000 > cumtapcnt: 1 > cfg: [1x1 struct] > > %% coherence spectrum fails: > cfg = []; > cfg.parameter = 'cohspctrm'; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> ft_connectivityplot(cfg, coh); > > Error using ft_connectivityplot (line 99) > the data should have a dimord of chan_chan_freq or chancmb_freq > > coh = > labelcmb: {'LFP1' 'LFP2'} > dimord: 'chan_freq' > cohspctrm: [1x150 double] > freq: [1x150 double] > dof: 1 > cfg: [1x1 struct] > > >> unique([coh.cohspctrm(:)]) > > ans = > > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > > > Thanks for your help, > > Julien C > > -- > > *Dr. Julien Catanese* > > *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada. * > *cell : +1 (519) 781 7575 <%2B1%20%28519%29%20781%207575>* > *tel lab : +1 (519) 888 4567 ext 31354 > <%2B1%20%28519%29%20888%204567%20ext%2031354>* > -- *Dr. Julien Catanese* *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada.* *cell : +1 (519) 781 7575* *tel lab : +1 (519) 888 4567 ext 31354* -------------- next part -------------- An HTML attachment was scrubbed... URL: From sviter33 at gmail.com Fri Feb 14 08:35:28 2014 From: sviter33 at gmail.com (=?KOI8-R?B?7NXLz9HOz9cg7cHL08nN?=) Date: Fri, 14 Feb 2014 11:35:28 +0400 Subject: [FieldTrip] ft_connectivityanalysis for one long trial In-Reply-To: References: Message-ID: Hi Julien, I suppose you may to try to use cfg.keeptapers = 'yes' with ft_freqanalysis. It's working for me. Best, Maxim Lukoyanov 2014-02-14 2:18 GMT+04:00 Julien Catanese : > It works fine if I artificially slice the data into trials. > > (nb: MATLAB's mscohere() works fine without chopping into trials, so I was > guessing it was also possible with the fieldtrip functions, but apparently > not, sorry about that, not a big deal). > > Julien C > > > > On Wed, Jan 22, 2014 at 1:22 PM, Julien Catanese < > catanese.julien at gmail.com> wrote: > >> >> Hi dear FieldTrip community, >> >> I'm trying to get the coherence spectrum between 2 LFP signals (based on >> the tutorial: "Analysis of sensor- and source-level connectivity"). >> >> This is sleep data, so I have only one long "trial" generated with >> ft_redefinetrial(). >> >> I can run ft_freqanalysis() without problems, but both for 'mtmconvol' >> and 'mtmfft' the next step, ft_connectivityanalysis(), fails: >> >> 1/ using 'mtmconvol': the cohspctrum consists of all '1' (the same >> happens when using 'fourier' instead of 'powandcsd') >> 2/ using 'mtmfft': "Error using ft_connectivityplot (line 99) the data >> should have a dimord of chan_chan_freq or chancmb_freq" >> >> How can I get a coherence spectrum for this data? Do I have to >> artificially chop it up into say, 2-second "fake trials"? >> >> notice that MATLAB's mscohere() works fine on the same data (so data are >> ok). >> >> >> >> More details below: >> >> 1/ using mtmconvol : >> >> %% starting point: loaded data >> data = >> hdr: [1x1 struct] >> label: {'LFP1' 'LFP2'} >> time: {[1x200000 double]} >> trial: {[2x200000 double]} >> fsample: 2000 >> cfg: [1x1 struct] >> sampleinfo: [1 200000] >> >> %% make one long trial >> cfg = []; >> cfg.trl = [1 200000 0]; >> data_faketrl = ft_redefinetrial(cfg,data); >> >> %% do frequqency anlaysis >> cfg = []; >> cfg.output = 'powandcsd'; >> cfg.method = 'mtmconvol'; >> cfg.taper = 'hanning'; >> cfg.foi = 1:1:150; >> cfg.t_ftimwin = ones(size(cfg.foi)).*2; % 2-second window >> cfg.toi = 0:1:10; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'LFP1', 'LFP2'}; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> freq = ft_freqanalysis(cfg, data_faketrl) >> >> freq = >> label: {'LFP1' 'LFP2'} >> dimord: 'rpt_chan_freq_time' >> freq: [1x150 double] >> time: [0 1 2 3 4 5 6 7 8 9 10] >> powspctrm: [4-D double] >> labelcmb: {'LFP1' 'LFP2'} >> crsspctrm: [4-D double] >> cumtapcnt: [1x150 double] >> cfg: [1x1 struct] >> >> %% coherence spectrum has all ones >> cfg = []; >> cfg.method = 'coh'; >> coh = ft_connectivityanalysis(cfg, freq); >> >> coh = >> >> labelcmb: {'LFP1' 'LFP2'} >> dimord: 'chan_freq_time' >> cohspctrm: [1x150x11 double] >> freq: [1x150 double] >> time: [0 1 2 3 4 5 6 7 8 9 10] >> dof: 150 >> cfg: [1x1 struct] >> >> % coh.cohspctrm(:,:,2:end) is all ones --> fail >> >> 2/ using mtmfft: >> %% >> cfg = []; >> cfg.output = 'powandcsd' >> cfg.method = 'mtmfft'; >> cfg.taper = 'hanning'; >> cfg.foi = 1:1:150; >> cfg.channel = {'LFP1', 'LFP2'}; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> freq = ft_freqanalysis(cfg, data_faketrl) >> >> freq = >> >> label: {'LFP1' 'LFP2'} >> dimord: 'rpt_chan_freq' >> freq: [1x150 double] >> powspctrm: [1x2x150 double] >> labelcmb: {'LFP1' 'LFP2'} >> crsspctrm: [1x1x150 double] >> cumsumcnt: 200000 >> cumtapcnt: 1 >> cfg: [1x1 struct] >> >> %% coherence spectrum fails: >> cfg = []; >> cfg.parameter = 'cohspctrm'; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> ft_connectivityplot(cfg, coh); >> >> Error using ft_connectivityplot (line 99) >> the data should have a dimord of chan_chan_freq or chancmb_freq >> >> coh = >> labelcmb: {'LFP1' 'LFP2'} >> dimord: 'chan_freq' >> cohspctrm: [1x150 double] >> freq: [1x150 double] >> dof: 1 >> cfg: [1x1 struct] >> >> >> unique([coh.cohspctrm(:)]) >> >> ans = >> >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> >> >> Thanks for your help, >> >> Julien C >> >> -- >> >> *Dr. Julien Catanese* >> >> *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada. * >> *cell : +1 (519) 781 7575 <%2B1%20%28519%29%20781%207575>* >> *tel lab : +1 (519) 888 4567 ext 31354 >> <%2B1%20%28519%29%20888%204567%20ext%2031354>* >> > > > > -- > > *Dr. Julien Catanese* > > *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada.* > *cell : +1 (519) 781 7575* > *tel lab : +1 (519) 888 4567 ext 31354* > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Mon Feb 17 08:59:00 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 17 Feb 2014 08:59:00 +0100 Subject: [FieldTrip] MEG/EEG toolkit course in Nijmegen - registration is open Message-ID: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> Dear FieldTrip mailing list On May 6-9, 2014 we will host the "Toolkit of Cognitive Neuroscience: advanced data analysis and source modelling of EEG and MEG data" at the Donders Institute in Nijmegen. This 4-day toolkit course will teach you advanced MEG and EEG data analysis skills. Preprocessing, frequency analysis, source reconstruction and various statistical methods will be covered. The toolkit will consist of a number of lectures, followed by hands-on sessions in which you will be tutored through the complete analysis of an MEG data set using the FieldTrip toolbox. There will be plenty of time to ask questions and discuss analysis methods pertaining to your reseach questions. In the last hands-on session you will get started with the analysis on the data that you will bring yourself The registration for this toolkit course is now open and can be found on http://www.ru.nl/donders/course-information/courses/toolkit-cognitive-4/ The fee for senior participants is € 400. The (PhD) student fee is € 200. Registration fee includes coffee/tea, Dutch sandwich lunches and one dinner. Please note that in the past years the course was oversubscribed and we expect that as well for this year. We will be able to host approximately 40 participants and consequently we are likely to be required to make a selection that is based on the information that you provide on the registration form. Note that neither being a very novice or a very expert in EEG/MEG disqualifies you from participating; we select the participants on basis of their motivation, research background and skills, and whether we expect the course to pay off for the participant (i.e. whether there is a match between course content and the expectations and requirements for fruitfull use of the analysis methods that we'll cover). Furthermore, we try to make a nice group of participants with a homogenous level and with sufficient broad coverage of research interests. The deadline for the initial registration is March 14, 2014. You can have a look at our Facebook page on http://www.facebook.com/fieldtriptoolbox to get an impression from the previous "MEG/EEG toolkit courses". Best regards, Robert Oostenveld and Jan-Mathijs Schoffelen ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging skype: r.oostenveld ----------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Mon Feb 17 10:49:40 2014 From: michielb at tcd.ie (Bart Michiels) Date: Mon, 17 Feb 2014 09:49:40 +0000 Subject: [FieldTrip] MEG/EEG toolkit course in Nijmegen - registration is open In-Reply-To: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> References: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> Message-ID: Hey Ed, Just need your opinion (as prof will ask the same to you): Would this be a good event to attend? Bests, Bart On 17 February 2014 07:59, Robert Oostenveld wrote: > Dear FieldTrip mailing list > > On May 6-9, 2014 we will host the "Toolkit of Cognitive Neuroscience: > advanced data analysis and source modelling of EEG and MEG data" at the > Donders Institute in Nijmegen. > > This 4-day toolkit course will teach you advanced MEG and EEG data > analysis skills. Preprocessing, frequency analysis, source reconstruction > and various statistical methods will be covered. The toolkit will consist > of a number of lectures, followed by hands-on sessions in which you will be > tutored through the complete analysis of an MEG data set using the > FieldTrip toolbox. There will be plenty of time to ask questions and > discuss analysis methods pertaining to your reseach questions. In the last > hands-on session you will get started with the analysis on the data that > you will bring yourself > > The registration for this toolkit course is now open and can be found on > http://www.ru.nl/donders/course-information/courses/toolkit-cognitive-4/ > > The fee for senior participants is EURO 400. The (PhD) student fee is EURO 200. > Registration fee includes coffee/tea, Dutch sandwich lunches and one dinner. > > Please note that in the past years the course was oversubscribed and we > expect that as well for this year. We will be able to host approximately 40 > participants and consequently we are likely to be required to make a > selection that is based on the information that you provide on the > registration form. Note that neither being a very novice or a very expert > in EEG/MEG disqualifies you from participating; we select the participants > on basis of their motivation, research background and skills, and whether > we expect the course to pay off for the participant (i.e. whether there is > a match between course content and the expectations and requirements for > fruitfull use of the analysis methods that we'll cover). Furthermore, we > try to make a nice group of participants with a homogenous level and with > sufficient broad coverage of research interests. The deadline for the > initial registration is March 14, 2014. > > You can have a look at our Facebook page on > http://www.facebook.com/fieldtriptoolbox to get an impression from the > previous "MEG/EEG toolkit courses". > > Best regards, > > Robert Oostenveld and Jan-Mathijs Schoffelen > > > ----------------------------------------------------------- > Robert Oostenveld, PhD > Senior Researcher & MEG Physicist > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > tel.: +31 (0)24 3619695 > e-mail: r.oostenveld at donders.ru.nl > web: http://www.ru.nl/neuroimaging > skype: r.oostenveld > ----------------------------------------------------------- > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notthemindprobe at yahoo.com Tue Feb 18 00:00:17 2014 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Mon, 17 Feb 2014 15:00:17 -0800 (PST) Subject: [FieldTrip] Recording Biosemi GSR data in GDF files Message-ID: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> Fieldtrip users: Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file? This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. Some more details: Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine. We recently wanted to add GSR data to this. However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself. When we record the GSR data using Activew in a BDF file, the data is recorded fine. Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file. This is in contrasts to the 8 external channels which do not undergo such additional manipulations. So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? Thanks! Eric From i.e.j.de.vries at student.vu.nl Tue Feb 18 00:00:29 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Mon, 17 Feb 2014 23:00:29 +0000 Subject: [FieldTrip] coherence vs magnitude squared coherence Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> Hi Fieldtrippers, If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? Cheers, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 18 06:43:08 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 18 Feb 2014 06:43:08 +0100 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> Message-ID: <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> Hi Floris, Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. Best, Jan-Mathijs On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: > Hi Fieldtrippers, > > If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? > > Cheers, > Ingmar > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 18 06:57:31 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 18 Feb 2014 06:57:31 +0100 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> Message-ID: Hi Ingmar, Sorry for the mix up. Apparently I was not yet fully awake when typing my previous reply. Blame it on the offspring, which kept me awake during some crucial parts of the night: where I typed 'Floris', I of course meant to type 'Ingmar' ;-). To all Florises on the list: this was a free answer to a question you didn't know you wanted to ask. Best, Jan-Mathijs On Feb 18, 2014, at 6:43 AM, jan-mathijs schoffelen wrote: > Hi Floris, > Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. > > Best, > Jan-Mathijs > > On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: > >> Hi Fieldtrippers, >> >> If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? >> >> Cheers, >> Ingmar >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Tue Feb 18 13:31:41 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Tue, 18 Feb 2014 12:31:41 +0000 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl>, Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F9649@PEXMB001B.vu.local> haha no worries, thanks for the reply! ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of jan-mathijs schoffelen [jan.schoffelen at donders.ru.nl] Sent: 18 February 2014 6:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] coherence vs magnitude squared coherence Hi Ingmar, Sorry for the mix up. Apparently I was not yet fully awake when typing my previous reply. Blame it on the offspring, which kept me awake during some crucial parts of the night: where I typed 'Floris', I of course meant to type 'Ingmar' ;-). To all Florises on the list: this was a free answer to a question you didn't know you wanted to ask. Best, Jan-Mathijs On Feb 18, 2014, at 6:43 AM, jan-mathijs schoffelen wrote: Hi Floris, Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. Best, Jan-Mathijs On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: Hi Fieldtrippers, If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? Cheers, Ingmar _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Feb 18 14:16:54 2014 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 18 Feb 2014 15:16:54 +0200 Subject: [FieldTrip] Antw: Creating a head model using OPENMEEG - Intersecting mesh error In-Reply-To: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> References: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> Message-ID: Dear Daniel and all, First, thank you very much for your advice and codes. They have proved very helpful, and now I have obtained some very good brain-skull-scalp meshes! I am now having a problem using OPENMEEG to actually compute the leadfield based on these meshes, using the following code on frequency domain data: cfg=[]; cfg.method = 'dics'; cfg.elec = elec; cfg.grid = grid; cfg.vol = vol; cfg.frequency = 10; % The mean frequency in the band cfg.keepfilter = 'yes'; sourceCombined = ft_sourceanalysis(cfg, freqCombined); The problem arises at the function "ft_leadfield_openmeeg" who tries using OPENMEEG installed on my PC (indeed there is a warning "warning('Sorry, Windows is not yet tested');" in this function). To fix onw of the bugs using a PC I changed line 94 to: basefile = tempname; [clearme basefile] = fileparts(basefile); clear clearme; but even so, every line who tries to actually use OPENMEEG, such as line 149: system([fullfile(OPENMEEG_PATH, 'om_check_geom'), ' -g ', geomFile]) fails to do so. For instance, I get a Windows error window that says "om_assemble.exe has stopped working" and "om_minverser.exe has stopped working", and also: Computing inverse head matrix 187 system([fullfile(OPENMEEG_PATH, 'om_minverser'), ' ', hmFile, ' ', hminvFile]); C:\OpenMEEG\bin\om_minverser version 2.1.0 (799) compiled at Aug 17 2011 19:50:11 | ------ C:\OpenMEEG\bin\om_minverser | C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin | C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hminv.bin | ----------------------- Exception: Unable to open the file C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin for reading Doing my best.... So it seems like OPENMEEG cannot open the file ending with "_hm.bin". This file indeed does no exist. I am using Matlab 2011b, full fieldtrip version of 17022014, Windows 7 64 bit, and OPENMEEG with om_assemble version 2.1.0 (799) compiled at Aug 17 2011 19:50:41. Must I use a Macintosh or Linux computer to make this work? Any ideas would be greatly appreciated! Thank you very much in advance, Roey On Mon, Jan 20, 2014 at 8:10 PM, Daniel Wong wrote: > You can try using the new iso2mesh meshing option that was recently added > by myself, Sarang Dalal, and Robert Oostenveld: > > cfg.method = 'iso2mesh'; > cfg.numvertices = 10000; % We'll decimate later - this gives nicer > results > bnd = ft_prepare_mesh(cfg,seg); > > % Decimate to a 1000, 2000, 3000 node mesh (scalp, skull, brain) > [bnd(1).pnt, bnd(1).tri] = meshresample(bnd(1).pnt, bnd(1).tri, > 1000/size(bnd(1).pnt,1)); > [bnd(2).pnt, bnd(2).tri] = meshresample(bnd(2).pnt, bnd(2).tri, > 2000/size(bnd(2).pnt,1)); > [bnd(3).pnt, bnd(3).tri] = meshresample(bnd(3).pnt, bnd(3).tri, > 3000/size(bnd(3).pnt,1)); > > The latest version of OpenMEEG automatically fixes mesh orientations, but > if you have an older version of OpenMEEG, you'll need to set bnd(ii).tri = > bnd(ii).tri(:,[3 2 1]) to fix the orientation error that you'll get - at > least until we hard code that fix into FieldTrip. > > Also, assuming your meshes look like they should (use ft_plot_mesh to > check), if you still have a problem with meshes intersecting each other, > you will find a subfunction called decouplesurf that is temporarily stashed > at the end of prepare_mesh_segmentation.m. Copy this function into a new > m-file (decouplesurf.m) and use it to fix those intersections as follows: > > bnd = decouplesurf(bnd); > > Note, this will not fix self-intersections. If you're really having a bad > day, try using the iso2mesh toolbox meshcheckrepair function: > % Check and repair mesh > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'dup'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'isolated'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'deep'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'meshfix'); > > This info should eventually find its way onto the FieldTrip tutorial > pages... > > > Best Regards, > Daniel Wong > > Daniel Wong, PhD (IBBME, University of Toronto) > Postdoctoral Researcher > Department of Psychology > University of Konstanz > > > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Tue Feb 18 16:55:55 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 18 Feb 2014 16:55:55 +0100 Subject: [FieldTrip] Recording Biosemi GSR data in GDF files In-Reply-To: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> References: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> Message-ID: <4A14FD77-D413-418C-B788-F45F0CD675AD@donders.ru.nl> Hi Eric, Although I don't have any real expertise in this matter, let me share my 2 cents: Your description suggests that the GSR is estimated using a 16Hz alternating current of constant (but presumably unknown) amplitude, and that GSR is estimated by solving Ohms law (V=I*R). Rather than doing an instantaneous estimate (which is noisy, especially if the current passes the zero-crossing) there will be a rectification and temporal smoothing of the voltage prior to the estimation. Or perhaps even better: a sliding window estimation: for a given time t take the signal from t-1/16s in the past up to t-0 (i.e. now) estimate the 16Hz amplitude using a DFT, this is a single positive number (either RMS, Vpeak, or Vpeak-to-peak) estimate R = V/I (this requires that you know the current I) You could determine I by connecting a known resistor of appropriate size to the electrodes. Or perhaps you don't even have to; if you are not interested in the absolute value but only in changes, you would just take R as proportional to V. Something like this (for the offline case) would do it time = (1:(fsample/16))/fsample; % just enough time for one oscillation model_c = cos(16*2*pi*time); model_s = sin(16*2*pi*time); model = model_c + i*model_s; % i is the complex number model = model./norm(model); signal = randn(1,10*fsample); % the raw signal amplitude = nan(size(signal)); % the estimated amplitude for t=1:length(signal) begsample = t - fsample/16 + 1; % note the +1, the segment should be 64 samples long endsample = t - 0; if begsample>=1 && endsample<=length(signal) segment = signal(begsample:endsample); amplitude(t) = segment*model'; % discrete fourier transform end end plot(abs(amplitude)) This can be translated to the online case by inserting it into one of the examples at http://fieldtrip.fcdonders.nl/development/realtime best regards, Robert On 18 Feb 2014, at 0:00, Eric Pohlmeyer wrote: > Fieldtrip users: > > Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file? This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. > > Some more details: > > Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine. We recently wanted to add GSR data to this. However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself. When we record the GSR data using Activew in a BDF file, the data is recorded fine. > > Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file. This is in contrasts to the 8 external channels which do not undergo such additional manipulations. > > So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? > > Thanks! > > Eric > > _______________________________________________ > 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 nathanweisz at mac.com Tue Feb 18 18:22:38 2014 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 18 Feb 2014 18:22:38 +0100 Subject: [FieldTrip] Neuroscience Master @cimec Message-ID: <45E8D277-A9E6-43CE-BCCE-9C6098543F55@mac.com> Dear Fieldtrippers, please find below infos for the Open Day dedicated to students interested in pursuing Master / PhD studies in cognitive neuroscience here at CIMeC. I encourage especially students interested in MEG to check out the program. I heard great things about the MEG lab there ;-) ciao, n --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Open Day for prospective graduate students in Mind/Brain Sciences Rovereto, 24 March 2014 The Open Day is dedicated to prospective MSc and PhD students from UniTN and other universities in Italy and abroad, interested in getting first hand information about the CIMeC Graduate Program in Cognitive and Brain Sciences: * Master's course in Cognitive Science * Doctoral course in Cognitive and Brain Sciences Throughout the day, students will have the opportunity to attend presentations of post-graduate studies available at CIMeC, get acquainted with admissions procedures and requirements, get information about financial aid and scholarship programs, get information on professional placement and research opportunities, take part in a guided tour of the CIMeC labs, and get more personalized information from faculty and students. For more information and schedule: http://international.unitn.it/news/open-day-prospective-graduate-students-in-cognitive-science If interested, please contact us at mcs at unitn.it (for prospective MSc students) orphd.cimec at unitn.it (for prospective PhD students) ______________________________ Dr. Nathan Weisz Associate Professor MEG & OBOB Lab CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY Tel +39 0461 28 3040 Fax +39 0461 28 3066 e-mail nathan.weisz at unitn.it Visit our homepage. Like us on facebook. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanger at uga.edu Tue Feb 18 20:44:28 2014 From: wanger at uga.edu (Timothy J Wanger) Date: Tue, 18 Feb 2014 19:44:28 +0000 Subject: [FieldTrip] timeseries analysis Message-ID: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> Hi, My name is Tim Wanger, I am a graduate student working with Dean Sabatinelli at the University of Georgia. This is my first attempt at using Field Trip. In order to familiarize myself with the software and learn how it can analyze data collected at our lab, I put together a small dataset containing fMRI timeseries from two different experimental conditions(arousing/not-arousing). After looking through the documentation on the Field Trip website, I came to the conclusion that 'ft_timelockanalysis' could be used to analyse timeseries data. After setting up a cfg variable, and importing my data(does not need preprocessing), I tried running ft_timelockanalysis, but there were some errors that I am not sure how to fix. I was wondering if anyone could help me sort this out. data.label=region'; % region info data.fsample=4; % 250ms sampling rate (4Hz) data.trial=timeseriesdata; % our data, <158x50 cell> matrix. trials have already been excised from raw data data.time=num2cell(1:length(timeseriesdata)); % represent time in samples data.trialinfo=arousalrating'; % experimental condition information cfg.channel='all'; cfg.trials= 'all'; cfg.covariance='no'; cfg.covariancewindow='all'; cfg.keeptrials='no'; cfg.removemean='yes'; cfg.vartrllength=2; % some trials are missing the 50th sample Here is the error I am currently receiving, with some relevant Matlab command window output. the input is raw data with 1 channels and 158 trials Warning: removing inconsistent sampleinfo > In ft_datatype_raw at 109 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 Warning: the data does not contain a trial definition > In utilities/private/warning_once at 116 In utilities/private/fixsampleinfo at 66 In ft_datatype_raw at 158 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 Warning: reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous recording > In utilities/private/warning_once at 116 In utilities/private/fixsampleinfo at 79 In ft_datatype_raw at 158 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 ??? Index exceeds matrix dimensions. Error in ==> fixsampleinfo at 95 offset(i) = time2offset(data.time{i}, data.fsample); Error in ==> ft_datatype_raw at 158 data = fixsampleinfo(data); Error in ==> ft_checkdata at 213 data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); Error in ==> ft_timelockanalysis at 105 data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in ==> testing_fieldtrip at 49 [timelock] = ft_timelockanalysis(cfg, data); So, my questions are: 1. Am I on the right track? 2. Is there a better function to be using? 3. Am I using the proper data format as an import? 4. The code is 'assuming that the trials are consecutive segments of a continuous recording', which is not the case for me, so what can/should I do about that? 5. Does anyone have a template matlab script and demo dataset (for timeseries analysis) that runs without errors, that I could look at? It would help me to just step through the analysis to see what's happening, and an example of input data/parameters. Thanks in advance! -Tim Wanger? -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Feb 19 16:57:20 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 19 Feb 2014 16:57:20 +0100 Subject: [FieldTrip] specifying the variables for ft_specest_mtmfft Message-ID: Dear all, I'm new to fieldtrip, and I would like to estimate the spectrum using ft_specest_mtmfft. With the help function, I understand that there are certain variables that I need to input in order for the mtmfft to work. I have some questions regarding the input variables. I have 4 intracranial channels and I cut my trials into segments of 2048 datapoints. My sampling resolution is 1000 Hz. Variables that I know what the inputs are: For dat, I know that this is the raw data for each segment. For time, I know that this is the time vector of each segment (in my case, it would be 0:0.001:2.048). For taper, I will be using 'hanning'. For freqoi, I'm interested in the frequency from 1:150. Variables that I don't know and not sure what to input: For ntaper, I would like to use multiple taper, however, I'm not sure how many number of tapers I should use. For spectrum, it states that it requires a matrix of taper*chan*freqoi of fourier coefficients. I'm not sure what this means at all. Could someone please help me with the variables that I'm not sure of? Thanks! Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Feb 19 17:37:20 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 19 Feb 2014 18:37:20 +0200 Subject: [FieldTrip] Antw: Creating a head model using OPENMEEG - Intersecting mesh error In-Reply-To: References: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> Message-ID: Otherwise, does anyone know if I could compute the leadfield using another program and import it to fieldtrip? Thank you once again, Hoping to resolve this issue soon, Roey On Tue, Feb 18, 2014 at 3:16 PM, Roey Schurr wrote: > Dear Daniel and all, > > First, thank you very much for your advice and codes. They have proved > very helpful, and now I have obtained some very good brain-skull-scalp > meshes! > > I am now having a problem using OPENMEEG to actually compute the leadfield > based on these meshes, using the following code on frequency domain data: > > cfg=[]; > cfg.method = 'dics'; > cfg.elec = elec; > cfg.grid = grid; > cfg.vol = vol; > cfg.frequency = 10; % The mean frequency in the band > cfg.keepfilter = 'yes'; > > sourceCombined = ft_sourceanalysis(cfg, freqCombined); > > > The problem arises at the function "ft_leadfield_openmeeg" who tries > using OPENMEEG installed on my PC (indeed there is a warning > "warning('Sorry, Windows is not yet tested');" in this function). > To fix onw of the bugs using a PC I changed line 94 to: > > basefile = tempname; > [clearme basefile] = fileparts(basefile); > clear clearme; > > but even so, every line who tries to actually use OPENMEEG, such as line > 149: > > system([fullfile(OPENMEEG_PATH, 'om_check_geom'), ' -g ', geomFile]) > > fails to do so. > For instance, I get a Windows error window that says "om_assemble.exe has > stopped working" and "om_minverser.exe has stopped working", and also: > > Computing inverse head matrix > 187 system([fullfile(OPENMEEG_PATH, 'om_minverser'), ' ', > hmFile, ' ', hminvFile]); > C:\OpenMEEG\bin\om_minverser version 2.1.0 (799) compiled at Aug 17 > 2011 19:50:11 > > | ------ C:\OpenMEEG\bin\om_minverser > | > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin > | > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hminv.bin > | ----------------------- > Exception: Unable to open the file > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin > for reading Doing my best.... > > So it seems like OPENMEEG cannot open the file ending with "_hm.bin". This > file indeed does no exist. > > > I am using Matlab 2011b, full fieldtrip version of 17022014, Windows 7 64 > bit, and OPENMEEG with om_assemble version 2.1.0 (799) compiled at Aug 17 > 2011 19:50:41. > > Must I use a Macintosh or Linux computer to make this work? > > Any ideas would be greatly appreciated! > Thank you very much in advance, > > Roey > > > On Mon, Jan 20, 2014 at 8:10 PM, Daniel Wong wrote: > >> You can try using the new iso2mesh meshing option that was recently added >> by myself, Sarang Dalal, and Robert Oostenveld: >> >> cfg.method = 'iso2mesh'; >> cfg.numvertices = 10000; % We'll decimate later - this gives nicer >> results >> bnd = ft_prepare_mesh(cfg,seg); >> >> % Decimate to a 1000, 2000, 3000 node mesh (scalp, skull, brain) >> [bnd(1).pnt, bnd(1).tri] = meshresample(bnd(1).pnt, bnd(1).tri, >> 1000/size(bnd(1).pnt,1)); >> [bnd(2).pnt, bnd(2).tri] = meshresample(bnd(2).pnt, bnd(2).tri, >> 2000/size(bnd(2).pnt,1)); >> [bnd(3).pnt, bnd(3).tri] = meshresample(bnd(3).pnt, bnd(3).tri, >> 3000/size(bnd(3).pnt,1)); >> >> The latest version of OpenMEEG automatically fixes mesh orientations, but >> if you have an older version of OpenMEEG, you'll need to set bnd(ii).tri = >> bnd(ii).tri(:,[3 2 1]) to fix the orientation error that you'll get - at >> least until we hard code that fix into FieldTrip. >> >> Also, assuming your meshes look like they should (use ft_plot_mesh to >> check), if you still have a problem with meshes intersecting each other, >> you will find a subfunction called decouplesurf that is temporarily stashed >> at the end of prepare_mesh_segmentation.m. Copy this function into a new >> m-file (decouplesurf.m) and use it to fix those intersections as follows: >> >> bnd = decouplesurf(bnd); >> >> Note, this will not fix self-intersections. If you're really having a bad >> day, try using the iso2mesh toolbox meshcheckrepair function: >> % Check and repair mesh >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'dup'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'isolated'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'deep'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'meshfix'); >> >> This info should eventually find its way onto the FieldTrip tutorial >> pages... >> >> >> Best Regards, >> Daniel Wong >> >> Daniel Wong, PhD (IBBME, University of Toronto) >> Postdoctoral Researcher >> Department of Psychology >> University of Konstanz >> >> >> >> _______________________________________________ >> 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 eelke.spaak at donders.ru.nl Wed Feb 19 18:04:27 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 19 Feb 2014 18:04:27 +0100 Subject: [FieldTrip] specifying the variables for ft_specest_mtmfft In-Reply-To: References: Message-ID: Dear Hweeling, ft_specest_mtmfft is one of the lower-level FieldTrip functions, which the end-user typically should not use. Instead, have a look at the documentation for ft_freqanalysis (type 'edit ft_freqanalysis' or look here: http://fieldtrip.fcdonders.nl/reference/ft_freqanalysis). There is a section specifically relating to options for mtmfft. All the options for ft_freqanalysis and other FieldTrip functions are specified using a 'cfg'-structure, e.g. like so: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 1:150; freq = ft_freqanalysis(cfg, data); Best, Eelke On 19 February 2014 16:57, Hwee Ling Lee wrote: > Dear all, > > I'm new to fieldtrip, and I would like to estimate the spectrum using > ft_specest_mtmfft. With the help function, I understand that there are > certain variables that I need to input in order for the mtmfft to work. > > I have some questions regarding the input variables. > > I have 4 intracranial channels and I cut my trials into segments of 2048 > datapoints. My sampling resolution is 1000 Hz. > > Variables that I know what the inputs are: > For dat, I know that this is the raw data for each segment. > For time, I know that this is the time vector of each segment (in my case, > it would be 0:0.001:2.048). > For taper, I will be using 'hanning'. > For freqoi, I'm interested in the frequency from 1:150. > > Variables that I don't know and not sure what to input: > For ntaper, I would like to use multiple taper, however, I'm not sure how > many number of tapers I should use. > For spectrum, it states that it requires a matrix of taper*chan*freqoi of > fourier coefficients. I'm not sure what this means at all. > > Could someone please help me with the variables that I'm not sure of? > > Thanks! > > Best regards, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Wed Feb 19 22:01:00 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 19 Feb 2014 16:01:00 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: Arjen, Thanks for answering all my previous questions. I was successfully able to incorporate head movements to my erf data. As I understand I have to do this separately for the time frequency data after keeping individual trials. I am interested in both beta and gamma bands [15:1:70]. my time frequency looks like this using wavelets, timefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x1500 double] powspctrm: [4-D double] cumtapcnt: [55x56 double] grad: [1x1 struct] elec: [1x1 struct] cfg: [1x1 struct] trialinfo: [55x1 double] After regressconfound hpicomptimefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x1500 double] powspctrm: [4-D double] cumtapcnt: [55x56 double] cfg: [1x1 struct] trialinfo: [55x1 double] beta: [4-D double] Regressconfound took about 1 hr and 30 mins, since its a huge matrix [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It will take an enoumous amount of time to process the data through regressconfound. Is there a workaround to make the processing faster or am I missing something. Any help would be of great help. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Feb 19 22:58:38 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <2108167665.5423215.1392847118322.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, Good to hear it's working out for you. A short answer would be 'no'. Reducing the size of your data matrix is likely going to speed up computations. Your time resolution seems pretty high (1500 frequency estimations per single trial); do you need that many? Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 19 februari 2014 22:01:00 > Onderwerp: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks for answering all my previous questions. I was successfully > able to incorporate head movements to my erf data. As I understand I > have to do this separately for the time frequency data after keeping > individual trials. I am interested in both beta and gamma bands > [15:1:70]. my time frequency looks like this using wavelets, > timefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > grad: [1x1 struct] > elec: [1x1 struct] > cfg: [1x1 struct] > trialinfo: [55x1 double] > After regressconfound > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > cfg: [1x1 struct] > trialinfo: [55x1 double] > beta: [4-D double] > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > will take an enoumous amount of time to process the data through > regressconfound. Is there a workaround to make the processing faster > or am I missing something. Any help would be of great help. > Thanks, > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Thu Feb 20 18:51:25 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 20 Feb 2014 18:51:25 +0100 Subject: [FieldTrip] source correlation. Message-ID: Hi Jan and Robert, Pls I have the following questions, 1. Regarding to attached picture, I calculated coherence using DICS method with ref channel T8 ( which is right temporal). I expect to see correlation or coherence by the the two side, but only found at the left temporal part but nothing on the seed point, the right temporal, or is there is any configuration i did not include or miss? I use the following configuration cfg2 = method: 'dics' frequency: 2 grid: [1x1 struct] vol: [1x1 struct] elec: [1x1 struct] channel: {63x1 cell} refchannel: 'T8' 2. I want to obtain connectivity matrix from the source. Will it be ok to calculate it from the power source using the following configuration cfg=[];cfg.method='powcorr'; The output powerspctrum only contains NaN. I am thinking if I could bring out only the inside dipoles and compute it differently. Can I obtain the same correlation matrix? Thank you! Azeez A. Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig1.png Type: image/png Size: 85415 bytes Desc: not available URL: From gopalar.ccf at gmail.com Thu Feb 20 22:12:28 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 20 Feb 2014 16:12:28 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: Arjen, Thanks, I reduced down the time resolution so computation can go faster. Now, my matrix looks like this hpicomptimefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x375 double] powspctrm: [4-D double] cumtapcnt: [59x56 double] cfg: [1x1 struct] trialinfo: [59x1 double] beta: [4-D double] ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. Thanks, Raghavan Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) From: "Stolk, A. (Arjen)" To: FieldTrip discussion list Subject: Re: [FieldTrip] regressconfound and frequency domain Message-ID: < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl> Content-Type: text/plain; charset="utf-8" Dear Raghavan, Good to hear it's working out for you. A short answer would be 'no'. Reducing the size of your data matrix is likely going to speed up computations. Your time resolution seems pretty high (1500 frequency estimations per single trial); do you need that many? Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 19 februari 2014 22:01:00 > Onderwerp: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks for answering all my previous questions. I was successfully > able to incorporate head movements to my erf data. As I understand I > have to do this separately for the time frequency data after keeping > individual trials. I am interested in both beta and gamma bands > [15:1:70]. my time frequency looks like this using wavelets, > timefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > grad: [1x1 struct] > elec: [1x1 struct] > cfg: [1x1 struct] > trialinfo: [55x1 double] > After regressconfound > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > cfg: [1x1 struct] > trialinfo: [55x1 double] > beta: [4-D double] > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > will take an enoumous amount of time to process the data through > regressconfound. Is there a workaround to make the processing faster > or am I missing something. Any help would be of great help. > Thanks, > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Thu Feb 20 22:45:58 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Thu, 20 Feb 2014 22:45:58 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <489473348.5444313.1392932758055.JavaMail.root@sculptor.zimbra.ru.nl> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks, I reduced down the time resolution so computation can go > faster. Now, m y matrix looks like this > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 struct] > trialinfo: [59x1 double] > beta: [4-D double] > ft_regressconfound run on timelock data seems to return output with > avg field. However, ft_regressconfound run on frequency data, does not > return average. I see the avg field being removed. Is there a reason? > Question - Since ft_regressconfound outputs power spectrum of > individual trials - 4D matrix (instead of average), can I simply > re-average the power spectrum over trials to see the average power for > that subject. Also, I need to run grand average (over subjects) before > running statistics. I hope these steps does not distort the data. > Please advise. > Thanks, > Raghavan > Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] regressconfound and frequency domain > Message-ID: > < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > > > Content-Type: text/plain; charset="utf-8" > Dear Raghavan, Good to hear it's working out for you. A short answer > would be 'no'. Reducing the size of your data matrix is likely going > to speed up computations. Your time resolution seems pretty high (1500 > frequency estimations per single trial); do you need that many? Yours, > Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: [FieldTrip] regressconfound and frequency domain > > Arjen, > > Thanks for answering all my previous questions. I was successfully > > able to incorporate head movements to my erf data. As I understand I > > have to do this separately for the time frequency data after keeping > > individual trials. I am interested in both beta and gamma bands > > [15:1:70]. my time frequency looks like this using wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > After regressconfound > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D double] > > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > > will take an enoumous amount of time to process the data through > > regressconfound. Is there a workaround to make the processing faster > > or am I missing something. Any help would be of great help. > > Thanks, > > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Thu Feb 20 23:33:18 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 20 Feb 2014 17:33:18 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> Thanks Arjen, Should I use ft_freqdescriptives to compute t descriptives for individual subjects, and then take that to group level instead of mean? If not, what are the other alternatives? Thanks, Raghavan Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks, I reduced down the time resolution so computation can go > faster. Now, m y matrix looks like this > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 struct] > trialinfo: [59x1 double] > beta: [4-D double] > ft_regressconfound run on timelock data seems to return output with > avg field. However, ft_regressconfound run on frequency data, does not > return average. I see the avg field being removed. Is there a reason? > Question - Since ft_regressconfound outputs power spectrum of > individual trials - 4D matrix (instead of average), can I simply > re-average the power spectrum over trials to see the average power for > that subject. Also, I need to run grand average (over subjects) before > running statistics. I hope these steps does not distort the data. > Please advise. > Thanks, > Raghavan > Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] regressconfound and frequency domain > Message-ID: > < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > > > Content-Type: text/plain; charset="utf-8" > Dear Raghavan, Good to hear it's working out for you. A short answer > would be 'no'. Reducing the size of your data matrix is likely going > to speed up computations. Your time resolution seems pretty high (1500 > frequency estimations per single trial); do you need that many? Yours, > Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: [FieldTrip] regressconfound and frequency domain > > Arjen, > > Thanks for answering all my previous questions. I was successfully > > able to incorporate head movements to my erf data. As I understand I > > have to do this separately for the time frequency data after keeping > > individual trials. I am interested in both beta and gamma bands > > [15:1:70]. my time frequency looks like this using wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > After regressconfound > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D double] > > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > > will take an enoumous amount of time to process the data through > > regressconfound. Is there a workaround to make the processing faster > > or am I missing something. Any help would be of great help. > > Thanks, > > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Fri Feb 21 09:23:49 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 21 Feb 2014 09:23:49 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> Message-ID: <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, To compute a t-descriptive on subject level freq data, you'll need to use ft_freqstatistics. Have a look here for instance: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq At the subject level, you do not need (non-parametric) cluster permutation testing (Maris & Oostenveld), as you're taking each subject's t-descriptives to the group level. At the group level, you can then test the hypothesis that there's a difference between tasks/conditions (H1) vs. no difference (H0). In order to do so, you'll need to create a dummy variable at the group level, that has the same number of 'subjects', but with zeros in all fields (in your case this will be a .stat field). At the group level, you thus call ft_freqstatistics again. This approach has the advantage that you're more sensitive (as compared to taking each subject's mean to the group level) to effects that are small but consistent over trials in each subject. Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 23:33:18 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Thanks Arjen, > Should I use ft_freqdescriptives to compute t descriptives for > individual subjects, and then take that to group level instead of > mean? If not, what are the other alternatives? > Thanks, > Raghavan > Hi Raghavan, ft_regressconfound run on timelock data seems to return > output with avg field. However, ft_regressconfound run on frequency > data, does not return average. I see the avg field being removed. Is > there a reason? >> Not intentionally, but not an issue either. You > could still use ft_freqdescriptives to compute the average for you, > but see my comment below. Question - Since ft_regressconfound outputs > power spectrum of individual trials - 4D matrix (instead of average), > can I simply re-average the power spectrum over trials to see the > average power for that subject. Also, I need to run grand average > (over subjects) before running statistics. I hope these steps does not > distort the data. Please advise. >> Remember that the mean over trials > is not affected by your clean-up of trial-by-trial variance due to > head movement. Taking each subject's mean (unaffected) to the group > level is an approach that will not benefit from your clean-up. In > order to benefit from reduced trial-by-trial variance, you'll need a > measure that depends on it, e.g. t-descriptive, neural > activity-behavior correlation (for taking to the group level). Hope > this helps, Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > Aan: > > fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 > > 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency > > domain > Arjen, > Thanks, I reduced down the time resolution so > > computation can go > faster. Now, m y matrix looks like this > > > hpicomptimefreq = > label: {204x1 cell} > dimord: > > 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > > > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 > > struct] > trialinfo: [59x1 double] > beta: [4-D double] > > > ft_regressconfound run on timelock data seems to return output with > > > avg field. However, ft_regressconfound run on frequency data, does > > not > return average. I see the avg field being removed. Is there a > > reason? > Question - Since ft_regressconfound outputs power spectrum > > of > individual trials - 4D matrix (instead of average), can I > > simply > re-average the power spectrum over trials to see the > > average power for > that subject. Also, I need to run grand average > > (over subjects) before > running statistics. I hope these steps does > > not distort the data. > Please advise. > Thanks, > Raghavan > Date: > > Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < > > a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < > > fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] > > regressconfound and frequency domain > Message-ID: > < > > 2108167665.5423215.1392847118322.JavaMail.root at > > sculptor.zimbra.ru.nl > > > Content-Type: text/plain; > > charset="utf-8" > Dear Raghavan, Good to hear it's working out for > > you. A short answer > would be 'no'. Reducing the size of your data > > matrix is likely going > to speed up computations. Your time > > resolution seems pretty high (1500 > frequency estimations per > > single trial); do you need that many? Yours, > Arjen ----- > > Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < > > gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: > > [FieldTrip] regressconfound and frequency domain > > Arjen, > > > > Thanks for answering all my previous questions. I was successfully > > > > able to incorporate head movements to my erf data. As I understand > > I > > have to do this separately for the time frequency data after > > keeping > > individual trials. I am interested in both beta and > > gamma bands > > [15:1:70]. my time frequency looks like this using > > wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > > > trialinfo: [55x1 double] > > After regressconfound > > > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D > > double] > > Regressconfound took about 1 hr and 30 mins, since its a > > huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for > > 20 subjects. It > > will take an enoumous amount of time to process > > the data through > > regressconfound. Is there a workaround to make > > the processing faster > > or am I missing something. Any help would > > be of great help. > > Thanks, > > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Feb 21 11:38:10 2014 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 21 Feb 2014 05:38:10 -0500 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> References: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Arjen, what you just described is more or less what I struggled to do last week and ultimately gave up as I was unable to figure out how to get FT to do it despite much meditation over tutorials and source files. Can you elaborate a bit more on what you are saying below -- not the ft_regressconfound bit, but the bit about how to get ft_statistics_montecarlo and its wrappers to do a trials-level analysis and permutation at the whole-group level? Especially, what does one put in cfg.design and how does one call the function? Everything I could find in the tutorials described the case of doing means at the subject level and then permutation of means at the group level, which as you point out is underpowered for subtle effects. My particular situation was timelock-analyzed trials (with keeptrials='yes'), but I could not find a way to set up cfg.design that did not throw error messages. The thing that really seemed to bother it was that there were different numbers of trials in the 2-3 conditions of interest, since some had to be removed for excessive artifact. Thanks for any help, Alik Alik Widge alik.widge at gmail.com (206) 866-5435 On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) wrote: > Dear Raghavan, > > To compute a t-descriptive on subject level freq data, you'll need to use > ft_freqstatistics. Have a look here for instance: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > At the subject level, you do not need (non-parametric) cluster permutation > testing (Maris & Oostenveld), as you're taking each subject's > t-descriptives to the group level. At the group level, you can then test > the hypothesis that there's a difference between tasks/conditions (H1) vs. > no difference (H0). In order to do so, you'll need to create a dummy > variable at the group level, that has the same number of 'subjects', but > with zeros in all fields (in your case this will be a .stat field). At the > group level, you thus call ft_freqstatistics again. This approach has the > advantage that you're more sensitive (as compared to taking each subject's > mean to the group level) to effects that are small but consistent over > trials in each subject. > > Arjen > > > ------------------------------ > > *Van: *"Raghavan Gopalakrishnan" > *Aan: *fieldtrip at science.ru.nl > *Verzonden: *Donderdag 20 februari 2014 23:33:18 > > *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain > > Thanks Arjen, > Should I use ft_freqdescriptives to compute t descriptives for individual > subjects, and then take that to group level instead of mean? If not, what > are the other alternatives? > Thanks, > Raghavan > > Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > >* Van: "Raghavan Gopalakrishnan" > > *>* Aan: fieldtrip at science.ru.nl > *>* Verzonden: Donderdag 20 februari 2014 22:12:28 > *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > *>* Arjen, > *>* Thanks, I reduced down the time resolution so computation can go > *>* faster. Now, m y matrix looks like this > *>* hpicomptimefreq = > *>* label: {204x1 cell} > *>* dimord: 'rpt_chan_freq_time' > *>* freq: [1x56 double] > *>* time: [1x375 double] > *>* powspctrm: [4-D double] > *>* cumtapcnt: [59x56 double] > *>* cfg: [1x1 struct] > *>* trialinfo: [59x1 double] > *>* beta: [4-D double] > *>* ft_regressconfound run on timelock data seems to return output with > *>* avg field. However, ft_regressconfound run on frequency data, does not > *>* return average. I see the avg field being removed. Is there a reason? > *>* Question - Since ft_regressconfound outputs power spectrum of > *>* individual trials - 4D matrix (instead of average), can I simply > *>* re-average the power spectrum over trials to see the average power for > *>* that subject. Also, I need to run grand average (over subjects) before > *>* running statistics. I hope these steps does not distort the data. > *>* Please advise. > *>* Thanks, > *>* Raghavan > *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > > *>* Subject: Re: [FieldTrip] regressconfound and frequency domain > *>* Message-ID: > *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > *>* > > *>* Content-Type: text/plain; charset="utf-8" > *>* Dear Raghavan, Good to hear it's working out for you. A short answer > *>* would be 'no'. Reducing the size of your data matrix is likely going > *>* to speed up computations. Your time resolution seems pretty high (1500 > *>* frequency estimations per single trial); do you need that many? Yours, > *>* Arjen ----- Oorspronkelijk bericht ----- > *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > *>* > Aan: fieldtrip at science.ru.nl > *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 > *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain > *>* > Arjen, > *>* > Thanks for answering all my previous questions. I was successfully > *>* > able to incorporate head movements to my erf data. As I understand I > *>* > have to do this separately for the time frequency data after keeping > *>* > individual trials. I am interested in both beta and gamma bands > *>* > [15:1:70]. my time frequency looks like this using wavelets, > *>* > timefreq = > *>* > label: {204x1 cell} > *>* > dimord: 'rpt_chan_freq_time' > *>* > freq: [1x56 double] > *>* > time: [1x1500 double] > *>* > powspctrm: [4-D double] > *>* > cumtapcnt: [55x56 double] > *>* > grad: [1x1 struct] > *>* > elec: [1x1 struct] > *>* > cfg: [1x1 struct] > *>* > trialinfo: [55x1 double] > *>* > After regressconfound > *>* > hpicomptimefreq = > *>* > label: {204x1 cell} > *>* > dimord: 'rpt_chan_freq_time' > *>* > freq: [1x56 double] > *>* > time: [1x1500 double] > *>* > powspctrm: [4-D double] > *>* > cumtapcnt: [55x56 double] > *>* > cfg: [1x1 struct] > *>* > trialinfo: [55x1 double] > *>* > beta: [4-D double] > *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > *>* > will take an enoumous amount of time to process the data through > *>* > regressconfound. Is there a workaround to make the processing faster > *>* > or am I missing something. Any help would be of great help. > *>* > Thanks, > *>* > Raghavan* > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Fri Feb 21 11:57:38 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Fri, 21 Feb 2014 11:57:38 +0100 Subject: [FieldTrip] timeseries analysis In-Reply-To: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> References: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> Message-ID: <53073122.7070305@donders.ru.nl> Hi Tim, interesting approach to use FieldTrip for fMRI data, keep us updated on your progress, please! Your error is rather straightforward. You need to specify a time-axis for each trial rather than a common time-axis. And pay attention to the dimensions. data.trial has to be cell-array where each trial is defined as nChans x nSamples. data.time needs to be cell-array and it's elements need to be 1 x nSamples. Lastly, data.label needs to be a cell-array with dimensions nChans x 1. for more information, see here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat Regarding your questions: > 1. Am I on the right track? yes, but maybe better define time in seconds than in samples, otherwise you're good. > 2. Is there a better function to be using? probably no, you need to hack it yourself together > 3. Am I using the proper data format as an import? if FT cannot read your data it by ft_read_data, then yes, this is the best (and only) way > 4. The code is 'assuming that the trials are consecutive segments of a > continuous recording', which is not the case for me, so what > can/should I do about that? you can define data.sampleinfo which specifies at what sample your trial started and ended relative to the actual recording. But, this information might not be necessary for now, so maybe just ignore the warning until you run into other problems. > 5. Does anyone have a template matlab script and demo dataset (for > timeseries analysis) that runs without errors, that I could look at? > It would help me to just step through the analysis to see what's > happening, and an example of input data/parameters. please see the link above for examples. Best, Jörn On 2/18/2014 8:44 PM, Timothy J Wanger wrote: > Hi, > > My name is Tim Wanger, I am a graduate student working with Dean > Sabatinelli at the University of Georgia. This is my first attempt at > using Field Trip. In order to familiarize myself with the software and > learn how it can analyze data collected at our lab, I put together a > small dataset containing fMRI timeseries from two different > experimental conditions(arousing/not-arousing). After looking through > the documentation on the Field Trip website, I came to the conclusion > that 'ft_timelockanalysis' could be used to analyse timeseries data. > After setting up a cfg variable, and importing my data(does not need > preprocessing), I tried running ft_timelockanalysis, but there were > some errors that I am not sure how to fix. I was wondering if anyone > could help me sort this out. > > data.label=region'; % region info > data.fsample=4; % 250ms sampling rate (4Hz) > data.trial=timeseriesdata; % our data, <158x50 cell> matrix. trials > have already been excised from raw data > data.time=num2cell(1:length(timeseriesdata)); % represent time in samples > data.trialinfo=arousalrating'; % experimental condition information > > cfg.channel='all'; > cfg.trials= 'all'; > cfg.covariance='no'; > cfg.covariancewindow='all'; > cfg.keeptrials='no'; > cfg.removemean='yes'; > cfg.vartrllength=2; % some trials are missing the 50th sample > > > Here is the error I am currently receiving, with some relevant Matlab > command window output. > > the input is raw data with 1 channels and 158 trials > Warning: removing inconsistent sampleinfo > > In ft_datatype_raw at 109 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > Warning: the data does not contain a trial definition > > In utilities/private/warning_once at 116 > In utilities/private/fixsampleinfo at 66 > In ft_datatype_raw at 158 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > Warning: reconstructing sampleinfo by assuming that the trials are > consecutive segments of a continuous > recording > > In utilities/private/warning_once at 116 > In utilities/private/fixsampleinfo at 79 > In ft_datatype_raw at 158 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > > ??? Index exceeds matrix dimensions. > Error in ==> fixsampleinfo at 95 > offset(i) = time2offset(data.time{i}, data.fsample); > Error in ==> ft_datatype_raw at 158 > data = fixsampleinfo(data); > Error in ==> ft_checkdata at 213 > data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); > Error in ==> ft_timelockanalysis at 105 > data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', > 'yes', 'hassampleinfo', 'yes'); > Error in ==> testing_fieldtrip at 49 > [timelock] = ft_timelockanalysis(cfg, data); > > > So, my questions are: > 1. Am I on the right track? > 2. Is there a better function to be using? > 3. Am I using the proper data format as an import? > 4. The code is 'assuming that the trials are consecutive segments of a > continuous recording', which is not the case for me, so what > can/should I do about that? > 5. Does anyone have a template matlab script and demo dataset (for > timeseries analysis) that runs without errors, that I could look at? > It would help me to just step through the analysis to see what's > happening, and an example of input data/parameters. > > Thanks in advance! > -Tim Wanger​ > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From gopalar.ccf at gmail.com Fri Feb 21 12:41:26 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Fri, 21 Feb 2014 06:41:26 -0500 Subject: [FieldTrip] sending mails to fieldtrip community Message-ID: Thanks Arjen Please respond to my trivial question. Thanks Raghavan ---------- Forwarded message ---------- From: *Stolk, A. (Arjen)* Date: Friday, February 21, 2014 Subject: mails to fieldtrip community To: Raghavan Gopalakrishnan Hi Raghavan, Ok, but let's keep it 'online' as other people might benefit from your questions as well. Yours, Arjen ------------------------------ *Van: *"Raghavan Gopalakrishnan" > *Aan: *"a stolk" > *Verzonden: *Donderdag 20 februari 2014 23:42:54 *Onderwerp: *mails to fieldtrip community Arjen, Whenever I try to post a message on Fieldtrip, it seems to appear as a separate message instead of creating a chain to the existing chain of mail exchanges. You could see that on the archives, I have three different chain with the same title - '[FieldTrip] regressconfound and frequency domain', though they all have the same subject. I thought it might be better for other users if they all form a chain instead of being separate. Thanks, Raghavan -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Fri Feb 21 15:53:35 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 21 Feb 2014 15:53:35 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Dear Alik, If I am correct, you're asking how to create subject-level t-descriptives, mentioned in the previous post? A quick answer would be to perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using ft_timelockstatistics (although you're not really 'testing' here, but only interested in that t-descriptive), in which trials are the unit of observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, ntrls_conditionB)]; ). Note that since an indepedent t-test tests for differences of the means of two conditions, it won't fail on unequal number of observations across the conditions (unlike a dependent/paired t-test). Hope this gets you kickstarted for the moment. I found a previous mail-conversation that goes more into detail, providing more overview of the steps involved: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html More useful documentation: http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Alik Widge" > Aan: "FieldTrip discussion list" > Verzonden: Vrijdag 21 februari 2014 11:38:10 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, what you just described is more or less what I struggled to do > last week and ultimately gave up as I was unable to figure out how to > get FT to do it despite much meditation over tutorials and source > files. Can you elaborate a bit more on what you are saying below -- > not the ft_regressconfound bit, but the bit about how to get > ft_statistics_montecarlo and its wrappers to do a trials-level > analysis and permutation at the whole-group level? Especially, what > does one put in cfg.design and how does one call the function? > Everything I could find in the tutorials described the case of doing > means at the subject level and then permutation of means at the group > level, which as you point out is underpowered for subtle effects. > My particular situation was timelock-analyzed trials (with > keeptrials='yes'), but I could not find a way to set up cfg.design > that did not throw error messages. The thing that really seemed to > bother it was that there were different numbers of trials in the 2-3 > conditions of interest, since some had to be removed for excessive > artifact. > Thanks for any help, > Alik > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > wrote: > > Dear Raghavan, > > To compute a t-descriptive on subject level freq data, you'll need > > to > > use ft_freqstatistics. Have a look here for instance: > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > At the subject level, you do not need (non-parametric) cluster > > permutation testing (Maris & Oostenveld), as you're taking each > > subject's t-descriptives to the group level. At the group level, you > > can then test the hypothesis that there's a difference between > > tasks/conditions (H1) vs. no difference (H0). In order to do so, > > you'll need to create a dummy variable at the group level, that has > > the same number of 'subjects', but with zeros in all fields (in your > > case this will be a .stat field). At the group level, you thus call > > ft_freqstatistics again. This approach has the advantage that you're > > more sensitive (as compared to taking each subject's mean to the > > group > > level) to effects that are small but consistent over trials in each > > subject. > > Arjen > > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > > Aan: fieldtrip at science.ru.nl > > > Verzonden: Donderdag 20 februari 2014 23:33:18 > > > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > > > Thanks Arjen, > > > Should I use ft_freqdescriptives to compute t descriptives for > > > individual subjects, and then take that to group level instead of > > > mean? If not, what are the other alternatives? > > > Thanks, > > > Raghavan > > > Hi Raghavan, ft_regressconfound run on timelock data seems to > > > return > > > output with avg field. However, ft_regressconfound run on > > > frequency > > > data, does not return average. I see the avg field being removed. > > > Is > > > there a reason? >> Not intentionally, but not an issue either. You > > > could still use ft_freqdescriptives to compute the average for > > > you, > > > but see my comment below. Question - Since ft_regressconfound > > > outputs > > > power spectrum of individual trials - 4D matrix (instead of > > > average), > > > can I simply re-average the power spectrum over trials to see the > > > average power for that subject. Also, I need to run grand average > > > (over subjects) before running statistics. I hope these steps does > > > not > > > distort the data. Please advise. >> Remember that the mean over > > > trials > > > is not affected by your clean-up of trial-by-trial variance due to > > > head movement. Taking each subject's mean (unaffected) to the > > > group > > > level is an approach that will not benefit from your clean-up. In > > > order to benefit from reduced trial-by-trial variance, you'll need > > > a > > > measure that depends on it, e.g. t-descriptive, neural > > > activity-behavior correlation (for taking to the group level). > > > Hope > > > this helps, Arjen ----- Oorspronkelijk bericht ----- > > > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > > > > Aan: > > > > fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari > > > > 2014 > > > > 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and > > > > frequency > > > > domain > Arjen, > Thanks, I reduced down the time resolution so > > > > computation can go > faster. Now, m y matrix looks like this > > > > > hpicomptimefreq = > label: {204x1 cell} > dimord: > > > > 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 > > > > double] > > > > > > > > > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 > > > > struct] > trialinfo: [59x1 double] > beta: [4-D double] > > > > > ft_regressconfound run on timelock data seems to return output > > > > with > > > > > avg field. However, ft_regressconfound run on frequency data, > > > > > does > > > > not > return average. I see the avg field being removed. Is > > > > there > > > > a > > > > reason? > Question - Since ft_regressconfound outputs power > > > > spectrum > > > > of > individual trials - 4D matrix (instead of average), can I > > > > simply > re-average the power spectrum over trials to see the > > > > average power for > that subject. Also, I need to run grand > > > > average > > > > (over subjects) before > running statistics. I hope these steps > > > > does > > > > not distort the data. > Please advise. > Thanks, > Raghavan > > > > > Date: > > > > Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. > > > > (Arjen)" > > > > < > > > > a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < > > > > fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] > > > > regressconfound and frequency domain > Message-ID: > < > > > > 2108167665.5423215.1392847118322.JavaMail.root at > > > > sculptor.zimbra.ru.nl > > > Content-Type: text/plain; > > > > charset="utf-8" > Dear Raghavan, Good to hear it's working out > > > > for > > > > you. A short answer > would be 'no'. Reducing the size of your > > > > data > > > > matrix is likely going > to speed up computations. Your time > > > > resolution seems pretty high (1500 > frequency estimations per > > > > single trial); do you need that many? Yours, > Arjen ----- > > > > Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" > > > > < > > > > gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > > > > > > > > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: > > > > [FieldTrip] regressconfound and frequency domain > > Arjen, > > > > > > Thanks for answering all my previous questions. I was > > > > successfully > > > > > > > > > > able to incorporate head movements to my erf data. As I > > > > > understand > > > > I > > have to do this separately for the time frequency data > > > > after > > > > keeping > > individual trials. I am interested in both beta and > > > > gamma bands > > [15:1:70]. my time frequency looks like this > > > > using > > > > wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: > > > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 > > > > double] > > > > > > > > > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 > > > > > struct] > > > > > > > > > > > trialinfo: [55x1 double] > > After regressconfound > > > > > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: > > > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 > > > > double] > > > > > > > > > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D > > > > double] > > Regressconfound took about 1 hr and 30 mins, since > > > > its > > > > a > > > > huge matrix > > [55x204x56x1500]. I have 25 such blocks of data > > > > for > > > > 20 subjects. It > > will take an enoumous amount of time to > > > > process > > > > the data through > > regressconfound. Is there a workaround to > > > > make > > > > the processing faster > > or am I missing something. Any help > > > > would > > > > be of great help. > > Thanks, > > Raghavan > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > > Phone: +31(0)243 68294 > > Web: www.arjenstolk.nl > > _______________________________________________ > > 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 -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Feb 21 16:14:04 2014 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 21 Feb 2014 10:14:04 -0500 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> References: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: I don't *think* I'm asking about how to do second-order analysis, unless I have missed something important. I did read the link/FAQ when I was working on this last week, and that seems different than the question I am asking. What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? Alik Alik Widge alik.widge at gmail.com (206) 866-5435 On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) wrote: > Dear Alik, > > If I am correct, you're asking how to create subject-level t-descriptives, > mentioned in the previous post? A quick answer would be to perform an > indepedent t-test ( cfg.statistic = indepsamplesT; ) using > ft_timelockstatistics (although you're not really 'testing' here, but only > interested in that t-descriptive), in which trials are the unit of > observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, > ntrls_conditionB)]; ). Note that since an indepedent t-test tests for > differences of the means of two conditions, it won't fail on unequal number > of observations across the conditions (unlike a dependent/paired t-test). > > Hope this gets you kickstarted for the moment. I found a previous > mail-conversation that goes more into detail, providing more overview of > the steps involved: > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html > More useful documentation: > > http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level > > Yours, > Arjen > > ------------------------------ > > *Van: *"Alik Widge" > *Aan: *"FieldTrip discussion list" > *Verzonden: *Vrijdag 21 februari 2014 11:38:10 > > *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain > > Arjen, what you just described is more or less what I struggled to do last > week and ultimately gave up as I was unable to figure out how to get FT to > do it despite much meditation over tutorials and source files. Can you > elaborate a bit more on what you are saying below -- not the > ft_regressconfound bit, but the bit about how to get > ft_statistics_montecarlo and its wrappers to do a trials-level analysis and > permutation at the whole-group level? Especially, what does one put in > cfg.design and how does one call the function? Everything I could find in > the tutorials described the case of doing means at the subject level and > then permutation of means at the group level, which as you point out is > underpowered for subtle effects. > > My particular situation was timelock-analyzed trials (with > keeptrials='yes'), but I could not find a way to set up cfg.design that > did not throw error messages. The thing that really seemed to bother it was > that there were different numbers of trials in the 2-3 conditions of > interest, since some had to be removed for excessive artifact. > > Thanks for any help, > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Raghavan, >> >> To compute a t-descriptive on subject level freq data, you'll need to use >> ft_freqstatistics. Have a look here for instance: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> >> At the subject level, you do not need (non-parametric) cluster >> permutation testing (Maris & Oostenveld), as you're taking each subject's >> t-descriptives to the group level. At the group level, you can then test >> the hypothesis that there's a difference between tasks/conditions (H1) vs. >> no difference (H0). In order to do so, you'll need to create a dummy >> variable at the group level, that has the same number of 'subjects', but >> with zeros in all fields (in your case this will be a .stat field). At the >> group level, you thus call ft_freqstatistics again. This approach has the >> advantage that you're more sensitive (as compared to taking each subject's >> mean to the group level) to effects that are small but consistent over >> trials in each subject. >> >> Arjen >> >> >> ------------------------------ >> >> *Van: *"Raghavan Gopalakrishnan" >> *Aan: *fieldtrip at science.ru.nl >> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Thanks Arjen, >> Should I use ft_freqdescriptives to compute t descriptives for individual >> subjects, and then take that to group level instead of mean? If not, what >> are the other alternatives? >> Thanks, >> Raghavan >> >> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >> >* Van: "Raghavan Gopalakrishnan" > >> *>* Aan: fieldtrip at science.ru.nl >> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >> *>* Arjen, >> *>* Thanks, I reduced down the time resolution so computation can go >> *>* faster. Now, m y matrix looks like this >> *>* hpicomptimefreq = >> *>* label: {204x1 cell} >> *>* dimord: 'rpt_chan_freq_time' >> *>* freq: [1x56 double] >> *>* time: [1x375 double] >> *>* powspctrm: [4-D double] >> *>* cumtapcnt: [59x56 double] >> *>* cfg: [1x1 struct] >> *>* trialinfo: [59x1 double] >> *>* beta: [4-D double] >> *>* ft_regressconfound run on timelock data seems to return output with >> *>* avg field. However, ft_regressconfound run on frequency data, does not >> *>* return average. I see the avg field being removed. Is there a reason? >> *>* Question - Since ft_regressconfound outputs power spectrum of >> *>* individual trials - 4D matrix (instead of average), can I simply >> *>* re-average the power spectrum over trials to see the average power for >> *>* that subject. Also, I need to run grand average (over subjects) before >> *>* running statistics. I hope these steps does not distort the data. >> *>* Please advise. >> *>* Thanks, >> *>* Raghavan >> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >> *>* Message-ID: >> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >> *>* > >> *>* Content-Type: text/plain; charset="utf-8" >> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >> *>* would be 'no'. Reducing the size of your data matrix is likely going >> *>* to speed up computations. Your time resolution seems pretty high (1500 >> *>* frequency estimations per single trial); do you need that many? Yours, >> *>* Arjen ----- Oorspronkelijk bericht ----- >> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >> *>* > Aan: fieldtrip at science.ru.nl >> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >> *>* > Arjen, >> *>* > Thanks for answering all my previous questions. I was successfully >> *>* > able to incorporate head movements to my erf data. As I understand I >> *>* > have to do this separately for the time frequency data after keeping >> *>* > individual trials. I am interested in both beta and gamma bands >> *>* > [15:1:70]. my time frequency looks like this using wavelets, >> *>* > timefreq = >> *>* > label: {204x1 cell} >> *>* > dimord: 'rpt_chan_freq_time' >> *>* > freq: [1x56 double] >> *>* > time: [1x1500 double] >> *>* > powspctrm: [4-D double] >> *>* > cumtapcnt: [55x56 double] >> *>* > grad: [1x1 struct] >> *>* > elec: [1x1 struct] >> *>* > cfg: [1x1 struct] >> *>* > trialinfo: [55x1 double] >> *>* > After regressconfound >> *>* > hpicomptimefreq = >> *>* > label: {204x1 cell} >> *>* > dimord: 'rpt_chan_freq_time' >> *>* > freq: [1x56 double] >> *>* > time: [1x1500 double] >> *>* > powspctrm: [4-D double] >> *>* > cumtapcnt: [55x56 double] >> *>* > cfg: [1x1 struct] >> *>* > trialinfo: [55x1 double] >> *>* > beta: [4-D double] >> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >> *>* > will take an enoumous amount of time to process the data through >> *>* > regressconfound. Is there a workaround to make the processing faster >> *>* > or am I missing something. Any help would be of great help. >> *>* > Thanks, >> *>* > Raghavan* >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> >> _______________________________________________ >> 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 > > > > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > > _______________________________________________ > 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 a.stolk8 at gmail.com Fri Feb 21 16:26:27 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Fri, 21 Feb 2014 16:26:27 +0100 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: References: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> >> _______________________________________________ >> 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 russgport at gmail.com Sat Feb 22 00:27:54 2014 From: russgport at gmail.com (Russell G Port) Date: Fri, 21 Feb 2014 18:27:54 -0500 Subject: [FieldTrip] sliding window for ICA Message-ID: Hi All, I have come across a problem and was hoping that someone had experience/knew things that could be useful.I have some MEG data, and the effort currently is to remove noise and artifact. I have the line noise reduction working fine, the question that faces me is the following. When I first read in my data I have the option of one of two methods. I can read it in as 1 second epoch for the whole length of the experiment (contiguous time bins, with no regard to events), or create 1 second epochs centered around a certain trigger (the data contains 4 different triggers). Initially I wanted to read in 1 second epochs (that spanned the entire dataset), clean it of artifacts (jumps, muscle, EOG,ECG, anything else), which would remove bad trials and components. I had then hoped to redefined the epoch, so that I could create 4 separate subsets of data, each centered around a separate trigger. It appears that I cannot do this (fieldtrip actually refuses this specifically). Is this because of issues with phase/jitter when putting the samples back together in different time sets? Second, it has been suggested that we perform ICA analysis to detect EOG and ECG artifacts on the data parsed just by timing (i.e. 1second bins contiguous for the entire length of the data but no relation to triggers), and have the component rejection scan my trials that are actually binned the based on triggers to remove the components; even though this is not the exact epochs used to classify the components. Is this possible? While I think it would be better to do the artifact correction on the whole dataset (all time/triggers included), would it actually be better to first define trials by triggers and then repeat everything (artifact rejection-wise)? This is very easy to do (and I have), the only issue comes when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as in http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg). I have the issue that when I used ft_artifact_ecg to detect peaks in the ECG channel (via z scores), zeros and NaNs are returned, and it fails to graph; since often the ECG timing occurs with such timing that the full pre/post time extends past what is actually in the trial. Is it proper just to remove all ECG events that cross the boundaries of the trigger based trials from the trial definitions used in next step. Here the sections of data contaminated with ECG are parsed and then tested to see coherence to the ICA components? I would fear that this would produce erroneous results, since the data for the ica would include the partial ECG event that I threw out. Best Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsauvigny at gmail.com Sat Feb 22 14:32:02 2014 From: tsauvigny at gmail.com (Thomas Sauvigny) Date: Sat, 22 Feb 2014 14:32:02 +0100 Subject: [FieldTrip] problem with EEG source reconstruction Message-ID: Dear fellow fiedtrippers, I would like to do a source reconstruction of EEG data using The FielTrip example MRI dataset via minimum-norm estimate. I stick close to the MNE tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and use a few steps from the EEG headmodel tutorial as well (http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I am struggling to combine the information from both tutorials in some crucial step prior to ft_sourceanalysis. My first approach has been to basically run through the MNE tutorial using the Fieltrip MRI dataset. As I could not save both the original anatomy and the masked anatomy in a freesurfer compatible format while using cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri = ft_volumesegment(cfg, mri); I instead proceeded as mentioned below and aligned the electrodes to the scalp in a second step (according to the headmodel tutorial). But when I want to combine the headmodel (vol) and the electrodes (elec_aligned2) into the leadfield, that does not work: using headmodel specified in the configuration using electrodes specified in the configuration Error using ft_prepare_vol_sens (line 534) unsupported volume conductor model for EEG Error in prepare_headmodel (line 94) [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ft_prepare_leadfield (line 124) [vol, sens, cfg] = prepare_headmodel(cfg, data); When I instead use the volume conduction model built in the headmodel tutorial (vol2) and the sourcespace from the MNE tutorial I get: Error using * Inner matrix dimensions must agree. Error in minimumnormestimate (line 179) A = P*A; % prewhitened leadfields Error in ft_sourceanalysis (line 869) dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, 'noisecov', squeeze(Cy(i,:,:))); In older posts in the mailing list there appeared to be problems with the scaling of the different components and I adapted the units, but that did not solve the problems. I would be very thankful for any help. cheers Thomas My script: clear all; mri = ft_read_mri('Subject01.mri'); save mri mri; disp(mri) cfg = []; cfg.resolution = 1; cfg.dim = [256 256 256]; mrirs = ft_volumereslice(cfg, mri); save mrirs mrirs; % segmentation of the mri % load mrirs; cfg = []; cfg.coordsys = 'ctf'; cfg.output = {'skullstrip' 'brain'}; seg = ft_volumesegment(cfg, mrirs); save seg seg; disp(seg(1)) %%% Thus, you need to identify the anterior commissure, the posterior commissure, and an interhemispheric point (which defines the XZ-plane). You can navigate across the slices with the arrows. %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel %%% coordinates of these landmarks are stored: % load mrirs; cfg = []; cfg.method = 'interactive'; mri_tal = ft_volumerealign(cfg, mrirs); save mri_tal mri_tal clear all; load mri_tal; load seg; % ensure that the skull-stripped anatomy is expressed in the same coordinate system as the anatomy seg.transform = mri_tal.transform; % save both the original anatomy, and the masked anatomy in a freesurfer compatible format cfg = []; cfg.filename = 'Subject01'; cfg.filetype = 'mgz'; cfg.parameter = 'anatomy'; ft_volumewrite(cfg, mri_tal); cfg.filename = 'Subject01masked'; ft_volumewrite(cfg, seg); %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% tcsh chsh -s /bin/tcsh setenv FREESURFER_HOME /Applications/freesurfer source $FREESURFER_HOME/SetUpFreeSurfer.csh setenv SUBJECTS_DIR /Applications/freesurfer/subjects setenv SUBJECT /Subject01 %%% .mgz files to mri folder cd $SUBJECTS_DIR/Subject01/mri/ mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz recon-all -talairach -subjid Subject01 recon-all -nuintensitycor -subjid Subject01 recon-all -normalization -subjid Subject01 cp T1.mgz brainmask.mgz recon-all -gcareg -subjid Subject01 recon-all -canorm -subjid Subject01 recon-all -careg -subjid Subject01 recon-all -calabel -subjid Subject01 recon-all -normalization2 -subjid Subject01 recon-all -segmentation -subjid Subject01 recon-all -fill -subjid Subject01 %%% This ends the part of the Freesurfer pipeline concerned with volumetric processing. At this stage you should have a file filled.mgz containing the segmentation of the cortical white matter (cerebellum is not included!). %%% You can check how this looks using FieldTrip, by doing the following: % % go to the Subject01/mri directory mri = ft_read_mri('filled.mgz'); cfg = []; cfg.interactive = 'yes'; figure;ft_sourceplot(cfg, mri); %%% back in Terminal: cd $SUBJECTS_DIR/Subject01/mri/ recon-all -tessellate -subjid Subject01 recon-all -smooth1 -subjid Subject01 recon-all -inflate1 -subjid Subject01 recon-all -qsphere -subjid Subject01 recon-all -fix -subjid Subject01 cp brain.mgz brain.finalsurfs.mgz recon-all -finalsurfs -subjid Subject01 recon-all -smooth2 -subjid Subject01 recon-all -inflate2 -subjid Subject01 recon-all -sphere -subjid Subject01 recon-all -surfreg -subjid Subject01 %%% MNE download and installation %%%%%%%%%%%%%% setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app source $MNE_ROOT/bin/mne_setup % http://martinos.org/mne/stable/manual/list.html cd $MNE_ROOT/bin ./mne_setup_sh setenv SUBJECTS_DIR /Applications/freesurfer/subjects setenv SUBJECT /Subject01 ./mne_setup_source_space --ico -6 --overwrite %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); figure;ft_plot_mesh(bnd); %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/mri mri_nom = ft_read_mri('orig-nomask.mgz'); cfg = []; cfg.method = 'interactive'; mri_nom_ctf = ft_volumerealign(cfg, mri_nom); %%% fiducials chosen, fiducials l,r,n mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/bem bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); sourcespace = ft_convert_units(bnd, 'cm'); sourcespace = ft_transform_geometry(T, sourcespace); save sourcespace sourcespace; save T T; %we will need the transformation matrix in the next step %%% Current Folder auf: /Applications/freesurfer/subjects/Subject01/Subject01/mri mri_nom = ft_read_mri('orig-nomask.mgz'); cfg = []; cfg.coordsys = 'spm'; cfg.output = {'brain'}; seg = ft_volumesegment(cfg, mri_nom); seg = ft_convert_units(seg,'cm'); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg,seg); vol.bnd = ft_transform_geometry(T, vol.bnd); save vol vol; % load vol % volume conduction model figure;hold on; ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight %%% so far, so good. >>> then I create the elec file: clear all; mri2 = ft_read_mri('Subject01.mri'); disp(mri2) save mri2 mri2; cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri2 = ft_volumesegment(cfg, mri2); save segmentedmri2 segmentedmri2 disp(segmentedmri2) cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 1000]; bnd2=ft_prepare_mesh(cfg,segmentedmri2); save bnd2 bnd2 disp(bnd2(1)) cfg = []; cfg.method ='dipoli'; vol2 = ft_prepare_headmodel(cfg, segmentedmri2); save vol2 vol2 disp(vol2) vol2 = ft_convert_units(vol2, 'cm'); figure; ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp figure; ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull figure; ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); elec2 = ft_read_sens('standard_1020.elc'); % may you need to define the path to the file disp(elec2) elec2 = ft_convert_units(elec2, 'cm'); % load volume conduction model load vol2; figure; % head surface (scalp) ft_plot_mesh(vol2.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % electrodes ft_plot_sens(elec2,'style', 'sk'); mri2 = ft_convert_units(mri2, 'cm'); nas=mri2.hdr.fiducial.mri.nas; lpa=mri2.hdr.fiducial.mri.lpa; rpa=mri2.hdr.fiducial.mri.rpa; transm=mri2.transform; nas=warp_apply(transm,nas, 'homogenous'); lpa=warp_apply(transm,lpa, 'homogenous'); rpa=warp_apply(transm,rpa, 'homogenous'); fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials fid.label = {'Nz','LPA','RPA'}; % same labels as in elec fid.unit = 'cm'; % same units as mri % alignment cfg = []; cfg.method = 'fiducial'; cfg.template = fid; % see above cfg.elec = elec2; cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec elec_aligned2 = ft_electroderealign(cfg); save elec_aligned2 elec_aligned2; % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); figure; ft_plot_sens(elec_aligned2,'style','sk'); hold on; ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', 'facecolor', [0.65 0.65 0.65]); %scalp cfg = []; cfg.method = 'interactive'; cfg.elec = elec_aligned2; cfg.headshape = vol2.bnd(1); elec_aligned2 = ft_electroderealign(cfg); %%%%% and here I am struggling: I can not get any of the above files to %%%%% work together: vol or vol2, elec_aligned2, sourcespace etc. vol = ft_convert_units(vol, 'cm'); elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); cfg = []; cfg.elec = elec_aligned2; % sensor positions cfg.channel = 'all'; % the used channels cfg.grid.pos = sourcespace.pnt; % source points cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are inside of the brain cfg.vol = vol; cfg.normalize = 'yes';% volume conduction model leadfield = ft_prepare_leadfield(cfg); save leadfield leadfield; clear all; load('GA1.mat') load('GA2.mat') load leadfield; load vol2; load elec_aligned2; cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned2; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; cfg.mne.normalize = 'yes'; sourceCERT0 = ft_sourceanalysis(cfg, GA1); sourceCERT3 = ft_sourceanalysis(cfg, GA2); -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Sat Feb 22 15:38:25 2014 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Sat, 22 Feb 2014 15:38:25 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: References: Message-ID: Hi Thomas, When I was working with actual data, once I got this error. At that time, it was the problem of having different number of electrodes for the forward solution (lead-field) i have created and for each subject recording electrodes. Each subject has different set of recording electrodes which gave this problem. I think we have to check the difference in electrodes or number of sensors. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > Dear fellow fiedtrippers, > > I would like to do a source reconstruction of EEG data using The FielTrip > example MRI dataset via minimum-norm estimate. I stick close to the MNE > tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and > use a few steps from the EEG headmodel tutorial as well ( > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I > am struggling to combine the information from both tutorials in some > crucial step prior to ft_sourceanalysis. > My first approach has been to basically run through the MNE tutorial using > the Fieltrip MRI dataset. As I could not save both the original anatomy and > the masked anatomy in a freesurfer compatible format while using > > *cfg = [];* > *cfg.output = {'brain','skull','scalp'};* > *segmentedmri = ft_volumesegment(cfg, mri);* > > I instead proceeded as mentioned below and aligned the electrodes to the > scalp in a second step (according to the headmodel tutorial). But when I > want to combine the headmodel (vol) and the electrodes (elec_aligned2) into > the leadfield, that does not work: > > *using headmodel specified in the configuration* > *using electrodes specified in the configuration* > *Error using ft_prepare_vol_sens (line 534)* > *unsupported volume conductor model for EEG* > > *Error in prepare_headmodel (line 94)* > *[vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order',* > *cfg.order);* > > *Error in ft_prepare_leadfield (line 124)* > *[vol, sens, cfg] = prepare_headmodel(cfg, data);* > > > When I instead use the volume conduction model built in the headmodel > tutorial (vol2) and the sourcespace from the MNE tutorial I get: > > > > > > > > > > *Error using * Inner matrix dimensions must agree.Error in > minimumnormestimate (line 179) A = P*A; % prewhitened > leadfieldsError in ft_sourceanalysis (line 869) dip(i) = > minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, > 'noisecov', squeeze(Cy(i,:,:)));* > > In older posts in the mailing list there appeared to be problems with the > scaling of the different components and I adapted the units, but that did > not solve the problems. > I would be very thankful for any help. > > > > cheers > Thomas > > > > > > > > > My script: > > clear all; > mri = ft_read_mri('Subject01.mri'); > save mri mri; > disp(mri) > > cfg = []; > cfg.resolution = 1; > cfg.dim = [256 256 256]; > mrirs = ft_volumereslice(cfg, mri); > save mrirs mrirs; > > % segmentation of the mri > % load mrirs; > cfg = []; > cfg.coordsys = 'ctf'; > cfg.output = {'skullstrip' 'brain'}; > seg = ft_volumesegment(cfg, mrirs); > save seg seg; > > disp(seg(1)) > > %%% Thus, you need to identify the anterior commissure, the posterior > commissure, and an interhemispheric point (which defines the XZ-plane). You > can navigate across the slices with the arrows. > %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel > %%% coordinates of these landmarks are stored: > % load mrirs; > cfg = []; > cfg.method = 'interactive'; > mri_tal = ft_volumerealign(cfg, mrirs); > save mri_tal mri_tal > > clear all; > load mri_tal; > load seg; > % ensure that the skull-stripped anatomy is expressed in the same > coordinate system as the anatomy > seg.transform = mri_tal.transform; > % save both the original anatomy, and the masked anatomy in a freesurfer > compatible format > cfg = []; > cfg.filename = 'Subject01'; > cfg.filetype = 'mgz'; > cfg.parameter = 'anatomy'; > ft_volumewrite(cfg, mri_tal); > cfg.filename = 'Subject01masked'; > ft_volumewrite(cfg, seg); > > %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% > tcsh > chsh -s /bin/tcsh > setenv FREESURFER_HOME /Applications/freesurfer > source $FREESURFER_HOME/SetUpFreeSurfer.csh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > %%% .mgz files to mri folder > cd $SUBJECTS_DIR/Subject01/mri/ > mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz > mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz > > recon-all -talairach -subjid Subject01 > recon-all -nuintensitycor -subjid Subject01 > recon-all -normalization -subjid Subject01 > cp T1.mgz brainmask.mgz > recon-all -gcareg -subjid Subject01 > recon-all -canorm -subjid Subject01 > recon-all -careg -subjid Subject01 > recon-all -calabel -subjid Subject01 > recon-all -normalization2 -subjid Subject01 > recon-all -segmentation -subjid Subject01 > recon-all -fill -subjid Subject01 > > > %%% This ends the part of the Freesurfer pipeline concerned with > volumetric processing. At this stage you should have a file filled.mgz > containing the segmentation of the cortical white matter (cerebellum is not > included!). > %%% You can check how this looks using FieldTrip, by doing the following: > % % go to the Subject01/mri directory > mri = ft_read_mri('filled.mgz'); > cfg = []; > cfg.interactive = 'yes'; > figure;ft_sourceplot(cfg, mri); > > %%% back in Terminal: > cd $SUBJECTS_DIR/Subject01/mri/ > recon-all -tessellate -subjid Subject01 > recon-all -smooth1 -subjid Subject01 > recon-all -inflate1 -subjid Subject01 > recon-all -qsphere -subjid Subject01 > recon-all -fix -subjid Subject01 > cp brain.mgz brain.finalsurfs.mgz > recon-all -finalsurfs -subjid Subject01 > recon-all -smooth2 -subjid Subject01 > recon-all -inflate2 -subjid Subject01 > recon-all -sphere -subjid Subject01 > recon-all -surfreg -subjid Subject01 > > %%% MNE download and installation %%%%%%%%%%%%%% > setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 > setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app > source $MNE_ROOT/bin/mne_setup > > % http://martinos.org/mne/stable/manual/list.html > cd $MNE_ROOT/bin > ./mne_setup_sh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > > ./mne_setup_source_space --ico -6 --overwrite > > %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > figure;ft_plot_mesh(bnd); > > %%% Current Folder : > /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > %%% fiducials chosen, fiducials l,r,n > > mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > %%% Current Folder : > /Applications/freesurfer/subjects/Subject01/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', > 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > %%% Current Folder auf: > /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.coordsys = 'spm'; > cfg.output = {'brain'}; > seg = ft_volumesegment(cfg, mri_nom); > seg = ft_convert_units(seg,'cm'); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg,seg); > vol.bnd = ft_transform_geometry(T, vol.bnd); > save vol vol; > > % load vol % volume conduction model > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > > > > %%% so far, so good. >>> then I create the elec file: > clear all; > mri2 = ft_read_mri('Subject01.mri'); > disp(mri2) > save mri2 mri2; > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri2 = ft_volumesegment(cfg, mri2); > save segmentedmri2 segmentedmri2 > disp(segmentedmri2) > > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd2=ft_prepare_mesh(cfg,segmentedmri2); > > save bnd2 bnd2 > > disp(bnd2(1)) > > cfg = []; > cfg.method ='dipoli'; > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > save vol2 vol2 > > disp(vol2) > > vol2 = ft_convert_units(vol2, 'cm'); > > > figure; > ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp > figure; > ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull > figure; > ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain > > ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, > 'edgecolor', [1 1 1], 'edgealpha', 0.05); > hold on; > ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); > hold on; > ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); > > elec2 = ft_read_sens('standard_1020.elc'); % may you need to > define the path to the file > > disp(elec2) > > elec2 = ft_convert_units(elec2, 'cm'); > > % load volume conduction model > load vol2; > figure; > % head surface (scalp) > ft_plot_mesh(vol2.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % electrodes > ft_plot_sens(elec2,'style', 'sk'); > > > mri2 = ft_convert_units(mri2, 'cm'); > > nas=mri2.hdr.fiducial.mri.nas; > lpa=mri2.hdr.fiducial.mri.lpa; > rpa=mri2.hdr.fiducial.mri.rpa; > > transm=mri2.transform; > > nas=warp_apply(transm,nas, 'homogenous'); > lpa=warp_apply(transm,lpa, 'homogenous'); > rpa=warp_apply(transm,rpa, 'homogenous'); > > fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials > fid.label = {'Nz','LPA','RPA'}; % same labels as in elec > fid.unit = 'cm'; % same units as mri > > % alignment > cfg = []; > cfg.method = 'fiducial'; > cfg.template = fid; % see above > cfg.elec = elec2; > cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid > and in elec > elec_aligned2 = ft_electroderealign(cfg); > > save elec_aligned2 elec_aligned2; > % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > figure; > ft_plot_sens(elec_aligned2,'style','sk'); > hold on; > ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', > 'facecolor', [0.65 0.65 0.65]); %scalp > > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec_aligned2; > cfg.headshape = vol2.bnd(1); > elec_aligned2 = ft_electroderealign(cfg); > > > *%%%%% and here I am struggling: I can not get any of the above files to* > *%%%%% work together: vol or vol2, elec_aligned2, sourcespace etc.* > > vol = ft_convert_units(vol, 'cm'); > elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > cfg = []; > cfg.elec = elec_aligned2; % sensor positions > cfg.channel = 'all'; % the used channels > cfg.grid.pos = sourcespace.pnt; % source points > cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are > inside of the brain > cfg.vol = vol; > cfg.normalize = 'yes';% volume conduction model > leadfield = ft_prepare_leadfield(cfg); > > save leadfield leadfield; > > clear all; > load('GA1.mat') > load('GA2.mat') > load leadfield; > load vol2; > load elec_aligned2; > > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned2; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > cfg.mne.normalize = 'yes'; > sourceCERT0 = ft_sourceanalysis(cfg, GA1); > sourceCERT3 = ft_sourceanalysis(cfg, GA2); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From aaron.schurger at gmail.com Sat Feb 22 16:37:27 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Sat, 22 Feb 2014 16:37:27 +0100 Subject: [FieldTrip] sliding window for ICA In-Reply-To: References: Message-ID: See below... On Sat, Feb 22, 2014 at 12:27 AM, Russell G Port wrote: > Hi All, > > I have come across a problem and was hoping that someone had experience/knew > things that could be useful.I have some MEG data, and the effort currently > is to remove noise and artifact. I have the line noise reduction working > fine, the question that faces me is the following. When I first read in my > data I have the option of one of two methods. I can read it in as 1 second > epoch for the whole length of the experiment (contiguous time bins, with no > regard to events), or create 1 second epochs centered around a certain > trigger (the data contains 4 different triggers). Initially I wanted to read > in 1 second epochs (that spanned the entire dataset), clean it of artifacts > (jumps, muscle, EOG,ECG, anything else), which would remove bad trials and > components. I had then hoped to redefined the epoch, so that I could create > 4 separate subsets of data, each centered around a separate trigger. It > appears that I cannot do this (fieldtrip actually refuses this > specifically). Is this because of issues with phase/jitter when putting the > samples back together in different time sets? Second, it has been suggested > that we perform ICA analysis to detect EOG and ECG artifacts on the data > parsed just by timing (i.e. 1second bins contiguous for the entire length of > the data but no relation to triggers), and have the component rejection scan > my trials that are actually binned the based on triggers to remove the > components; even though this is not the exact epochs used to classify the > components. Is this possible? This is the preferred way to do it. Read in all of your data in 1- or 2-second epochs at arbitrary points (just one right after another). Run ICA on these epochs and save the components that you get (call this 'comp'). Then make a note of the components that you want to remove (usually blink, eye movement, and heart). Now read in your data time-locked to your triggers and use the previously-defined components to clean up the data (use the cfg to specify which components you want to remove). [data] = ft_rejectcomponent(cfg, comp, data); > > While I think it would be better to do the artifact correction on the whole > dataset (all time/triggers included), would it actually be better to first > define trials by triggers and then repeat everything (artifact > rejection-wise)? This is very easy to do (and I have), the only issue comes > when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as in > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg). > I have the issue that when I used ft_artifact_ecg to detect peaks in the ECG > channel (via z scores), zeros and NaNs are returned, and it fails to graph; > since often the ECG timing occurs with such timing that the full pre/post > time extends past what is actually in the trial. Is it proper just to remove > all ECG events that cross the boundaries of the trigger based trials from > the trial definitions used in next step. Here the sections of data > contaminated with ECG are parsed and then tested to see coherence to the ICA > components? I would fear that this would produce erroneous results, since > the data for the ica would include the partial ECG event that I threw out. > > Best > Russ Port > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From russgport at gmail.com Sat Feb 22 19:49:17 2014 From: russgport at gmail.com (Russell G Port) Date: Sat, 22 Feb 2014 13:49:17 -0500 Subject: [FieldTrip] sliding window for ICA In-Reply-To: References: Message-ID: Thank you Dr Schurger, this is awesome On Sat, Feb 22, 2014 at 10:37 AM, Aaron Schurger wrote: > See below... > > > On Sat, Feb 22, 2014 at 12:27 AM, Russell G Port > wrote: > > Hi All, > > > > I have come across a problem and was hoping that someone had > experience/knew > > things that could be useful.I have some MEG data, and the effort > currently > > is to remove noise and artifact. I have the line noise reduction working > > fine, the question that faces me is the following. When I first read in > my > > data I have the option of one of two methods. I can read it in as 1 > second > > epoch for the whole length of the experiment (contiguous time bins, with > no > > regard to events), or create 1 second epochs centered around a certain > > trigger (the data contains 4 different triggers). Initially I wanted to > read > > in 1 second epochs (that spanned the entire dataset), clean it of > artifacts > > (jumps, muscle, EOG,ECG, anything else), which would remove bad trials > and > > components. I had then hoped to redefined the epoch, so that I could > create > > 4 separate subsets of data, each centered around a separate trigger. It > > appears that I cannot do this (fieldtrip actually refuses this > > specifically). Is this because of issues with phase/jitter when putting > the > > samples back together in different time sets? Second, it has been > suggested > > that we perform ICA analysis to detect EOG and ECG artifacts on the data > > parsed just by timing (i.e. 1second bins contiguous for the entire > length of > > the data but no relation to triggers), and have the component rejection > scan > > my trials that are actually binned the based on triggers to remove the > > components; even though this is not the exact epochs used to classify the > > components. Is this possible? > > This is the preferred way to do it. Read in all of your data in 1- or > 2-second epochs at arbitrary points (just one right after another). > Run ICA on these epochs and save the components that you get (call > this 'comp'). Then make a note of the components that you want to > remove (usually blink, eye movement, and heart). Now read in your data > time-locked to your triggers and use the previously-defined components > to clean up the data (use the cfg to specify which components you want > to remove). > [data] = ft_rejectcomponent(cfg, comp, data); > > > > > While I think it would be better to do the artifact correction on the > whole > > dataset (all time/triggers included), would it actually be better to > first > > define trials by triggers and then repeat everything (artifact > > rejection-wise)? This is very easy to do (and I have), the only issue > comes > > when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as > in > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg > ). > > I have the issue that when I used ft_artifact_ecg to detect peaks in the > ECG > > channel (via z scores), zeros and NaNs are returned, and it fails to > graph; > > since often the ECG timing occurs with such timing that the full pre/post > > time extends past what is actually in the trial. Is it proper just to > remove > > all ECG events that cross the boundaries of the trigger based trials from > > the trial definitions used in next step. Here the sections of data > > contaminated with ECG are parsed and then tested to see coherence to the > ICA > > components? I would fear that this would produce erroneous results, since > > the data for the ica would include the partial ECG event that I threw > out. > > > > Best > > Russ Port > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > 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 zizlsperger at gmail.com Sun Feb 23 13:14:37 2014 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Sun, 23 Feb 2014 13:14:37 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: References: Message-ID: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> Hello in view of your code: first check if elec2 = ft_read_sens('standard_1020.elc’); corresponds to the channel structure of your functional data (averages). Best to Hamburg Leo — Dr. med. Leopold Zizlsperger Klinik für Neurologie Uniklinik RWTH Aachen Pauwelsstrasse 30 52074 Aachen Tel: +49 241 80 35465 lzizlsperger at ukaachen.de Leopold Zizlsperger, MD Department of Neurology RWTH Aachen University Pauwelsstrasse 30 52074 Aachen, Germany Tel: +49 241 80 35465 lzizlsperger at ukaachen.de On 22 Feb 2014, at 15:38, Chaitanya Srinivas wrote: > Hi Thomas, > > When I was working with actual data, once I got this error. At that time, it was the problem of having different number of electrodes for the forward solution (lead-field) i have created and for each subject recording electrodes. Each subject has different set of recording electrodes which gave this problem. I think we have to check the difference in electrodes or number of sensors. > > > > =============================================== > > > > Best Regards > Chaitanya Srinivas Lanka > > Wiss. Mitarbeiter PhD Student > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for Neuroscience > Eberhard Karls University Eberhard Karls University > Otfried-Mueller-Str.45 Österbergstr. 3 > D-72076 Tuebingen D-72074 Tuebingen > Mobile Phone Number : +49-176-79035731 > =============================================== > > > On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > Dear fellow fiedtrippers, > > I would like to do a source reconstruction of EEG data using The FielTrip example MRI dataset via minimum-norm estimate. I stick close to the MNE tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and use a few steps from the EEG headmodel tutorial as well (http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I am struggling to combine the information from both tutorials in some crucial step prior to ft_sourceanalysis. > My first approach has been to basically run through the MNE tutorial using the Fieltrip MRI dataset. As I could not save both the original anatomy and the masked anatomy in a freesurfer compatible format while using > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri); > > I instead proceeded as mentioned below and aligned the electrodes to the scalp in a second step (according to the headmodel tutorial). But when I want to combine the headmodel (vol) and the electrodes (elec_aligned2) into the leadfield, that does not work: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Error using ft_prepare_vol_sens (line 534) > unsupported volume conductor model for EEG > > Error in prepare_headmodel (line 94) > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', > cfg.order); > > Error in ft_prepare_leadfield (line 124) > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > When I instead use the volume conduction model built in the headmodel tutorial (vol2) and the sourcespace from the MNE tutorial I get: > > Error using * > Inner matrix dimensions must agree. > > Error in minimumnormestimate (line 179) > A = P*A; % prewhitened leadfields > > Error in ft_sourceanalysis (line 869) > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, > 'noisecov', squeeze(Cy(i,:,:))); > > In older posts in the mailing list there appeared to be problems with the scaling of the different components and I adapted the units, but that did not solve the problems. > I would be very thankful for any help. > > > > cheers > Thomas > > > > > > > > > My script: > > clear all; > mri = ft_read_mri('Subject01.mri'); > save mri mri; > disp(mri) > > cfg = []; > cfg.resolution = 1; > cfg.dim = [256 256 256]; > mrirs = ft_volumereslice(cfg, mri); > save mrirs mrirs; > > % segmentation of the mri > % load mrirs; > cfg = []; > cfg.coordsys = 'ctf'; > cfg.output = {'skullstrip' 'brain'}; > seg = ft_volumesegment(cfg, mrirs); > save seg seg; > > disp(seg(1)) > > %%% Thus, you need to identify the anterior commissure, the posterior commissure, and an interhemispheric point (which defines the XZ-plane). You can navigate across the slices with the arrows. > %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel > %%% coordinates of these landmarks are stored: > % load mrirs; > cfg = []; > cfg.method = 'interactive'; > mri_tal = ft_volumerealign(cfg, mrirs); > save mri_tal mri_tal > > clear all; > load mri_tal; > load seg; > % ensure that the skull-stripped anatomy is expressed in the same coordinate system as the anatomy > seg.transform = mri_tal.transform; > % save both the original anatomy, and the masked anatomy in a freesurfer compatible format > cfg = []; > cfg.filename = 'Subject01'; > cfg.filetype = 'mgz'; > cfg.parameter = 'anatomy'; > ft_volumewrite(cfg, mri_tal); > cfg.filename = 'Subject01masked'; > ft_volumewrite(cfg, seg); > > %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% > tcsh > chsh -s /bin/tcsh > setenv FREESURFER_HOME /Applications/freesurfer > source $FREESURFER_HOME/SetUpFreeSurfer.csh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > %%% .mgz files to mri folder > cd $SUBJECTS_DIR/Subject01/mri/ > mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz > mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz > > recon-all -talairach -subjid Subject01 > recon-all -nuintensitycor -subjid Subject01 > recon-all -normalization -subjid Subject01 > cp T1.mgz brainmask.mgz > recon-all -gcareg -subjid Subject01 > recon-all -canorm -subjid Subject01 > recon-all -careg -subjid Subject01 > recon-all -calabel -subjid Subject01 > recon-all -normalization2 -subjid Subject01 > recon-all -segmentation -subjid Subject01 > recon-all -fill -subjid Subject01 > > > %%% This ends the part of the Freesurfer pipeline concerned with volumetric processing. At this stage you should have a file filled.mgz containing the segmentation of the cortical white matter (cerebellum is not included!). > %%% You can check how this looks using FieldTrip, by doing the following: > % % go to the Subject01/mri directory > mri = ft_read_mri('filled.mgz'); > cfg = []; > cfg.interactive = 'yes'; > figure;ft_sourceplot(cfg, mri); > > %%% back in Terminal: > cd $SUBJECTS_DIR/Subject01/mri/ > recon-all -tessellate -subjid Subject01 > recon-all -smooth1 -subjid Subject01 > recon-all -inflate1 -subjid Subject01 > recon-all -qsphere -subjid Subject01 > recon-all -fix -subjid Subject01 > cp brain.mgz brain.finalsurfs.mgz > recon-all -finalsurfs -subjid Subject01 > recon-all -smooth2 -subjid Subject01 > recon-all -inflate2 -subjid Subject01 > recon-all -sphere -subjid Subject01 > recon-all -surfreg -subjid Subject01 > > %%% MNE download and installation %%%%%%%%%%%%%% > setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 > setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app > source $MNE_ROOT/bin/mne_setup > > % http://martinos.org/mne/stable/manual/list.html > cd $MNE_ROOT/bin > ./mne_setup_sh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > > ./mne_setup_source_space --ico -6 --overwrite > > %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > figure;ft_plot_mesh(bnd); > > %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > %%% fiducials chosen, fiducials l,r,n > > mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > %%% Current Folder auf: /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.coordsys = 'spm'; > cfg.output = {'brain'}; > seg = ft_volumesegment(cfg, mri_nom); > seg = ft_convert_units(seg,'cm'); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg,seg); > vol.bnd = ft_transform_geometry(T, vol.bnd); > save vol vol; > > % load vol % volume conduction model > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > > > > %%% so far, so good. >>> then I create the elec file: > clear all; > mri2 = ft_read_mri('Subject01.mri'); > disp(mri2) > save mri2 mri2; > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri2 = ft_volumesegment(cfg, mri2); > save segmentedmri2 segmentedmri2 > disp(segmentedmri2) > > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd2=ft_prepare_mesh(cfg,segmentedmri2); > > save bnd2 bnd2 > > disp(bnd2(1)) > > cfg = []; > cfg.method ='dipoli'; > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > save vol2 vol2 > > disp(vol2) > > vol2 = ft_convert_units(vol2, 'cm'); > > > figure; > ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp > figure; > ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull > figure; > ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain > > ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > hold on; > ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); > hold on; > ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); > > elec2 = ft_read_sens('standard_1020.elc'); % may you need to define the path to the file > > disp(elec2) > > elec2 = ft_convert_units(elec2, 'cm'); > > % load volume conduction model > load vol2; > figure; > % head surface (scalp) > ft_plot_mesh(vol2.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % electrodes > ft_plot_sens(elec2,'style', 'sk'); > > > mri2 = ft_convert_units(mri2, 'cm'); > > nas=mri2.hdr.fiducial.mri.nas; > lpa=mri2.hdr.fiducial.mri.lpa; > rpa=mri2.hdr.fiducial.mri.rpa; > > transm=mri2.transform; > > nas=warp_apply(transm,nas, 'homogenous'); > lpa=warp_apply(transm,lpa, 'homogenous'); > rpa=warp_apply(transm,rpa, 'homogenous'); > > fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials > fid.label = {'Nz','LPA','RPA'}; % same labels as in elec > fid.unit = 'cm'; % same units as mri > > % alignment > cfg = []; > cfg.method = 'fiducial'; > cfg.template = fid; % see above > cfg.elec = elec2; > cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec > elec_aligned2 = ft_electroderealign(cfg); > > save elec_aligned2 elec_aligned2; > % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > figure; > ft_plot_sens(elec_aligned2,'style','sk'); > hold on; > ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', 'facecolor', [0.65 0.65 0.65]); %scalp > > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec_aligned2; > cfg.headshape = vol2.bnd(1); > elec_aligned2 = ft_electroderealign(cfg); > > > %%%%% and here I am struggling: I can not get any of the above files to > %%%%% work together: vol or vol2, elec_aligned2, sourcespace etc. > > vol = ft_convert_units(vol, 'cm'); > elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > cfg = []; > cfg.elec = elec_aligned2; % sensor positions > cfg.channel = 'all'; % the used channels > cfg.grid.pos = sourcespace.pnt; % source points > cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are inside of the brain > cfg.vol = vol; > cfg.normalize = 'yes';% volume conduction model > leadfield = ft_prepare_leadfield(cfg); > > save leadfield leadfield; > > clear all; > load('GA1.mat') > load('GA2.mat') > load leadfield; > load vol2; > load elec_aligned2; > > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned2; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > cfg.mne.normalize = 'yes'; > sourceCERT0 = ft_sourceanalysis(cfg, GA1); > sourceCERT3 = ft_sourceanalysis(cfg, GA2); > > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_Signatur.png Type: image/png Size: 3435 bytes Desc: not available URL: From tsauvigny at gmail.com Sun Feb 23 18:51:22 2014 From: tsauvigny at gmail.com (Thomas Sauvigny) Date: Sun, 23 Feb 2014 18:51:22 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> References: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> Message-ID: Awesome, Thank you Chaitanya and Leo! Am 23.02.2014 13:27 schrieb "Zizlsperger Leopold" : > Hello > in view of your code: first check if > elec2 = ft_read_sens('standard_1020.elc'); > corresponds to the channel structure of your functional data (averages). > Best to Hamburg > Leo > > -- > > > Dr. med. Leopold Zizlsperger > Klinik für Neurologie > Uniklinik RWTH Aachen > Pauwelsstrasse 30 > 52074 Aachen > Tel: +49 241 80 35465 > lzizlsperger at ukaachen.de > > > > > > Leopold Zizlsperger, MD > Department of Neurology > RWTH Aachen University > Pauwelsstrasse 30 > 52074 Aachen, Germany > Tel: +49 241 80 35465 > lzizlsperger at ukaachen.de > > > On 22 Feb 2014, at 15:38, Chaitanya Srinivas > wrote: > > Hi Thomas, > > When I was working with actual data, once I got this error. At that time, > it was the problem of having different number of electrodes for the forward > solution (lead-field) i have created and for each subject recording > electrodes. Each subject has different set of recording electrodes which > gave this problem. I think we have to check the difference in electrodes or > number of sensors. > > > > *=============================================== * > > > ***Best Regards* > > > *Chaitanya Srinivas Lanka Wiss. Mitarbeiter > * > > *PhD Student Functional and Restorative Neurosurgery Neural Information > ProcessingNeurosurgical University Hospital* > > * Graduate Training Center for Neuroscience Eberhard Karls > University Eberhard Karls University **Otfried-Mueller-Str.45 > Österbergstr. 3* > * D-72076 Tuebingen **D-72074 > Tuebingen* > > *Mobile Phone Number : +49-176-79035731* > *===============================================* > > > On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > >> Dear fellow fiedtrippers, >> >> I would like to do a source reconstruction of EEG data using The FielTrip >> example MRI dataset via minimum-norm estimate. I stick close to the MNE >> tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) >> and use a few steps from the EEG headmodel tutorial as well ( >> http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I >> am struggling to combine the information from both tutorials in some >> crucial step prior to ft_sourceanalysis. >> My first approach has been to basically run through the MNE tutorial >> using the Fieltrip MRI dataset. As I could not save both the original >> anatomy and the masked anatomy in a freesurfer compatible format while >> using >> >> *cfg = [];* >> *cfg.output = {'brain','skull','scalp'};* >> *segmentedmri = ft_volumesegment(cfg, mri);* >> >> I instead proceeded as mentioned below and aligned the electrodes to the >> scalp in a second step (according to the headmodel tutorial). But when I >> want to combine the headmodel (vol) and the electrodes (elec_aligned2) into >> the leadfield, that does not work: >> >> *using headmodel specified in the configuration* >> *using electrodes specified in the configuration* >> *Error using ft_prepare_vol_sens (line 534)* >> *unsupported volume conductor model for EEG* >> >> *Error in prepare_headmodel (line 94)* >> *[vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, >> 'order',* >> *cfg.order);* >> >> *Error in ft_prepare_leadfield (line 124)* >> *[vol, sens, cfg] = prepare_headmodel(cfg, data);* >> >> >> When I instead use the volume conduction model built in the headmodel >> tutorial (vol2) and the sourcespace from the MNE tutorial I get: >> >> >> >> >> >> >> >> >> >> *Error using * Inner matrix dimensions must agree.Error in >> minimumnormestimate (line 179) A = P*A; % prewhitened >> leadfieldsError in ft_sourceanalysis (line 869) dip(i) = >> minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, >> 'noisecov', squeeze(Cy(i,:,:)));* >> >> In older posts in the mailing list there appeared to be problems with the >> scaling of the different components and I adapted the units, but that did >> not solve the problems. >> I would be very thankful for any help. >> >> >> >> cheers >> Thomas >> >> >> >> >> >> >> >> >> My script: >> >> clear all; >> mri = ft_read_mri('Subject01.mri'); >> save mri mri; >> disp(mri) >> >> cfg = []; >> cfg.resolution = 1; >> cfg.dim = [256 256 256]; >> mrirs = ft_volumereslice(cfg, mri); >> save mrirs mrirs; >> >> % segmentation of the mri >> % load mrirs; >> cfg = []; >> cfg.coordsys = 'ctf'; >> cfg.output = {'skullstrip' 'brain'}; >> seg = ft_volumesegment(cfg, mrirs); >> save seg seg; >> >> disp(seg(1)) >> >> %%% Thus, you need to identify the anterior commissure, the posterior >> commissure, and an interhemispheric point (which defines the XZ-plane). You >> can navigate across the slices with the arrows. >> %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel >> %%% coordinates of these landmarks are stored: >> % load mrirs; >> cfg = []; >> cfg.method = 'interactive'; >> mri_tal = ft_volumerealign(cfg, mrirs); >> save mri_tal mri_tal >> >> clear all; >> load mri_tal; >> load seg; >> % ensure that the skull-stripped anatomy is expressed in the same >> coordinate system as the anatomy >> seg.transform = mri_tal.transform; >> % save both the original anatomy, and the masked anatomy in a freesurfer >> compatible format >> cfg = []; >> cfg.filename = 'Subject01'; >> cfg.filetype = 'mgz'; >> cfg.parameter = 'anatomy'; >> ft_volumewrite(cfg, mri_tal); >> cfg.filename = 'Subject01masked'; >> ft_volumewrite(cfg, seg); >> >> %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% >> tcsh >> chsh -s /bin/tcsh >> setenv FREESURFER_HOME /Applications/freesurfer >> source $FREESURFER_HOME/SetUpFreeSurfer.csh >> >> setenv SUBJECTS_DIR /Applications/freesurfer/subjects >> setenv SUBJECT /Subject01 >> %%% .mgz files to mri folder >> cd $SUBJECTS_DIR/Subject01/mri/ >> mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz >> mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz >> >> recon-all -talairach -subjid Subject01 >> recon-all -nuintensitycor -subjid Subject01 >> recon-all -normalization -subjid Subject01 >> cp T1.mgz brainmask.mgz >> recon-all -gcareg -subjid Subject01 >> recon-all -canorm -subjid Subject01 >> recon-all -careg -subjid Subject01 >> recon-all -calabel -subjid Subject01 >> recon-all -normalization2 -subjid Subject01 >> recon-all -segmentation -subjid Subject01 >> recon-all -fill -subjid Subject01 >> >> >> %%% This ends the part of the Freesurfer pipeline concerned with >> volumetric processing. At this stage you should have a file filled.mgz >> containing the segmentation of the cortical white matter (cerebellum is not >> included!). >> %%% You can check how this looks using FieldTrip, by doing the following: >> % % go to the Subject01/mri directory >> mri = ft_read_mri('filled.mgz'); >> cfg = []; >> cfg.interactive = 'yes'; >> figure;ft_sourceplot(cfg, mri); >> >> %%% back in Terminal: >> cd $SUBJECTS_DIR/Subject01/mri/ >> recon-all -tessellate -subjid Subject01 >> recon-all -smooth1 -subjid Subject01 >> recon-all -inflate1 -subjid Subject01 >> recon-all -qsphere -subjid Subject01 >> recon-all -fix -subjid Subject01 >> cp brain.mgz brain.finalsurfs.mgz >> recon-all -finalsurfs -subjid Subject01 >> recon-all -smooth2 -subjid Subject01 >> recon-all -inflate2 -subjid Subject01 >> recon-all -sphere -subjid Subject01 >> recon-all -surfreg -subjid Subject01 >> >> %%% MNE download and installation %%%%%%%%%%%%%% >> setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 >> setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app >> source $MNE_ROOT/bin/mne_setup >> >> % http://martinos.org/mne/stable/manual/list.html >> cd $MNE_ROOT/bin >> ./mne_setup_sh >> >> setenv SUBJECTS_DIR /Applications/freesurfer/subjects >> setenv SUBJECT /Subject01 >> >> ./mne_setup_source_space --ico -6 --overwrite >> >> %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem >> bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', >> 'mne_source'); >> figure;ft_plot_mesh(bnd); >> >> %%% Current Folder : >> /Applications/freesurfer/subjects/Subject01/Subject01/mri >> mri_nom = ft_read_mri('orig-nomask.mgz'); >> >> cfg = []; >> cfg.method = 'interactive'; >> mri_nom_ctf = ft_volumerealign(cfg, mri_nom); >> >> %%% fiducials chosen, fiducials l,r,n >> >> mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); >> T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); >> %%% Current Folder : >> /Applications/freesurfer/subjects/Subject01/Subject01/bem >> bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', >> 'mne_source'); >> sourcespace = ft_convert_units(bnd, 'cm'); >> sourcespace = ft_transform_geometry(T, sourcespace); >> save sourcespace sourcespace; >> save T T; %we will need the transformation matrix in the next step >> >> %%% Current Folder auf: >> /Applications/freesurfer/subjects/Subject01/Subject01/mri >> mri_nom = ft_read_mri('orig-nomask.mgz'); >> >> cfg = []; >> cfg.coordsys = 'spm'; >> cfg.output = {'brain'}; >> seg = ft_volumesegment(cfg, mri_nom); >> seg = ft_convert_units(seg,'cm'); >> >> cfg = []; >> cfg.method = 'singleshell'; >> vol = ft_prepare_headmodel(cfg,seg); >> vol.bnd = ft_transform_geometry(T, vol.bnd); >> save vol vol; >> >> % load vol % volume conduction model >> figure;hold on; >> ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; >> ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight >> >> >> >> %%% so far, so good. >>> then I create the elec file: >> clear all; >> mri2 = ft_read_mri('Subject01.mri'); >> disp(mri2) >> save mri2 mri2; >> >> cfg = []; >> cfg.output = {'brain','skull','scalp'}; >> segmentedmri2 = ft_volumesegment(cfg, mri2); >> save segmentedmri2 segmentedmri2 >> disp(segmentedmri2) >> >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.numvertices = [3000 2000 1000]; >> bnd2=ft_prepare_mesh(cfg,segmentedmri2); >> >> save bnd2 bnd2 >> >> disp(bnd2(1)) >> >> cfg = []; >> cfg.method ='dipoli'; >> vol2 = ft_prepare_headmodel(cfg, segmentedmri2); >> >> save vol2 vol2 >> >> disp(vol2) >> >> vol2 = ft_convert_units(vol2, 'cm'); >> >> >> figure; >> ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp >> figure; >> ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull >> figure; >> ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain >> >> ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, >> 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> hold on; >> ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); >> hold on; >> ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); >> >> elec2 = ft_read_sens('standard_1020.elc'); % may you need to >> define the path to the file >> >> disp(elec2) >> >> elec2 = ft_convert_units(elec2, 'cm'); >> >> % load volume conduction model >> load vol2; >> figure; >> % head surface (scalp) >> ft_plot_mesh(vol2.bnd(1), >> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); >> hold on; >> % electrodes >> ft_plot_sens(elec2,'style', 'sk'); >> >> >> mri2 = ft_convert_units(mri2, 'cm'); >> >> nas=mri2.hdr.fiducial.mri.nas; >> lpa=mri2.hdr.fiducial.mri.lpa; >> rpa=mri2.hdr.fiducial.mri.rpa; >> >> transm=mri2.transform; >> >> nas=warp_apply(transm,nas, 'homogenous'); >> lpa=warp_apply(transm,lpa, 'homogenous'); >> rpa=warp_apply(transm,rpa, 'homogenous'); >> >> fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials >> fid.label = {'Nz','LPA','RPA'}; % same labels as in elec >> fid.unit = 'cm'; % same units as mri >> >> % alignment >> cfg = []; >> cfg.method = 'fiducial'; >> cfg.template = fid; % see above >> cfg.elec = elec2; >> cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid >> and in elec >> elec_aligned2 = ft_electroderealign(cfg); >> >> save elec_aligned2 elec_aligned2; >> % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); >> figure; >> ft_plot_sens(elec_aligned2,'style','sk'); >> hold on; >> ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', >> 'facecolor', [0.65 0.65 0.65]); %scalp >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec_aligned2; >> cfg.headshape = vol2.bnd(1); >> elec_aligned2 = ft_electroderealign(cfg); >> >> >> *%%%%% and here I am struggling: I can not get any of the above files to* >> *%%%%% work together: vol or vol2, elec_aligned2, sourcespace etc.* >> >> vol = ft_convert_units(vol, 'cm'); >> elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); >> cfg = []; >> cfg.elec = elec_aligned2; % sensor positions >> cfg.channel = 'all'; % the used channels >> cfg.grid.pos = sourcespace.pnt; % source points >> cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are >> inside of the brain >> cfg.vol = vol; >> cfg.normalize = 'yes';% volume conduction model >> leadfield = ft_prepare_leadfield(cfg); >> >> save leadfield leadfield; >> >> clear all; >> load('GA1.mat') >> load('GA2.mat') >> load leadfield; >> load vol2; >> load elec_aligned2; >> >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned2; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> cfg.mne.normalize = 'yes'; >> sourceCERT0 = ft_sourceanalysis(cfg, GA1); >> sourceCERT3 = ft_sourceanalysis(cfg, GA2); >> >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_Signatur.png Type: image/png Size: 3435 bytes Desc: not available URL: From pgoodin at swin.edu.au Mon Feb 24 10:46:52 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 24 Feb 2014 09:46:52 +0000 Subject: [FieldTrip] Plotting group SD / CI over multiplottER data? Message-ID: Hi Fieldtrippers, As the subject says, is it possible to plot standard deviations / confidence intervals for group timelock data using multiplotter? After grandaveraging the data the var variable is removed, so is there a work around to either getting the timelockgrandaverage function to include a measure of group variance or adding one in? Thanks for any advice / assistance, Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Feb 24 23:01:26 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 24 Feb 2014 17:01:26 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: <8C6ABCDE-8D0A-4769-94A8-87BC7071251F@gmail.com> Hi Arjen, Alik Thanks for stimulating this discussion about second level statistics. I tried as suggested, but it would be great if one of you can detail the steps involved so I can make sure what am doing is indeed correct. It would be great if some more detail is provided on the field trip web page about this. Thanks, Raghavan What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Feb 25 10:32:39 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 25 Feb 2014 10:32:39 +0100 Subject: [FieldTrip] Referencing Message-ID: Dear all, I have 4 electrodes, and I would like to reference my data by subtracting from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. I was wondering if there is an easier way in fieldtrip to perform this calculation, and then to change the data structure with these new channel labels. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.andolina at ucl.ac.uk Tue Feb 25 11:25:02 2014 From: i.andolina at ucl.ac.uk (Ian M. Andolina) Date: Tue, 25 Feb 2014 10:25:02 +0000 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? Message-ID: <530C6F7E.2000702@ucl.ac.uk> Hi, I wanted to use Fieldtrip to recreate the methodology used in a paper by Leopold et al., 2003 — the relevant methods section is the following: /“The LFP signals were resampled to 1 kHz, and then band-pass filtered into seven frequency ranges using a second order, bi-directional, zero-phase Chebyshev type-1 filter. The frequency ranges, as well as their rough mapping onto classically defined electroencephalographic conventions, were the following: δ (1–4 Hz), θ (5–8 Hz), α (9–14 Hz), β (15–30 Hz), γL (30–50 Hz), γH (50–100 Hz), and γVH (100–150 Hz). The resulting band-limited signals were full-wave rectified by taking their absolute value. They were then resampled to 20 Hz after low-pass filtering with an eighth order Chebyshev type-1 filter (cutoff = 8 Hz).”/ My LFP data is sampled at 1kHz, and I manually pad with data either side of the event triggered region of interest. Fieldtrip doesn’t have a |chebyshev type-1| filter, but would a second order two-pass (aka zero phase?) butterworth be good enough considering the frequency bands used? I’m using the following cfg passed to |ft_preprocessing| for the initial bandpass filtering and rectification: |freq ={[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 150]}; for j =1:length(freq) cfg =[]; cfg.padding =0; cfg.bpfilter ='yes'; cfg.bpfilttype ='but'; cfg.bpfreq = freq{j}; cfg.bpfiltdir ='twopass'; cfg.bpfiltord =2; cfg.bpinstabilityfix ='reduce'; cfg.rectify ='yes'; bp{j} = ft_preprocessing(cfg,ft); end | As far as I can see in |ft_preprocessing| rectification occurs after filtering, so this is as specified by Leopold /et al.,/ Then for downsampling/resampling: |cfg =[]; cfg.padding =0; cfg.lpfilter ='yes'; cfg.lpfreq =8; cfg.lpfilttype ='but'; cfg.lpfiltdir ='twopass'; cfg.lpfiltord =8; cfg.lpinstabilityfix ='reduce'; bp{j} = ft_preprocessing(cfg,bp{j}); cfg =[]; cfg.resample ='yes'; cfg.resamplefs =20; cfg.detrend ='no'; bp{j} = ft_resampledata(cfg,bp{j}); | Does this seem a correct translation of this method in Fieldtrip? Are there any caveats other than the filter differences? Thanks, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Tue Feb 25 12:50:57 2014 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Tue, 25 Feb 2014 12:50:57 +0100 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: <530C6F7E.2000702@ucl.ac.uk> References: <530C6F7E.2000702@ucl.ac.uk> Message-ID: Hi Ian, If you want to approximate a chebyshev filter with butterworth, you obviously need a higher order than the actual chebyshev uses. Some simple calculations are involved on your data which basically suggests even to get a 3dB of stopband attenuation for the delta range, you would be needing an order of 3 for a chebyshev-1 type filter. Similarly you will be needing a 4th order butterworth filter. By default, even the filedtrip uses 4th order for butterworth filter. So I would suggest you to use a 4th order butterworth filter to approximate the chebyshev filter you mentioned here. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Tue, Feb 25, 2014 at 11:25 AM, Ian M. Andolina wrote: > Hi, I wanted to use Fieldtrip to recreate the methodology used in a > paper by Leopold et al., 2003 — the relevant methods section is the following: > > *“The LFP signals were resampled to 1 kHz, and then band-pass filtered > into seven frequency ranges using a second order, bi-directional, > zero-phase Chebyshev type-1 filter. The frequency ranges, as well as their > rough mapping onto classically defined electroencephalographic conventions, > were the following: δ (1–4 Hz), θ (5–8 Hz), α (9–14 Hz), β (15–30 Hz), γL > (30–50 Hz), γH (50–100 Hz), and γVH (100–150 Hz). The resulting > band-limited signals were full-wave rectified by taking their absolute > value. They were then resampled to 20 Hz after low-pass filtering with an > eighth order Chebyshev type-1 filter (cutoff = 8 Hz).”* > > My LFP data is sampled at 1kHz, and I manually pad with data either side > of the event triggered region of interest. Fieldtrip doesn’t have a chebyshev > type-1 filter, but would a second order two-pass (aka zero phase?) > butterworth be good enough considering the frequency bands used? I’m using > the following cfg passed to ft_preprocessing for the initial bandpass > filtering and rectification: > > freq = {[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 150]};for j = 1:length(freq) > cfg = []; > cfg.padding = 0; > cfg.bpfilter = 'yes'; > cfg.bpfilttype = 'but'; > cfg.bpfreq = freq{j}; > cfg.bpfiltdir = 'twopass'; > cfg.bpfiltord = 2; > cfg.bpinstabilityfix = 'reduce'; > cfg.rectify = 'yes'; > bp{j} = ft_preprocessing(cfg,ft);end > > As far as I can see in ft_preprocessing rectification occurs after > filtering, so this is as specified by Leopold *et al.,* > > Then for downsampling/resampling: > > cfg = [];cfg.padding = 0;cfg.lpfilter = 'yes';cfg.lpfreq = 8;cfg.lpfilttype = 'but';cfg.lpfiltdir = 'twopass';cfg.lpfiltord = 8;cfg.lpinstabilityfix = 'reduce'; > bp{j} = ft_preprocessing(cfg,bp{j}); > cfg = [];cfg.resample = 'yes';cfg.resamplefs = 20;cfg.detrend = 'no'; > bp{j} = ft_resampledata(cfg,bp{j}); > > Does this seem a correct translation of this method in Fieldtrip? Are > there any caveats other than the filter differences? > > Thanks, Ian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From conrado.bosman at gmail.com Tue Feb 25 13:47:24 2014 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Tue, 25 Feb 2014 13:47:24 +0100 Subject: [FieldTrip] Referencing In-Reply-To: References: Message-ID: <4B4052A2-BD50-4CE6-BBB5-D2846C86BD77@gmail.com> Dear Hweeling, There is indeed an easy way to re-referencing electrodes using local derivation in Fieldtrip. You need to create an structure call montage, that in your case should be: montage = [] montage.labelorg = {'E1' 'E2' 'E3' 'E4'} montage.labelnew = {'E2-E1' E3-E2' 'E4-E3'} montage.tra = [1 -1 0 0;0 -1 1 0;0 0 -1 1]; then... cfg = []; cfg.reref = 'yes' cfg.montage = montage; dat = ft_preprocessing(cfg,dat) % dat is your original data structure containing your original channels Hope it works! Best, Conrado On 25 Feb 2014, at 10:32, Hwee Ling Lee wrote: > Dear all, > > I have 4 electrodes, and I would like to reference my data by subtracting from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. > > I was wondering if there is an easier way in fieldtrip to perform this calculation, and then to change the data structure with these new channel labels. > > Thanks. > > Cheers, > Hweeling > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From pierre.megevand at gmail.com Tue Feb 25 17:14:42 2014 From: pierre.megevand at gmail.com (=?ISO-8859-1?Q?Pierre_M=E9gevand?=) Date: Tue, 25 Feb 2014 11:14:42 -0500 Subject: [FieldTrip] Referencing (Hwee Ling Lee) Message-ID: Dear Hweeling, ft_apply_montage is the function that you are looking for. http://fieldtrip.fcdonders.nl/reference/ft_apply_montage The documentation for that function shows exactly what you want to do. Pierre -- Pierre Mégevand, MD, PhD Post-doctoral research fellow Laboratory for Multimodal Human Brain Mapping Feinstein Institute for Medical Research Manhasset, NY, USA On Tue, Feb 25, 2014 at 6:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Referencing (Hwee Ling Lee) > 2. Band Limited Power Analysis in Fieldtrip? (Ian M. Andolina) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 25 Feb 2014 10:32:39 +0100 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Referencing > Message-ID: > BkryfFvXKuLR2SNpdTxsjWN_rQcAKEA at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I have 4 electrodes, and I would like to reference my data by subtracting > from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. > > I was wondering if there is an easier way in fieldtrip to perform this > calculation, and then to change the data structure with these new channel > labels. > > Thanks. > > Cheers, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140225/78be03db/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Tue, 25 Feb 2014 10:25:02 +0000 > From: "Ian M. Andolina" > To: > Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? > Message-ID: <530C6F7E.2000702 at ucl.ac.uk> > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi, I wanted to use Fieldtrip to recreate the methodology used in a > paper by Leopold et al., 2003 > ? the relevant methods > section is the following: > > /?The LFP signals were resampled to 1 kHz, and then band-pass filtered > into seven frequency ranges using a second order, bi-directional, > zero-phase Chebyshev type-1 filter. The frequency ranges, as well as > their rough mapping onto classically defined electroencephalographic > conventions, were the following: ? (1?4 Hz), ? (5?8 Hz), ? (9?14 Hz), ? > (15?30 Hz), ?L (30?50 Hz), ?H (50?100 Hz), and ?VH (100?150 Hz). The > resulting band-limited signals were full-wave rectified by taking their > absolute value. They were then resampled to 20 Hz after low-pass > filtering with an eighth order Chebyshev type-1 filter (cutoff = 8 Hz).?/ > > My LFP data is sampled at 1kHz, and I manually pad with data either side > of the event triggered region of interest. Fieldtrip doesn?t have a > |chebyshev type-1| filter, but would a second order two-pass (aka zero > phase?) butterworth be good enough considering the frequency bands used? > I?m using the following cfg passed to |ft_preprocessing| for the initial > bandpass filtering and rectification: > > |freq ={[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 > 150]}; > for j =1:length(freq) > cfg =[]; > cfg.padding =0; > cfg.bpfilter ='yes'; > cfg.bpfilttype ='but'; > cfg.bpfreq = freq{j}; > cfg.bpfiltdir ='twopass'; > cfg.bpfiltord =2; > cfg.bpinstabilityfix ='reduce'; > cfg.rectify ='yes'; > bp{j} = ft_preprocessing(cfg,ft); > end > | > > As far as I can see in |ft_preprocessing| rectification occurs after > filtering, so this is as specified by Leopold /et al.,/ > > Then for downsampling/resampling: > > |cfg =[]; > cfg.padding =0; > cfg.lpfilter ='yes'; > cfg.lpfreq =8; > cfg.lpfilttype ='but'; > cfg.lpfiltdir ='twopass'; > cfg.lpfiltord =8; > cfg.lpinstabilityfix ='reduce'; > bp{j} = ft_preprocessing(cfg,bp{j}); > cfg =[]; > cfg.resample ='yes'; > cfg.resamplefs =20; > cfg.detrend ='no'; > bp{j} = ft_resampledata(cfg,bp{j}); > | > > Does this seem a correct translation of this method in Fieldtrip? Are > there any caveats other than the filter differences? > > Thanks, Ian > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140225/a73da687/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 39, Issue 44 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Tue Feb 25 17:55:16 2014 From: michielb at tcd.ie (Bart Michiels) Date: Tue, 25 Feb 2014 16:55:16 +0000 Subject: [FieldTrip] non parametric statistics on connectivity data Message-ID: Hi all, I have two resting state coherence dataset (patient and control) both with the dimensions frequency x chan x chan and would like to do some non-parametric stats. Knowing that channel level analysis isn't the best idea to assess connectivity, which fieldtrip sub-function could I use to make some statistical inference about connectivity difference between patients and controls? I know that all statistical tools can be used for data dimensions: frequency x chan, but not the freq x chan x chan I was thinking of ft_statfun_indepsamplesZcoh but am not sure this is the right one. Thank you ! Best, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Feb 25 18:10:02 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 25 Feb 2014 18:10:02 +0100 Subject: [FieldTrip] non parametric statistics on connectivity data In-Reply-To: References: Message-ID: Dear Bart, one way to plug freq x chan x chan data into the statistics functions requiring freq x chan is to restructure your data to channel combinations, in a way that you end up with chan times chan elements in a freq x chan matrix. Of course you'll have to create new labels for your new channels. Hope this helps, if you need more specific advise, let me know. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 25.02.2014 um 17:55 schrieb Bart Michiels: > Hi all, > > I have two resting state coherence dataset (patient and control) both with the dimensions frequency x chan x chan and would like to do some non-parametric stats. > Knowing that channel level analysis isn't the best idea to assess connectivity, which fieldtrip sub-function could I use to make some statistical inference about connectivity difference between patients and controls? > > I know that all statistical tools can be used for data dimensions: frequency x chan, but not the freq x chan x chan > I was thinking of ft_statfun_indepsamplesZcoh but am not sure this is the right one. > > Thank you ! > Best, Bart > _______________________________________________ > 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 gopalar.ccf at gmail.com Tue Feb 25 23:01:17 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 25 Feb 2014 17:01:17 -0500 Subject: [FieldTrip] regressconfound and statistics Message-ID: <3F209DE8-FE47-49BE-9FA7-9AEE1477E37B@gmail.com> Arjen et al, I have the following output data from regressconfound pertaining to one block of data. hpicompfiltdata = avg: [306x1500 double] var: [306x1500 double] time: [1x1500 double] dof: [306x1500 double] label: {306x1 cell} trial: [59x306x1500 double] dimord: 'rpt_chan_time' trialinfo: [59x1 double] cfg: [1x1 struct] beta: [37x306x1500 double] Since I have 4 blocks for each subject, I appended them using ft_appenddata, and using ft_timelockanalysis (mentioning appropriate cfg.trial and cfg.keeptrials=‘yes’;) I split the data into 2 conditions timelock_cond1 (shown below) and timelock_cond2, retaining only 204 gradiometers ( i suppose I am not supposed to use ft_combineplanar at this level since it would distort the results). timelock_cond1 = avg: [204x1500 double] var: [204x1500 double] time: [1x1500 double] dof: [204x1500 double] label: {204x1 cell} trial: [143x204x1500 double] dimord: 'rpt_chan_time' trialinfo: [143x1 double] cfg: [1x1 struct] Then these are the steps I did, per your suggestion. 1. I gathered all the time lock (from above step) for all subjects in a cell matrix, timelock_cond1{:} and timelock_cond2{:} 3. Then I ran first level stats for each subject, with cfg.statistic= indepsamplesT and cfg.method=‘analytic’; cfg.design as you suggested, and rest of cfg. for sj = 1: size(subj,2) stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); end 4. Then, I did timelockgrandaverage cfg.keepindividual = 'yes'; cfg.parameter = 'stat'; stat2=ft_timelockgrandaverage(cfg,stat1{:}); 5. Created a dummy variable just like stat2 in the above step and replaced the field ‘individual’ with zeros dummy2=stat2; dummy2.individual=zeros(size(stat2.individual)); 6. Finally, ran the second level stats, with cfg. statistic = ‘depsamplesT’; cfg.method=‘montecarlo’; and rest of cfg. stat = ft_timelockstatistics(cfg, stat2, dummy2); However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn’t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong. Thanks, Raghavan What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Feb 26 09:20:05 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 26 Feb 2014 09:20:05 +0100 (CET) Subject: [FieldTrip] regressconfound and statistics In-Reply-To: <3F209DE8-FE47-49BE-9FA7-9AEE1477E37B@gmail.com> Message-ID: <1312202281.5535647.1393402805973.JavaMail.root@sculptor.zimbra.ru.nl> Hi Raghavan, Could you provide some more details on what statistical comparisons you are trying to make? It seems you have 4 blocks of recordings, each encompassing 2 task conditions, which you want to compare in terms of evoked/induced activity. If this is correct, you could 1) append data of the 4 blocks (subject-level) 2) regress out contributions from head movement using ft_regressconfound (subject-level) 3) split the trials into the 2 task conditions (subject-level) 4) compute t-scores using an independent samples t-test (subject-level) 5) non-parametric testing of effects using a dummy variable with zeros (group-level) From your descriptions, I got the impression you might have reversed the order of step 1 and 2. "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn’t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong." It's hard to tell from this information what might have caused this difference. For instance, the incorrect order of the steps above, or differences in neural processes you may be capturing through using a mean vs. a t-score, or maybe even head positions that are positively correlated with your effects, possibly because they're driving them (e.g. differential distances to the MEG sensors between the task conditions may cause the amplitude of the same ERP be more pronounced in one condition than another). I'd recommend looking into the (average) head positions of the different blocks/conditions, and see what is going on there (e.g. http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis? ). Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Dinsdag 25 februari 2014 23:01:17 > Onderwerp: Re: [FieldTrip] regressconfound and statistics > Arjen et al, > I have the following output data from regressconfound pertaining to > one block of data. > hpicompfiltdata = > avg: [306x1500 double] > var: [306x1500 double] > time: [1x1500 double] > dof: [306x1500 double] > label: {306x1 cell} > trial: [59x306x1500 double] > dimord: 'rpt_chan_time' > trialinfo: [59x1 double] > cfg: [1x1 struct] > beta: [37x306x1500 double] > Since I have 4 blocks for each subject, I appended them using > ft_appenddata, and using ft_timelockanalysis (mentioning appropriate > cfg.trial and cfg.keeptrials=‘yes’; ) I split the data into 2 > conditions timelock_cond1 (shown below) and timelock_cond2, retaining > only 204 gradiometers ( i suppose I am not supposed to use > ft_combineplanar at this level since it would distort the results). > timelock_cond1 = > avg: [204x1500 double] > var: [204x1500 double] > time: [1x1500 double] > dof: [204x1500 double] > label: {204x1 cell} > trial: [143x204x1500 double] > dimord: 'rpt_chan_time' > trialinfo: [143x1 double] > cfg: [1x1 struct] > Then these are the steps I did, per your suggestion. > 1. I gathered all the time lock (from above step) for all subjects in > a cell matrix, timelock_cond1{:} and timelock_cond2{:} > 3. Then I ran first level stats for each subject, with cfg.statistic= > indepsamplesT and cfg.method=‘analytic’; cfg.design as you suggested, > and rest of cfg. > for sj = 1: size(subj,2) > stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); > end > 4. Then, I did timelockgrandaverage > cfg.keepindividual = 'yes'; > cfg.parameter = 'stat'; > stat2=ft_timelockgrandaverage(cfg,stat1{:}); > 5. Created a dummy variable just like stat2 in the above step and > replaced the field ‘individual’ with zeros > dummy2=stat2; > dummy2.individual=zeros(size(stat2.individual)); > 6. Finally, ran the second level stats, with cfg. statistic = > ‘depsamplesT’; cfg.method=‘montecarlo’; and rest of cfg. > stat = ft_timelockstatistics(cfg, stat2, dummy2); > However, the problem is, whatever significance I found earlier (i.e. > by comparing means rather than t-statistic) doesn’t test significant > now. I thought it might get better by doing this, but seems to get > worse. Please correct me if I am doing anything wrong. > Thanks, > Raghavan > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, > still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of > that > within-subjects descriptive/difference. > >> Ok. That's indeed the procedure I tried to outline. In your earlier > >> reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance > having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I > misunderstood > your suggestion? > >> I might have not been clear there then. I was meant to say that one > >> could use ft_regressconfound on trials of two (or more) conditions > >> combined > of a single subject, prior to calculating the single subject > t-descriptive > (using ft_xxxstatistics). This allows one to compute a 'cleaner' > t-score, > or at least provide a good case that head movement did not > differentially > influence activity levels in the separate conditions. It was not > related to > pooling trials between subjects. > 2014-02-21 16:14 GMT+01:00 Alik Widge < alik.widge at gmail.com >: > > I don't *think* I'm asking about how to do second-order analysis, > > unless I > have missed something important. I did read the link/FAQ > > when I was working > on this last week, and that seems different > > than the question I am asking. > > What you described in your reply > > to me just now, calling > ft_timelockstatistics at the subject level > > to calculate descriptives, still > effectively reduces each subject > > to one "datapoint" -- the difference > between conditions of the > > selected t-descriptive for that subject. I > believe I understand > > how to do that, and how to then do nonparametric > shuffle testing > > at the between-subjects level for the signfiicance of that > > > within-subjects descriptive/difference. > > In your earlier reply to > > Raghavan, it sounded like you were suggesting > pooling the trials > > themselves between subjects (that is, all subjects' > trials go into > > one big "bucket"), with the trial-to-trial variance having > been > > removed via ft_regressconfound, *then* calling the ft_statistics > > > functions on this single large "bucket" of trials. Have I > > misunderstood > your suggestion? > > Alik > > Alik Widge > > > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, > > 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > > > wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to > > create subject-level >> t-descriptives, mentioned in the previous > > post? A quick answer would be to >> perform an indepedent t-test ( > > cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics > > (although you're not really 'testing' here, but only >> interested > > in that t-descriptive), in which trials are the unit of >> > > observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> > > ntrls_conditionB)]; ). Note that since an indepedent t-test tests > > for >> differences of the means of two conditions, it won't fail on > > unequal number >> of observations across the conditions (unlike a > > dependent/paired t-test). >> >> Hope this gets you kickstarted for > > the moment. I found a previous >> mail-conversation that goes more > > into detail, providing more overview of >> the steps involved: >> > > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html > > >> More useful documentation: >> >> > > http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level > > >> >> Yours, >> Arjen >> >> ------------------------------ >> >> > > *Van: *"Alik Widge" < alik.widge at gmail.com > >> *Aan: *"FieldTrip > > discussion list" < fieldtrip at science.ru.nl > >> *Verzonden: > > *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: > > [FieldTrip] regressconfound and frequency domain >> >> Arjen, what > > you just described is more or less what I struggled to do >> last > > week and ultimately gave up as I was unable to figure out how to get > > >> FT to do it despite much meditation over tutorials and source > > files. Can >> you elaborate a bit more on what you are saying below > > -- not the >> ft_regressconfound bit, but the bit about how to get > > >> ft_statistics_montecarlo and its wrappers to do a trials-level > > analysis and >> permutation at the whole-group level? Especially, > > what does one put in >> cfg.design and how does one call the > > function? Everything I could find in >> the tutorials described the > > case of doing means at the subject level and >> then permutation of > > means at the group level, which as you point out is >> underpowered > > for subtle effects. >> >> My particular situation was > > timelock-analyzed trials (with >> keeptrials='yes'), but I could not > > find a way to set up cfg.design that >> did not throw error > > messages. The thing that really seemed to bother it was >> that > > there were different numbers of trials in the 2-3 conditions of >> > > interest, since some had to be removed for excessive artifact. >> >> > > Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at > > gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 > > AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl > wrote: >> > > >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject > > level freq data, you'll need to >>> use ft_freqstatistics. Have a > > look here for instance: >>> > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> > > >>> At the subject level, you do not need (non-parametric) cluster > > >>> permutation testing (Maris & Oostenveld), as you're taking each > > subject's >>> t-descriptives to the group level. At the group level, > > you can then test >>> the hypothesis that there's a difference > > between tasks/conditions (H1) vs. >>> no difference (H0). In order > > to do so, you'll need to create a dummy >>> variable at the group > > level, that has the same number of 'subjects', but >>> with zeros in > > all fields (in your case this will be a .stat field). At the >>> > > group level, you thus call ft_freqstatistics again. This approach > > has the >>> advantage that you're more sensitive (as compared to > > taking each subject's >>> mean to the group level) to effects that > > are small but consistent over >>> trials in each subject. >>> >>> > > Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: > > *"Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *Aan: * > > fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari > > 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound > > and frequency domain >>> >>> Thanks Arjen, >>> Should I use > > ft_freqdescriptives to compute t descriptives for >>> individual > > subjects, and then take that to group level instead of mean? If >>> > > not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> > > >>> Hi Raghavan, ft_regressconfound run on timelock data seems to > > return output with avg field. However, ft_regressconfound run on > > frequency data, does not return average. I see the avg field being > > removed. Is there a reason? >> Not intentionally, but not an issue > > either. You could still use ft_freqdescriptives to compute the > > average for you, but see my comment below. Question - Since > > ft_regressconfound outputs power spectrum of individual trials - 4D > > matrix (instead of average), can I simply re-average the power > > spectrum over trials to see the average power for that subject. > > Also, I need to run grand average (over subjects) before running > > statistics. I hope these steps does not distort the data. Please > > advise. >> Remember that the mean over trials is not affected by > > your clean-up of trial-by-trial variance due to head movement. > > Taking each subject's mean (unaffected) to the group level is an > > approach that will not benefit from your clean-up. In order to > > benefit from reduced trial-by-trial variance, you'll need a measure > > that depends on it, e.g. t-descriptive, neural activity-behavior > > correlation (for taking to the group level). Hope this helps, Arjen > > ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan > > Gopalakrishnan" > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> *>* > > Aan: fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: > > Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, > > >>> *>* Thanks, I reduced down the time resolution so computation > > can go >>> *>* faster. Now, m y matrix looks like this >>> *>* > > hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: > > 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: > > [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: > > [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 > > double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on > > timelock data seems to return output with >>> *>* avg field. > > However, ft_regressconfound run on frequency data, does not >>> *>* > > return average. I see the avg field being removed. Is there a > > reason? >>> *>* Question - Since ft_regressconfound outputs power > > spectrum of >>> *>* individual trials - 4D matrix (instead of > > average), can I simply >>> *>* re-average the power spectrum over > > trials to see the average power for >>> *>* that subject. Also, I > > need to run grand average (over subjects) before >>> *>* running > > statistics. I hope these steps does not distort the data. >>> *>* > > Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, > > 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < > > a.stolk at fcdonders.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > To: FieldTrip discussion list < fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > Subject: Re: [FieldTrip] regressconfound and frequency domain >>> > > *>* Message-ID: >>> *>* < > > 2108167665.5423215.1392847118322.JavaMail.root at > > sculptor.zimbra.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear > > Raghavan, Good to hear it's working out for you. A short answer >>> > > *>* would be 'no'. Reducing the size of your data matrix is likely > > going >>> *>* to speed up computations. Your time resolution seems > > pretty high (1500 >>> *>* frequency estimations per single trial); > > do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk > > bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf > > at gmail.com < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > > Aan: fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: > > [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, > > >>> *>* > Thanks for answering all my previous questions. I was > > successfully >>> *>* > able to incorporate head movements to my erf > > data. As I understand I >>> *>* > have to do this separately for the > > time frequency data after keeping >>> *>* > individual trials. I am > > interested in both beta and gamma bands >>> *>* > [15:1:70]. my time > > frequency looks like this using wavelets, >>> *>* > timefreq = >>> > > *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> > > *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > > > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > > > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: > > [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After > > regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 > > cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 > > double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D > > double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 > > struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D > > double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since > > its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks > > of data for 20 subjects. It >>> *>* > will take an enoumous amount > > of time to process the data through >>> *>* > regressconfound. Is > > there a workaround to make the processing faster >>> *>* > or am I > > missing something. Any help would be of great help. >>> *>* > > > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> > > _______________________________________________ >>> fieldtrip > > mailing list >>> fieldtrip at donders.ru.nl >>> > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> > > >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour > > >>> Centre for Cognitive Neuroimaging >>> Radboud University > > Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: > > +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> > > _______________________________________________ >>> 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 >> >> >> >> > > >> -- >> Donders Institute for Brain, Cognition and Behaviour >> > > Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> > > >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: > > www.arjenstolk.nl >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.andolina at ucl.ac.uk Wed Feb 26 14:43:15 2014 From: i.andolina at ucl.ac.uk (Ian M. Andolina) Date: Wed, 26 Feb 2014 13:43:15 +0000 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: References: Message-ID: <530DEF73.3030605@ucl.ac.uk> On 25/02/2014 11:51, fieldtrip-request at science.ru.nl wrote: > Re: [FieldTrip] Band Limited Power Analysis in Fieldtrip? Thanks Chaitanya, I get instability for the 1-4Hz band using a 4th order butterworth, but it seems to work for the higher bands (using cfg.bpinstabilityfix = 'reduce' to fix it only for the bands that need it). Does anyone know if integrating a chebyshev type-1 filter into fieldtrip preprocessing has been attempted, it is present in the signal processing toolbox and I could do this manually but I'd rather use existing code if possible... Thanks again, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Wed Feb 26 17:38:23 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 26 Feb 2014 11:38:23 -0500 Subject: [FieldTrip] regressconfound and statistics In-Reply-To: References: Message-ID: Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.” I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Another question, is it ok to apply combineplanar to regressconfounded data? Thanks for your support. Raghavan > > > Date: Wed, 26 Feb 2014 09:20:05 +0100 (CET) > From: "Stolk, A. (Arjen)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] regressconfound and statistics > Message-ID: > <1312202281.5535647.1393402805973.JavaMail.root at sculptor.zimbra.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Raghavan, Could you provide some more details on what statistical comparisons you are trying to make? It seems you have 4 blocks of recordings, each encompassing 2 task conditions, which you want to compare in terms of evoked/induced activity. If this is correct, you could 1) append data of the 4 blocks (subject-level) 2) regress out contributions from head movement using ft_regressconfound (subject-level) 3) split the trials into the 2 task conditions (subject-level) 4) compute t-scores using an independent samples t-test (subject-level) 5) non-parametric testing of effects using a dummy variable with zeros (group-level) From your descriptions, I got the impression you might have reversed the order of step 1 and 2. "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong." It's hard to tell from this information what might have caused this difference. For instance, the incorrect order of the steps above, or differences in neural processes you may be capturing through using a mean vs. a t-score, or maybe even head positions that are positively correlated with your effects, possibly because they're driving them (e.g. differential distances to the MEG sensors between the task conditions may cause the amplitude of the same ERP be more pronounced in one condition than another). I'd recommend looking into the (average) head positions of the different blocks/conditions, and see what is going on there (e.g. http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis? ). Arjen ----- Oorspronkelijk bericht ----- >> Van: "Raghavan Gopalakrishnan" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Dinsdag 25 februari 2014 23:01:17 >> Onderwerp: Re: [FieldTrip] regressconfound and statistics >> Arjen et al, >> I have the following output data from regressconfound pertaining to >> one block of data. >> hpicompfiltdata = >> avg: [306x1500 double] >> var: [306x1500 double] >> time: [1x1500 double] >> dof: [306x1500 double] >> label: {306x1 cell} >> trial: [59x306x1500 double] >> dimord: 'rpt_chan_time' >> trialinfo: [59x1 double] >> cfg: [1x1 struct] >> beta: [37x306x1500 double] >> Since I have 4 blocks for each subject, I appended them using >> ft_appenddata, and using ft_timelockanalysis (mentioning appropriate >> cfg.trial and cfg.keeptrials=?yes?; ) I split the data into 2 >> conditions timelock_cond1 (shown below) and timelock_cond2, retaining >> only 204 gradiometers ( i suppose I am not supposed to use >> ft_combineplanar at this level since it would distort the results). >> timelock_cond1 = >> avg: [204x1500 double] >> var: [204x1500 double] >> time: [1x1500 double] >> dof: [204x1500 double] >> label: {204x1 cell} >> trial: [143x204x1500 double] >> dimord: 'rpt_chan_time' >> trialinfo: [143x1 double] >> cfg: [1x1 struct] >> Then these are the steps I did, per your suggestion. >> 1. I gathered all the time lock (from above step) for all subjects in >> a cell matrix, timelock_cond1{:} and timelock_cond2{:} >> 3. Then I ran first level stats for each subject, with cfg.statistic= >> indepsamplesT and cfg.method=?analytic?; cfg.design as you suggested, >> and rest of cfg. >> for sj = 1: size(subj,2) >> stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); >> end >> 4. Then, I did timelockgrandaverage >> cfg.keepindividual = 'yes'; >> cfg.parameter = 'stat'; >> stat2=ft_timelockgrandaverage(cfg,stat1{:}); >> 5. Created a dummy variable just like stat2 in the above step and >> replaced the field ?individual? with zeros >> dummy2=stat2; >> dummy2.individual=zeros(size(stat2.individual)); >> 6. Finally, ran the second level stats, with cfg. statistic = >> ?depsamplesT?; cfg.method=?montecarlo?; and rest of cfg. >> stat = ft_timelockstatistics(cfg, stat2, dummy2); >> However, the problem is, whatever significance I found earlier (i.e. >> by comparing means rather than t-statistic) doesn?t test significant >> now. I thought it might get better by doing this, but seems to get >> worse. Please correct me if I am doing anything wrong. >> Thanks, >> Raghavan >> What you described in your reply to me just now, calling >> ft_timelockstatistics at the subject level to calculate descriptives, >> still >> effectively reduces each subject to one "datapoint" -- the difference >> between conditions of the selected t-descriptive for that subject. I >> believe I understand how to do that, and how to then do nonparametric >> shuffle testing at the between-subjects level for the signfiicance of >> that >> within-subjects descriptive/difference. >>>> Ok. That's indeed the procedure I tried to outline. In your earlier >>>> reply to Raghavan, it sounded like you were suggesting >> pooling the trials themselves between subjects (that is, all subjects' >> trials go into one big "bucket"), with the trial-to-trial variance >> having >> been removed via ft_regressconfound, *then* calling the ft_statistics >> functions on this single large "bucket" of trials. Have I >> misunderstood >> your suggestion? >>>> I might have not been clear there then. I was meant to say that one >>>> could use ft_regressconfound on trials of two (or more) conditions >>>> combined >> of a single subject, prior to calculating the single subject >> t-descriptive >> (using ft_xxxstatistics). This allows one to compute a 'cleaner' >> t-score, >> or at least provide a good case that head movement did not >> differentially >> influence activity levels in the separate conditions. It was not >> related to >> pooling trials between subjects. >> 2014-02-21 16:14 GMT+01:00 Alik Widge < alik.widge at gmail.com >: >>> I don't *think* I'm asking about how to do second-order analysis, >>> unless I > have missed something important. I did read the link/FAQ >>> when I was working > on this last week, and that seems different >>> than the question I am asking. > > What you described in your reply >>> to me just now, calling > ft_timelockstatistics at the subject level >>> to calculate descriptives, still > effectively reduces each subject >>> to one "datapoint" -- the difference > between conditions of the >>> selected t-descriptive for that subject. I > believe I understand >>> how to do that, and how to then do nonparametric > shuffle testing >>> at the between-subjects level for the signfiicance of that > >>> within-subjects descriptive/difference. > > In your earlier reply to >>> Raghavan, it sounded like you were suggesting > pooling the trials >>> themselves between subjects (that is, all subjects' > trials go into >>> one big "bucket"), with the trial-to-trial variance having > been >>> removed via ft_regressconfound, *then* calling the ft_statistics > >>> functions on this single large "bucket" of trials. Have I >>> misunderstood > your suggestion? > > Alik > > Alik Widge > >>> alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, >>> 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > >>> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to >>> create subject-level >> t-descriptives, mentioned in the previous >>> post? A quick answer would be to >> perform an indepedent t-test ( >>> cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics >>> (although you're not really 'testing' here, but only >> interested >>> in that t-descriptive), in which trials are the unit of >> >>> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> >>> ntrls_conditionB)]; ). Note that since an indepedent t-test tests >>> for >> differences of the means of two conditions, it won't fail on >>> unequal number >> of observations across the conditions (unlike a >>> dependent/paired t-test). >> >> Hope this gets you kickstarted for >>> the moment. I found a previous >> mail-conversation that goes more >>> into detail, providing more overview of >> the steps involved: >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >>>>> More useful documentation: >> >> >>> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >>>>>>> Yours, >> Arjen >> >> ------------------------------ >> >> >>> *Van: *"Alik Widge" < alik.widge at gmail.com > >> *Aan: *"FieldTrip >>> discussion list" < fieldtrip at science.ru.nl > >> *Verzonden: >>> *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: >>> [FieldTrip] regressconfound and frequency domain >> >> Arjen, what >>> you just described is more or less what I struggled to do >> last >>> week and ultimately gave up as I was unable to figure out how to get >>>>> FT to do it despite much meditation over tutorials and source >>> files. Can >> you elaborate a bit more on what you are saying below >>> -- not the >> ft_regressconfound bit, but the bit about how to get >>>>> ft_statistics_montecarlo and its wrappers to do a trials-level >>> analysis and >> permutation at the whole-group level? Especially, >>> what does one put in >> cfg.design and how does one call the >>> function? Everything I could find in >> the tutorials described the >>> case of doing means at the subject level and >> then permutation of >>> means at the group level, which as you point out is >> underpowered >>> for subtle effects. >> >> My particular situation was >>> timelock-analyzed trials (with >> keeptrials='yes'), but I could not >>> find a way to set up cfg.design that >> did not throw error >>> messages. The thing that really seemed to bother it was >> that >>> there were different numbers of trials in the 2-3 conditions of >> >>> interest, since some had to be removed for excessive artifact. >> >> >>> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at >>> gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 >>> AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl > wrote: >> >>>>>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject >>> level freq data, you'll need to >>> use ft_freqstatistics. Have a >>> look here for instance: >>> >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>>>>> At the subject level, you do not need (non-parametric) cluster >>>>>> permutation testing (Maris & Oostenveld), as you're taking each >>> subject's >>> t-descriptives to the group level. At the group level, >>> you can then test >>> the hypothesis that there's a difference >>> between tasks/conditions (H1) vs. >>> no difference (H0). In order >>> to do so, you'll need to create a dummy >>> variable at the group >>> level, that has the same number of 'subjects', but >>> with zeros in >>> all fields (in your case this will be a .stat field). At the >>> >>> group level, you thus call ft_freqstatistics again. This approach >>> has the >>> advantage that you're more sensitive (as compared to >>> taking each subject's >>> mean to the group level) to effects that >>> are small but consistent over >>> trials in each subject. >>> >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: >>> *"Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *Aan: * >>> fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari >>> 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound >>> and frequency domain >>> >>> Thanks Arjen, >>> Should I use >>> ft_freqdescriptives to compute t descriptives for >>> individual >>> subjects, and then take that to group level instead of mean? If >>> >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>>>>> Hi Raghavan, ft_regressconfound run on timelock data seems to >>> return output with avg field. However, ft_regressconfound run on >>> frequency data, does not return average. I see the avg field being >>> removed. Is there a reason? >> Not intentionally, but not an issue >>> either. You could still use ft_freqdescriptives to compute the >>> average for you, but see my comment below. Question - Since >>> ft_regressconfound outputs power spectrum of individual trials - 4D >>> matrix (instead of average), can I simply re-average the power >>> spectrum over trials to see the average power for that subject. >>> Also, I need to run grand average (over subjects) before running >>> statistics. I hope these steps does not distort the data. Please >>> advise. >> Remember that the mean over trials is not affected by >>> your clean-up of trial-by-trial variance due to head movement. >>> Taking each subject's mean (unaffected) to the group level is an >>> approach that will not benefit from your clean-up. In order to >>> benefit from reduced trial-by-trial variance, you'll need a measure >>> that depends on it, e.g. t-descriptive, neural activity-behavior >>> correlation (for taking to the group level). Hope this helps, Arjen >>> ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan >>> Gopalakrishnan" >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> *>* >>> Aan: fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* >>> Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: >>> Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>>>>> *>* Thanks, I reduced down the time resolution so computation >>> can go >>> *>* faster. Now, m y matrix looks like this >>> *>* >>> hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: >>> 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: >>> [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: >>> [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 >>> double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on >>> timelock data seems to return output with >>> *>* avg field. >>> However, ft_regressconfound run on frequency data, does not >>> *>* >>> return average. I see the avg field being removed. Is there a >>> reason? >>> *>* Question - Since ft_regressconfound outputs power >>> spectrum of >>> *>* individual trials - 4D matrix (instead of >>> average), can I simply >>> *>* re-average the power spectrum over >>> trials to see the average power for >>> *>* that subject. Also, I >>> need to run grand average (over subjects) before >>> *>* running >>> statistics. I hope these steps does not distort the data. >>> *>* >>> Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, >>> 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < >>> a.stolk at fcdonders.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>> To: FieldTrip discussion list < fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>> Subject: Re: [FieldTrip] regressconfound and frequency domain >>> >>> *>* Message-ID: >>> *>* < >>> 2108167665.5423215.1392847118322.JavaMail.root at >>> sculptor.zimbra.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > >>>>>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear >>> Raghavan, Good to hear it's working out for you. A short answer >>> >>> *>* would be 'no'. Reducing the size of your data matrix is likely >>> going >>> *>* to speed up computations. Your time resolution seems >>> pretty high (1500 >>> *>* frequency estimations per single trial); >>> do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk >>> bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf >>> at gmail.com < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>>> Aan: fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > >>> Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: >>> [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>>>>> *>* > Thanks for answering all my previous questions. I was >>> successfully >>> *>* > able to incorporate head movements to my erf >>> data. As I understand I >>> *>* > have to do this separately for the >>> time frequency data after keeping >>> *>* > individual trials. I am >>> interested in both beta and gamma bands >>> *>* > [15:1:70]. my time >>> frequency looks like this using wavelets, >>> *>* > timefreq = >>> >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > >>> powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* >>>> grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: >>> [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After >>> regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 >>> cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 >>> double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D >>> double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 >>> struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D >>> double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since >>> its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks >>> of data for 20 subjects. It >>> *>* > will take an enoumous amount >>> of time to process the data through >>> *>* > regressconfound. Is >>> there a workaround to make the processing faster >>> *>* > or am I >>> missing something. Any help would be of great help. >>> *>* > >>> Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip >>> mailing list >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>>>>>>>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>> Radboud University >>> Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: >>> +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> >>> _______________________________________________ >>> 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 >> >> >> >> >>>>> -- >> Donders Institute for Brain, Cognition and Behaviour >> >>> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >>>>> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: >>> www.arjenstolk.nl >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 39, Issue 48 > ***************************************** From v.piai.research at gmail.com Wed Feb 26 19:03:55 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 26 Feb 2014 19:03:55 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' Message-ID: <530E2C8B.6070004@gmail.com> Hi all, Does anyone have some tips for getting a nice sourceplot using the 'ortho' method? I'm using functional data masked by the stats results. I see a lot of cerebellum activity as well as deeper sources, so a surface plot is very likely to be fooling me. I'm getting a very ugly figure, though, because of all the squares (activity and masks) bleeding outside of the skull outline. Anyone with experience on what works well to make that look nicer (eg., in Illustrator)? Thanks, Vitoria From a.stolk at fcdonders.ru.nl Wed Feb 26 22:43:59 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 26 Feb 2014 22:43:59 +0100 (CET) Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <530E2C8B.6070004@gmail.com> Message-ID: <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Hi Vitoria, I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Vitoria Piai" > Aan: fieldtrip at donders.ru.nl > Verzonden: Woensdag 26 februari 2014 19:03:55 > Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' > Hi all, > > Does anyone have some tips for getting a nice sourceplot using the > 'ortho' method? > I'm using functional data masked by the stats results. I see a lot of > cerebellum activity as well as deeper sources, so a surface plot is > very > likely to be fooling me. I'm getting a very ugly figure, though, > because > of all the squares (activity and masks) bleeding outside of the skull > outline. > Anyone with experience on what works well to make that look nicer > (eg., > in Illustrator)? > > Thanks, Vitoria > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl From notthemindprobe at yahoo.com Thu Feb 27 01:11:59 2014 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Wed, 26 Feb 2014 16:11:59 -0800 (PST) Subject: [FieldTrip] Recording Biosemi GSR data in GDF files In-Reply-To: Message-ID: <1393459919.4744.YahooMailBasic@web140204.mail.bf1.yahoo.com> Robert: Thanks for your suggestions, after doing some digging in the Actiview Labview code and some Biosemi forums posting I found there is some interesting variations in the Biosemi GSR sensors that affect how they are interpreted by the biosemi2ft code and then stored in the GDF files. Most significantly, for Biosemi there are two channels of analog data the correspond to 1 channel of GSR data. In other words, to use biosemi2ft to get EEG channels 1:32 you would specify channels 1, 2, .... 32 in the biosemi2ft config file. This corresponds to biosemi/BDF channels 1:32. Similarly, if you want the 8 Biosemi external analog channels [biosemi channels 257 to 264] you would specify channels 257 to 264 in the config file for biosemi2ft. However, if you specify that you want channels 265 and 266 in the biosemi2ft config this witll *not* give you the Biosemi GSR1 and Biosemi GSR2 channels. Instead you will get two voltage measurements that are both used by Actiview to calculate GSR1. Therefore you need to set up the biosemi2ft config file to recorded channels 265->268 [4 channels] in order the get the raw data that is used by Biosemi to calculate the contents of its channels 265(GSR1) and 266 (GSR2). Actiview does something along the following with the pairs of channels to calculate GSR (the following would be for GSR1, GSR2 would use channels 268&267) GSR1 = CH266-CH265 low pass filter GSR GSR1 = 13.3*GSR Max and minimum substraction in a sliding window (128 data points for a complete 16Hz excitation wave cycle when data is at 2048Hz, there is 50% window overlap) GSR1 = GSR1/8192 GSR1 = 1/GSR1 GSR1 = 1E+9 * GSR1 There can be some variation to account for different speed modes/sampling rates (I've been running at 2048Hz). There is also additional operations for verifying data integrity, and converting data types. Anyway, one of the big things to be aware of is that when you go beyond channel 264 there is no longer a 1:1 relationship in the Biosemi data channeling numbering and the way that the biosemi2ft is accessing the (raw) data. I haven't used any of the other Biosemi sensor data, but some of the messages in their forums suggest that the ERGO, RESP and TEMP sensors as well under go additional processing in Actiview. So I don't know if there are multiple channels of 'raw' data that correspond to each of those. Best, Eric ---------------------------------------------------------------------- Message: 1 Date: Tue, 18 Feb 2014 16:55:55 +0100 From: Robert Oostenveld To: FieldTrip discussion list Subject: Re: [FieldTrip] Recording Biosemi GSR data in GDF files Message-ID: <4A14FD77-D413-418C-B788-F45F0CD675AD at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Eric, Although I don't have any real expertise in this matter, let me share my 2 cents: Your description suggests that the GSR is estimated using a 16Hz alternating current  of constant (but presumably unknown) amplitude, and that GSR is estimated by solving Ohms law (V=I*R). Rather than doing an instantaneous estimate (which is noisy, especially if the current passes the zero-crossing)  there will be a rectification and temporal smoothing of the voltage prior to the estimation. Or perhaps even better: a sliding window estimation: for a given time t   take the signal from t-1/16s in the past up to t-0 (i.e. now)   estimate the 16Hz amplitude using a DFT, this is a single positive number (either RMS, Vpeak, or Vpeak-to-peak)   estimate R = V/I (this requires that you know the current I) You could determine I by connecting a known resistor of appropriate size to the electrodes. Or perhaps you don't even have to; if you are not interested in the absolute value but only in changes, you would just take R as proportional to V. Something like this (for the offline case) would do it time    = (1:(fsample/16))/fsample; % just enough time for one oscillation model_c = cos(16*2*pi*time); model_s = sin(16*2*pi*time); model   = model_c + i*model_s;      % i is the complex number model   = model./norm(model); signal    = randn(1,10*fsample);    % the raw signal amplitude = nan(size(signal));      % the estimated amplitude for t=1:length(signal)   begsample = t - fsample/16 + 1;   % note the +1, the segment should be 64 samples long   endsample = t - 0;   if begsample>=1 && endsample<=length(signal)     segment = signal(begsample:endsample);     amplitude(t) = segment*model'; % discrete fourier transform   end end plot(abs(amplitude)) This can be translated to the online case by inserting it into one of the examples at http://fieldtrip.fcdonders.nl/development/realtime best regards, Robert On 18 Feb 2014, at 0:00, Eric Pohlmeyer wrote: > Fieldtrip users: > > Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file?  This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. > > Some more details: > > Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine.  We recently wanted to add GSR data to this.  However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself.  When we record the GSR data using Activew in a BDF file, the data is recorded fine. > > Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file.  This is in contrasts to the 8 external channels which do not undergo such additional manipulations. > > So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? > > Thanks! > > Eric > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From barbara.schorr at uni-ulm.de Thu Feb 27 09:08:24 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Thu, 27 Feb 2014 09:08:24 +0100 Subject: [FieldTrip] Plotting ERP data: From topoplot to 3D brain surface plot Message-ID: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> Dear Fieldtripers, I have ERP data from a normal oddball task (low pitch tones vs. high pitch tones) resulting in a P300. I know how to plot them with the normal ft_topoplot command. For just visualization, this is fine, but for a publication I would like to plot my data on a 3D brain surface. I know how to do that with the ft_sourceplot command. I tried it with my data, but the result is not even close to what I see when I plot it with the ft_topoplot command (I don's see the nice big blob of activity in the parietal cortex). I guess the problem is that I do more analizyng steps in order to get the data structure which is needed for sourceplotting. What I really just want to do is putting my topoplot on a brainsurface. Is that possible in fieldtrip or do I need to use another software? Thank you very much for your help!! Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From eelke.spaak at donders.ru.nl Thu Feb 27 09:19:55 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 27 Feb 2014 09:19:55 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Vitória, When you are calling ft_sourceinterpolate, you can call it with different interpolation methods. I think the default is 'nearest', which results in interpolated blocky figures. You can also specify cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both of which result in smoother interpolations. Furthermore you can play around with the mask variable for plotting. I guess you are now using the binary mask resulting from the output of ft_sourcestatistics. You can also create a real-value mask based e.g. on the statistical or relative values (which results in opacity being ramped up according to effect size), and then apply the statistical map to that. This would be something like the following: tmp = int_stat.stat; oldmask = int_stat.mask; int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % set the new mask to range between 0 and 1 int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels where int_stat is the result of ft_sourceinterpolate. Note that because I used 'sphere_avg' interpolation in this case, the interpolated mask will not be strictly binary anymore, hence the test < 0.9, rather than == 1. (Also note that you should specify cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting with a mask like the above.) Does this do something like you want? Best, Eelke On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: > Hi Vitoria, > > I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, > > Arjen > > > ----- Oorspronkelijk bericht ----- >> Van: "Vitoria Piai" >> Aan: fieldtrip at donders.ru.nl >> Verzonden: Woensdag 26 februari 2014 19:03:55 >> Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' >> Hi all, >> >> Does anyone have some tips for getting a nice sourceplot using the >> 'ortho' method? >> I'm using functional data masked by the stats results. I see a lot of >> cerebellum activity as well as deeper sources, so a surface plot is >> very >> likely to be fooling me. I'm getting a very ugly figure, though, >> because >> of all the squares (activity and masks) bleeding outside of the skull >> outline. >> Anyone with experience on what works well to make that look nicer >> (eg., >> in Illustrator)? >> >> Thanks, Vitoria >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From v.piai.research at gmail.com Thu Feb 27 16:44:46 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Feb 2014 16:44:46 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: <530F5D6E.4030804@gmail.com> Hi Elke and Arjen, Thanks a lot, it almost solved the problem (see figure). It looks better than before anyways, so I guess I could just do the finishing in Illustrator. (Or can you tell from this figure that something is going wrong with the interpolation/projection?) Vitoria On 27-2-2014 9:19, Eelke Spaak wrote: > Hi Vitória, > > When you are calling ft_sourceinterpolate, you can call it with > different interpolation methods. I think the default is 'nearest', > which results in interpolated blocky figures. You can also specify > cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both > of which result in smoother interpolations. > > Furthermore you can play around with the mask variable for plotting. I > guess you are now using the binary mask resulting from the output of > ft_sourcestatistics. You can also create a real-value mask based e.g. > on the statistical or relative values (which results in opacity being > ramped up according to effect size), and then apply the statistical > map to that. This would be something like the following: > > tmp = int_stat.stat; > oldmask = int_stat.mask; > int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % > set the new mask to range between 0 and 1 > int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels > > where int_stat is the result of ft_sourceinterpolate. Note that > because I used 'sphere_avg' interpolation in this case, the > interpolated mask will not be strictly binary anymore, hence the test > < 0.9, rather than == 1. (Also note that you should specify > cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting > with a mask like the above.) > > Does this do something like you want? > > Best, > Eelke > > On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: >> Hi Vitoria, >> >> I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, >> >> Arjen >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "Vitoria Piai" >>> Aan: fieldtrip at donders.ru.nl >>> Verzonden: Woensdag 26 februari 2014 19:03:55 >>> Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' >>> Hi all, >>> >>> Does anyone have some tips for getting a nice sourceplot using the >>> 'ortho' method? >>> I'm using functional data masked by the stats results. I see a lot of >>> cerebellum activity as well as deeper sources, so a surface plot is >>> very >>> likely to be fooling me. I'm getting a very ugly figure, though, >>> because >>> of all the squares (activity and masks) bleeding outside of the skull >>> outline. >>> Anyone with experience on what works well to make that look nicer >>> (eg., >>> in Illustrator)? >>> >>> Thanks, Vitoria >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> _______________________________________________ >> 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 -- Vitória Piai PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition, Radboud University Nijmegen Montessorilaan 3, B.02.30 6525 HR Nijmegen The Netherlands Email : V.piai at donders.ru.nl Phone : +31 24 3612635 www.vitoriapiai.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dedabghb.png Type: image/png Size: 178693 bytes Desc: not available URL: From ayobimpe2004 at hotmail.com Thu Feb 27 22:37:50 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 27 Feb 2014 22:37:50 +0100 Subject: [FieldTrip] correlated sources with DICS Message-ID: Hello, I want to compute source coherence with DICS. I am not getting what I want with cfg.refdip option.Please how can I include two bilateral reference positions in leadfield computation or generally compute source coherence from one source location to other sources? Azeez A. Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Feb 28 08:50:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 28 Feb 2014 08:50:34 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <530F5D6E.4030804@gmail.com> References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> <530F5D6E.4030804@gmail.com> Message-ID: Hi Vitoria, I forgot to add: the default in ft_sourceinterpolate is to *always* use 'nearest' interpolation if the data field is logical (as is the case for the mask; hence still the blocky masking). This is a reasonable setting I guess, but I don't see a reason why you shouldn't be able to use 'smudge' or 'sphere_avg' for a mask as well. You can circumvent this by doing stat.mask = double(stat.mask); before the interpolation step. Best, Eelke On 27 February 2014 16:44, Vitoria Piai wrote: > Hi Elke and Arjen, > > Thanks a lot, it almost solved the problem (see figure). It looks better > than before anyways, so I guess I could just do the finishing in > Illustrator. > (Or can you tell from this figure that something is going wrong with the > interpolation/projection?) > > Vitoria > > > > On 27-2-2014 9:19, Eelke Spaak wrote: > > Hi Vitória, > > When you are calling ft_sourceinterpolate, you can call it with > different interpolation methods. I think the default is 'nearest', > which results in interpolated blocky figures. You can also specify > cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both > of which result in smoother interpolations. > > Furthermore you can play around with the mask variable for plotting. I > guess you are now using the binary mask resulting from the output of > ft_sourcestatistics. You can also create a real-value mask based e.g. > on the statistical or relative values (which results in opacity being > ramped up according to effect size), and then apply the statistical > map to that. This would be something like the following: > > tmp = int_stat.stat; > oldmask = int_stat.mask; > int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % > set the new mask to range between 0 and 1 > int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels > > where int_stat is the result of ft_sourceinterpolate. Note that > because I used 'sphere_avg' interpolation in this case, the > interpolated mask will not be strictly binary anymore, hence the test > < 0.9, rather than == 1. (Also note that you should specify > cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting > with a mask like the above.) > > Does this do something like you want? > > Best, > Eelke > > On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: > > Hi Vitoria, > > I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, > > Arjen > > > ----- Oorspronkelijk bericht ----- > > Van: "Vitoria Piai" > Aan: fieldtrip at donders.ru.nl > Verzonden: Woensdag 26 februari 2014 19:03:55 > Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' > Hi all, > > Does anyone have some tips for getting a nice sourceplot using the > 'ortho' method? > I'm using functional data masked by the stats results. I see a lot of > cerebellum activity as well as deeper sources, so a surface plot is > very > likely to be fooling me. I'm getting a very ugly figure, though, > because > of all the squares (activity and masks) bleeding outside of the skull > outline. > Anyone with experience on what works well to make that look nicer > (eg., > in Illustrator)? > > Thanks, Vitoria > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Vitória Piai > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition, Radboud University Nijmegen > Montessorilaan 3, B.02.30 > 6525 HR Nijmegen > The Netherlands > > Email : V.piai at donders.ru.nl > Phone : +31 24 3612635www.vitoriapiai.com > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dedabghb.png Type: image/png Size: 178693 bytes Desc: not available URL: From sauer.mpih at googlemail.com Fri Feb 28 12:08:41 2014 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Fri, 28 Feb 2014 12:08:41 +0100 Subject: [FieldTrip] Warning in topoplot function - 4D data Message-ID: Dear all, when plotting topoplots of 4D data using the 4D248 layout, Matlab gives me the warning "Some points fall outside the outline, please consider using another layout.". Indeed, two frontal sensors are placed outside the head. I am wondering why this message shows up and whether this influences results, i.e. a misplaced peak sensor. I tried with different fieldtrip versions, current ones and old ones. I get the warning all the time. Any help is appreciated! Thanks a lot and best regards, Andreas -- Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: andreas.sauer at brain.mpg.de www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-02-28 11:57:24.png Type: image/png Size: 15484 bytes Desc: not available URL: From albenin at mail.ru Fri Feb 28 15:28:40 2014 From: albenin at mail.ru (=?UTF-8?B?0JDQu9C10LrRgdC10Lkg0JHQtdC90LjQvQ==?=) Date: Fri, 28 Feb 2014 18:28:40 +0400 Subject: [FieldTrip] =?utf-8?q?Statistics_on_freq_data?= In-Reply-To: <1391612267.921368498@f293.i.mail.ru> References: <1391612267.921368498@f293.i.mail.ru> Message-ID: <1393597720.682131540@f250.i.mail.ru> Hi all! Does anyone have ideas? :) > > >Dear Fieldtripers, > >First of all big thanks for a wonderful tool and support! > >I have some questions about cluster based permutation test on TF data. >I perform a between-trials experiment and want to search differences say >on frequencies 10-30Hz and latencies 200-1200 ms from onset. >So I need to explore these ranges for possible differencies in powerspectrum. >When I use for example > >cfg.latency          = [0.2 1.2]; >cfg.frequency        = [10 30]; > >I find no significant clusters, and lowest p_value is very high, say 0,8. >But when I try to look at smaller time/frequency areas, like > >cfg.latency          = [0.2 0.3]; >cfg.frequency        = [15 16]; > >There can be one or two significant clusters with p_values<0.01. >So my question is: does the algorithm look for the whole specified TF window like >0.2-1.2s   10-30Hz and tries to find significant difference based on the whole length >of interval? This could explain why there are no significant clusters on bigger windows. >Such clusters appear when we shorten the toi and foi - it's much more probable to find differences >at smaller scales. >So the next question is: what should I do to explore the whole number of frequencies and latencies? >Shall I run a loop with parameters like this: > >Iteration 1 >cfg.latency          = [0.2 0.3]; >cfg.frequency        = [15 16]; > >Iteration 2 >cfg.latency          = [0.3 0.4]; >cfg.frequency        = [15 16]; > >... and so on? > >Or maybe I do not understand something in basis of method? >BTW, I've read all tutorials and appropriate papers like >Nonparametric statistical testing of EEG, but could not find the answer. > > >Thanks in advance, > >Alex > > > >_______________________________________________ >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 jm.horschig at donders.ru.nl Mon Feb 3 09:10:39 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 09:10:39 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: Message-ID: <52EF4EFF.3010304@donders.ru.nl> Hi Joram, this might be a stupid question, but is there a grandavg{1}.anatomy field at all? Best, Jörn On 1/31/2014 12:44 PM, Joram van Driel wrote: > Hi all, > > I'm trying to plot the grand average of a source analysis. However no > matter what I try, the result of ft_sourcegrandaverage keeps giving me > only the functional data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell structure): > > temp = zeros([length(nsubjects) size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one subject one condition > customavg.avg.pow = squeeze(mean(temp,1)); % and replace power with > the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Feb 3 09:19:35 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 09:19:35 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> Message-ID: <52EF5117.6070700@donders.ru.nl> Hi Victoria, is there anything wrong with the code you used below? By smoothing, do you refer to smoothing in the frequency domain? Best, Jörn On 1/30/2014 11:33 AM, Victoria Schröder wrote: > Hello > > I am currently working on a freqanalysis as a first step to do a > connectivityanalysis. I am a bit unsure about the method to use for > the freqanalysis. My stimuli are very long: between 29 and 30 sec. In > total i have 4 stimuli per condition and 2 seperate conditions. I am > looking at the beta range so fairly low frequencies. > > this is my code: > Am i using the right taper and method. Should i smooth the data? and > if so, what should such a smoothing parameter depend on? > > %fourier analysis > cfg=[]; > cfg.output='fourier'; > cfg.method='mtmfft'; > cfg.foi=[12:30]; > cfg.taper='hanning'; > cfg.keeptrials='yes'; > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > frefourier=ft_freqanalysis(cfg,data_clean); > > > %coherence analysis > cfg=[]; > cfg.method='coh'; > cfg.channelcmb={'B3' 'C15' > 'B3' 'C10' > 'B23' 'C15' > 'B23' 'C10'} > coherence=ft_connectivityanalysis(cfg, frefourier); > > > Thank you very much for the suggestions! > Best > Victoria > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From joramvandriel at gmail.com Mon Feb 3 09:59:20 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 3 Feb 2014 09:59:20 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: <52EF4EFF.3010304@donders.ru.nl> References: <52EF4EFF.3010304@donders.ru.nl> Message-ID: Hi Jörn, Not a stupid question at all, because indeed there isn't. I thought that was the problem too; I already tried putting the .anatomy field of one of the (normalized) subjects into the grandavg structure, but that resulted in a bunch of errors due to an error in the cornerpoints function. This is how the grandavg structure looks like after ft_sourcegrandaverage (fieldtrip version 20140127): pos: [7109137x3 double] dim: [181 217 181] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' inside: [1550519x1 double] outside: [5558618x1 double] df: [7109137x1 double] cfg: [1x1 struct] This my cfg: grandavg = cell(1,2); cfg = []; cfg.parameter = 'avg.pow'; cfg.keepindividual = 'no'; grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition 1 grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition 2 Hope you can find out what the problem is..! Thanks a lot, Joram On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Joram, > > this might be a stupid question, but is there a grandavg{1}.anatomy field > at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > >> Hi all, >> >> I'm trying to plot the grand average of a source analysis. However no >> matter what I try, the result of ft_sourcegrandaverage keeps giving me only >> the functional data, no anatomy. >> >> My cfg for ft_sourceplot is: >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'no'; >> cfg.funparameter = 'avg.pow'; >> cfg.maskparameter = cfg.funparameter; >> cfg.funcolorlim = [0 0.2]; >> cfg.opacitylim = [0 0.2]; >> cfg.opacitymap = 'rampup'; >> >> ft_sourceplot(cfg,grandavg{1}) >> >> I thus created my own grandaverage, like this (where sourceDiffAll{:,:} >> is a subject-by-condition cell structure): >> >> temp = zeros([length(nsubjects) size(sourceDiffAll{1,1}.avg.pow)]); >> for s=1:length(nsubjects) >> temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - >> sourceDiffAll{s,1}.avg.pow; % create condition contrast >> end >> customavg = sourceDiffAll{1,1}; % just copy one subject one condition >> customavg.avg.pow = squeeze(mean(temp,1)); % and replace power with the >> grand average power condition-contrast >> >> Now using ft_sourceplot on customavg works just fine. >> Any idea of what's going wrong with ft_sourceplot on >> ft_sourcegrandaverage? >> Thanks! >> >> - Joram >> >> >> -- >> Joram van Driel, MSc. >> PhD student @ University of Amsterdam >> Brain & Cognition @ Department of Psychology >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Mon Feb 3 10:56:34 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 10:56:34 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: <52EF4EFF.3010304@donders.ru.nl> Message-ID: <52EF67D2.1050208@donders.ru.nl> Hi Joram, you probably need to interpolate to a template and then put the pos and dim field from the template you used in the source structure. You do not have to interpolate, but then make sure that the dimensions of your anatomy match the dimensions of your sourcemodel. Not sure if you followed any tutorial, but this is a good one: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended Best, Jörn On 2/3/2014 9:59 AM, Joram van Driel wrote: > Hi Jörn, > Not a stupid question at all, because indeed there isn't. I thought > that was the problem too; I already tried putting the .anatomy field > of one of the (normalized) subjects into the grandavg structure, but > that resulted in a bunch of errors due to an error in the cornerpoints > function. > This is how the grandavg structure looks like after > ft_sourcegrandaverage (fieldtrip version 20140127): > > pos: [7109137x3 double] > dim: [181 217 181] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > inside: [1550519x1 double] > outside: [5558618x1 double] > df: [7109137x1 double] > cfg: [1x1 struct] > > This my cfg: > > grandavg = cell(1,2); > cfg = []; > cfg.parameter = 'avg.pow'; > cfg.keepindividual = 'no'; > grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition 1 > grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition 2 > > Hope you can find out what the problem is..! > > Thanks a lot, > Joram > > > > On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" > > wrote: > > Hi Joram, > > this might be a stupid question, but is there a > grandavg{1}.anatomy field at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > > Hi all, > > I'm trying to plot the grand average of a source analysis. > However no matter what I try, the result of > ft_sourcegrandaverage keeps giving me only the functional > data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell structure): > > temp = zeros([length(nsubjects) > size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one subject one > condition > customavg.avg.pow = squeeze(mean(temp,1)); % and replace power > with the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From victorias at dsv.su.se Mon Feb 3 11:15:07 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Mon, 03 Feb 2014 11:15:07 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF5117.6070700@donders.ru.nl> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> Message-ID: <087550bc51e8099724e221be5016154f@dsv.su.se> Dear Jörn, the code works but i dont know whether my data is logical and whether i decided to use the right method etc. My trials are pretty long (approx 30 sec but all are not the same length) and i am interested in beta frequency. First, it is not really clear to me whether i should use cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the latter calculates the FFT for shorter self-specified time windows to look at changes in power over time. Is that right? however, if i have more stimuli for one condition, how is the time component then taken into account? does mtmconvol take all trials of one condition and average the the power for each time window over all trials? Or is each trial treated seperatly? Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq when using cfg.taper='hanning'? As i understand hanning if appropriate for lower freuquencies so i should use this taper to assess beta frequencies. Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? Thank you a lot for the help Best Victoria 2014-02-03 09:19 skrev Jörn M. Horschig: > Hi Victoria, > > is there anything wrong with the code you used below? By smoothing, > do you refer to smoothing in the frequency domain? > > Best, > Jörn > > > On 1/30/2014 11:33 AM, Victoria Schröder wrote: >> Hello >> >> I am currently working on a freqanalysis as a first step to do a >> connectivityanalysis. I am a bit unsure about the method to use for >> the freqanalysis. My stimuli are very long: between 29 and 30 sec. In >> total i have 4 stimuli per condition and 2 seperate conditions. I am >> looking at the beta range so fairly low frequencies. >> >> this is my code: >> Am i using the right taper and method. Should i smooth the data? and >> if so, what should such a smoothing parameter depend on? >> >> %fourier analysis >> cfg=[]; >> cfg.output='fourier'; >> cfg.method='mtmfft'; >> cfg.foi=[12:30]; >> cfg.taper='hanning'; >> cfg.keeptrials='yes'; >> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >> frefourier=ft_freqanalysis(cfg,data_clean); >> >> >> %coherence analysis >> cfg=[]; >> cfg.method='coh'; >> cfg.channelcmb={'B3' 'C15' >> 'B3' 'C10' >> 'B23' 'C15' >> 'B23' 'C10'} >> coherence=ft_connectivityanalysis(cfg, frefourier); >> >> >> Thank you very much for the suggestions! >> Best >> Victoria >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From jm.horschig at donders.ru.nl Mon Feb 3 11:42:06 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 03 Feb 2014 11:42:06 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <087550bc51e8099724e221be5016154f@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> Message-ID: <52EF727E.2080902@donders.ru.nl> Hi Victoria, you might want to read the relevant part of the walkthrough for your questions on mtmconvol and mtmfft: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis Then, also doing this tutorial might help in understanding what the different methods are doing: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis And lastly, to shortly answer your questions, see below ;) On 2/3/2014 11:15 AM, Victoria Schröder wrote: > Dear Jörn, Hi ;) > > the code works but i dont know whether my data is logical and whether > i decided to use the right method etc. maybe you should try to get into one of the FieldTrip courses :) This might tremendously help you in understanding what's being done and why. Otherwise, try to read as much as you can, read methods of papers and discuss with your supervisor and colleagues. Of course, on the mailing list we also like to help a lot. > > My trials are pretty long (approx 30 sec but all are not the same > length) and i am interested in beta frequency. > > First, it is not really clear to me whether i should use > cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the > latter calculates the FFT for shorter self-specified time windows to > look at changes in power over time. Is that right? yep, about right. > however, if i have more stimuli for one condition, how is the time > component then taken into account? it depends on how you segmented your data. FieldTrip is just transforming your preprocessed data, so whatever you put in is what you get out. > does mtmconvol take all trials of one condition and average the the > power for each time window over all trials? Or is each trial treated > seperatly? depends on whether you specify cfg.keeptrials = 'yes' or 'no' > > Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq > when using cfg.taper='hanning'? no, a hanning taper is always a single taper. Only when combining multiple tapers you can effectively smooth in the frequency domain. this is implemented as taper='dpss' > As i understand hanning if appropriate for lower freuquencies so i > should use this taper to assess beta frequencies. this is a rule of thumb, but there is nothing wrong with using multitapering for lower frequencies. It depends on what you expect from your data and what you want to achieve. > > Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? this depends on the frequencies you are interested in. I wouldn't trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. > > Thank you a lot for the help you're welcome, hope this helps > Best > Victoria Likewise, Jörn > > > 2014-02-03 09:19 skrev Jörn M. Horschig: >> Hi Victoria, >> >> is there anything wrong with the code you used below? By smoothing, >> do you refer to smoothing in the frequency domain? >> >> Best, >> Jörn >> >> >> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>> Hello >>> >>> I am currently working on a freqanalysis as a first step to do a >>> connectivityanalysis. I am a bit unsure about the method to use for >>> the freqanalysis. My stimuli are very long: between 29 and 30 sec. >>> In total i have 4 stimuli per condition and 2 seperate conditions. I >>> am looking at the beta range so fairly low frequencies. >>> >>> this is my code: >>> Am i using the right taper and method. Should i smooth the data? and >>> if so, what should such a smoothing parameter depend on? >>> >>> %fourier analysis >>> cfg=[]; >>> cfg.output='fourier'; >>> cfg.method='mtmfft'; >>> cfg.foi=[12:30]; >>> cfg.taper='hanning'; >>> cfg.keeptrials='yes'; >>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>> frefourier=ft_freqanalysis(cfg,data_clean); >>> >>> >>> %coherence analysis >>> cfg=[]; >>> cfg.method='coh'; >>> cfg.channelcmb={'B3' 'C15' >>> 'B3' 'C10' >>> 'B23' 'C15' >>> 'B23' 'C10'} >>> coherence=ft_connectivityanalysis(cfg, frefourier); >>> >>> >>> Thank you very much for the suggestions! >>> Best >>> Victoria >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Mon Feb 3 11:38:21 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 3 Feb 2014 11:38:21 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <087550bc51e8099724e221be5016154f@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> Message-ID: Dear Victoria, Those are all very good questions. It might be very beneficial for you to go through the following tutorial once: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis I think many of the questions you have will be answered along the way. If not (or if you've already read the tutorial), feel free to ask of course! Best, Eelke On 3 February 2014 11:15, Victoria Schröder wrote: > Dear Jörn, > > the code works but i dont know whether my data is logical and whether i > decided to use the right method etc. > > My trials are pretty long (approx 30 sec but all are not the same length) > and i am interested in beta frequency. > > First, it is not really clear to me whether i should use cfg.method=mtmfft > or cfg.method=mtmconvol. As i understand , the latter calculates the FFT > for shorter self-specified time windows to look at changes in power over > time. Is that right? however, if i have more stimuli for one condition, how > is the time component then taken into account? does mtmconvol take all > trials of one condition and average the the power for each time window over > all trials? Or is each trial treated seperatly? > > Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq when > using cfg.taper='hanning'? As i understand hanning if appropriate for lower > freuquencies so i should use this taper to assess beta frequencies. > > Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? > > Thank you a lot for the help > Best > Victoria > > > 2014-02-03 09:19 skrev Jörn M. Horschig: > >> Hi Victoria, >> >> is there anything wrong with the code you used below? By smoothing, >> do you refer to smoothing in the frequency domain? >> >> Best, >> Jörn >> >> >> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>> >>> Hello >>> >>> I am currently working on a freqanalysis as a first step to do a >>> connectivityanalysis. I am a bit unsure about the method to use for the >>> freqanalysis. My stimuli are very long: between 29 and 30 sec. In total i >>> have 4 stimuli per condition and 2 seperate conditions. I am looking at the >>> beta range so fairly low frequencies. >>> >>> this is my code: >>> Am i using the right taper and method. Should i smooth the data? and if >>> so, what should such a smoothing parameter depend on? >>> >>> %fourier analysis >>> cfg=[]; >>> cfg.output='fourier'; >>> cfg.method='mtmfft'; >>> cfg.foi=[12:30]; >>> cfg.taper='hanning'; >>> cfg.keeptrials='yes'; >>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>> frefourier=ft_freqanalysis(cfg,data_clean); >>> >>> >>> %coherence analysis >>> cfg=[]; >>> cfg.method='coh'; >>> cfg.channelcmb={'B3' 'C15' >>> 'B3' 'C10' >>> 'B23' 'C15' >>> 'B23' 'C10'} >>> coherence=ft_connectivityanalysis(cfg, frefourier); >>> >>> >>> Thank you very much for the suggestions! >>> Best >>> Victoria >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 victorias at dsv.su.se Mon Feb 3 12:14:07 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Mon, 03 Feb 2014 12:14:07 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF727E.2080902@donders.ru.nl> References: "<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> Message-ID: <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> Thank Jörn, Thank for the advice for the tutorials but i have already looked at them a lot. Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged power over trials? what happens then when the trials do not have the same length? and a last question :) what does cfg.toi depend on ? in the tutorial time frequency analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the case? I hope this should be it for now Best Victoria 2014-02-03 11:42 skrev Jörn M. Horschig: > Hi Victoria, > > you might want to read the relevant part of the walkthrough for your > questions on mtmconvol and mtmfft: > http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis > > Then, also doing this tutorial might help in understanding what the > different methods are doing: > http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis > > And lastly, to shortly answer your questions, see below ;) > > On 2/3/2014 11:15 AM, Victoria Schröder wrote: >> Dear Jörn, > Hi ;) > >> >> the code works but i dont know whether my data is logical and >> whether i decided to use the right method etc. > maybe you should try to get into one of the FieldTrip courses :) This > might tremendously help you in understanding what's being done and > why. Otherwise, try to read as much as you can, read methods of > papers > and discuss with your supervisor and colleagues. Of course, on the > mailing list we also like to help a lot. >> >> My trials are pretty long (approx 30 sec but all are not the same >> length) and i am interested in beta frequency. >> >> First, it is not really clear to me whether i should use >> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >> latter calculates the FFT for shorter self-specified time windows to >> look at changes in power over time. Is that right? yep, about right. > >> however, if i have more stimuli for one condition, how is the time >> component then taken into account? it depends on how you segmented >> your data. FieldTrip is just transforming your preprocessed data, so >> whatever you put in is what you get out. > >> does mtmconvol take all trials of one condition and average the the >> power for each time window over all trials? Or is each trial treated >> seperatly? > depends on whether you specify cfg.keeptrials = 'yes' or 'no' >> >> Say i would use cfg.method=mtmfft do i need to specify a >> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >> always a single taper. Only when combining multiple tapers you can >> effectively smooth in the frequency domain. this is implemented as >> taper='dpss' > >> As i understand hanning if appropriate for lower freuquencies so i >> should use this taper to assess beta frequencies. > this is a rule of thumb, but there is nothing wrong with using > multitapering for lower frequencies. It depends on what you expect > from your data and what you want to achieve. >> >> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? > this depends on the frequencies you are interested in. I wouldn't > trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. > >> >> Thank you a lot for the help > you're welcome, hope this helps >> Best >> Victoria > Likewise, > Jörn > >> >> >> 2014-02-03 09:19 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> is there anything wrong with the code you used below? By smoothing, >>> do you refer to smoothing in the frequency domain? >>> >>> Best, >>> Jörn >>> >>> >>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>> Hello >>>> >>>> I am currently working on a freqanalysis as a first step to do a >>>> connectivityanalysis. I am a bit unsure about the method to use for >>>> the freqanalysis. My stimuli are very long: between 29 and 30 sec. >>>> In total i have 4 stimuli per condition and 2 seperate conditions. I >>>> am looking at the beta range so fairly low frequencies. >>>> >>>> this is my code: >>>> Am i using the right taper and method. Should i smooth the data? >>>> and if so, what should such a smoothing parameter depend on? >>>> >>>> %fourier analysis >>>> cfg=[]; >>>> cfg.output='fourier'; >>>> cfg.method='mtmfft'; >>>> cfg.foi=[12:30]; >>>> cfg.taper='hanning'; >>>> cfg.keeptrials='yes'; >>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>> >>>> >>>> %coherence analysis >>>> cfg=[]; >>>> cfg.method='coh'; >>>> cfg.channelcmb={'B3' 'C15' >>>> 'B3' 'C10' >>>> 'B23' 'C15' >>>> 'B23' 'C10'} >>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>> >>>> >>>> Thank you very much for the suggestions! >>>> Best >>>> Victoria >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From joramvandriel at gmail.com Mon Feb 3 12:19:52 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 3 Feb 2014 12:19:52 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: <52EF67D2.1050208@donders.ru.nl> References: <52EF4EFF.3010304@donders.ru.nl> <52EF67D2.1050208@donders.ru.nl> Message-ID: Hi Jörn, Hi Joram, > > you probably need to interpolate to a template and then put the pos and > dim field from the template you used in the source structure. With source structure you mean the result from ft_sourcegrandaverage? That already has a pos and dim field. Or the subject individual source structures, *after* ft_sourceinterpolate but *before* ft_volumenormalise? > You do not have to interpolate, but then make sure that the dimensions of > your anatomy match the dimensions of your sourcemodel. > I'm not sure what you mean here. I did for each subject ft_sourceinterpolate and ft_volumenormalise. Shouldn't then ft_sourcegrandaverage give me something that I could plot with ft_sourceplot? Or am I asking too much of FieldTrip right now :) According to the regular beamforming tutorial this should be possible. But I will try the steps from the extended tutorial (and this one might be useful as well: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) and see how far that brings me! Thanks, Joram > > Not sure if you followed any tutorial, but this is a good one: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended > > Best, > Jörn > > > > On 2/3/2014 9:59 AM, Joram van Driel wrote: > >> Hi Jörn, >> Not a stupid question at all, because indeed there isn't. I thought that >> was the problem too; I already tried putting the .anatomy field of one of >> the (normalized) subjects into the grandavg structure, but that resulted in >> a bunch of errors due to an error in the cornerpoints function. >> This is how the grandavg structure looks like after ft_sourcegrandaverage >> (fieldtrip version 20140127): >> >> pos: [7109137x3 double] >> dim: [181 217 181] >> avg: [1x1 struct] >> var: [1x1 struct] >> dimord: 'voxel' >> inside: [1550519x1 double] >> outside: [5558618x1 double] >> df: [7109137x1 double] >> cfg: [1x1 struct] >> >> This my cfg: >> >> grandavg = cell(1,2); >> cfg = []; >> cfg.parameter = 'avg.pow'; >> cfg.keepindividual = 'no'; >> grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition >> 1 >> grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition >> 2 >> >> Hope you can find out what the problem is..! >> >> Thanks a lot, >> Joram >> >> >> >> On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" < >> jm.horschig at donders.ru.nl > wrote: >> >> Hi Joram, >> >> this might be a stupid question, but is there a >> grandavg{1}.anatomy field at all? >> >> Best, >> Jörn >> >> >> On 1/31/2014 12:44 PM, Joram van Driel wrote: >> >> Hi all, >> >> I'm trying to plot the grand average of a source analysis. >> However no matter what I try, the result of >> ft_sourcegrandaverage keeps giving me only the functional >> data, no anatomy. >> >> My cfg for ft_sourceplot is: >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'no'; >> cfg.funparameter = 'avg.pow'; >> cfg.maskparameter = cfg.funparameter; >> cfg.funcolorlim = [0 0.2]; >> cfg.opacitylim = [0 0.2]; >> cfg.opacitymap = 'rampup'; >> >> ft_sourceplot(cfg,grandavg{1}) >> >> I thus created my own grandaverage, like this (where >> sourceDiffAll{:,:} is a subject-by-condition cell structure): >> >> temp = zeros([length(nsubjects) >> size(sourceDiffAll{1,1}.avg.pow)]); >> for s=1:length(nsubjects) >> temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - >> sourceDiffAll{s,1}.avg.pow; % create condition contrast >> end >> customavg = sourceDiffAll{1,1}; % just copy one subject one >> condition >> customavg.avg.pow = squeeze(mean(temp,1)); % and replace power >> with the grand average power condition-contrast >> >> Now using ft_sourceplot on customavg works just fine. >> Any idea of what's going wrong with ft_sourceplot on >> ft_sourcegrandaverage? >> Thanks! >> >> - Joram >> >> >> -- Joram van Driel, MSc. >> PhD student @ University of Amsterdam >> Brain & Cognition @ Department of Psychology >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Mon Feb 3 13:37:44 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 13:37:44 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: <52EF4EFF.3010304@donders.ru.nl> <52EF67D2.1050208@donders.ru.nl> Message-ID: <52EF8D98.5030202@donders.ru.nl> Hi Joram, the (regular) beamforming tutorial is dealing only with the single subject case. The extended sets the stage for averaging over subjects as well. I think all of your questions will be answered when you went through that one. Otherwise, feel free to ask any questions that remain open ;) Best, Jörn On 2/3/2014 12:19 PM, Joram van Driel wrote: > Hi Jörn, > > Hi Joram, > > you probably need to interpolate to a template and then put the > pos and dim field from the template you used in the source structure. > > > With source structure you mean the result from ft_sourcegrandaverage? > That already has a pos and dim field. Or the subject individual source > structures, *after* ft_sourceinterpolate but *before* ft_volumenormalise? > > You do not have to interpolate, but then make sure that the > dimensions of your anatomy match the dimensions of your sourcemodel. > > > I'm not sure what you mean here. I did for each subject > ft_sourceinterpolate and ft_volumenormalise. Shouldn't then > ft_sourcegrandaverage give me something that I could plot with > ft_sourceplot? Or am I asking too much of FieldTrip right now :) > According to the regular beamforming tutorial this should be possible. > > But I will try the steps from the extended tutorial (and this one > might be useful as well: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > and see how far that brings me! > > Thanks, > Joram > > > Not sure if you followed any tutorial, but this is a good one: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended > > Best, > Jörn > > > > On 2/3/2014 9:59 AM, Joram van Driel wrote: > > Hi Jörn, > Not a stupid question at all, because indeed there isn't. I > thought that was the problem too; I already tried putting the > .anatomy field of one of the (normalized) subjects into the > grandavg structure, but that resulted in a bunch of errors due > to an error in the cornerpoints function. > This is how the grandavg structure looks like after > ft_sourcegrandaverage (fieldtrip version 20140127): > > pos: [7109137x3 double] > dim: [181 217 181] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > inside: [1550519x1 double] > outside: [5558618x1 double] > df: [7109137x1 double] > cfg: [1x1 struct] > > This my cfg: > > grandavg = cell(1,2); > cfg = []; > cfg.parameter = 'avg.pow'; > cfg.keepindividual = 'no'; > grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % > condition 1 > grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % > condition 2 > > Hope you can find out what the problem is..! > > Thanks a lot, > Joram > > > > On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" > > >> wrote: > > Hi Joram, > > this might be a stupid question, but is there a > grandavg{1}.anatomy field at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > > Hi all, > > I'm trying to plot the grand average of a source analysis. > However no matter what I try, the result of > ft_sourcegrandaverage keeps giving me only the functional > data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell > structure): > > temp = zeros([length(nsubjects) > size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one > subject one > condition > customavg.avg.pow = squeeze(mean(temp,1)); % and > replace power > with the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > > > > Tel: +31-(0)24-36-68493 > > > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Feb 3 13:40:55 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 03 Feb 2014 13:40:55 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> References: "<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> Message-ID: <52EF8E57.6060207@donders.ru.nl> Hi Victoria, On 2/3/2014 12:14 PM, Victoria Schröder wrote: > Thank Jörn, > > Thank for the advice for the tutorials but i have already looked at > them a lot. > > Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged > power over trials? Well, it might sound obvious, but if you say 'yes' to keep trials, you keep the trials, whereas if you say 'no' you do not keep the trials and instead get an average. > what happens then when the trials do not have the same length? The average will be made with all data that is available. If some trials go to 30s but all trials go to 29s, then the average of the last one second is made of less data then the first 29s. This is a crucial point for doing statistics as the degrees of freedom, signal-to noise ration etc. will be different for different time points. > > and a last question :) > > what does cfg.toi depend on ? in the tutorial time frequency analysis > this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the > case? it depends on what time you are interested in and how much memory (and cpu time aka patience) you got. Good luck ;) Best, Jörn > > I hope this should be it for now > Best > Victoria > > > 2014-02-03 11:42 skrev Jörn M. Horschig: >> Hi Victoria, >> >> you might want to read the relevant part of the walkthrough for your >> questions on mtmconvol and mtmfft: >> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >> >> Then, also doing this tutorial might help in understanding what the >> different methods are doing: >> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >> >> And lastly, to shortly answer your questions, see below ;) >> >> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>> Dear Jörn, >> Hi ;) >> >>> >>> the code works but i dont know whether my data is logical and >>> whether i decided to use the right method etc. >> maybe you should try to get into one of the FieldTrip courses :) This >> might tremendously help you in understanding what's being done and >> why. Otherwise, try to read as much as you can, read methods of papers >> and discuss with your supervisor and colleagues. Of course, on the >> mailing list we also like to help a lot. >>> >>> My trials are pretty long (approx 30 sec but all are not the same >>> length) and i am interested in beta frequency. >>> >>> First, it is not really clear to me whether i should use >>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>> latter calculates the FFT for shorter self-specified time windows to >>> look at changes in power over time. Is that right? yep, about right. >> >>> however, if i have more stimuli for one condition, how is the time >>> component then taken into account? it depends on how you segmented >>> your data. FieldTrip is just transforming your preprocessed data, so >>> whatever you put in is what you get out. >> >>> does mtmconvol take all trials of one condition and average the the >>> power for each time window over all trials? Or is each trial treated >>> seperatly? >> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>> >>> Say i would use cfg.method=mtmfft do i need to specify a >>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >>> always a single taper. Only when combining multiple tapers you can >>> effectively smooth in the frequency domain. this is implemented as >>> taper='dpss' >> >>> As i understand hanning if appropriate for lower freuquencies so i >>> should use this taper to assess beta frequencies. >> this is a rule of thumb, but there is nothing wrong with using >> multitapering for lower frequencies. It depends on what you expect >> from your data and what you want to achieve. >>> >>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >> this depends on the frequencies you are interested in. I wouldn't >> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >> >>> >>> Thank you a lot for the help >> you're welcome, hope this helps >>> Best >>> Victoria >> Likewise, >> Jörn >> >>> >>> >>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>> Hi Victoria, >>>> >>>> is there anything wrong with the code you used below? By smoothing, >>>> do you refer to smoothing in the frequency domain? >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>> Hello >>>>> >>>>> I am currently working on a freqanalysis as a first step to do a >>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>> for the freqanalysis. My stimuli are very long: between 29 and 30 >>>>> sec. In total i have 4 stimuli per condition and 2 seperate >>>>> conditions. I am looking at the beta range so fairly low frequencies. >>>>> >>>>> this is my code: >>>>> Am i using the right taper and method. Should i smooth the data? >>>>> and if so, what should such a smoothing parameter depend on? >>>>> >>>>> %fourier analysis >>>>> cfg=[]; >>>>> cfg.output='fourier'; >>>>> cfg.method='mtmfft'; >>>>> cfg.foi=[12:30]; >>>>> cfg.taper='hanning'; >>>>> cfg.keeptrials='yes'; >>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>> >>>>> >>>>> %coherence analysis >>>>> cfg=[]; >>>>> cfg.method='coh'; >>>>> cfg.channelcmb={'B3' 'C15' >>>>> 'B3' 'C10' >>>>> 'B23' 'C15' >>>>> 'B23' 'C10'} >>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>> >>>>> >>>>> Thank you very much for the suggestions! >>>>> Best >>>>> Victoria >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jkhartshorne at gmail.com Mon Feb 3 22:19:41 2014 From: jkhartshorne at gmail.com (Joshua Hartshorne) Date: Mon, 3 Feb 2014 16:19:41 -0500 Subject: [FieldTrip] Interactions Message-ID: Hi Eric, I tried the simulations as you suggested. Rather I simulated several different types of 2X2 datasets. For all of them, permutation analysis worked just fine. Of course, it's possible that I'm doing something wrong, so I'd appreciate your feedback. Here's how I created the data: *between/between*. Normally-distributed data in each of 4 cells. The effect size for e1 and e2 were each set to 1, with a SD of 1. The interaction (if present) was .75 with an SD of 1. There were 40 subjects per cell. *within/within. *For each participant, I generated a random intercept (M=0, SD=.25) and random slopes for both e1 and e2 (M=1, SD=.25) and for the interaction, if present (M=.75, SD=.25). Having generated that, for each participant in each condition, I drew a single sample where the mean was the sum of the effects just listed and the SD=1. *within/between. *The first factor was within subjects and the second was between. Each subject had a random intercept (SD=.25) and a random slope for factor 1 (M=1, SD=.25). The subjects in Level 1 for both factors had a random intercept (M=.75, SD=.25). The between-subject factor was 1. As above, I then generated a single datapoint from a normal distribution (M=1, SD=1). In each case, I ran 500 simulations with an interaction and 500 without. For each, I analyzed either with an ANOVA (ezANOVA in R) or a 500-sample permutation test, as follows: Permutations respected the structure of the data. So in the between/between case, condition labels were permuted freely. In the within/within case, for each subject, I randomly flipped the levels of each factor, preserving structure. That is, each subject had two cells where factor 1 was 0 and two where factor 1 was 1. If the codes switched, both the 1s were turned to 0s and both the 0s were turned to 1s. The same was done for Factor 2. I dealt with the within/between data in an analogous fashion, with the constraint that the same number of subjects be in the each of the between-subject conditions. Having done my permuting, I then calculated the F-stat for the interaction. I then compared the actual F-stat against the resulting distribution. The short description of the result is I got basically the same results for the permutation tests and the ANOVA. For instance, in the within/within case, when there was an actual interaction in the generative model, I got an average p-value of .0844 using ezANOVA and .0858 using permutations. The Type II error was .318 and .312, respectively. When there was no interaction, I got average p-values of .5052 and .5066, respectively, and a Type I error of .036 and .038, respectively. I got analogous results for between/between and within/within. Incidentally, I understand that it isn't strictly necessary to permute condition codes for both factors. But it doesn't seem to do any harm, either. I actually tried the within/between case permuting only the between factor, with similar results. Thanks, Josh On Sun, Jan 26, 2014 at 4:44 AM, wrote: > Hi Steve and Josh, > > > Josh writes > > > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > > and it would be great to see it. > > In general, questions like these are very hard to answer satisfactorily on > a > discussion list. It is dealt with much more easily in person, say at one of > the Fieldtrip courses. However, let me give it a try. > > To prove that something does not work it suffices to produces a single > example that shows the contrary. > > Try the following: > > Generate random data in a 2-by-2 between-subjects design (say, normally > distributed within every cell). Add large main effects (relative to the > within-cell variance; say, MS_beween 50 times larger than MS_within) and no > interaction effect. Take a small number of subjects (say, 5 per cell). Now, > calculate a permutation p-value for the interaction-effect F-statistic by > permuting across all 4 cells. Do this for a large number of simulated data > set. My prediction is that, on average, the F-statistic p-value is less > than > 0.05, which it should be (because there is no interaction effect). > > I have not run this simulation study myself. Let me know if it does not > produce the predicted result. (I cannot guarantee that I'm not missing > something when producing this recipe.) > > > > Best, > > Eric > > > > > > > > -----Original Message----- > > From: Stephen Politzer-Ahles [mailto:politzerahless at gmail.com] > > Sent: zondag 26 januari 2014 8:25 > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] interactions > > > > Hi Josh, > > > > Have you seen this [admittedly pretty old now] message from the > > archives: http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > > January/003447.html > > ? My understanding was that it is ok to test interactions in within- > > subjects designs, and that you could do it by faking a dataset that > > represents the interaction (step 3 in that message) and then doing a > > dependent samples t-test. I had never heard before that interactions > > can't be tested in a within-subjects design, but also it's been a long > > time since I've looked at this issue--I'd definitely be interested to > > hear if this is no longer the recommended way to test interactions. I > > have seen messages saying that it doesn't work for between-subjects > > designs (e.g. > > http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > > September/004244.html), > > but I'm not sure if that's still current. Hopefully someone on the list > > can offer more insight about the second question. > > > > Best, > > Steve > > > > > > > > Message: 2 > > > Date: Fri, 24 Jan 2014 10:54:10 -0500 > > > From: Joshua Hartshorne > > > To: fieldtrip at science.ru.nl > > > Subject: [FieldTrip] interactions > > > Message-ID: > > > > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > > > Hi List! > > > > > > I have seen around a dozen comments in the archives that interactions > > > can't be tested by permutation for within-subject designs. I haven't > > > been able to find a thread that explains why not. It seems like in a > > > 2x2 design, you could still pick one of the conditions and permute > > the > > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > > and it would be great to see it. > > > > > > Similarly, for the mixed design, why permute the between-subject > > labels? > > > Why not permute the within-subject labels instead? Actually, why not > > > do both? I follow the reasoning why permuting both is overkill, but > > > not why it's wrong. > > > > > > If someone could explain, it would be much appreciated. Knowing what > > > to do is good, but it would be even better to understand why. > > > > > > Thanks, > > > Josh > > > -------------- next part -------------- An HTML attachment was > > > scrubbed... > > > URL: > > > > > > b885cb4a/attachment-0001.html> > > > > > > > ------------------------------ > > Message: 2 > Date: Sun, 26 Jan 2014 10:43:58 +0100 > From: Azeez Adebimpe > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group > level > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi Chaitanya , > I would suggest you try analyitcs instead of montecarlo and use stat= > ft_sourcestatitics(cfg, source1a, source2a .................., > source1b,source2b.............);a and b are for the conditions. > Azeez Adebimpe > > > Date: Sun, 26 Jan 2014 09:46:03 +0100 > From: chaitanya.pro at gmail.com > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level > > Hi Eelke, > > No significant results then in my data. I wonder how my boss takes it :P. > Anyway, thanks for your help on a Sunday that too. > >From your reply I also understand that the code doesn't have any mistakes > :) > > =============================================== > > > > Best RegardsChaitanya Srinivas Lanka > > > Wiss. Mitarbeiter PhD Student > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > Eberhard Karls University Eberhard Karls > University > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > D-72076 Tuebingen D-72074 Tuebingen > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > On Sun, Jan 26, 2014 at 9:40 AM, Eelke Spaak > wrote: > > Hi Chaitanya, > stat.prob reflects the 'p-values' resulting from your statistical test. So > voxels expressing e.g. stat.prob < 0.05 should be considered reflecting a > significant difference between conditions. The NaNs correspond to voxels > outside the brain. > > > Since stat.mask is all zeros (which by default is just stat.prob < 0.05), > this indicates there are no significant differences between your > conditions. There is nothing we can help you with in this respect :) > > > Best,Eelke > > On 26 January 2014 09:06, Chaitanya Srinivas > wrote: > > > Hi Eelke, > > I looked at the stat.stat values if that is what you mean. There > are some NaNs , but also some values. Similarly in stat.prob, there are > some 1's. The stat.mask is all zeros as you say. > > > > > Any further suggestions from you? > Thank you > > =============================================== > > > > Best RegardsChaitanya Srinivas Lanka > > > > > Wiss. Mitarbeiter PhD Student > > > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > > > Eberhard Karls University Eberhard Karls > University > > > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > > > D-72076 Tuebingen D-72074 Tuebingen > > > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > > > On Sun, Jan 26, 2014 at 8:53 AM, Eelke Spaak > wrote: > > > > Dear Chaitanya, > Perhaps an obvious question: do you find any significant differences in > the statistics step (inspect the stat structure)? If not, the mask will > consist of all zeroes, hence giving you a 'blank' plot. > > > > > Best,Eelke > > On 26 January 2014 08:46, Chaitanya Srinivas > wrote: > > > > > Dear fieldtrip users, > I would like to do sourcestatistics on a group level with eeg data. I have > a > pre and post intervention measurement for each of my 10 subjects > . After source reconstruction using an DICS beamformer > and volume normalization, I calculated the sourcegrandaverage for the pre > and > post condition and i have avg.pow for each subject. > > However, when I use the grandaverage results in ft_sourcestatistics in the > configuration shown below and plot the result I just get a blank anatomical > mri. It only runs with cfg.parameter="pow" .I tried with cfg.parameter = > 'avg.pow' it doesnt run. > Do I have to set any additional parameters or am I making some mistake? > > > cfg=[]; > cfg.dim = grandAVGsourcePre.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > > nsubj=length(sourcePre.trial); > cfg.design(1,:) = [1:nsubj 1:nsubj]; > cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; > cfg.uvar = 1; > cfg.ivar = 2; > stat = ft_sourcestatistics(cfg, grandAVGsourcePre, grandAVGsourcePost); > and next interpolation > > cfg = []; > > > > > > cfg.voxelcoord = 'no'; > cfg.parameter = 'mask'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > > > > > > mask = > ft_sourceinterpolate(cfg,stat,mri); > statplot.mask = mask.mask; > > > and then for plotting > > > > > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'stat'; > cfg.maskparameter = 'mask'; > cfg.funcolorlim = [-0.1 0.1]; > cfg.opacitylim = [-0.1 0.1]; > figure > ft_sourceplot(cfg, statplot); > > > > > > > > > > > > > > > > > > > > =============================================== > > > > > > > > Best RegardsChaitanya Srinivas Lanka > > Wiss. Mitarbeiter PhD Student > > > > > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > > > > > Eberhard Karls University Eberhard Karls > University > > > > > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > > > > > D-72076 Tuebingen D-72074 Tuebingen > > > > > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140126/9c7c30c0/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: image.png > Type: image/png > Size: 23195 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140126/9c7c30c0/attachment.png > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 38, Issue 49 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa.filevich at gmail.com Tue Feb 4 10:36:56 2014 From: elisa.filevich at gmail.com (elisa filevich) Date: Tue, 4 Feb 2014 10:36:56 +0100 Subject: [FieldTrip] FFT on a single concatenate trial Message-ID: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Dear all, I'm doing frequency tagging on relatively short epochs. My frequency components are clearly there, but the signal-to-noise ratio is very low. In order to improve SNR, I want to try to concatenate the individual trials (with the appropriate epoch length to keep the frequency constant). I simply concatenated all trial and timepoints vectors into a single trial structure, and I now have may data in a structure that has the following fields: appended = label: {1x22 cell} fsample: 512 elec: [1x1 struct] trial: [22x157990 single] time: [1x157990 double] I then run the FFT below, and I get the following error: error('the data does not contain a dimord, but it also does not resemble raw or component data'); Is it possible to run FFT on a single trial? Is there a way to work around this? Best Elisa cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 5:.5:35; cfg.keeptrials = 'no'; FFThann = ft_freqanalysis(cfg, epoched); -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Feb 4 10:44:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 4 Feb 2014 10:44:34 +0100 Subject: [FieldTrip] FFT on a single concatenate trial In-Reply-To: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> References: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Message-ID: Dear Elisa, Raw data is represented with time axes and trials in a cell array (one element per trial), so if you do appended.trial = {appended.trial}; appended.time = {appended.time}; it should work. Best, Eelke On 4 February 2014 10:36, elisa filevich wrote: > Dear all, > > I'm doing frequency tagging on relatively short epochs. My frequency > components are clearly there, but the signal-to-noise ratio is very low. In > order to improve SNR, I want to try to concatenate the individual trials > (with the appropriate epoch length to keep the frequency constant). > > I simply concatenated all trial and timepoints vectors into a single trial > structure, and I now have may data in a structure that has the following > fields: > > > appended = > > label: {1x22 cell} > fsample: 512 > elec: [1x1 struct] > trial: [22x157990 single] > time: [1x157990 double] > > > I then run the FFT below, and I get the following error: > > error('the data does not contain a dimord, but it also does not resemble > raw or component data'); > > Is it possible to run FFT on a single trial? Is there a way to work around > this? > > Best > Elisa > > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'all'; > cfg.method = 'mtmfft'; > cfg.taper = 'hanning'; > cfg.foi = 5:.5:35; > cfg.keeptrials = 'no'; > FFThann = ft_freqanalysis(cfg, epoched); > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From elisa.filevich at gmail.com Tue Feb 4 11:01:29 2014 From: elisa.filevich at gmail.com (elisa filevich) Date: Tue, 4 Feb 2014 11:01:29 +0100 Subject: [FieldTrip] FFT on a single concatenate trial In-Reply-To: References: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Message-ID: <2221B484-313D-4870-ACD3-28A8FDE2BDD1@gmail.com> It did work, many thanks! On Feb 4, 2014, at 10:44 AM, Eelke Spaak wrote: > Dear Elisa, > > Raw data is represented with time axes and trials in a cell array (one > element per trial), so if you do > > appended.trial = {appended.trial}; > appended.time = {appended.time}; > > it should work. > > Best, > Eelke > > On 4 February 2014 10:36, elisa filevich wrote: >> Dear all, >> >> I'm doing frequency tagging on relatively short epochs. My frequency >> components are clearly there, but the signal-to-noise ratio is very low. In >> order to improve SNR, I want to try to concatenate the individual trials >> (with the appropriate epoch length to keep the frequency constant). >> >> I simply concatenated all trial and timepoints vectors into a single trial >> structure, and I now have may data in a structure that has the following >> fields: >> >> >> appended = >> >> label: {1x22 cell} >> fsample: 512 >> elec: [1x1 struct] >> trial: [22x157990 single] >> time: [1x157990 double] >> >> >> I then run the FFT below, and I get the following error: >> >> error('the data does not contain a dimord, but it also does not resemble >> raw or component data'); >> >> Is it possible to run FFT on a single trial? Is there a way to work around >> this? >> >> Best >> Elisa >> >> >> cfg = []; >> cfg.output = 'pow'; >> cfg.channel = 'all'; >> cfg.method = 'mtmfft'; >> cfg.taper = 'hanning'; >> cfg.foi = 5:.5:35; >> cfg.keeptrials = 'no'; >> FFThann = ft_freqanalysis(cfg, epoched); >> >> >> >> _______________________________________________ >> 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 Feb 4 12:16:34 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 4 Feb 2014 12:16:34 +0100 (CET) Subject: [FieldTrip] Interactions In-Reply-To: References: Message-ID: <004e01cf219a$8eb3ec30$ac1bc490$@maris@psych.ru.nl> Hi Josh, You may have found something that is worth exploring. However, it will be challenge to provide a formal proof of the fact that the permutation analysis provides false alarm rate control under the null hypothesis of no interaction effect. The crucial design here is the full between-subjects design, because for the other designs a valid permutation analysis exists (as demonstrated by formal proof). I would embark on a testing-the-limits simulation study: between/between. Normally-distributed data in each of 4 cells. The effect size for e1 and e2 were each set to 1, with a SD of 1. The interaction (if present) was .75 with an SD of 1. There were 40 subjects per cell. Set the effect sizes to 20, reduce the number of subjects to 5 per cell, and simulate data without an interaction effect. I'm curious how the simulated false alarm rate of the permutation test looks like. (After this email, I will not continue this discussion any further. It is becoming a scientific project; interesting though .) Best, Eric within/within. For each participant, I generated a random intercept (M=0, SD=.25) and random slopes for both e1 and e2 (M=1, SD=.25) and for the interaction, if present (M=.75, SD=.25). Having generated that, for each participant in each condition, I drew a single sample where the mean was the sum of the effects just listed and the SD=1. within/between. The first factor was within subjects and the second was between. Each subject had a random intercept (SD=.25) and a random slope for factor 1 (M=1, SD=.25). The subjects in Level 1 for both factors had a random intercept (M=.75, SD=.25). The between-subject factor was 1. As above, I then generated a single datapoint from a normal distribution (M=1, SD=1). In each case, I ran 500 simulations with an interaction and 500 without. For each, I analyzed either with an ANOVA (ezANOVA in R) or a 500-sample permutation test, as follows: Permutations respected the structure of the data. So in the between/between case, condition labels were permuted freely. In the within/within case, for each subject, I randomly flipped the levels of each factor, preserving structure. That is, each subject had two cells where factor 1 was 0 and two where factor 1 was 1. If the codes switched, both the 1s were turned to 0s and both the 0s were turned to 1s. The same was done for Factor 2. I dealt with the within/between data in an analogous fashion, with the constraint that the same number of subjects be in the each of the between-subject conditions. Having done my permuting, I then calculated the F-stat for the interaction. I then compared the actual F-stat against the resulting distribution. The short description of the result is I got basically the same results for the permutation tests and the ANOVA. For instance, in the within/within case, when there was an actual interaction in the generative model, I got an average p-value of .0844 using ezANOVA and .0858 using permutations. The Type II error was .318 and .312, respectively. When there was no interaction, I got average p-values of .5052 and .5066, respectively, and a Type I error of .036 and .038, respectively. I got analogous results for between/between and within/within. Incidentally, I understand that it isn't strictly necessary to permute condition codes for both factors. But it doesn't seem to do any harm, either. I actually tried the within/between case permuting only the between factor, with similar results. Thanks, Josh On Sun, Jan 26, 2014 at 4:44 AM, wrote: Hi Steve and Josh, Josh writes > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > and it would be great to see it. In general, questions like these are very hard to answer satisfactorily on a discussion list. It is dealt with much more easily in person, say at one of the Fieldtrip courses. However, let me give it a try. To prove that something does not work it suffices to produces a single example that shows the contrary. Try the following: Generate random data in a 2-by-2 between-subjects design (say, normally distributed within every cell). Add large main effects (relative to the within-cell variance; say, MS_beween 50 times larger than MS_within) and no interaction effect. Take a small number of subjects (say, 5 per cell). Now, calculate a permutation p-value for the interaction-effect F-statistic by permuting across all 4 cells. Do this for a large number of simulated data set. My prediction is that, on average, the F-statistic p-value is less than 0.05, which it should be (because there is no interaction effect). I have not run this simulation study myself. Let me know if it does not produce the predicted result. (I cannot guarantee that I'm not missing something when producing this recipe.) Best, Eric > -----Original Message----- > From: Stephen Politzer-Ahles [mailto:politzerahless at gmail.com] > Sent: zondag 26 januari 2014 8:25 > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] interactions > > Hi Josh, > > Have you seen this [admittedly pretty old now] message from the > archives: http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > January/003447.html > ? My understanding was that it is ok to test interactions in within- > subjects designs, and that you could do it by faking a dataset that > represents the interaction (step 3 in that message) and then doing a > dependent samples t-test. I had never heard before that interactions > can't be tested in a within-subjects design, but also it's been a long > time since I've looked at this issue--I'd definitely be interested to > hear if this is no longer the recommended way to test interactions. I > have seen messages saying that it doesn't work for between-subjects > designs (e.g. > http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > September/004244.html), > but I'm not sure if that's still current. Hopefully someone on the list > can offer more insight about the second question. > > Best, > Steve > > > > > Message: 2 > > Date: Fri, 24 Jan 2014 10:54:10 -0500 > > From: Joshua Hartshorne > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] interactions > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi List! > > > > I have seen around a dozen comments in the archives that interactions > > can't be tested by permutation for within-subject designs. I haven't > > been able to find a thread that explains why not. It seems like in a > > 2x2 design, you could still pick one of the conditions and permute > the > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > and it would be great to see it. > > > > Similarly, for the mixed design, why permute the between-subject > labels? > > Why not permute the within-subject labels instead? Actually, why not > > do both? I follow the reasoning why permuting both is overkill, but > > not why it's wrong. > > > > If someone could explain, it would be much appreciated. Knowing what > > to do is good, but it would be even better to understand why. > > > > Thanks, > > Josh > > -------------- next part -------------- An HTML attachment was > > scrubbed... > > URL: > > > b885cb4a/attachment-0001.html> > > ------------------------------ Message: 2 Date: Sun, 26 Jan 2014 10:43:58 +0100 From: Azeez Adebimpe To: FieldTrip discussion list Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Chaitanya , I would suggest you try analyitcs instead of montecarlo and use stat= ft_sourcestatitics(cfg, source1a, source2a .................., source1b,source2b.............);a and b are for the conditions. Azeez Adebimpe Date: Sun, 26 Jan 2014 09:46:03 +0100 From: chaitanya.pro at gmail.com To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level Hi Eelke, No significant results then in my data. I wonder how my boss takes it :P. Anyway, thanks for your help on a Sunday that too. >From your reply I also understand that the code doesn't have any mistakes :) =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== On Sun, Jan 26, 2014 at 9:40 AM, Eelke Spaak wrote: Hi Chaitanya, stat.prob reflects the 'p-values' resulting from your statistical test. So voxels expressing e.g. stat.prob < 0.05 should be considered reflecting a significant difference between conditions. The NaNs correspond to voxels outside the brain. Since stat.mask is all zeros (which by default is just stat.prob < 0.05), this indicates there are no significant differences between your conditions. There is nothing we can help you with in this respect :) Best,Eelke On 26 January 2014 09:06, Chaitanya Srinivas wrote: Hi Eelke, I looked at the stat.stat values if that is what you mean. There are some NaNs , but also some values. Similarly in stat.prob, there are some 1's. The stat.mask is all zeros as you say. Any further suggestions from you? Thank you =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== On Sun, Jan 26, 2014 at 8:53 AM, Eelke Spaak wrote: Dear Chaitanya, Perhaps an obvious question: do you find any significant differences in the statistics step (inspect the stat structure)? If not, the mask will consist of all zeroes, hence giving you a 'blank' plot. Best,Eelke On 26 January 2014 08:46, Chaitanya Srinivas wrote: Dear fieldtrip users, I would like to do sourcestatistics on a group level with eeg data. I have a pre and post intervention measurement for each of my 10 subjects . After source reconstruction using an DICS beamformer and volume normalization, I calculated the sourcegrandaverage for the pre and post condition and i have avg.pow for each subject. However, when I use the grandaverage results in ft_sourcestatistics in the configuration shown below and plot the result I just get a blank anatomical mri. It only runs with cfg.parameter="pow" .I tried with cfg.parameter = 'avg.pow' it doesnt run. Do I have to set any additional parameters or am I making some mistake? cfg=[]; cfg.dim = grandAVGsourcePre.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; nsubj=length(sourcePre.trial); cfg.design(1,:) = [1:nsubj 1:nsubj]; cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; cfg.uvar = 1; cfg.ivar = 2; stat = ft_sourcestatistics(cfg, grandAVGsourcePre, grandAVGsourcePost); and next interpolation cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'mask'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; mask = ft_sourceinterpolate(cfg,stat,mri); statplot.mask = mask.mask; and then for plotting cfg = []; cfg.method = 'slice'; cfg.funparameter = 'stat'; cfg.maskparameter = 'mask'; cfg.funcolorlim = [-0.1 0.1]; cfg.opacitylim = [-0.1 0.1]; figure ft_sourceplot(cfg, statplot); =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 38, Issue 49 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Tue Feb 4 14:52:58 2014 From: barbara.schorr at uni-ulm.de (Barbara Schorr) Date: Tue, 04 Feb 2014 14:52:58 +0100 Subject: [FieldTrip] Plotting fieldtrip porcessed data with EMEGS Message-ID: <52F0F0B9.8020102@uni-ulm.de> Dear Fieldtripers, I would like to make graphics (topoplots) of ERP data I processed in fieldtrip. For first visualization I usually just use ft_topoplotTFR. Now I want to try EMEGS and the implemented 3D plots. I am not sure how to import my timelocked data into EMEGS. Can anybody help? I also asked the EMEGS developers for help, but I thought I also try it here, because maybe someone else already did this. I hope I was clear enough, and I would appreciate any help. Best regards, Barbara Schorr -- Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm Therapiezentrum Burgau Kapuzinerstraße 34 89331 Burgau From julian.keil at gmail.com Tue Feb 4 16:07:05 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 4 Feb 2014 16:07:05 +0100 Subject: [FieldTrip] Plotting fieldtrip porcessed data with EMEGS In-Reply-To: <52F0F0B9.8020102@uni-ulm.de> References: <52F0F0B9.8020102@uni-ulm.de> Message-ID: Dear Barbara, as far as I remember, the easies way to interact with EMEGS is using ASCII-Files, which you then convert to their own SCADS format. I'm pretty sure there is a function for this (ascii2scads.m or something). So the way to go - as long as it's just for visualization - would be: * Export your Grand Average (.avg field in your ERP data) as ASCII with rows for channels and colums for time points. * Convert ASCII files to SCADS * Load SCADS to EMEGS Note, that you need a 3d Sensor position file in order to plot the EMEGS data. Good Luck, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 04.02.2014 um 14:52 schrieb Barbara Schorr: > Dear Fieldtripers, > > I would like to make graphics (topoplots) of ERP data I processed in fieldtrip. For first visualization I usually just use ft_topoplotTFR. Now I want to try EMEGS and the implemented 3D plots. > I am not sure how to import my timelocked data into EMEGS. Can anybody help? I also asked the EMEGS developers for help, but I thought I also try it here, because maybe someone else already did this. > I hope I was clear enough, and I would appreciate any help. > > Best regards, > Barbara Schorr > > > -- > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > Therapiezentrum Burgau > Kapuzinerstraße 34 > 89331 Burgau > > _______________________________________________ > 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 ivano_triggiani at yahoo.it Tue Feb 4 18:01:07 2014 From: ivano_triggiani at yahoo.it (Ivano Triggiani) Date: Tue, 4 Feb 2014 17:01:07 +0000 (GMT) Subject: [FieldTrip] Still about channel repair Message-ID: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> Hi Fieldtrippers, I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: cfg                = []; replace_channels   = ft_channelselection('gui',hdr.label); cfg.badchannel     = replace_channels; cfg.layout         = 'EEG_layout.lay'; cfg.method         = 'triangulation'; cfg.elecfile       = 'EEG_cap.sfp'; cfg.neighbours     = neighbours; cfg.trials         = 'all'; elec.label         = hdr.label; data.elec          = ft_prepare_layout(cfg); repaired_data      = ft_channelrepair(cfg,rawdataout);   but it returns: ??? Error using ==> ft_channelrepair at 92 the data should contain either an electrode or a gradiometer definition I cannot find into documentation what it means. I guess I have to specify the kind of measurement (EEG/MEG), but where? Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? Thanks a lot, Ivano ------------------------------------------------------------------------ "No man can wear one face to himself and another to the multitude, without finally getting bewildered as to which one is true." Nathaniel Hawthorne -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 4 18:08:37 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 4 Feb 2014 18:08:37 +0100 Subject: [FieldTrip] Still about channel repair In-Reply-To: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> References: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62@donders.ru.nl> Hi Ivano, Please have a look at the link attached. http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > Hi Fieldtrippers, > > I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: > cfg = []; > replace_channels = ft_channelselection('gui',hdr.label); > cfg.badchannel = replace_channels; > cfg.layout = 'EEG_layout.lay'; > cfg.method = 'triangulation'; > cfg.elecfile = 'EEG_cap.sfp'; > cfg.neighbours = neighbours; > cfg.trials = 'all'; > elec.label = hdr.label; > data.elec = ft_prepare_layout(cfg); > repaired_data = ft_channelrepair(cfg,rawdataout); > > but it returns: > ??? Error using ==> ft_channelrepair at 92 > the data should contain either an electrode or a gradiometer definition > > I cannot find into documentation what it means. > I guess I have to specify the kind of measurement (EEG/MEG), but where? > Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? > > Thanks a lot, > > Ivano > ------------------------------------------------------------------------ > > > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkhartshorne at gmail.com Tue Feb 4 20:32:38 2014 From: jkhartshorne at gmail.com (Joshua Hartshorne) Date: Tue, 4 Feb 2014 14:32:38 -0500 Subject: [FieldTrip] Interactions In-Reply-To: <4CD13553-340E-4104-B84E-CE018C4AB241@gmail.com> References: <52f0cc13.48d30e0a.1197.ffff8e6bSMTPIN_ADDED_BROKEN@mx.google.com> <4CD13553-340E-4104-B84E-CE018C4AB241@gmail.com> Message-ID: Hi Eric, I tried effect sizes of 20 and 4 subjects per condition. With 200 iterations, the false alarm rate was *lower* for permutations (.02) than for a standard ANOVA (.025). For good measure, I also tried with effect sizes of 10, with the same result (.02 vs. .03). I still don't see what the problem would be. I always understood that the main thing permutation tests need is exchangeability, and it doesn't get much more exchangeable than in a between/between design. I'm reading the original work now, though, so maybe I'll discover something. Josh On Tue, Feb 4, 2014 at 6:16 AM, Eric Maris wrote: > Hi Josh, > > > > You may have found something that is worth exploring. However, it will be > challenge to provide a formal proof of the fact that the permutation > analysis provides false alarm rate control under the null hypothesis of no > interaction effect. The crucial design here is the full between-subjects > design, because for the other designs a valid permutation analysis exists > (as demonstrated by formal proof). > > > > I would embark on a testing-the-limits simulation study: > > > > *between/between*. Normally-distributed data in each of 4 cells. The > effect size for e1 and e2 were each set to 1, with a SD of 1. The > interaction (if present) was .75 with an SD of 1. There were 40 subjects > per cell. > > > > Set the effect sizes to 20, reduce the number of subjects to 5 per cell, > and simulate data without an interaction effect. I'm curious how the > simulated false alarm rate of the permutation test looks like. > > > > (After this email, I will not continue this discussion any further. It is > becoming a scientific project; interesting though ...) > > > > Best, > > > > Eric > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivano_triggiani at yahoo.it Wed Feb 5 10:25:44 2014 From: ivano_triggiani at yahoo.it (Ivano Triggiani) Date: Wed, 5 Feb 2014 09:25:44 +0000 (GMT) Subject: [FieldTrip] Still about channel repair (jan-mathijs schoffelen) In-Reply-To: References: Message-ID: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> Dear Jan-Mathijs, Thanks a lot for you quick answer, but I can assure you that I read every document before sending any boring message to community :-D . I prepared that electrodes position file (although it is not so clear how to prepare channels position file!), but I don't understand where it has to be declared... I searched for some template scripts but nothing seems to help. My problem seems easy. I have a bad channel (P3 referred to AFz, from standard 10-10 System), and I want to 'repair' it...  Ivano   ------------------------------------------------------------------------ "No man can wear one face to himself and another to the multitude, without finally getting bewildered as to which one is true." Nathaniel Hawthorne ------------------------------ Message: 4 Date: Tue, 4 Feb 2014 18:08:37 +0100 From: jan-mathijs schoffelen To: Fieldtrip List Subject: Re: [FieldTrip] Still about channel repair Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62 at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Ivano, Please have a look at the link attached. http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > Hi Fieldtrippers, > > I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: > cfg                = []; > replace_channels  = ft_channelselection('gui',hdr.label); > cfg.badchannel    = replace_channels; > cfg.layout        = 'EEG_layout.lay'; > cfg.method        = 'triangulation'; > cfg.elecfile      = 'EEG_cap.sfp'; > cfg.neighbours    = neighbours; > cfg.trials        = 'all'; > elec.label        = hdr.label; > data.elec          = ft_prepare_layout(cfg); > repaired_data      = ft_channelrepair(cfg,rawdataout); >  > but it returns: > ??? Error using ==> ft_channelrepair at 92 > the data should contain either an electrode or a gradiometer definition > > I cannot find into documentation what it means. > I guess I have to specify the kind of measurement (EEG/MEG), but where? > Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? > > Thanks a lot, > > Ivano > ------------------------------------------------------------------------ > > > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From victorias at dsv.su.se Wed Feb 5 12:40:56 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Wed, 05 Feb 2014 12:40:56 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF8E57.6060207@donders.ru.nl> References: "\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: Dear Jörn, I still am dealing with finding the right cfg.toi when doing a time frequency analysis. Depending on the time resolution i get NaN values in the first matrixes in the resulting powspctrm and crsspctrm. It seems that for the first times selected there is no data. If i choose a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start below 1 i get Nan values. This is my code for the analysis. I would appreciate some concrete advice and suggestions why i run into this problem. % time-frequency analysis cfg = []; cfg.output = 'powandcsd'; % different for convol than for fft cfg.channel={'C15' 'C10' 'B23' 'B3'}; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.trials=data_clean.trialinfo(:,1) < 20; cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' 'B13' 'D31' 'B11'}; cfg.channelcmb={'C29' 'D23' 'C29' 'D31' 'C29' 'D29' 'C31' 'D23' 'C31' 'D31' 'C31' 'D29' 'C26' 'D23' 'C26' 'D31' 'C26' 'D29' 'C16' 'B26' 'C16' 'B11' 'C16' 'B13' 'C13' 'B26' 'C13' 'B11' 'C13' 'B13' 'C9' 'B26' 'C9' 'B11' 'C9' 'B13'} ; cfg.foi = 12:2:30; % 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:0.05:1; freq_convol = ft_freqanalysis(cfg, data_clean); Thank you a lot Victoria 2014-02-03 13:40 skrev Jörn M. Horschig: > Hi Victoria, > > On 2/3/2014 12:14 PM, Victoria Schröder wrote: >> Thank Jörn, >> >> Thank for the advice for the tutorials but i have already looked at >> them a lot. >> >> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >> averaged power over trials? Well, it might sound obvious, but if you >> say 'yes' to keep trials, you keep the trials, whereas if you say 'no' >> you do not keep the trials and instead get an average. > >> what happens then when the trials do not have the same length? > The average will be made with all data that is available. If some > trials go to 30s but all trials go to 29s, then the average of the > last one second is made of less data then the first 29s. This is a > crucial point for doing statistics as the degrees of freedom, > signal-to noise ration etc. will be different for different time > points. > >> >> and a last question :) >> >> what does cfg.toi depend on ? in the tutorial time frequency >> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is >> that the case? > it depends on what time you are interested in and how much memory > (and cpu time aka patience) you got. > > Good luck ;) > Best, > Jörn > >> >> I hope this should be it for now >> Best >> Victoria >> >> >> 2014-02-03 11:42 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> you might want to read the relevant part of the walkthrough for >>> your >>> questions on mtmconvol and mtmfft: >>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>> >>> Then, also doing this tutorial might help in understanding what the >>> different methods are doing: >>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>> >>> And lastly, to shortly answer your questions, see below ;) >>> >>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>> Dear Jörn, >>> Hi ;) >>> >>>> >>>> the code works but i dont know whether my data is logical and >>>> whether i decided to use the right method etc. >>> maybe you should try to get into one of the FieldTrip courses :) >>> This >>> might tremendously help you in understanding what's being done and >>> why. Otherwise, try to read as much as you can, read methods of >>> papers >>> and discuss with your supervisor and colleagues. Of course, on the >>> mailing list we also like to help a lot. >>>> >>>> My trials are pretty long (approx 30 sec but all are not the same >>>> length) and i am interested in beta frequency. >>>> >>>> First, it is not really clear to me whether i should use >>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>> latter calculates the FFT for shorter self-specified time windows to >>>> look at changes in power over time. Is that right? yep, about right. >>> >>>> however, if i have more stimuli for one condition, how is the time >>>> component then taken into account? it depends on how you segmented >>>> your data. FieldTrip is just transforming your preprocessed data, so >>>> whatever you put in is what you get out. >>> >>>> does mtmconvol take all trials of one condition and average the >>>> the power for each time window over all trials? Or is each trial >>>> treated seperatly? >>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>> >>>> Say i would use cfg.method=mtmfft do i need to specify a >>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >>>> always a single taper. Only when combining multiple tapers you can >>>> effectively smooth in the frequency domain. this is implemented as >>>> taper='dpss' >>> >>>> As i understand hanning if appropriate for lower freuquencies so i >>>> should use this taper to assess beta frequencies. >>> this is a rule of thumb, but there is nothing wrong with using >>> multitapering for lower frequencies. It depends on what you expect >>> from your data and what you want to achieve. >>>> >>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>> this depends on the frequencies you are interested in. I wouldn't >>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>> >>>> >>>> Thank you a lot for the help >>> you're welcome, hope this helps >>>> Best >>>> Victoria >>> Likewise, >>> Jörn >>> >>>> >>>> >>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>> Hi Victoria, >>>>> >>>>> is there anything wrong with the code you used below? By >>>>> smoothing, >>>>> do you refer to smoothing in the frequency domain? >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> >>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>> Hello >>>>>> >>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>>> for the freqanalysis. My stimuli are very long: between 29 and 30 >>>>>> sec. In total i have 4 stimuli per condition and 2 seperate >>>>>> conditions. I am looking at the beta range so fairly low >>>>>> frequencies. >>>>>> >>>>>> this is my code: >>>>>> Am i using the right taper and method. Should i smooth the data? >>>>>> and if so, what should such a smoothing parameter depend on? >>>>>> >>>>>> %fourier analysis >>>>>> cfg=[]; >>>>>> cfg.output='fourier'; >>>>>> cfg.method='mtmfft'; >>>>>> cfg.foi=[12:30]; >>>>>> cfg.taper='hanning'; >>>>>> cfg.keeptrials='yes'; >>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>> >>>>>> >>>>>> %coherence analysis >>>>>> cfg=[]; >>>>>> cfg.method='coh'; >>>>>> cfg.channelcmb={'B3' 'C15' >>>>>> 'B3' 'C10' >>>>>> 'B23' 'C15' >>>>>> 'B23' 'C10'} >>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>> >>>>>> >>>>>> Thank you very much for the suggestions! >>>>>> Best >>>>>> Victoria >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>>> >>>>> -- Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From eelke.spaak at donders.ru.nl Wed Feb 5 12:45:56 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 5 Feb 2014 12:45:56 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: Dear Victoria, Please have a look here: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans Best, Eelke On 5 February 2014 12:40, Victoria Schröder wrote: > Dear Jörn, > > I still am dealing with finding the right cfg.toi when doing a time > frequency analysis. Depending on the time resolution i get NaN values in the > first matrixes in the resulting powspctrm and crsspctrm. It seems that for > the first times selected there is no data. If i choose a cfg.toi 1:0.05:2 > then i get no Nan values but as soon as I start below 1 i get Nan values. > > This is my code for the analysis. I would appreciate some concrete advice > and suggestions why i run into this problem. > > % time-frequency analysis > cfg = []; > cfg.output = 'powandcsd'; % different for convol than for fft > > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.trials=data_clean.trialinfo(:,1) < 20; > cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' 'B13' > 'D31' 'B11'}; > cfg.channelcmb={'C29' 'D23' > 'C29' 'D31' > 'C29' 'D29' > 'C31' 'D23' > 'C31' 'D31' > 'C31' 'D29' > 'C26' 'D23' > 'C26' 'D31' > 'C26' 'D29' > 'C16' 'B26' > 'C16' 'B11' > 'C16' 'B13' > 'C13' 'B26' > 'C13' 'B11' > 'C13' 'B13' > 'C9' 'B26' > 'C9' 'B11' > 'C9' 'B13'} ; > cfg.foi = 12:2:30; % 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:0.05:1; > freq_convol = ft_freqanalysis(cfg, data_clean); > > Thank you a lot > Victoria > > > 2014-02-03 13:40 skrev Jörn M. Horschig: > >> Hi Victoria, >> >> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>> >>> Thank Jörn, >>> >>> Thank for the advice for the tutorials but i have already looked at them >>> a lot. >>> >>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged >>> power over trials? Well, it might sound obvious, but if you say 'yes' to >>> keep trials, you keep the trials, whereas if you say 'no' you do not keep >>> the trials and instead get an average. >> >> >>> what happens then when the trials do not have the same length? >> >> The average will be made with all data that is available. If some >> trials go to 30s but all trials go to 29s, then the average of the >> last one second is made of less data then the first 29s. This is a >> crucial point for doing statistics as the degrees of freedom, >> signal-to noise ration etc. will be different for different time >> points. >> >>> >>> and a last question :) >>> >>> what does cfg.toi depend on ? in the tutorial time frequency analysis >>> this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the case? >> >> it depends on what time you are interested in and how much memory >> (and cpu time aka patience) you got. >> >> Good luck ;) >> Best, >> Jörn >> >>> >>> I hope this should be it for now >>> Best >>> Victoria >>> >>> >>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>> >>>> Hi Victoria, >>>> >>>> you might want to read the relevant part of the walkthrough for your >>>> questions on mtmconvol and mtmfft: >>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>> >>>> Then, also doing this tutorial might help in understanding what the >>>> different methods are doing: >>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>> >>>> And lastly, to shortly answer your questions, see below ;) >>>> >>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>> >>>>> Dear Jörn, >>>> >>>> Hi ;) >>>> >>>>> >>>>> the code works but i dont know whether my data is logical and whether i >>>>> decided to use the right method etc. >>>> >>>> maybe you should try to get into one of the FieldTrip courses :) This >>>> might tremendously help you in understanding what's being done and >>>> why. Otherwise, try to read as much as you can, read methods of papers >>>> and discuss with your supervisor and colleagues. Of course, on the >>>> mailing list we also like to help a lot. >>>>> >>>>> >>>>> My trials are pretty long (approx 30 sec but all are not the same >>>>> length) and i am interested in beta frequency. >>>>> >>>>> First, it is not really clear to me whether i should use >>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the latter >>>>> calculates the FFT for shorter self-specified time windows to look at >>>>> changes in power over time. Is that right? yep, about right. >>>> >>>> >>>>> however, if i have more stimuli for one condition, how is the time >>>>> component then taken into account? it depends on how you segmented your >>>>> data. FieldTrip is just transforming your preprocessed data, so whatever you >>>>> put in is what you get out. >>>> >>>> >>>>> does mtmconvol take all trials of one condition and average the the >>>>> power for each time window over all trials? Or is each trial treated >>>>> seperatly? >>>> >>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>> >>>>> >>>>> Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq >>>>> when using cfg.taper='hanning'? no, a hanning taper is always a single >>>>> taper. Only when combining multiple tapers you can effectively smooth in the >>>>> frequency domain. this is implemented as taper='dpss' >>>> >>>> >>>>> As i understand hanning if appropriate for lower freuquencies so i >>>>> should use this taper to assess beta frequencies. >>>> >>>> this is a rule of thumb, but there is nothing wrong with using >>>> multitapering for lower frequencies. It depends on what you expect >>>> from your data and what you want to achieve. >>>>> >>>>> >>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>>> >>>> this depends on the frequencies you are interested in. I wouldn't >>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>>> >>>>> >>>>> Thank you a lot for the help >>>> >>>> you're welcome, hope this helps >>>>> >>>>> Best >>>>> Victoria >>>> >>>> Likewise, >>>> Jörn >>>> >>>>> >>>>> >>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>> >>>>>> Hi Victoria, >>>>>> >>>>>> is there anything wrong with the code you used below? By smoothing, >>>>>> do you refer to smoothing in the frequency domain? >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>> >>>>>>> Hello >>>>>>> >>>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>>> connectivityanalysis. I am a bit unsure about the method to use for the >>>>>>> freqanalysis. My stimuli are very long: between 29 and 30 sec. In total i >>>>>>> have 4 stimuli per condition and 2 seperate conditions. I am looking at the >>>>>>> beta range so fairly low frequencies. >>>>>>> >>>>>>> this is my code: >>>>>>> Am i using the right taper and method. Should i smooth the data? and >>>>>>> if so, what should such a smoothing parameter depend on? >>>>>>> >>>>>>> %fourier analysis >>>>>>> cfg=[]; >>>>>>> cfg.output='fourier'; >>>>>>> cfg.method='mtmfft'; >>>>>>> cfg.foi=[12:30]; >>>>>>> cfg.taper='hanning'; >>>>>>> cfg.keeptrials='yes'; >>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>> >>>>>>> >>>>>>> %coherence analysis >>>>>>> cfg=[]; >>>>>>> cfg.method='coh'; >>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>> 'B3' 'C10' >>>>>>> 'B23' 'C15' >>>>>>> 'B23' 'C10'} >>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>> >>>>>>> >>>>>>> Thank you very much for the suggestions! >>>>>>> Best >>>>>>> Victoria >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>>> >>>>>> >>>>>> -- Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>>> >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 jm.horschig at donders.ru.nl Wed Feb 5 12:47:46 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 05 Feb 2014 12:47:46 +0100 Subject: [FieldTrip] Still about channel repair (jan-mathijs schoffelen) In-Reply-To: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> References: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> Message-ID: <52F224E2.9080908@donders.ru.nl> Hi Ivano, your input seems a bit ambigious and wrong. First of, try using a new FieldTrip version. Second, you specify cfg.elecfile, then you set data.elec to some layout, and finally you do not use the data variable but rawdataout as your input to ft_channelrepair. Resolving these issues and, let me repeat, updating to a new FT version, will resolve your issues. Buono fortuna, Jörn On 2/5/2014 10:25 AM, Ivano Triggiani wrote: > Dear Jan-Mathijs, > > Thanks a lot for you quick answer, but I can assure you that I read > every document before sending any boring message to community :-D . > I prepared that electrodes position file (although it is not so clear > how to prepare channels position file!), but I don't understand where > it has to be declared... I searched for some template scripts but > nothing seems to help. > My problem seems easy. I have a bad channel (P3 referred to AFz, from > standard 10-10 System), and I want to 'repair' it... > > Ivano > > ------------------------------------------------------------------------ > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > > > > ------------------------------ > > Message: 4 > Date: Tue, 4 Feb 2014 18:08:37 +0100 > From: jan-mathijs schoffelen > > To: Fieldtrip List > > Subject: Re: [FieldTrip] Still about channel repair > Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62 at donders.ru.nl > > > Content-Type: text/plain; charset="us-ascii" > > Hi Ivano, > Please have a look at the link attached. > > http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described > > Best, > Jan-Mathijs > > On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > > > Hi Fieldtrippers, > > > > I read many answers about problems on channel repair, but still > something miss me to understand hot to fix a channel. I tried with: > > cfg = []; > > replace_channels = ft_channelselection('gui',hdr.label); > > cfg.badchannel = replace_channels; > > cfg.layout = 'EEG_layout.lay'; > > cfg.method = 'triangulation'; > > cfg.elecfile = 'EEG_cap.sfp'; > > cfg.neighbours = neighbours; > > cfg.trials = 'all'; > > elec.label = hdr.label; > > data.elec = ft_prepare_layout(cfg); > > repaired_data = ft_channelrepair(cfg,rawdataout); > > > > but it returns: > > ??? Error using ==> ft_channelrepair at 92 > > the data should contain either an electrode or a gradiometer definition > > > > I cannot find into documentation what it means. > > I guess I have to specify the kind of measurement (EEG/MEG), but where? > > Furthermore I read the docs about electrode position , channel > position and so on, but can we get some example? > > > > Thanks a lot, > > > > Ivano > > ------------------------------------------------------------------------ > > > > > > > > > > "No man can wear one face to himself > > and another to the multitude, > > without finally getting bewildered > > as to which one is true." > > > > > > Nathaniel Hawthorne > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Wed Feb 5 12:49:38 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Wed, 05 Feb 2014 12:49:38 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: References: "\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: <52F22552.3030109@donders.ru.nl> Hi Victoria, see: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans?s[]=tfr&s[]=nan and: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis These should answer your question ;) Best, Jörn On 2/5/2014 12:40 PM, Victoria Schröder wrote: > Dear Jörn, > > I still am dealing with finding the right cfg.toi when doing a time > frequency analysis. Depending on the time resolution i get NaN values > in the first matrixes in the resulting powspctrm and crsspctrm. It > seems that for the first times selected there is no data. If i choose > a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start > below 1 i get Nan values. > > This is my code for the analysis. I would appreciate some concrete > advice and suggestions why i run into this problem. > > % time-frequency analysis > cfg = []; > cfg.output = 'powandcsd'; % different for convol than for fft > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.trials=data_clean.trialinfo(:,1) < 20; > cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' > 'B13' 'D31' 'B11'}; > cfg.channelcmb={'C29' 'D23' > 'C29' 'D31' > 'C29' 'D29' > 'C31' 'D23' > 'C31' 'D31' > 'C31' 'D29' > 'C26' 'D23' > 'C26' 'D31' > 'C26' 'D29' > 'C16' 'B26' > 'C16' 'B11' > 'C16' 'B13' > 'C13' 'B26' > 'C13' 'B11' > 'C13' 'B13' > 'C9' 'B26' > 'C9' 'B11' > 'C9' 'B13'} ; > cfg.foi = 12:2:30; % 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:0.05:1; > freq_convol = ft_freqanalysis(cfg, data_clean); > > Thank you a lot > Victoria > > > 2014-02-03 13:40 skrev Jörn M. Horschig: >> Hi Victoria, >> >> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>> Thank Jörn, >>> >>> Thank for the advice for the tutorials but i have already looked at >>> them a lot. >>> >>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >>> averaged power over trials? Well, it might sound obvious, but if you >>> say 'yes' to keep trials, you keep the trials, whereas if you say >>> 'no' you do not keep the trials and instead get an average. >> >>> what happens then when the trials do not have the same length? >> The average will be made with all data that is available. If some >> trials go to 30s but all trials go to 29s, then the average of the >> last one second is made of less data then the first 29s. This is a >> crucial point for doing statistics as the degrees of freedom, >> signal-to noise ration etc. will be different for different time >> points. >> >>> >>> and a last question :) >>> >>> what does cfg.toi depend on ? in the tutorial time frequency >>> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why >>> is that the case? >> it depends on what time you are interested in and how much memory >> (and cpu time aka patience) you got. >> >> Good luck ;) >> Best, >> Jörn >> >>> >>> I hope this should be it for now >>> Best >>> Victoria >>> >>> >>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>> Hi Victoria, >>>> >>>> you might want to read the relevant part of the walkthrough for your >>>> questions on mtmconvol and mtmfft: >>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>> >>>> Then, also doing this tutorial might help in understanding what the >>>> different methods are doing: >>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>> >>>> And lastly, to shortly answer your questions, see below ;) >>>> >>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>> Dear Jörn, >>>> Hi ;) >>>> >>>>> >>>>> the code works but i dont know whether my data is logical and >>>>> whether i decided to use the right method etc. >>>> maybe you should try to get into one of the FieldTrip courses :) This >>>> might tremendously help you in understanding what's being done and >>>> why. Otherwise, try to read as much as you can, read methods of papers >>>> and discuss with your supervisor and colleagues. Of course, on the >>>> mailing list we also like to help a lot. >>>>> >>>>> My trials are pretty long (approx 30 sec but all are not the same >>>>> length) and i am interested in beta frequency. >>>>> >>>>> First, it is not really clear to me whether i should use >>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>>> latter calculates the FFT for shorter self-specified time windows >>>>> to look at changes in power over time. Is that right? yep, about >>>>> right. >>>> >>>>> however, if i have more stimuli for one condition, how is the time >>>>> component then taken into account? it depends on how you segmented >>>>> your data. FieldTrip is just transforming your preprocessed data, >>>>> so whatever you put in is what you get out. >>>> >>>>> does mtmconvol take all trials of one condition and average the >>>>> the power for each time window over all trials? Or is each trial >>>>> treated seperatly? >>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>> >>>>> Say i would use cfg.method=mtmfft do i need to specify a >>>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper >>>>> is always a single taper. Only when combining multiple tapers you >>>>> can effectively smooth in the frequency domain. this is >>>>> implemented as taper='dpss' >>>> >>>>> As i understand hanning if appropriate for lower freuquencies so i >>>>> should use this taper to assess beta frequencies. >>>> this is a rule of thumb, but there is nothing wrong with using >>>> multitapering for lower frequencies. It depends on what you expect >>>> from your data and what you want to achieve. >>>>> >>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>>> this depends on the frequencies you are interested in. I wouldn't >>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>>> >>>>> >>>>> Thank you a lot for the help >>>> you're welcome, hope this helps >>>>> Best >>>>> Victoria >>>> Likewise, >>>> Jörn >>>> >>>>> >>>>> >>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>> Hi Victoria, >>>>>> >>>>>> is there anything wrong with the code you used below? By smoothing, >>>>>> do you refer to smoothing in the frequency domain? >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>> Hello >>>>>>> >>>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>>>> for the freqanalysis. My stimuli are very long: between 29 and >>>>>>> 30 sec. In total i have 4 stimuli per condition and 2 seperate >>>>>>> conditions. I am looking at the beta range so fairly low >>>>>>> frequencies. >>>>>>> >>>>>>> this is my code: >>>>>>> Am i using the right taper and method. Should i smooth the data? >>>>>>> and if so, what should such a smoothing parameter depend on? >>>>>>> >>>>>>> %fourier analysis >>>>>>> cfg=[]; >>>>>>> cfg.output='fourier'; >>>>>>> cfg.method='mtmfft'; >>>>>>> cfg.foi=[12:30]; >>>>>>> cfg.taper='hanning'; >>>>>>> cfg.keeptrials='yes'; >>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>> >>>>>>> >>>>>>> %coherence analysis >>>>>>> cfg=[]; >>>>>>> cfg.method='coh'; >>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>> 'B3' 'C10' >>>>>>> 'B23' 'C15' >>>>>>> 'B23' 'C10'} >>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>> >>>>>>> >>>>>>> Thank you very much for the suggestions! >>>>>>> Best >>>>>>> Victoria >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>>> >>>>>> -- Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From victorias at dsv.su.se Wed Feb 5 12:57:31 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Wed, 05 Feb 2014 12:57:31 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52F22552.3030109@donders.ru.nl> References: "\"\\\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\\\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>\" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se>" <52EF8E57.6060207@donders.ru.nl> <52F22552.3030109@donders.ru.nl> Message-ID: <9d84b751ebbaefe3ace5c3405cbc9a7c@dsv.su.se> Dear Eelke and Jörn Yes, this really answers my question. Really cool! Thanks Victoria 2014-02-05 12:49 skrev Jörn M. Horschig: > Hi Victoria, > > see: > > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans?s[]=tfr&s[]=nan > and: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis > > These should answer your question ;) > > Best, > Jörn > > On 2/5/2014 12:40 PM, Victoria Schröder wrote: >> Dear Jörn, >> >> I still am dealing with finding the right cfg.toi when doing a time >> frequency analysis. Depending on the time resolution i get NaN values >> in the first matrixes in the resulting powspctrm and crsspctrm. It >> seems that for the first times selected there is no data. If i choose >> a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start >> below 1 i get Nan values. >> >> This is my code for the analysis. I would appreciate some concrete >> advice and suggestions why i run into this problem. >> >> % time-frequency analysis >> cfg = []; >> cfg.output = 'powandcsd'; % different for convol than for fft >> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >> cfg.method = 'mtmconvol'; >> cfg.taper = 'hanning'; >> cfg.keeptrials = 'yes'; >> cfg.trials=data_clean.trialinfo(:,1) < 20; >> cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' >> 'B13' 'D31' 'B11'}; >> cfg.channelcmb={'C29' 'D23' >> 'C29' 'D31' >> 'C29' 'D29' >> 'C31' 'D23' >> 'C31' 'D31' >> 'C31' 'D29' >> 'C26' 'D23' >> 'C26' 'D31' >> 'C26' 'D29' >> 'C16' 'B26' >> 'C16' 'B11' >> 'C16' 'B13' >> 'C13' 'B26' >> 'C13' 'B11' >> 'C13' 'B13' >> 'C9' 'B26' >> 'C9' 'B11' >> 'C9' 'B13'} ; >> cfg.foi = 12:2:30; % 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:0.05:1; >> freq_convol = ft_freqanalysis(cfg, data_clean); >> >> Thank you a lot >> Victoria >> >> >> 2014-02-03 13:40 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>>> Thank Jörn, >>>> >>>> Thank for the advice for the tutorials but i have already looked >>>> at them a lot. >>>> >>>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >>>> averaged power over trials? Well, it might sound obvious, but if you >>>> say 'yes' to keep trials, you keep the trials, whereas if you say >>>> 'no' you do not keep the trials and instead get an average. >>> >>>> what happens then when the trials do not have the same length? >>> The average will be made with all data that is available. If some >>> trials go to 30s but all trials go to 29s, then the average of the >>> last one second is made of less data then the first 29s. This is a >>> crucial point for doing statistics as the degrees of freedom, >>> signal-to noise ration etc. will be different for different time >>> points. >>> >>>> >>>> and a last question :) >>>> >>>> what does cfg.toi depend on ? in the tutorial time frequency >>>> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why >>>> is that the case? >>> it depends on what time you are interested in and how much memory >>> (and cpu time aka patience) you got. >>> >>> Good luck ;) >>> Best, >>> Jörn >>> >>>> >>>> I hope this should be it for now >>>> Best >>>> Victoria >>>> >>>> >>>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>>> Hi Victoria, >>>>> >>>>> you might want to read the relevant part of the walkthrough for >>>>> your >>>>> questions on mtmconvol and mtmfft: >>>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>>> >>>>> Then, also doing this tutorial might help in understanding what >>>>> the >>>>> different methods are doing: >>>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>>> >>>>> And lastly, to shortly answer your questions, see below ;) >>>>> >>>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>>> Dear Jörn, >>>>> Hi ;) >>>>> >>>>>> >>>>>> the code works but i dont know whether my data is logical and >>>>>> whether i decided to use the right method etc. >>>>> maybe you should try to get into one of the FieldTrip courses :) >>>>> This >>>>> might tremendously help you in understanding what's being done >>>>> and >>>>> why. Otherwise, try to read as much as you can, read methods of >>>>> papers >>>>> and discuss with your supervisor and colleagues. Of course, on >>>>> the >>>>> mailing list we also like to help a lot. >>>>>> >>>>>> My trials are pretty long (approx 30 sec but all are not the >>>>>> same length) and i am interested in beta frequency. >>>>>> >>>>>> First, it is not really clear to me whether i should use >>>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>>>> latter calculates the FFT for shorter self-specified time windows >>>>>> to look at changes in power over time. Is that right? yep, about >>>>>> right. >>>>> >>>>>> however, if i have more stimuli for one condition, how is the >>>>>> time component then taken into account? it depends on how you >>>>>> segmented your data. FieldTrip is just transforming your >>>>>> preprocessed data, so whatever you put in is what you get out. >>>>> >>>>>> does mtmconvol take all trials of one condition and average the >>>>>> the power for each time window over all trials? Or is each trial >>>>>> treated seperatly? >>>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>>> >>>>>> Say i would use cfg.method=mtmfft do i need to specify a >>>>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper >>>>>> is always a single taper. Only when combining multiple tapers you >>>>>> can effectively smooth in the frequency domain. this is >>>>>> implemented as taper='dpss' >>>>> >>>>>> As i understand hanning if appropriate for lower freuquencies so >>>>>> i should use this taper to assess beta frequencies. >>>>> this is a rule of thumb, but there is nothing wrong with using >>>>> multitapering for lower frequencies. It depends on what you >>>>> expect >>>>> from your data and what you want to achieve. >>>>>> >>>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is >>>>>> appropriate? >>>>> this depends on the frequencies you are interested in. I wouldn't >>>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least >>>>> 300ms. >>>>> >>>>>> >>>>>> Thank you a lot for the help >>>>> you're welcome, hope this helps >>>>>> Best >>>>>> Victoria >>>>> Likewise, >>>>> Jörn >>>>> >>>>>> >>>>>> >>>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>>> Hi Victoria, >>>>>>> >>>>>>> is there anything wrong with the code you used below? By >>>>>>> smoothing, >>>>>>> do you refer to smoothing in the frequency domain? >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> >>>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>>> Hello >>>>>>>> >>>>>>>> I am currently working on a freqanalysis as a first step to do >>>>>>>> a connectivityanalysis. I am a bit unsure about the method to >>>>>>>> use for the freqanalysis. My stimuli are very long: between 29 >>>>>>>> and 30 sec. In total i have 4 stimuli per condition and 2 >>>>>>>> seperate conditions. I am looking at the beta range so fairly >>>>>>>> low frequencies. >>>>>>>> >>>>>>>> this is my code: >>>>>>>> Am i using the right taper and method. Should i smooth the >>>>>>>> data? and if so, what should such a smoothing parameter depend >>>>>>>> on? >>>>>>>> >>>>>>>> %fourier analysis >>>>>>>> cfg=[]; >>>>>>>> cfg.output='fourier'; >>>>>>>> cfg.method='mtmfft'; >>>>>>>> cfg.foi=[12:30]; >>>>>>>> cfg.taper='hanning'; >>>>>>>> cfg.keeptrials='yes'; >>>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>>> >>>>>>>> >>>>>>>> %coherence analysis >>>>>>>> cfg=[]; >>>>>>>> cfg.method='coh'; >>>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>>> 'B3' 'C10' >>>>>>>> 'B23' 'C15' >>>>>>>> 'B23' 'C10'} >>>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>>> >>>>>>>> >>>>>>>> Thank you very much for the suggestions! >>>>>>>> Best >>>>>>>> Victoria >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>>> >>>>>>> -- Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> -- Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From joramvandriel at gmail.com Wed Feb 5 13:10:16 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 5 Feb 2014 13:10:16 +0100 Subject: [FieldTrip] cluster-based permutation stats with combined-planar neuromag data Message-ID: Hi all, I want to do statistics on frequency domain MEG data using cluster-based permutation testing, but I get stuck with the neighbour construction. I have Neuromag data, 204 sensors (excluding magnetometers), on which I did frequency analysis, after which I used ft_combineplanar to get a final set of 102 sensors. I have two freq cell structures corresponding to 2 conditions, 10 subjects each (within-subject design). I know the layout, template and neighbour approach for Neuromag is tricky because of the different sensor types, but here's what I did: cfg = []; cfg_lay.layout = 'neuromag306cmb.lay'; cfg_lay.grad = freq{1}.grad; cfg_neighb.layout = ft_prepare_layout(cfg_lay,freq{1}); cfg_neighb.method = 'template'; cfg_neighb.template = 'neuromag306cmb_neighb.mat'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb,freq{1}); cfg.minnbchan = 2; ... And then the cfg continues with standard settings for cluster-based permutation testing. When I run: stat = ft_freqstatistics(cfg, freq{2}, freq{1}); I get the error: ??? Error using ==> findcluster at 56 invalid dimension of spatdimneighbstructmat Error in ==> clusterstat at 185 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> ft_statistics_montecarlo at 361 [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in ==> ft_freqstatistics at 323 [stat, cfg] = statmethod(cfg, dat, cfg.design); I digged into these embedded functions but can't wrap my head around what went wrong. The later constructed cfg.connectivity seems to be empty; my guess is that produces channeighbstructmat to be empty, which produces the error. The output of ft_prepare_layout says there are on average 6.8 neighbours per channel, and the result of ft_neighbourplot looks perfectly fine: [image: Inline image 1] [image: Inline image 2] Does anybody have a suggestion how to tackle this problem? Any help is much appreciated! Thanks, Joram -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 25532 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 22254 bytes Desc: not available URL: From i.e.j.de.vries at student.vu.nl Wed Feb 5 13:29:33 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 5 Feb 2014 12:29:33 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Wed Feb 5 13:38:09 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 5 Feb 2014 12:38:09 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> p.s. And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? Greetings ________________________________ From: Vries, I.E.J. de Sent: 05 February 2014 13:29 To: fieldtrip at science.ru.nl Subject: corticomuscular and intermuscular coherence Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Feb 5 14:02:27 2014 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 5 Feb 2014 14:02:27 +0100 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> Message-ID: Dear Ingmar, I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: > p.s. > > And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? > > Greetings > > From: Vries, I.E.J. de > Sent: 05 February 2014 13:29 > To: fieldtrip at science.ru.nl > Subject: corticomuscular and intermuscular coherence > > Dear Fieldtrippers, > > I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. > My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... > > Thanks in advance, > Greetings, > Ingmar > _______________________________________________ > 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 albenin at mail.ru Wed Feb 5 15:57:47 2014 From: albenin at mail.ru (=?UTF-8?B?0JDQu9C10LrRgdC10Lkg0JHQtdC90LjQvQ==?=) Date: Wed, 05 Feb 2014 18:57:47 +0400 Subject: [FieldTrip] =?utf-8?q?Statistics_on_freq_data?= Message-ID: <1391612267.921368498@f293.i.mail.ru> Dear Fieldtripers, First of all big thanks for a wonderful tool and support! I have some questions about cluster based permutation test on TF data. I perform a between-trials experiment and want to search differences say on frequencies 10-30Hz and latencies 200-1200 ms from onset. So I need to explore these ranges for possible differencies in powerspectrum. When I use for example cfg.latency          = [0.2 1.2]; cfg.frequency        = [10 30]; I find no significant clusters, and lowest p_value is very high, say 0,8. But when I try to look at smaller time/frequency areas, like cfg.latency          = [0.2 0.3]; cfg.frequency        = [15 16]; There can be one or two significant clusters with p_values<0.01. So my question is: does the algorithm look for the whole specified TF window like 0.2-1.2s   10-30Hz and tries to find significant difference based on the whole length of interval? This could explain why there are no significant clusters on bigger windows. Such clusters appear when we shorten the toi and foi - it's much more probable to find differences at smaller scales. So the next question is: what should I do to explore the whole number of frequencies and latencies? Shall I run a loop with parameters like this: Iteration 1 cfg.latency          = [0.2 0.3]; cfg.frequency        = [15 16]; Iteration 2 cfg.latency          = [0.3 0.4]; cfg.frequency        = [15 16]; ... and so on? Or maybe I do not understand something in basis of method? BTW, I've read all tutorials and appropriate papers like Nonparametric statistical testing of EEG, but could not find the answer. Thanks in advance, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From edueeg at gmail.com Wed Feb 5 17:54:37 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Wed, 5 Feb 2014 14:54:37 -0200 Subject: [FieldTrip] eeglab2fieldtrip segmented data Message-ID: <722C334C-5EA5-43FD-BD0D-F493D42718DA@gmail.com> Hello There, I am trying to export continuous data segmented in EEGLab (using the eeg_rejepochs function) to fieldtrip using eeglab2fieldtrip, but it does not seem to correctly understand the segmentation done in EEGLab, issuing a warning that "the data does not contain a trial definition" and another stating that "reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous dataset" (which I know they're not) Has anybody gone through something similar and can help me figure out how to solve this, please? many thanks eduardo From sviter33 at gmail.com Thu Feb 6 13:01:02 2014 From: sviter33 at gmail.com (=?KOI8-R?B?7NXLz9HOz9cg7cHL08nN?=) Date: Thu, 6 Feb 2014 16:01:02 +0400 Subject: [FieldTrip] Coherence statistics between two groups of subjects Message-ID: Can anyone help me to understand the best way to calculate coherence of continuous data and compare results for two groups of subjects? The problem is that length of records is not equal for different subjects and for every subject I have several files. However, total length of records is not less than 30 s (Fs=500 Hz). I want to be sure that unequal length is not effect on results of statistical comparison between groups. Is it better to process these files separately and then average results or use ft_appenddata for each subject's files before the analysis? My second question is how to make a statistical test on the results of ft_connectivityanalysis between two groups of subjects. I have read all mail archive about this topic but with no progress. May anyone provide simple code example? Thenks for your help, Maxim Lukoyanov J. Researcher, NNMST -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Feb 6 14:22:50 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 06 Feb 2014 14:22:50 +0100 Subject: [FieldTrip] Gradiometer definition after ft_appenddata Message-ID: <52F38CAA.5070301@uni-tuebingen.de> Dear all, I have a question concerning ft_appenddata dropping the gradiometer definition to make sure one is not using a grad definition that does not fit the data (see [1] for an earlier quick discussion). I have an MEG data set in which some subjects had a short break during recording. The fiducial markers remained in place during the break. For each of these subjects, I would like to define trials in both data parts and then append them before doing further analysis. Is it valid to use the first part's grad definition for the combined data set? The grad definitions in the two parts are not identical. I assume this is because the subjects moved during the break and the grad definition is in relation to the fiducial markers at recording onset? Thanks in advance for your help! All the best, Jens P.S.: Sorry in case there is information on that on the fieldtrip website. I could only find an earlier quick exchange on this mailinglist: [1] http://mailman.science.ru.nl/pipermail/fieldtrip/2013-April/006405.html Here, Eelke Spaak said one can attach gradiometer data as long as one is sure it's the correct one. But how do I know it is correct? ...and the general info about the grad definitions: [2] http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described From i.e.j.de.vries at student.vu.nl Fri Feb 7 00:51:10 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Thu, 6 Feb 2014 23:51:10 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Hi Julian, Thanks for the reply. Yes I understand coherence of 1 time series is not possible, but I figured if you have a long enough trial and separate this in enough time windows, you could calculate the average coherence (so not time-resolved) over the whole trial. Anyway I have 10 trials per condition so I'll never calculate the coherence for a single trial. cheers, Ingmar ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: 05 February 2014 14:02 To: FieldTrip discussion list Subject: Re: [FieldTrip] corticomuscular and intermuscular coherence Dear Ingmar, I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: p.s. And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? Greetings ________________________________ From: Vries, I.E.J. de Sent: 05 February 2014 13:29 To: fieldtrip at science.ru.nl Subject: corticomuscular and intermuscular coherence Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar _______________________________________________ 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 julian.keil at gmail.com Fri Feb 7 10:22:01 2014 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 7 Feb 2014 10:22:01 +0100 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Message-ID: Hi Ingmar, it is definitively possible to cut your long (15 s) trials into smaller segments (i.e. 2 s) using ft_redefinetrial. The input would look something like this, in case you haven't tried this: for t = 1:length(in.trials) % loop over trials cfg=[]; cfg.trials = t; % only take on trial at a time cfg.length = 2; % length of the new trials cfg.overlap = .5 % How much of trial n should overlap with trial n+1 out{t} = ft_redefinetrial(cfg,in); % This gives you an output of your 90 trials, cut into smaller "sub trials" end This way, you could actually compute the coherence of each of your 90 long trials separately. However, I'm not sure if this is correct at all or not oversampling your data. If anyone objects, please correct me! Best, Julian Am 07.02.2014 um 00:51 schrieb Vries, I.E.J. de: > Hi Julian, > > Thanks for the reply. Yes I understand coherence of 1 time series is not possible, but I figured if you have a long enough trial and separate this in enough time windows, you could calculate the average coherence (so not time-resolved) over the whole trial. Anyway I have 10 trials per condition so I'll never calculate the coherence for a single trial. > > cheers, > Ingmar > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] > Sent: 05 February 2014 14:02 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] corticomuscular and intermuscular coherence > > Dear Ingmar, > > I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. > > In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: > > Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 > > In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. > > Best, > > Julian > > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: > >> p.s. >> >> And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? >> >> Greetings >> >> From: Vries, I.E.J. de >> Sent: 05 February 2014 13:29 >> To: fieldtrip at science.ru.nl >> Subject: corticomuscular and intermuscular coherence >> >> Dear Fieldtrippers, >> >> I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. >> My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... >> >> Thanks in advance, >> Greetings, >> Ingmar >> _______________________________________________ >> 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 aaron.schurger at gmail.com Fri Feb 7 12:43:04 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Fri, 7 Feb 2014 12:43:04 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output Message-ID: Hi, I am running a time-frequency analysis using ft_freqanalysis with the wavelet method. I assume that the output in each frequency band is temporally aligned to the midpoint of the wavelet (thinking in terms of convolution): i.e. the power value that I get at time 0.300, for a given frequency f, is precisely the dot product of f's wavelet CENTERED at 0.300 sec in the data. Is that correct? If so, how can I ask for the output of freqanalysis to be time aligned to the leading edge of the wavelet rather than the center? I.e. I want to make sure that each point in the output only has information about the past and knows nothing about the future, with respect to that time. Is there a simple way to do this? Thanks! Aaron -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From eelke.spaak at donders.ru.nl Fri Feb 7 12:56:13 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 7 Feb 2014 12:56:13 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi Aaron, Indeed, the value you get at t = 0.3 will correspond to the wavelet (or, equivalently, the time window that was tapered and Fourier-transformed) centered at that time point. So if your time window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched from t = 0.1 to t = 0.5 s. There is no default option to align the time points of interest to an edge of the wavelet. However, there is a very straightforward solution to what you are asking: if you want to make sure that the wavelet 'knows nothing' of the future after e.g. t = 0.5s, then only consider the time points up to and including t = 0.3s for any subsequent analyses. (Or more general up to t = tA - W/2, where tA is the point of interest beyond which no info can bleed into the wavelet, and W is the window length.) Best, Eelke On 7 February 2014 12:43, Aaron Schurger wrote: > Hi, > I am running a time-frequency analysis using ft_freqanalysis with the > wavelet method. I assume that the output in each frequency band is > temporally aligned to the midpoint of the wavelet (thinking in terms > of convolution): i.e. the power value that I get at time 0.300, for a > given frequency f, is precisely the dot product of f's wavelet > CENTERED at 0.300 sec in the data. Is that correct? If so, how can I > ask for the output of freqanalysis to be time aligned to the leading > edge of the wavelet rather than the center? I.e. I want to make sure > that each point in the output only has information about the past and > knows nothing about the future, with respect to that time. Is there a > simple way to do this? > Thanks! > Aaron > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Fri Feb 7 17:03:40 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Fri, 7 Feb 2014 11:03:40 -0500 Subject: [FieldTrip] ft_regressconfound Message-ID: Dear all, I am using regressconfound on Neuromag data. In CTF data, data for coil1, coil2 and coil3 are generated and then circumcenter function is called to compute 3 translational and 3 rotational dof. Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT channels that provide quarternion parameters q1 through q6, where q4,q5 and q6 are translations in x, y and z directions. I am using these q4,q5 and q6 to directly compute the rotational orientations (using the last part of the circumcenter.m script). It is said regressconfound must be used as a last step prior to stats. I have 4 blocks of data for each subject. Which option below should I follow? 1. Apply regress confound separately to four blocks? But, then I have to average these four blocks once again using ft_timelockanalysis, then grand average using ft_timelockgrandaverage before computing stats. 2. Or should I append the four blocks first, then perform regressconfound? In this case, I directly go to grandaverage and stats. Any suggestion is appreciated. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Fri Feb 7 17:39:17 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Fri, 7 Feb 2014 17:39:17 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi, Eelke, Thank you for your reply - that is very helpful indeed. One question remains then: how do I know what W is for each frequency band? I think W will of course depend on the frequency (in the case of morlet wavelets), being shorter for higher frequencies and longer for lower frequencies. I know that wavelets are defined in terms of the standard deviation of the envelope, but the window itself of course extends out beyond 1 std of the envelope, to some point beyond where the wavelet tapers to zero (I guess). So, if you know how I can compute W for any arbitrary frequency band, in the case of morlet wavelets, I would be very grateful. Thanks again! Aaron On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: > Hi Aaron, > > Indeed, the value you get at t = 0.3 will correspond to the wavelet > (or, equivalently, the time window that was tapered and > Fourier-transformed) centered at that time point. So if your time > window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched > from t = 0.1 to t = 0.5 s. > > There is no default option to align the time points of interest to an > edge of the wavelet. However, there is a very straightforward solution > to what you are asking: if you want to make sure that the wavelet > 'knows nothing' of the future after e.g. t = 0.5s, then only consider > the time points up to and including t = 0.3s for any subsequent > analyses. (Or more general up to t = tA - W/2, where tA is the point > of interest beyond which no info can bleed into the wavelet, and W is > the window length.) > > Best, > Eelke > > On 7 February 2014 12:43, Aaron Schurger wrote: >> Hi, >> I am running a time-frequency analysis using ft_freqanalysis with the >> wavelet method. I assume that the output in each frequency band is >> temporally aligned to the midpoint of the wavelet (thinking in terms >> of convolution): i.e. the power value that I get at time 0.300, for a >> given frequency f, is precisely the dot product of f's wavelet >> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >> ask for the output of freqanalysis to be time aligned to the leading >> edge of the wavelet rather than the center? I.e. I want to make sure >> that each point in the output only has information about the past and >> knows nothing about the future, with respect to that time. Is there a >> simple way to do this? >> Thanks! >> Aaron >> >> -- >> Aaron Schurger, PhD >> Senior researcher >> Laboratory of Cognitive Neuroscience >> Brain-Mind Institute, Department of Life Sciences >> École Polytechnique Fédérale de Lausanne >> Station 19, AI 2101 >> 1015 Lausanne, Switzerland >> +41 21 693 1771 >> aaron.schurger at epfl.ch >> http://lnco.epfl.ch/ >> >> _______________________________________________ >> 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 -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From eelke.spaak at donders.ru.nl Fri Feb 7 17:57:31 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 7 Feb 2014 17:57:31 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi Aaron, I had been assuming you were using cfg.method = 'mtmconvol', which does an implicit wavelet convolution, but lets you specify the parameters in terms of a window length, taper to use, and smoothing parameter (if using slepian taper sequence). Mtmconvol is the method I would almost always use, as it provides a greater degree of control over and flexibility in the parameters. However, now I understand you might be using cfg.method = 'wavelet'. Could you post the entire cfg you are using for ft_freqanalysis? Best, Eelke On 7 February 2014 17:39, Aaron Schurger wrote: > Hi, Eelke, > Thank you for your reply - that is very helpful indeed. One question > remains then: how do I know what W is for each frequency band? I think > W will of course depend on the frequency (in the case of morlet > wavelets), being shorter for higher frequencies and longer for lower > frequencies. I know that wavelets are defined in terms of the standard > deviation of the envelope, but the window itself of course extends out > beyond 1 std of the envelope, to some point beyond where the wavelet > tapers to zero (I guess). So, if you know how I can compute W for any > arbitrary frequency band, in the case of morlet wavelets, I would be > very grateful. > Thanks again! > Aaron > > On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: >> Hi Aaron, >> >> Indeed, the value you get at t = 0.3 will correspond to the wavelet >> (or, equivalently, the time window that was tapered and >> Fourier-transformed) centered at that time point. So if your time >> window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched >> from t = 0.1 to t = 0.5 s. >> >> There is no default option to align the time points of interest to an >> edge of the wavelet. However, there is a very straightforward solution >> to what you are asking: if you want to make sure that the wavelet >> 'knows nothing' of the future after e.g. t = 0.5s, then only consider >> the time points up to and including t = 0.3s for any subsequent >> analyses. (Or more general up to t = tA - W/2, where tA is the point >> of interest beyond which no info can bleed into the wavelet, and W is >> the window length.) >> >> Best, >> Eelke >> >> On 7 February 2014 12:43, Aaron Schurger wrote: >>> Hi, >>> I am running a time-frequency analysis using ft_freqanalysis with the >>> wavelet method. I assume that the output in each frequency band is >>> temporally aligned to the midpoint of the wavelet (thinking in terms >>> of convolution): i.e. the power value that I get at time 0.300, for a >>> given frequency f, is precisely the dot product of f's wavelet >>> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >>> ask for the output of freqanalysis to be time aligned to the leading >>> edge of the wavelet rather than the center? I.e. I want to make sure >>> that each point in the output only has information about the past and >>> knows nothing about the future, with respect to that time. Is there a >>> simple way to do this? >>> Thanks! >>> Aaron >>> >>> -- >>> Aaron Schurger, PhD >>> Senior researcher >>> Laboratory of Cognitive Neuroscience >>> Brain-Mind Institute, Department of Life Sciences >>> École Polytechnique Fédérale de Lausanne >>> Station 19, AI 2101 >>> 1015 Lausanne, Switzerland >>> +41 21 693 1771 >>> aaron.schurger at epfl.ch >>> http://lnco.epfl.ch/ >>> >>> _______________________________________________ >>> 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 > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From edueeg at gmail.com Fri Feb 7 17:56:52 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Fri, 7 Feb 2014 14:56:52 -0200 Subject: [FieldTrip] ft_channelrepair layout problem Message-ID: Hello all, I am having dificulties with the function ft_channelrepair because one of it's inputs must be cfg.elec (electrode positions) but I can't figure out how to convert my layout (I have it as an ascii .lay as well as .mat with the "lay" struct) to the proper format for ft_channelrepair Already tried the tutorials and ft_readsens and ft_datatype_sens but unfortunately I am still having trouble to solve this Can anyone help me out please?? many thanks eduardo From a.stolk at fcdonders.ru.nl Fri Feb 7 17:59:49 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 7 Feb 2014 17:59:49 +0100 (CET) Subject: [FieldTrip] ft_regressconfound In-Reply-To: Message-ID: <1180822759.5206965.1391792389190.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, It is indeed recommended to use ft_regressconfound as a last step prior to statistical assessment. It will remove trial-by-trial variance in the neural data that can be attributed to trial-by-trial variance in head position. The latter is approximated with regressors containing trial-by-trial information on head positions deviating from the session/experiment mean. Because the head position timeseries is mean-subtracted, the mean neural activity over trials is not affected by ft_regressconfound; only the variance over trials is, which should result in a cleaner representation of the data. In order to estimate the contribution of different head positions to the neural data, ft_regressconfound relies on general linear modeling. Applying ft_regressconfound to the four blocks separately (your option 1) will involve four different model estimations and their associated errors. Because these errors may differ per estimation, the quality of treatment of the neural data may also differ per block. This will not affect the mean neural activity in each block, but it may affect the grand mean over all four blocks as for trials in one block more contribution from head position may be regressed out than for another. Applying ft_regressconfound on the data of the four blocks together (your option 2), will not affect the grand mean over the trials from all four blocks. It will reduce the influence of head movement on trial-by-trial variance in neural activity. This can be for better, or for worse: namely, if there are consistent differences in head positions between two conditions (captured in those four blocks), it may bring the means of neural activity evoked in these two conditions closer to each other, reducing effect sizes. In fact, the employment of ft_regressconfound allows one to make a good case that an observed effect (i.e. differential neural activity between the two conditions) cannot be attributed to differences in head positions when recording those conditions (note that the same analysis could also be performed with eye-movement related activity, or any other measure of a potential confound). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Vrijdag 7 februari 2014 17:03:40 > Onderwerp: [FieldTrip] ft_regressconfound > Dear all, > I am using regressconfound on Neuromag data. In CTF data, data for > coil1, coil2 and coil3 are generated and then circumcenter function is > called to compute 3 translational and 3 rotational dof. > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > channels that provide quarternion parameters q1 through q6, where > q4,q5 and q6 are translations in x, y and z directions. I am using > these q4,q5 and q6 to directly compute the rotational orientations > (using the last part of the circumcenter.m script). > It is said regressconfound must be used as a last step prior to stats. > I have 4 blocks of data for each subject. Which option below should I > follow? > 1. Apply regress confound separately to four blocks? But, then I have > to average these four blocks once again using ft_timelockanalysis, > then grand average using ft_timelockgrandaverage before computing > stats. > 2. Or should I append the four blocks first, then perform > regressconfound? In this case, I directly go to grandaverage and > stats. > Any suggestion is appreciated. > Thanks, > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Sat Feb 8 10:33:01 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Sat, 8 Feb 2014 10:33:01 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi, Eelke, Sure, here it is: cfg=[]; cfg.method = 'wavelet'; % or 'tfr' cfg.toi = []; cfg.foi = [1:12,14:2:30,35:5:100]; cfg.width = 7; cfg.gwidth = 5; cfg.trials = btn; I would be keen on using the mtmconvol method, but then I have to decide how to choose all of the parameters. Any guidelines? Thanks! Aaron On Fri, Feb 7, 2014 at 5:57 PM, Eelke Spaak wrote: > Hi Aaron, > > I had been assuming you were using cfg.method = 'mtmconvol', which > does an implicit wavelet convolution, but lets you specify the > parameters in terms of a window length, taper to use, and smoothing > parameter (if using slepian taper sequence). Mtmconvol is the method I > would almost always use, as it provides a greater degree of control > over and flexibility in the parameters. However, now I understand you > might be using cfg.method = 'wavelet'. Could you post the entire cfg > you are using for ft_freqanalysis? > > Best, > Eelke > > On 7 February 2014 17:39, Aaron Schurger wrote: >> Hi, Eelke, >> Thank you for your reply - that is very helpful indeed. One question >> remains then: how do I know what W is for each frequency band? I think >> W will of course depend on the frequency (in the case of morlet >> wavelets), being shorter for higher frequencies and longer for lower >> frequencies. I know that wavelets are defined in terms of the standard >> deviation of the envelope, but the window itself of course extends out >> beyond 1 std of the envelope, to some point beyond where the wavelet >> tapers to zero (I guess). So, if you know how I can compute W for any >> arbitrary frequency band, in the case of morlet wavelets, I would be >> very grateful. >> Thanks again! >> Aaron >> >> On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: >>> Hi Aaron, >>> >>> Indeed, the value you get at t = 0.3 will correspond to the wavelet >>> (or, equivalently, the time window that was tapered and >>> Fourier-transformed) centered at that time point. So if your time >>> window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched >>> from t = 0.1 to t = 0.5 s. >>> >>> There is no default option to align the time points of interest to an >>> edge of the wavelet. However, there is a very straightforward solution >>> to what you are asking: if you want to make sure that the wavelet >>> 'knows nothing' of the future after e.g. t = 0.5s, then only consider >>> the time points up to and including t = 0.3s for any subsequent >>> analyses. (Or more general up to t = tA - W/2, where tA is the point >>> of interest beyond which no info can bleed into the wavelet, and W is >>> the window length.) >>> >>> Best, >>> Eelke >>> >>> On 7 February 2014 12:43, Aaron Schurger wrote: >>>> Hi, >>>> I am running a time-frequency analysis using ft_freqanalysis with the >>>> wavelet method. I assume that the output in each frequency band is >>>> temporally aligned to the midpoint of the wavelet (thinking in terms >>>> of convolution): i.e. the power value that I get at time 0.300, for a >>>> given frequency f, is precisely the dot product of f's wavelet >>>> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >>>> ask for the output of freqanalysis to be time aligned to the leading >>>> edge of the wavelet rather than the center? I.e. I want to make sure >>>> that each point in the output only has information about the past and >>>> knows nothing about the future, with respect to that time. Is there a >>>> simple way to do this? >>>> Thanks! >>>> Aaron >>>> >>>> -- >>>> Aaron Schurger, PhD >>>> Senior researcher >>>> Laboratory of Cognitive Neuroscience >>>> Brain-Mind Institute, Department of Life Sciences >>>> École Polytechnique Fédérale de Lausanne >>>> Station 19, AI 2101 >>>> 1015 Lausanne, Switzerland >>>> +41 21 693 1771 >>>> aaron.schurger at epfl.ch >>>> http://lnco.epfl.ch/ >>>> >>>> _______________________________________________ >>>> 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 >> >> >> >> -- >> Aaron Schurger, PhD >> Senior researcher >> Laboratory of Cognitive Neuroscience >> Brain-Mind Institute, Department of Life Sciences >> École Polytechnique Fédérale de Lausanne >> Station 19, AI 2101 >> 1015 Lausanne, Switzerland >> +41 21 693 1771 >> aaron.schurger at epfl.ch >> http://lnco.epfl.ch/ >> >> _______________________________________________ >> 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 -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From jm.horschig at donders.ru.nl Mon Feb 10 09:24:28 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 10 Feb 2014 09:24:28 +0100 Subject: [FieldTrip] ft_channelrepair layout problem In-Reply-To: References: Message-ID: <52F88CBC.7090804@donders.ru.nl> Hi Eduardo, it might help if you read in one of the template sensor descriptions (FieldTrip/template/electrode/) and check http://fieldtrip.fcdonders.nl/reference/ft_datatype_sens to get an idea what you need and what to do. Maybe there even is already an electrode template available for you. Best, Jörn On 2/7/2014 5:56 PM, Eduardo Schenberg wrote: > Hello all, > > I am having dificulties with the function ft_channelrepair because one of it's inputs must be cfg.elec (electrode positions) but I can't figure out how to convert my layout (I have it as an ascii .lay as well as .mat with the "lay" struct) to the proper format for ft_channelrepair > > Already tried the tutorials and ft_readsens and ft_datatype_sens but unfortunately I am still having trouble to solve this > > Can anyone help me out please?? > > many thanks > > eduardo > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From bingshuo.li at student.uni-tuebingen.de Mon Feb 10 15:05:51 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Mon, 10 Feb 2014 15:05:51 +0100 Subject: [FieldTrip] TMS-EEG Decay Artifact Message-ID: Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Mon Feb 10 15:24:39 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 10 Feb 2014 15:24:39 +0100 (CET) Subject: [FieldTrip] TMS-EEG Decay Artifact In-Reply-To: References: Message-ID: <007f01cf266b$d5524ad0$7ff6e070$@herring@fcdonders.ru.nl> Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the 'evil' decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Feb 10 17:02:34 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 10 Feb 2014 11:02:34 -0500 Subject: [FieldTrip] ft_regressconfound Message-ID: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> Dear Arjen Thanks for your prompt response. I understand your point regarding using ft_regressconfound with all 4 blocks together. I think that makes more sense. I have another question. I understand ft_regressconfound must be the last step. However, can time frequency calculation be done on data after employing regressconfound? Or would you suggest doing trial by trial time frequency calculation, then compensate using regressconfound and then compute timelock? Is there a reason not to do the former way? Thanks, Raghavan Dear Raghavan, It is indeed recommended to use ft_regressconfound as a last step prior to statistical assessment. It will remove trial-by-trial variance in the neural data that can be attributed to trial-by-trial variance in head position. The latter is approximated with regressors containing trial-by-trial information on head positions deviating from the session/experiment mean. Because the head position timeseries is mean-subtracted, the mean neural activity over trials is not affected by ft_regressconfound; only the variance over trials is, which should result in a cleaner representation of the data. In order to estimate the contribution of different head positions to the neural data, ft_regressconfound relies on general linear modeling. Applying ft_regressconfound to the four blocks separately (your option 1) will involve four different model estimations and their associated errors. Because these errors may differ per estimation, the quality of treatment of the neural data may also differ per block. This will not affect the mean neural activity in each block, but it may affect the grand mean over all four blocks as for trials in one block more contribution from head position may be regressed out than for another. Applying ft_regressconfound on the data of the four blocks together (your option 2), will not affect the grand mean over the trials from all four blocks. It will reduce the influence of head movement on trial-by-trial variance in neural activity. This can be for better, or for worse: namely, if there are consistent differences in head positions between two conditions (captured in those four blocks), it may bring the means of neural activity evoked in these two conditions closer to each other, reducing effect sizes. In fact, the employment of ft_regressconfound allows one to make a good case that an observed effect (i.e. differential neural activity between the two conditions) cannot be attributed to differences in head positions when recording those conditions (note that the same analysis could also be performed with eye-movement related activity, or any other measure of a potential confound). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Vrijdag 7 februari 2014 17:03:40 > Onderwerp: [FieldTrip] ft_regressconfound > Dear all, > I am using regressconfound on Neuromag data. In CTF data, data for > coil1, coil2 and coil3 are generated and then circumcenter function is > called to compute 3 translational and 3 rotational dof. > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > channels that provide quarternion parameters q1 through q6, where > q4,q5 and q6 are translations in x, y and z directions. I am using > these q4,q5 and q6 to directly compute the rotational orientations > (using the last part of the circumcenter.m script). > It is said regressconfound must be used as a last step prior to stats. > I have 4 blocks of data for each subject. Which option below should I > follow? > 1. Apply regress confound separately to four blocks? But, then I have > to average these four blocks once again using ft_timelockanalysis, > then grand average using ft_timelockgrandaverage before computing > stats. > 2. Or should I append the four blocks first, then perform > regressconfound? In this case, I directly go to grandaverage and > stats. > Any suggestion is appreciated. > Thanks, > Raghavan From cmoisello at gmail.com Mon Feb 10 18:03:06 2014 From: cmoisello at gmail.com (Clara Moisello) Date: Mon, 10 Feb 2014 12:03:06 -0500 Subject: [FieldTrip] question about ft_statfun_actvsblT Message-ID: Hello Fieldtrip community, I have a question re: ft_statfun_actvsblT What I would like to do is to identify electrodes whose power changes significantly from baseline at SINGLE subject level, i.e. across trials instead than across subjects. I was thinking that the function above would answer my needs, but I realized that it is probably meant for a between-subject type of comparison. Could someone shed some light on the issue, or has addressed the issue in any other way? Thanks! Clara -- Clara Moisello, PhD Dept Physiology, Pharmacology & Neuroscience City College of New York Harris Hall - Room 202 phone: +12126507487 fax: +12126507726 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Feb 10 19:13:58 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Mon, 10 Feb 2014 19:13:58 +0100 (CET) Subject: [FieldTrip] ft_regressconfound In-Reply-To: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> Message-ID: <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, > I have another question. I understand ft_regressconfound must be the > last > step. However, can time frequency calculation be done on data after > employing regressconfound? Or would you suggest doing trial by trial > time > frequency calculation, then compensate using regressconfound and then > compute timelock? Is there a reason not to do the former way? I would recommend doing the latter, provided that you meant to say 'compute statistics' instead of 'compute timelock'. When ft_regressconfound is applied to raw/ERF data, trial-by-trial adjustments are made to the data, according to explained variance by head movements (and thus differences in distances to the sensors). Subsequently performing time frequency analysis on this data may give a distorted view of signal frequency powers. Note that if a source reconstruction analysis is also one of your follow-up steps, it is recommended to do this on the 'original' data, and then use ft_regressconfound at the source level. See 'Practical issues' on this page for the rationale behind this: http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis In sum, ft_regressconfound is best used as a last step prior ft_xxxstatistics. Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Maandag 10 februari 2014 17:02:34 > Onderwerp: Re: [FieldTrip] ft_regressconfound > Dear Arjen > Thanks for your prompt response. I understand your point regarding > using > ft_regressconfound with all 4 blocks together. I think that makes more > sense. > I have another question. I understand ft_regressconfound must be the > last > step. However, can time frequency calculation be done on data after > employing regressconfound? Or would you suggest doing trial by trial > time > frequency calculation, then compensate using regressconfound and then > compute timelock? Is there a reason not to do the former way? > > Thanks, > Raghavan > > Dear Raghavan, It is indeed recommended to use ft_regressconfound as a > last > step prior to statistical assessment. It will remove trial-by-trial > variance > in the neural data that can be attributed to trial-by-trial variance > in head > position. The latter is approximated with regressors containing > trial-by-trial information on head positions deviating from the > session/experiment mean. Because the head position timeseries is > mean-subtracted, the mean neural activity over trials is not affected > by > ft_regressconfound; only the variance over trials is, which should > result in > a cleaner representation of the data. In order to estimate the > contribution > of different head positions to the neural data, ft_regressconfound > relies on > general linear modeling. Applying ft_regressconfound to the four > blocks > separately (your option 1) will involve four different model > estimations and > their associated errors. Because these errors may differ per > estimation, the > quality of treatment of the neural data may also differ per block. > This will > not affect the mean neural activity in each block, but it may affect > the > grand mean over all four blocks as for trials in one block more > contribution > from head position may be regressed out than for another. Applying > ft_regressconfound on the data of the four blocks together (your > option 2), > will not affect the grand mean over the trials from all four blocks. > It will > reduce the influence of head movement on trial-by-trial variance in > neural > activity. This can be for better, or for worse: namely, if there are > consistent differences in head positions between two conditions > (captured in > those four blocks), it may bring the means of neural activity evoked > in > these two conditions closer to each other, reducing effect sizes. In > fact, > the employment of ft_regressconfound allows one to make a good case > that an > observed effect (i.e. differential neural activity between the two > conditions) cannot be attributed to differences in head positions when > recording those conditions (note that the same analysis could also be > performed with eye-movement related activity, or any other measure of > a > potential confound). Hope this helps, Arjen ----- Oorspronkelijk > bericht > ----- > > Van: "Raghavan Gopalakrishnan" > > Aan: fieldtrip at science.ru.nl > > Verzonden: Vrijdag 7 februari 2014 17:03:40 > > Onderwerp: [FieldTrip] ft_regressconfound > > Dear all, > > I am using regressconfound on Neuromag data. In CTF data, data for > > coil1, coil2 and coil3 are generated and then circumcenter function > > is > > called to compute 3 translational and 3 rotational dof. > > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > > channels that provide quarternion parameters q1 through q6, where > > q4,q5 and q6 are translations in x, y and z directions. I am using > > these q4,q5 and q6 to directly compute the rotational orientations > > (using the last part of the circumcenter.m script). > > It is said regressconfound must be used as a last step prior to > > stats. > > I have 4 blocks of data for each subject. Which option below should > > I > > follow? > > 1. Apply regress confound separately to four blocks? But, then I > > have > > to average these four blocks once again using ft_timelockanalysis, > > then grand average using ft_timelockgrandaverage before computing > > stats. > > 2. Or should I append the four blocks first, then perform > > regressconfound? In this case, I directly go to grandaverage and > > stats. > > Any suggestion is appreciated. > > Thanks, > > Raghavan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl From e.maris at psych.ru.nl Mon Feb 10 21:14:27 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 10 Feb 2014 21:14:27 +0100 (CET) Subject: [FieldTrip] question about ft_statfun_actvsblT In-Reply-To: References: Message-ID: <060301cf269c$af87a5d0$0e96f170$@maris@psych.ru.nl> Hi Laura, What I would like to do is to identify electrodes whose power changes significantly from baseline at SINGLE subject level, i.e. across trials instead than across subjects. I was thinking that the function above would answer my needs, but I realized that it is probably meant for a between-subject type of comparison. Could someone shed some light on the issue, or has addressed the issue in any other way? No problem. You can do this. Have a look here: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq, and in particular in the section "Within-trials experiments". Best, Eric Maris Thanks! Clara -- Clara Moisello, PhD Dept Physiology, Pharmacology & Neuroscience City College of New York Harris Hall - Room 202 phone: +12126507487 fax: +12126507726 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Tue Feb 11 16:16:23 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Tue, 11 Feb 2014 15:16:23 +0000 Subject: [FieldTrip] Issue with ft_databrowser Message-ID: <52FA3EC7.9010600@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Tue Feb 11 16:54:01 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Tue, 11 Feb 2014 16:54:01 +0100 (CET) Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <52FA3EC7.9010600@glasgow.ac.uk> Message-ID: <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> Hi May, The first possible options is that you need to use Matlab2011b - anything more updated can lead to a change in calculations (which may not give an error) or a crash (which might be what is happening). However, I'm not the most familiar with the output below, if this is not the solution I'm sure someone else can help. Best, Nietzsche ----- Original Message ----- > From: "Heng-Ru May Tan" > To: fieldtrip at science.ru.nl > Sent: Tuesday, 11 February, 2014 4:16:23 PM > Subject: [FieldTrip] Issue with ft_databrowser > Hello, > > I have been unable to use ft_databrowser today to view ICA components; > which is slightly strange. It used to work... > I have just installed fieldtrip-20140210 and using Matlab13b on 64bit > machine -- which led to repeated crash issue, as with > fieldtrip-20140114 which I tried on Matlab12a and 13b. > > Does anyone have any ideas as to what could lead to the problem? > Quoted below is structure of input compASSR and what Matlab spewed > when attempting to continue. > > Thanks in advance, > May > > > > > >> compASSR > > compASSR = > > fsample: 1.0172e+03 > time: {1x104 cell} > trial: {1x104 cell} > topo: [233x50 double] > unmixing: [50x233 double] > label: {50x1 cell} > topolabel: {233x1 cell} > sampleinfo: [104x2 double] > cfg: [1x1 struct] > > > > >> cfg=[]; > > % cfg.channel=[{'MEG'} badChansList]; > cfg.continuous = 'yes'; > cfg.channels = [1:10]; > cfg.layout = '4D248.lay'; > cfg.viewmode = 'component'; > >> ft_databrowser(cfg,compASSR) > reading layout from file 4D248.lay > the call to "ft_prepare_layout" took 0 seconds > the input is component data with 50 components and 233 original > channels > detected 0 visual artifacts > > ------------------------------------------------------------------------ > Access violation detected at Tue Feb 11 14:54:01 2014 > ------------------------------------------------------------------------ > > Configuration: > Crash Decoding : Disabled > Default Encoding : windows-1252 > MATLAB Architecture: win64 > MATLAB Root : C:\Program Files\MATLAB\R2013b > MATLAB Version : 8.2.0.701 (R2013b) > Operating System : Microsoft Windows 7 > Processor ID : x86 Family 6 Model 26 Stepping 5, GenuineIntel > Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java > HotSpot(TM) 64-Bit Server VM mixed mode > Window System : Version 6.1 (Build 7601: Service Pack 1) > > Fault Count: 1 > > > Abnormal termination: > Access violation > > Register State (from fault): > RAX = 00000000000001a4 RBX = 0000000027620080 > RCX = 00000000000262de RDX = 00000000000001b2 > RSP = 0000000004023340 RBP = 000000000000007e > RSI = 00000001240fbcd0 RDI = 00000001394eb996 > > R8 = 00000000000262de R9 = 0000000000000230 > R10 = 0000000000000000 R11 = 0000000004023418 > R12 = 0000000000f206cd R13 = 00000000a4f5fe90 > R14 = 000000000002635c R15 = 00000000000006c8 > > RIP = 0000000006583211 EFL = 00010216 > > CS = 0033 FS = 0053 GS = 002b > > Stack Trace (from fault): > [ 0] 0x0000000006583211 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02896401 > RenderEngineBase::~RenderEngineBase+00148801 > [ 1] 0x00000000064fc8ae C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02345134 text_to_pixel+00005038 > [ 2] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 3] 0x000000000646573d C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01726269 > renderAnimatedKids+00000509 > [ 4] 0x000000000646a5ad C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01746349 getARDonAxis+00010413 > [ 5] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 6] 0x000000000648c51a C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01885466 > FigureSetVisualAutoMode+00001594 > [ 7] 0x00000000064912ed C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01905389 > UIJ_CreatePeerWindow+00001789 > [ 8] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 9] 0x0000000006589358 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02921304 > RenderEngineBase::~RenderEngineBase+00173704 > [ 10] 0x000000000648df14 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01892116 > FigureSetVisualAutoMode+00008244 > [ 11] 0x000000000648df8d C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01892237 > FigureSetVisualAutoMode+00008365 > [ 12] 0x00000000060db67f C:\Program > Files\MATLAB\R2013b\bin\win64\libmwgui.dll+00439935 > wm_ExposeFcn_Pre_Optional+00000303 > [ 13] 0x000000006b6fae14 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00175636 > GetframeJava+00001124 > [ 14] 0x000000006b6fcd5e C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00183646 > UIJ_IsWindowShowing+00000430 > [ 15] 0x000000006b6feab8 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191160 > UIJ_clearWaitForResize+00002472 > [ 16] 0x000000006b6febcd C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191437 > UIJ_ExposeFcn+00000141 > [ 17] 0x000000006b6d3bce C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015310 > UIJ_MarkEventFinished+00005998 > [ 18] 0x000000006b6d3c20 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015392 > UIJ_MarkEventFinished+00006080 > [ 19] 0x000000006b6f795c C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00162140 > uij::JavaDraw2D::paintQuadStrip+00001500 > [ 20] 0x000000006c68ae38 C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00241208 > uddSetListenerRecursionWarning+00000680 > [ 21] 0x000000006c68b48c C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00242828 > UDListenerManagerHost::notifyEvent+00000076 > [ 22] 0x000000006c6838dd C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00211165 > UDEventInfo::send+00000093 > [ 23] 0x000000006b2f7d7f C:\Program > Files\MATLAB\R2013b\bin\win64\udd_mi.dll+00032127 > MErrorException::operator=+00027919 > [ 24] 0x000000006b01fa96 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > UIW_IsUserMessage+00000086 > [ 25] 0x000000006b020175 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > UIW_SetGLIMUserMsg+00000117 > [ 26] 0x000000006b0201f9 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > UIW_SetGLIMUserMsg+00000249 > [ 27] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > GetMenuBarInfo+00000638 > [ 28] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > SystemParametersInfoW+00000235 > [ 29] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > IsProcessDPIAware+00000465 > [ 30] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > KiUserCallbackDispatcher+00000031 > [ 31] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > PeekMessageW+00000186 > [ 32] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > GetKeyState+00000238 > [ 33] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > PeekMessageA+00000087 > [ 34] 0x000000006aff94db C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > UIW_SetCurrentDialog+00000731 > [ 35] 0x000000006b021632 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > ws_FreeSystemFont+00000482 > [ 36] 0x000000006f156600 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > [ 37] 0x000000006f156fc5 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > [ 38] 0x000000006f157e10 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > [ 39] 0x000000006f160596 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > sysq::removeProcessPendingEventsHook+00010998 > [ 40] 0x000000006f16089a C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > svWS_ProcessPendingEvents+00000138 > [ 41] 0x00000000064937f0 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01914864 > hgWaitforbuttonpress+00001552 > [ 42] 0x000000018000d7ff C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00055295 > Mfh_file::dispatch_fh+00001167 > [ 43] 0x000000018000ddb7 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00056759 > Mfunction_handle::dispatch+00000487 > [ 44] 0x0000000004e96a81 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > inFunctionHandleInterface::DestroyWorkspace+00308737 > [ 45] 0x0000000004e9303e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00471102 > inFunctionHandleInterface::DestroyWorkspace+00293822 > [ 46] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 47] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 48] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 49] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 50] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 51] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 52] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 53] 0x0000000004e6c634 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00312884 > inFunctionHandleInterface::DestroyWorkspace+00135604 > [ 54] 0x0000000004e7fa37 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00391735 > inFunctionHandleInterface::DestroyWorkspace+00214455 > [ 55] 0x0000000004e9dc4f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00515151 > inFunctionHandleInterface::DestroyWorkspace+00337871 > [ 56] 0x0000000004e86639 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00419385 > inFunctionHandleInterface::DestroyWorkspace+00242105 > [ 57] 0x0000000004e8feaf C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00458415 > inFunctionHandleInterface::DestroyWorkspace+00281135 > [ 58] 0x0000000004e92e23 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00470563 > inFunctionHandleInterface::DestroyWorkspace+00293283 > [ 59] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 60] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 61] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 62] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 63] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 64] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 65] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 66] 0x0000000004e96a81 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > inFunctionHandleInterface::DestroyWorkspace+00308737 > [ 67] 0x0000000004f20657 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01050199 > inEachVisibleName+00015383 > [ 68] 0x0000000004e946c2 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00476866 > inFunctionHandleInterface::DestroyWorkspace+00299586 > [ 69] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 70] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 71] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 72] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 73] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 74] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 75] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 76] 0x0000000004f3438e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01131406 > inSetWorkSpaces+00001262 > [ 77] 0x0000000004f406f5 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01181429 > SetInterpreter+00000325 > [ 78] 0x0000000004f42cb5 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191093 > inEvalCmd+00008789 > [ 79] 0x0000000004f42c82 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191042 > inEvalCmd+00008738 > [ 80] 0x0000000004f42c47 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01190983 > inEvalCmd+00008679 > [ 81] 0x000000000532ad0c C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05287180 > inMexPutVariable+00008364 > [ 82] 0x000000000532b066 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05288038 > inMexPutVariable+00009222 > [ 83] 0x000000000532b49e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289118 > inMexPutVariable+00010302 > [ 84] 0x000000000532b7dc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289948 > inMexPutVariable+00011132 > [ 85] 0x000000000523ff91 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+04325265 > inEvalCmdWithLocalReturn+00000065 > [ 86] 0x000000006c71be9d C:\Program > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00048797 > mnDebugPrompt+00000109 > [ 87] 0x000000006c71cf7f C:\Program > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00053119 > mnParser+00000735 > [ 88] 0x000000006e4ff4b4 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00193716 > mcrInstance::mnParser_on_interpreter_thread+00000036 > [ 89] 0x000000006e4e44b0 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083120 > mcr::runtime::setInterpreterThreadToCurrent+00029472 > [ 90] 0x000000006e4e4510 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083216 > mcr::runtime::setInterpreterThreadToCurrent+00029568 > [ 91] 0x000000006b01fa96 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > UIW_IsUserMessage+00000086 > [ 92] 0x000000006b020175 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > UIW_SetGLIMUserMsg+00000117 > [ 93] 0x000000006b0201f9 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > UIW_SetGLIMUserMsg+00000249 > [ 94] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > GetMenuBarInfo+00000638 > [ 95] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > SystemParametersInfoW+00000235 > [ 96] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > IsProcessDPIAware+00000465 > [ 97] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > KiUserCallbackDispatcher+00000031 > [ 98] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > PeekMessageW+00000186 > [ 99] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > GetKeyState+00000238 > [100] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > PeekMessageA+00000087 > [101] 0x000000006aff94db C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > UIW_SetCurrentDialog+00000731 > [102] 0x000000006b021632 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > ws_FreeSystemFont+00000482 > [103] 0x000000006f156600 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > [104] 0x000000006f156fc5 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > [105] 0x000000006f157e10 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > [106] 0x000000006f160596 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > sysq::removeProcessPendingEventsHook+00010998 > [107] 0x000000006f16089a C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > svWS_ProcessPendingEvents+00000138 > [108] 0x000000006e4e552d C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00087341 > mcr::runtime::setInterpreterThreadToCurrent+00033693 > [109] 0x000000006e4e57fb C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00088059 > mcr::runtime::setInterpreterThreadToCurrent+00034411 > [110] 0x000000006e4d9545 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00038213 > mcrInstantiationError::operator=+00003221 > [111] 0x000000006e4dc872 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00051314 > mcr_invoke_on_interpreter_thread+00001602 > [112] 0x000000006e4e98e6 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00104678 mcrDesktopMain+00000230 > [113] 0x0000000140004f0b C:\Program > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00020235 > [114] 0x0000000140006a07 C:\Program > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00027143 > [115] 0x0000000076cb652d C:\Windows\system32\kernel32.dll+00091437 > BaseThreadInitThunk+00000013 > [116] 0x0000000076dec541 C:\Windows\SYSTEM32\ntdll.dll+00181569 > RtlUserThreadStart+00000033 > > > If this problem is reproducible, please submit a Service Request via: > http://www.mathworks.com/support/contact_us/ > > A technical support engineer might contact you with further > information. > > Thank you for your help.** This crash report has been saved to disk as > C:\Users\######\AppData\Local\Temp\matlab_crash_dump.11620-1 ** > > > Error using setappdata > Invalid object handle > > Error in ft_databrowser>redraw_cb (line 1896) > setappdata(h, 'opt', opt); > > Error in ft_databrowser (line 676) > redraw_cb(h); > > [Please exit and restart MATLAB]>> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From alik.widge at gmail.com Tue Feb 11 17:11:54 2014 From: alik.widge at gmail.com (Alik Widge) Date: Tue, 11 Feb 2014 11:11:54 -0500 Subject: [FieldTrip] ft_timelockgrandaverage -- bug or as-designed? Message-ID: I have encountered a behavior with ft_timelockgrandaverage that seems to me to be a bug, but I'm not quite sure. Hence why I am asking here and not just filing a bug. I'm using the attached .mat, and you can replicate the behavior with: cfg = []; cfg.channel = 'all'; cfg.keepindividual = 'no'; cfg.method = 'within'; out_data = ft_timelockgrandaverage(cfg,Dstruct.on.MSITOnset.global.x{:}); This will crash due to an array dimension mismatch. It does so because my different subjects/blocks in x{:} have different numbers of samples. Up around line 147, the ft_ function goes through varargin{:} and cuts down the averaged variable (in my case, 'avg') so that it has the same number of samples in each of the varargin{:} data structures. The thing that I feel is a bug: it cuts the data, (expressed as varargin{i}.(cfg.parameter) ), but it does NOT similarly cut the variance ( varargin{i}.var ) or the per-timepoint DOF ( varargin{i}.dof ). As a result, when it gets to line 193 and tries to do avgmat(s, :, :) = varargin{s}.(cfg.parameter).*varargin{s}.dof; the (cfg.parameter) and dof matrices are now of different sizes, and we crash. I can add my desired behavior to a local copy of the function and keep working, but would appreciate some advice on whether this is actually a bug, or somehow a design feature that I've failed to understand. Alik Widge alik.widge at gmail.com (206) 866-5435 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 11 17:24:24 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 11 Feb 2014 17:24:24 +0100 Subject: [FieldTrip] ft_timelockgrandaverage -- bug or as-designed? In-Reply-To: References: Message-ID: <693C3ECE-ABE6-4E18-88B5-08D5E2354109@donders.ru.nl> Dear Alik, Thanks for reporting this. To me it sounds indeed like a bug. It would be great if you could file this as such on our bugzilla bug-tracking system. www.bugzilla.fcdonders.nl. If you create yourself an account and file a new bug, with the contents of this e-mail, we can take it from there. If you already have a fixed version of the code, feel free to attach it as attachment to the bug ;-). Best wishes, Jan-Mathijs On Feb 11, 2014, at 5:11 PM, Alik Widge wrote: > I have encountered a behavior with ft_timelockgrandaverage that seems to me to be a bug, but I'm not quite sure. Hence why I am asking here and not just filing a bug. I'm using the attached .mat, and you can replicate the behavior with: > > cfg = []; > cfg.channel = 'all'; > cfg.keepindividual = 'no'; > cfg.method = 'within'; > > out_data = ft_timelockgrandaverage(cfg,Dstruct.on.MSITOnset.global.x{:}); > > > This will crash due to an array dimension mismatch. It does so because my different subjects/blocks in x{:} have different numbers of samples. Up around line 147, the ft_ function goes through varargin{:} and cuts down the averaged variable (in my case, 'avg') so that it has the same number of samples in each of the varargin{:} data structures. > The thing that I feel is a bug: it cuts the data, (expressed as varargin{i}.(cfg.parameter) ), but it does NOT similarly cut the variance ( varargin{i}.var ) or the per-timepoint DOF ( varargin{i}.dof ). As a result, when it gets to line 193 and tries to do > > avgmat(s, :, :) = varargin{s}.(cfg.parameter).*varargin{s}.dof; > > the (cfg.parameter) and dof matrices are now of different sizes, and we crash. > > I can add my desired behavior to a local copy of the function and keep working, but would appreciate some advice on whether this is actually a bug, or somehow a design feature that I've failed to understand. > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From elmeri.syrjanen at gmail.com Tue Feb 11 17:25:55 2014 From: elmeri.syrjanen at gmail.com (=?ISO-8859-1?Q?Elmeri_Syrj=E4nen?=) Date: Tue, 11 Feb 2014 17:25:55 +0100 Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> References: <52FA3EC7.9010600@glasgow.ac.uk> <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear May, this is a reported bug that appeared sometime in September in the fieldtrip code. Here's the bugzilla thread: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2316 /elmeri On Tue, Feb 11, 2014 at 4:54 PM, Lam, Nietzsche wrote: > Hi May, > > The first possible options is that you need to use Matlab2011b - anything > more updated can lead to a change in calculations (which may not give an > error) or a crash (which might be what is happening). However, I'm not the > most familiar with the output below, if this is not the solution I'm sure > someone else can help. > > Best, > Nietzsche > > ----- Original Message ----- > > From: "Heng-Ru May Tan" > > To: fieldtrip at science.ru.nl > > Sent: Tuesday, 11 February, 2014 4:16:23 PM > > Subject: [FieldTrip] Issue with ft_databrowser > > Hello, > > > > I have been unable to use ft_databrowser today to view ICA components; > > which is slightly strange. It used to work... > > I have just installed fieldtrip-20140210 and using Matlab13b on 64bit > > machine -- which led to repeated crash issue, as with > > fieldtrip-20140114 which I tried on Matlab12a and 13b. > > > > Does anyone have any ideas as to what could lead to the problem? > > Quoted below is structure of input compASSR and what Matlab spewed > > when attempting to continue. > > > > Thanks in advance, > > May > > > > > > > > > > >> compASSR > > > > compASSR = > > > > fsample: 1.0172e+03 > > time: {1x104 cell} > > trial: {1x104 cell} > > topo: [233x50 double] > > unmixing: [50x233 double] > > label: {50x1 cell} > > topolabel: {233x1 cell} > > sampleinfo: [104x2 double] > > cfg: [1x1 struct] > > > > > > > > >> cfg=[]; > > > > % cfg.channel=[{'MEG'} badChansList]; > > cfg.continuous = 'yes'; > > cfg.channels = [1:10]; > > cfg.layout = '4D248.lay'; > > cfg.viewmode = 'component'; > > >> ft_databrowser(cfg,compASSR) > > reading layout from file 4D248.lay > > the call to "ft_prepare_layout" took 0 seconds > > the input is component data with 50 components and 233 original > > channels > > detected 0 visual artifacts > > > > ------------------------------------------------------------------------ > > Access violation detected at Tue Feb 11 14:54:01 2014 > > ------------------------------------------------------------------------ > > > > Configuration: > > Crash Decoding : Disabled > > Default Encoding : windows-1252 > > MATLAB Architecture: win64 > > MATLAB Root : C:\Program Files\MATLAB\R2013b > > MATLAB Version : 8.2.0.701 (R2013b) > > Operating System : Microsoft Windows 7 > > Processor ID : x86 Family 6 Model 26 Stepping 5, GenuineIntel > > Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java > > HotSpot(TM) 64-Bit Server VM mixed mode > > Window System : Version 6.1 (Build 7601: Service Pack 1) > > > > Fault Count: 1 > > > > > > Abnormal termination: > > Access violation > > > > Register State (from fault): > > RAX = 00000000000001a4 RBX = 0000000027620080 > > RCX = 00000000000262de RDX = 00000000000001b2 > > RSP = 0000000004023340 RBP = 000000000000007e > > RSI = 00000001240fbcd0 RDI = 00000001394eb996 > > > > R8 = 00000000000262de R9 = 0000000000000230 > > R10 = 0000000000000000 R11 = 0000000004023418 > > R12 = 0000000000f206cd R13 = 00000000a4f5fe90 > > R14 = 000000000002635c R15 = 00000000000006c8 > > > > RIP = 0000000006583211 EFL = 00010216 > > > > CS = 0033 FS = 0053 GS = 002b > > > > Stack Trace (from fault): > > [ 0] 0x0000000006583211 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02896401 > > RenderEngineBase::~RenderEngineBase+00148801 > > [ 1] 0x00000000064fc8ae C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02345134 text_to_pixel+00005038 > > [ 2] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 3] 0x000000000646573d C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01726269 > > renderAnimatedKids+00000509 > > [ 4] 0x000000000646a5ad C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01746349 getARDonAxis+00010413 > > [ 5] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 6] 0x000000000648c51a C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01885466 > > FigureSetVisualAutoMode+00001594 > > [ 7] 0x00000000064912ed C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01905389 > > UIJ_CreatePeerWindow+00001789 > > [ 8] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 9] 0x0000000006589358 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02921304 > > RenderEngineBase::~RenderEngineBase+00173704 > > [ 10] 0x000000000648df14 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01892116 > > FigureSetVisualAutoMode+00008244 > > [ 11] 0x000000000648df8d C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01892237 > > FigureSetVisualAutoMode+00008365 > > [ 12] 0x00000000060db67f C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwgui.dll+00439935 > > wm_ExposeFcn_Pre_Optional+00000303 > > [ 13] 0x000000006b6fae14 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00175636 > > GetframeJava+00001124 > > [ 14] 0x000000006b6fcd5e C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00183646 > > UIJ_IsWindowShowing+00000430 > > [ 15] 0x000000006b6feab8 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191160 > > UIJ_clearWaitForResize+00002472 > > [ 16] 0x000000006b6febcd C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191437 > > UIJ_ExposeFcn+00000141 > > [ 17] 0x000000006b6d3bce C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015310 > > UIJ_MarkEventFinished+00005998 > > [ 18] 0x000000006b6d3c20 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015392 > > UIJ_MarkEventFinished+00006080 > > [ 19] 0x000000006b6f795c C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00162140 > > uij::JavaDraw2D::paintQuadStrip+00001500 > > [ 20] 0x000000006c68ae38 C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00241208 > > uddSetListenerRecursionWarning+00000680 > > [ 21] 0x000000006c68b48c C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00242828 > > UDListenerManagerHost::notifyEvent+00000076 > > [ 22] 0x000000006c6838dd C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00211165 > > UDEventInfo::send+00000093 > > [ 23] 0x000000006b2f7d7f C:\Program > > Files\MATLAB\R2013b\bin\win64\udd_mi.dll+00032127 > > MErrorException::operator=+00027919 > > [ 24] 0x000000006b01fa96 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > > UIW_IsUserMessage+00000086 > > [ 25] 0x000000006b020175 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > > UIW_SetGLIMUserMsg+00000117 > > [ 26] 0x000000006b0201f9 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > > UIW_SetGLIMUserMsg+00000249 > > [ 27] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > > GetMenuBarInfo+00000638 > > [ 28] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > > SystemParametersInfoW+00000235 > > [ 29] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > > IsProcessDPIAware+00000465 > > [ 30] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > > KiUserCallbackDispatcher+00000031 > > [ 31] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > > PeekMessageW+00000186 > > [ 32] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > > GetKeyState+00000238 > > [ 33] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > > PeekMessageA+00000087 > > [ 34] 0x000000006aff94db C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > > UIW_SetCurrentDialog+00000731 > > [ 35] 0x000000006b021632 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > > ws_FreeSystemFont+00000482 > > [ 36] 0x000000006f156600 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > > [ 37] 0x000000006f156fc5 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > > [ 38] 0x000000006f157e10 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > > [ 39] 0x000000006f160596 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > > sysq::removeProcessPendingEventsHook+00010998 > > [ 40] 0x000000006f16089a C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > > svWS_ProcessPendingEvents+00000138 > > [ 41] 0x00000000064937f0 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01914864 > > hgWaitforbuttonpress+00001552 > > [ 42] 0x000000018000d7ff C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00055295 > > Mfh_file::dispatch_fh+00001167 > > [ 43] 0x000000018000ddb7 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00056759 > > Mfunction_handle::dispatch+00000487 > > [ 44] 0x0000000004e96a81 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > > inFunctionHandleInterface::DestroyWorkspace+00308737 > > [ 45] 0x0000000004e9303e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00471102 > > inFunctionHandleInterface::DestroyWorkspace+00293822 > > [ 46] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 47] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 48] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 49] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 50] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 51] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 52] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 53] 0x0000000004e6c634 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00312884 > > inFunctionHandleInterface::DestroyWorkspace+00135604 > > [ 54] 0x0000000004e7fa37 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00391735 > > inFunctionHandleInterface::DestroyWorkspace+00214455 > > [ 55] 0x0000000004e9dc4f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00515151 > > inFunctionHandleInterface::DestroyWorkspace+00337871 > > [ 56] 0x0000000004e86639 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00419385 > > inFunctionHandleInterface::DestroyWorkspace+00242105 > > [ 57] 0x0000000004e8feaf C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00458415 > > inFunctionHandleInterface::DestroyWorkspace+00281135 > > [ 58] 0x0000000004e92e23 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00470563 > > inFunctionHandleInterface::DestroyWorkspace+00293283 > > [ 59] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 60] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 61] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 62] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 63] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 64] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 65] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 66] 0x0000000004e96a81 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > > inFunctionHandleInterface::DestroyWorkspace+00308737 > > [ 67] 0x0000000004f20657 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01050199 > > inEachVisibleName+00015383 > > [ 68] 0x0000000004e946c2 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00476866 > > inFunctionHandleInterface::DestroyWorkspace+00299586 > > [ 69] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 70] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 71] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 72] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 73] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 74] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 75] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 76] 0x0000000004f3438e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01131406 > > inSetWorkSpaces+00001262 > > [ 77] 0x0000000004f406f5 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01181429 > > SetInterpreter+00000325 > > [ 78] 0x0000000004f42cb5 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191093 > > inEvalCmd+00008789 > > [ 79] 0x0000000004f42c82 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191042 > > inEvalCmd+00008738 > > [ 80] 0x0000000004f42c47 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01190983 > > inEvalCmd+00008679 > > [ 81] 0x000000000532ad0c C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05287180 > > inMexPutVariable+00008364 > > [ 82] 0x000000000532b066 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05288038 > > inMexPutVariable+00009222 > > [ 83] 0x000000000532b49e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289118 > > inMexPutVariable+00010302 > > [ 84] 0x000000000532b7dc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289948 > > inMexPutVariable+00011132 > > [ 85] 0x000000000523ff91 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+04325265 > > inEvalCmdWithLocalReturn+00000065 > > [ 86] 0x000000006c71be9d C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00048797 > > mnDebugPrompt+00000109 > > [ 87] 0x000000006c71cf7f C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00053119 > > mnParser+00000735 > > [ 88] 0x000000006e4ff4b4 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00193716 > > mcrInstance::mnParser_on_interpreter_thread+00000036 > > [ 89] 0x000000006e4e44b0 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083120 > > mcr::runtime::setInterpreterThreadToCurrent+00029472 > > [ 90] 0x000000006e4e4510 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083216 > > mcr::runtime::setInterpreterThreadToCurrent+00029568 > > [ 91] 0x000000006b01fa96 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > > UIW_IsUserMessage+00000086 > > [ 92] 0x000000006b020175 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > > UIW_SetGLIMUserMsg+00000117 > > [ 93] 0x000000006b0201f9 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > > UIW_SetGLIMUserMsg+00000249 > > [ 94] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > > GetMenuBarInfo+00000638 > > [ 95] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > > SystemParametersInfoW+00000235 > > [ 96] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > > IsProcessDPIAware+00000465 > > [ 97] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > > KiUserCallbackDispatcher+00000031 > > [ 98] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > > PeekMessageW+00000186 > > [ 99] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > > GetKeyState+00000238 > > [100] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > > PeekMessageA+00000087 > > [101] 0x000000006aff94db C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > > UIW_SetCurrentDialog+00000731 > > [102] 0x000000006b021632 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > > ws_FreeSystemFont+00000482 > > [103] 0x000000006f156600 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > > [104] 0x000000006f156fc5 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > > [105] 0x000000006f157e10 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > > [106] 0x000000006f160596 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > > sysq::removeProcessPendingEventsHook+00010998 > > [107] 0x000000006f16089a C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > > svWS_ProcessPendingEvents+00000138 > > [108] 0x000000006e4e552d C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00087341 > > mcr::runtime::setInterpreterThreadToCurrent+00033693 > > [109] 0x000000006e4e57fb C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00088059 > > mcr::runtime::setInterpreterThreadToCurrent+00034411 > > [110] 0x000000006e4d9545 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00038213 > > mcrInstantiationError::operator=+00003221 > > [111] 0x000000006e4dc872 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00051314 > > mcr_invoke_on_interpreter_thread+00001602 > > [112] 0x000000006e4e98e6 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00104678 mcrDesktopMain+00000230 > > [113] 0x0000000140004f0b C:\Program > > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00020235 > > [114] 0x0000000140006a07 C:\Program > > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00027143 > > [115] 0x0000000076cb652d C:\Windows\system32\kernel32.dll+00091437 > > BaseThreadInitThunk+00000013 > > [116] 0x0000000076dec541 C:\Windows\SYSTEM32\ntdll.dll+00181569 > > RtlUserThreadStart+00000033 > > > > > > If this problem is reproducible, please submit a Service Request via: > > http://www.mathworks.com/support/contact_us/ > > > > A technical support engineer might contact you with further > > information. > > > > Thank you for your help.** This crash report has been saved to disk as > > C:\Users\######\AppData\Local\Temp\matlab_crash_dump.11620-1 ** > > > > > > Error using setappdata > > Invalid object handle > > > > Error in ft_databrowser>redraw_cb (line 1896) > > setappdata(h, 'opt', opt); > > > > Error in ft_databrowser (line 676) > > redraw_cb(h); > > > > [Please exit and restart MATLAB]>> > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > 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 Heng-RuMay.Tan at glasgow.ac.uk Tue Feb 11 18:02:51 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Tue, 11 Feb 2014 17:02:51 +0000 Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <52FA3EC7.9010600@glasgow.ac.uk> References: <52FA3EC7.9010600@glasgow.ac.uk> Message-ID: <52FA57BB.50402@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed Feb 12 08:47:38 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 12 Feb 2014 08:47:38 +0100 Subject: [FieldTrip] ft_regressconfound In-Reply-To: <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> References: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Dear Raghavan, I've followed your conversation with Arjen with great interest. Although I have worked with the headposition based on the location coils in the CTF system, I am now working with an Elekta Neuromag Vectorview system. I would be very interested to hear how you approach this issue using Maxfilter and cHPI in the Neuromag setup. And not only me - I'm sure the Neuromag / FieldTrip community would greatly appreciate your experience and approach. Please let me know if you are willing to share your procedure. Best wishes, Stephen On 10 February 2014 19:13, Stolk, A. (Arjen) wrote: > Dear Raghavan, > > > I have another question. I understand ft_regressconfound must be the > > last > > step. However, can time frequency calculation be done on data after > > employing regressconfound? Or would you suggest doing trial by trial > > time > > frequency calculation, then compensate using regressconfound and then > > compute timelock? Is there a reason not to do the former way? > > I would recommend doing the latter, provided that you meant to say > 'compute statistics' instead of 'compute timelock'. When ft_regressconfound > is applied to raw/ERF data, trial-by-trial adjustments are made to the > data, according to explained variance by head movements (and thus > differences in distances to the sensors). Subsequently performing time > frequency analysis on this data may give a distorted view of signal > frequency powers. > > Note that if a source reconstruction analysis is also one of your > follow-up steps, it is recommended to do this on the 'original' data, and > then use ft_regressconfound at the source level. See 'Practical issues' on > this page for the rationale behind this: > > > http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis > > In sum, ft_regressconfound is best used as a last step prior > ft_xxxstatistics. > > Yours, > Arjen > > > ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" > > Aan: fieldtrip at science.ru.nl > > Verzonden: Maandag 10 februari 2014 17:02:34 > > Onderwerp: Re: [FieldTrip] ft_regressconfound > > Dear Arjen > > Thanks for your prompt response. I understand your point regarding > > using > > ft_regressconfound with all 4 blocks together. I think that makes more > > sense. > > I have another question. I understand ft_regressconfound must be the > > last > > step. However, can time frequency calculation be done on data after > > employing regressconfound? Or would you suggest doing trial by trial > > time > > frequency calculation, then compensate using regressconfound and then > > compute timelock? Is there a reason not to do the former way? > > > > Thanks, > > Raghavan > > > > Dear Raghavan, It is indeed recommended to use ft_regressconfound as a > > last > > step prior to statistical assessment. It will remove trial-by-trial > > variance > > in the neural data that can be attributed to trial-by-trial variance > > in head > > position. The latter is approximated with regressors containing > > trial-by-trial information on head positions deviating from the > > session/experiment mean. Because the head position timeseries is > > mean-subtracted, the mean neural activity over trials is not affected > > by > > ft_regressconfound; only the variance over trials is, which should > > result in > > a cleaner representation of the data. In order to estimate the > > contribution > > of different head positions to the neural data, ft_regressconfound > > relies on > > general linear modeling. Applying ft_regressconfound to the four > > blocks > > separately (your option 1) will involve four different model > > estimations and > > their associated errors. Because these errors may differ per > > estimation, the > > quality of treatment of the neural data may also differ per block. > > This will > > not affect the mean neural activity in each block, but it may affect > > the > > grand mean over all four blocks as for trials in one block more > > contribution > > from head position may be regressed out than for another. Applying > > ft_regressconfound on the data of the four blocks together (your > > option 2), > > will not affect the grand mean over the trials from all four blocks. > > It will > > reduce the influence of head movement on trial-by-trial variance in > > neural > > activity. This can be for better, or for worse: namely, if there are > > consistent differences in head positions between two conditions > > (captured in > > those four blocks), it may bring the means of neural activity evoked > > in > > these two conditions closer to each other, reducing effect sizes. In > > fact, > > the employment of ft_regressconfound allows one to make a good case > > that an > > observed effect (i.e. differential neural activity between the two > > conditions) cannot be attributed to differences in head positions when > > recording those conditions (note that the same analysis could also be > > performed with eye-movement related activity, or any other measure of > > a > > potential confound). Hope this helps, Arjen ----- Oorspronkelijk > > bericht > > ----- > > > Van: "Raghavan Gopalakrishnan" > > > Aan: fieldtrip at science.ru.nl > > > Verzonden: Vrijdag 7 februari 2014 17:03:40 > > > Onderwerp: [FieldTrip] ft_regressconfound > > > Dear all, > > > I am using regressconfound on Neuromag data. In CTF data, data for > > > coil1, coil2 and coil3 are generated and then circumcenter function > > > is > > > called to compute 3 translational and 3 rotational dof. > > > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > > > channels that provide quarternion parameters q1 through q6, where > > > q4,q5 and q6 are translations in x, y and z directions. I am using > > > these q4,q5 and q6 to directly compute the rotational orientations > > > (using the last part of the circumcenter.m script). > > > It is said regressconfound must be used as a last step prior to > > > stats. > > > I have 4 blocks of data for each subject. Which option below should > > > I > > > follow? > > > 1. Apply regress confound separately to four blocks? But, then I > > > have > > > to average these four blocks once again using ft_timelockanalysis, > > > then grand average using ft_timelockgrandaverage before computing > > > stats. > > > 2. Or should I append the four blocks first, then perform > > > regressconfound? In this case, I directly go to grandaverage and > > > stats. > > > Any suggestion is appreciated. > > > Thanks, > > > Raghavan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > 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 gopalar.ccf at gmail.com Thu Feb 13 16:18:59 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 13 Feb 2014 10:18:59 -0500 Subject: [FieldTrip] timelock statistics Message-ID: Dear all, I have a question regarding statistics. I am doing cluster analysis using monte carlo. I have 2 conditions (cond-1 and cond-2). Each condition has 3 sub-conditions that are temporally separated (lets say cond-1a/2a, cond-1b/2b and cond-1c/2c). I did the statistics 1. on cond-1 vs cond-2 as a whole. 2. cond-1a vs cond-2a, cond-1b vs cond-2b and cond-1c vs 2c separately after splitting the conditions cond-1 and cond-2 using ft_selectdata. I was expecting the answers from #1 and #2 above to be the same. #2 showed one significant cluster in each of the three individual comparisons, totaling 3 clusters. However, #1 above showed only one significant cluster corresponding to one of the three individual cluster in #2. Can anyone explain why results are different? Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From werkle at mpib-berlin.mpg.de Thu Feb 13 17:12:04 2014 From: werkle at mpib-berlin.mpg.de (MWB) Date: Thu, 13 Feb 2014 17:12:04 +0100 Subject: [FieldTrip] PhD-position at the Max Planck Institute for HUman Development, Berlin In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Message-ID: <52FCEED4.2030805@mpib-berlin.mpg.de> Dear colleagues, the project "Cognitive and Neural Dynamics of Memory Across the Lifespan (CONMEM) at the Center for Lifespan Psychology, Max Planck Institute for Human Development, Berlin, is seeking applications for a Predoctoral Research Fellow. Please see the details about the available position in the attached PDF-file. Best regards, Markus Werkle-Bergner -- ************************************************************** Dr. rer. nat. Markus Werkle-Bergner, Dipl. Psych. Research Scientist Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Announcement_2014_V1.pdf Type: application/pdf Size: 189067 bytes Desc: PhD_Announcement_2014_V1.pdf URL: From kai.hwang at gmail.com Thu Feb 13 18:57:03 2014 From: kai.hwang at gmail.com (Kai Hwang) Date: Thu, 13 Feb 2014 12:57:03 -0500 Subject: [FieldTrip] Postdoctoral Position, Pittsburgh Message-ID: Postdoctoral Position Laboratory of Neurocognitive Development Department of Psychiatry University of Pittsburgh, Pennsylvania Principal investigator: Bea Luna, Ph.D. Applicants are invited for a funded postdoctoral position at the University of Pittsburgh investigating cognitive development using a multimodal neuroimaging approach combining fMRI, DTI, MEG, and behavioral testing. We are looking for exceptional Ph.D. researchers with prior experience in MEG/EEG methodology and neuroimaging data analyses. Inherent interest in developmental cognitive neuroscience is a plus. Potential projects will involve investigating the development of functional brain networks supporting cognitive control and/or cognitive-affect interactions during adolescence. Applicants should be willing to commit to a minimum two year appointment. Applicants will be reviewed on an on-going basis until the position is filled. Applicants should send a CV, statement of research interest and contact information of three referees to Dr. Bea Luna (lunab at upmc.edu). -------------- next part -------------- An HTML attachment was scrubbed... URL: From ericksonb.eng at gmail.com Thu Feb 13 22:14:32 2014 From: ericksonb.eng at gmail.com (Erickson) Date: Thu, 13 Feb 2014 16:14:32 -0500 Subject: [FieldTrip] 10-05 Electrode File co-registration Message-ID: List, In the documentation, two pages appear to conflict concerning the head model to which the standard_1005.elc electrode location file is co-registered to. http://fieldtrip.fcdonders.nl/template/electrode advises that the standard_1005.elc file is coregistered to a spherical head model (with coordinates in MNI space). (see the link to http://www.ncbi.nlm.nih.gov/pubmed/11275545on this page) http://fieldtrip.fcdonders.nl/template/headmodel appears to contradict this by stating that the standard_1005.elc file's positions are co-registered to MNI space geometry based on the Colin27 model (which is exactly what I'm looking for). However this page also says that the segmentation is based on the same paper as I linked above. Perhaps I do not understand what is meant by a segmentation. Are these electrode positions (in the file standard_1005.elc) referenced to a spherical head model or to the Colin27 model? Your time is very appreciated! Brian Erickson Ph.D. candidate, ACBS Program Drexel University Psychology Department ericksonb.eng at gmail.com 215 760 7253 -------------- next part -------------- An HTML attachment was scrubbed... URL: From catanese.julien at gmail.com Thu Feb 13 23:18:30 2014 From: catanese.julien at gmail.com (Julien Catanese) Date: Thu, 13 Feb 2014 17:18:30 -0500 Subject: [FieldTrip] ft_connectivityanalysis for one long trial In-Reply-To: References: Message-ID: It works fine if I artificially slice the data into trials. (nb: MATLAB's mscohere() works fine without chopping into trials, so I was guessing it was also possible with the fieldtrip functions, but apparently not, sorry about that, not a big deal). Julien C On Wed, Jan 22, 2014 at 1:22 PM, Julien Catanese wrote: > > Hi dear FieldTrip community, > > I'm trying to get the coherence spectrum between 2 LFP signals (based on > the tutorial: "Analysis of sensor- and source-level connectivity"). > > This is sleep data, so I have only one long "trial" generated with > ft_redefinetrial(). > > I can run ft_freqanalysis() without problems, but both for 'mtmconvol' and > 'mtmfft' the next step, ft_connectivityanalysis(), fails: > > 1/ using 'mtmconvol': the cohspctrum consists of all '1' (the same > happens when using 'fourier' instead of 'powandcsd') > 2/ using 'mtmfft': "Error using ft_connectivityplot (line 99) the data > should have a dimord of chan_chan_freq or chancmb_freq" > > How can I get a coherence spectrum for this data? Do I have to > artificially chop it up into say, 2-second "fake trials"? > > notice that MATLAB's mscohere() works fine on the same data (so data are > ok). > > > > More details below: > > 1/ using mtmconvol : > > %% starting point: loaded data > data = > hdr: [1x1 struct] > label: {'LFP1' 'LFP2'} > time: {[1x200000 double]} > trial: {[2x200000 double]} > fsample: 2000 > cfg: [1x1 struct] > sampleinfo: [1 200000] > > %% make one long trial > cfg = []; > cfg.trl = [1 200000 0]; > data_faketrl = ft_redefinetrial(cfg,data); > > %% do frequqency anlaysis > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 1:1:150; > cfg.t_ftimwin = ones(size(cfg.foi)).*2; % 2-second window > cfg.toi = 0:1:10; > cfg.keeptrials = 'yes'; > cfg.channel = {'LFP1', 'LFP2'}; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> freq = ft_freqanalysis(cfg, data_faketrl) > > freq = > label: {'LFP1' 'LFP2'} > dimord: 'rpt_chan_freq_time' > freq: [1x150 double] > time: [0 1 2 3 4 5 6 7 8 9 10] > powspctrm: [4-D double] > labelcmb: {'LFP1' 'LFP2'} > crsspctrm: [4-D double] > cumtapcnt: [1x150 double] > cfg: [1x1 struct] > > %% coherence spectrum has all ones > cfg = []; > cfg.method = 'coh'; > coh = ft_connectivityanalysis(cfg, freq); > > coh = > > labelcmb: {'LFP1' 'LFP2'} > dimord: 'chan_freq_time' > cohspctrm: [1x150x11 double] > freq: [1x150 double] > time: [0 1 2 3 4 5 6 7 8 9 10] > dof: 150 > cfg: [1x1 struct] > > % coh.cohspctrm(:,:,2:end) is all ones --> fail > > 2/ using mtmfft: > %% > cfg = []; > cfg.output = 'powandcsd' > cfg.method = 'mtmfft'; > cfg.taper = 'hanning'; > cfg.foi = 1:1:150; > cfg.channel = {'LFP1', 'LFP2'}; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> freq = ft_freqanalysis(cfg, data_faketrl) > > freq = > > label: {'LFP1' 'LFP2'} > dimord: 'rpt_chan_freq' > freq: [1x150 double] > powspctrm: [1x2x150 double] > labelcmb: {'LFP1' 'LFP2'} > crsspctrm: [1x1x150 double] > cumsumcnt: 200000 > cumtapcnt: 1 > cfg: [1x1 struct] > > %% coherence spectrum fails: > cfg = []; > cfg.parameter = 'cohspctrm'; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> ft_connectivityplot(cfg, coh); > > Error using ft_connectivityplot (line 99) > the data should have a dimord of chan_chan_freq or chancmb_freq > > coh = > labelcmb: {'LFP1' 'LFP2'} > dimord: 'chan_freq' > cohspctrm: [1x150 double] > freq: [1x150 double] > dof: 1 > cfg: [1x1 struct] > > >> unique([coh.cohspctrm(:)]) > > ans = > > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > > > Thanks for your help, > > Julien C > > -- > > *Dr. Julien Catanese* > > *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada. * > *cell : +1 (519) 781 7575 <%2B1%20%28519%29%20781%207575>* > *tel lab : +1 (519) 888 4567 ext 31354 > <%2B1%20%28519%29%20888%204567%20ext%2031354>* > -- *Dr. Julien Catanese* *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada.* *cell : +1 (519) 781 7575* *tel lab : +1 (519) 888 4567 ext 31354* -------------- next part -------------- An HTML attachment was scrubbed... URL: From sviter33 at gmail.com Fri Feb 14 08:35:28 2014 From: sviter33 at gmail.com (=?KOI8-R?B?7NXLz9HOz9cg7cHL08nN?=) Date: Fri, 14 Feb 2014 11:35:28 +0400 Subject: [FieldTrip] ft_connectivityanalysis for one long trial In-Reply-To: References: Message-ID: Hi Julien, I suppose you may to try to use cfg.keeptapers = 'yes' with ft_freqanalysis. It's working for me. Best, Maxim Lukoyanov 2014-02-14 2:18 GMT+04:00 Julien Catanese : > It works fine if I artificially slice the data into trials. > > (nb: MATLAB's mscohere() works fine without chopping into trials, so I was > guessing it was also possible with the fieldtrip functions, but apparently > not, sorry about that, not a big deal). > > Julien C > > > > On Wed, Jan 22, 2014 at 1:22 PM, Julien Catanese < > catanese.julien at gmail.com> wrote: > >> >> Hi dear FieldTrip community, >> >> I'm trying to get the coherence spectrum between 2 LFP signals (based on >> the tutorial: "Analysis of sensor- and source-level connectivity"). >> >> This is sleep data, so I have only one long "trial" generated with >> ft_redefinetrial(). >> >> I can run ft_freqanalysis() without problems, but both for 'mtmconvol' >> and 'mtmfft' the next step, ft_connectivityanalysis(), fails: >> >> 1/ using 'mtmconvol': the cohspctrum consists of all '1' (the same >> happens when using 'fourier' instead of 'powandcsd') >> 2/ using 'mtmfft': "Error using ft_connectivityplot (line 99) the data >> should have a dimord of chan_chan_freq or chancmb_freq" >> >> How can I get a coherence spectrum for this data? Do I have to >> artificially chop it up into say, 2-second "fake trials"? >> >> notice that MATLAB's mscohere() works fine on the same data (so data are >> ok). >> >> >> >> More details below: >> >> 1/ using mtmconvol : >> >> %% starting point: loaded data >> data = >> hdr: [1x1 struct] >> label: {'LFP1' 'LFP2'} >> time: {[1x200000 double]} >> trial: {[2x200000 double]} >> fsample: 2000 >> cfg: [1x1 struct] >> sampleinfo: [1 200000] >> >> %% make one long trial >> cfg = []; >> cfg.trl = [1 200000 0]; >> data_faketrl = ft_redefinetrial(cfg,data); >> >> %% do frequqency anlaysis >> cfg = []; >> cfg.output = 'powandcsd'; >> cfg.method = 'mtmconvol'; >> cfg.taper = 'hanning'; >> cfg.foi = 1:1:150; >> cfg.t_ftimwin = ones(size(cfg.foi)).*2; % 2-second window >> cfg.toi = 0:1:10; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'LFP1', 'LFP2'}; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> freq = ft_freqanalysis(cfg, data_faketrl) >> >> freq = >> label: {'LFP1' 'LFP2'} >> dimord: 'rpt_chan_freq_time' >> freq: [1x150 double] >> time: [0 1 2 3 4 5 6 7 8 9 10] >> powspctrm: [4-D double] >> labelcmb: {'LFP1' 'LFP2'} >> crsspctrm: [4-D double] >> cumtapcnt: [1x150 double] >> cfg: [1x1 struct] >> >> %% coherence spectrum has all ones >> cfg = []; >> cfg.method = 'coh'; >> coh = ft_connectivityanalysis(cfg, freq); >> >> coh = >> >> labelcmb: {'LFP1' 'LFP2'} >> dimord: 'chan_freq_time' >> cohspctrm: [1x150x11 double] >> freq: [1x150 double] >> time: [0 1 2 3 4 5 6 7 8 9 10] >> dof: 150 >> cfg: [1x1 struct] >> >> % coh.cohspctrm(:,:,2:end) is all ones --> fail >> >> 2/ using mtmfft: >> %% >> cfg = []; >> cfg.output = 'powandcsd' >> cfg.method = 'mtmfft'; >> cfg.taper = 'hanning'; >> cfg.foi = 1:1:150; >> cfg.channel = {'LFP1', 'LFP2'}; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> freq = ft_freqanalysis(cfg, data_faketrl) >> >> freq = >> >> label: {'LFP1' 'LFP2'} >> dimord: 'rpt_chan_freq' >> freq: [1x150 double] >> powspctrm: [1x2x150 double] >> labelcmb: {'LFP1' 'LFP2'} >> crsspctrm: [1x1x150 double] >> cumsumcnt: 200000 >> cumtapcnt: 1 >> cfg: [1x1 struct] >> >> %% coherence spectrum fails: >> cfg = []; >> cfg.parameter = 'cohspctrm'; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> ft_connectivityplot(cfg, coh); >> >> Error using ft_connectivityplot (line 99) >> the data should have a dimord of chan_chan_freq or chancmb_freq >> >> coh = >> labelcmb: {'LFP1' 'LFP2'} >> dimord: 'chan_freq' >> cohspctrm: [1x150 double] >> freq: [1x150 double] >> dof: 1 >> cfg: [1x1 struct] >> >> >> unique([coh.cohspctrm(:)]) >> >> ans = >> >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> >> >> Thanks for your help, >> >> Julien C >> >> -- >> >> *Dr. Julien Catanese* >> >> *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada. * >> *cell : +1 (519) 781 7575 <%2B1%20%28519%29%20781%207575>* >> *tel lab : +1 (519) 888 4567 ext 31354 >> <%2B1%20%28519%29%20888%204567%20ext%2031354>* >> > > > > -- > > *Dr. Julien Catanese* > > *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada.* > *cell : +1 (519) 781 7575* > *tel lab : +1 (519) 888 4567 ext 31354* > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Mon Feb 17 08:59:00 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 17 Feb 2014 08:59:00 +0100 Subject: [FieldTrip] MEG/EEG toolkit course in Nijmegen - registration is open Message-ID: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> Dear FieldTrip mailing list On May 6-9, 2014 we will host the "Toolkit of Cognitive Neuroscience: advanced data analysis and source modelling of EEG and MEG data" at the Donders Institute in Nijmegen. This 4-day toolkit course will teach you advanced MEG and EEG data analysis skills. Preprocessing, frequency analysis, source reconstruction and various statistical methods will be covered. The toolkit will consist of a number of lectures, followed by hands-on sessions in which you will be tutored through the complete analysis of an MEG data set using the FieldTrip toolbox. There will be plenty of time to ask questions and discuss analysis methods pertaining to your reseach questions. In the last hands-on session you will get started with the analysis on the data that you will bring yourself The registration for this toolkit course is now open and can be found on http://www.ru.nl/donders/course-information/courses/toolkit-cognitive-4/ The fee for senior participants is € 400. The (PhD) student fee is € 200. Registration fee includes coffee/tea, Dutch sandwich lunches and one dinner. Please note that in the past years the course was oversubscribed and we expect that as well for this year. We will be able to host approximately 40 participants and consequently we are likely to be required to make a selection that is based on the information that you provide on the registration form. Note that neither being a very novice or a very expert in EEG/MEG disqualifies you from participating; we select the participants on basis of their motivation, research background and skills, and whether we expect the course to pay off for the participant (i.e. whether there is a match between course content and the expectations and requirements for fruitfull use of the analysis methods that we'll cover). Furthermore, we try to make a nice group of participants with a homogenous level and with sufficient broad coverage of research interests. The deadline for the initial registration is March 14, 2014. You can have a look at our Facebook page on http://www.facebook.com/fieldtriptoolbox to get an impression from the previous "MEG/EEG toolkit courses". Best regards, Robert Oostenveld and Jan-Mathijs Schoffelen ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging skype: r.oostenveld ----------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Mon Feb 17 10:49:40 2014 From: michielb at tcd.ie (Bart Michiels) Date: Mon, 17 Feb 2014 09:49:40 +0000 Subject: [FieldTrip] MEG/EEG toolkit course in Nijmegen - registration is open In-Reply-To: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> References: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> Message-ID: Hey Ed, Just need your opinion (as prof will ask the same to you): Would this be a good event to attend? Bests, Bart On 17 February 2014 07:59, Robert Oostenveld wrote: > Dear FieldTrip mailing list > > On May 6-9, 2014 we will host the "Toolkit of Cognitive Neuroscience: > advanced data analysis and source modelling of EEG and MEG data" at the > Donders Institute in Nijmegen. > > This 4-day toolkit course will teach you advanced MEG and EEG data > analysis skills. Preprocessing, frequency analysis, source reconstruction > and various statistical methods will be covered. The toolkit will consist > of a number of lectures, followed by hands-on sessions in which you will be > tutored through the complete analysis of an MEG data set using the > FieldTrip toolbox. There will be plenty of time to ask questions and > discuss analysis methods pertaining to your reseach questions. In the last > hands-on session you will get started with the analysis on the data that > you will bring yourself > > The registration for this toolkit course is now open and can be found on > http://www.ru.nl/donders/course-information/courses/toolkit-cognitive-4/ > > The fee for senior participants is EURO 400. The (PhD) student fee is EURO 200. > Registration fee includes coffee/tea, Dutch sandwich lunches and one dinner. > > Please note that in the past years the course was oversubscribed and we > expect that as well for this year. We will be able to host approximately 40 > participants and consequently we are likely to be required to make a > selection that is based on the information that you provide on the > registration form. Note that neither being a very novice or a very expert > in EEG/MEG disqualifies you from participating; we select the participants > on basis of their motivation, research background and skills, and whether > we expect the course to pay off for the participant (i.e. whether there is > a match between course content and the expectations and requirements for > fruitfull use of the analysis methods that we'll cover). Furthermore, we > try to make a nice group of participants with a homogenous level and with > sufficient broad coverage of research interests. The deadline for the > initial registration is March 14, 2014. > > You can have a look at our Facebook page on > http://www.facebook.com/fieldtriptoolbox to get an impression from the > previous "MEG/EEG toolkit courses". > > Best regards, > > Robert Oostenveld and Jan-Mathijs Schoffelen > > > ----------------------------------------------------------- > Robert Oostenveld, PhD > Senior Researcher & MEG Physicist > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > tel.: +31 (0)24 3619695 > e-mail: r.oostenveld at donders.ru.nl > web: http://www.ru.nl/neuroimaging > skype: r.oostenveld > ----------------------------------------------------------- > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notthemindprobe at yahoo.com Tue Feb 18 00:00:17 2014 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Mon, 17 Feb 2014 15:00:17 -0800 (PST) Subject: [FieldTrip] Recording Biosemi GSR data in GDF files Message-ID: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> Fieldtrip users: Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file? This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. Some more details: Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine. We recently wanted to add GSR data to this. However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself. When we record the GSR data using Activew in a BDF file, the data is recorded fine. Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file. This is in contrasts to the 8 external channels which do not undergo such additional manipulations. So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? Thanks! Eric From i.e.j.de.vries at student.vu.nl Tue Feb 18 00:00:29 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Mon, 17 Feb 2014 23:00:29 +0000 Subject: [FieldTrip] coherence vs magnitude squared coherence Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> Hi Fieldtrippers, If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? Cheers, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 18 06:43:08 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 18 Feb 2014 06:43:08 +0100 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> Message-ID: <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> Hi Floris, Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. Best, Jan-Mathijs On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: > Hi Fieldtrippers, > > If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? > > Cheers, > Ingmar > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 18 06:57:31 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 18 Feb 2014 06:57:31 +0100 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> Message-ID: Hi Ingmar, Sorry for the mix up. Apparently I was not yet fully awake when typing my previous reply. Blame it on the offspring, which kept me awake during some crucial parts of the night: where I typed 'Floris', I of course meant to type 'Ingmar' ;-). To all Florises on the list: this was a free answer to a question you didn't know you wanted to ask. Best, Jan-Mathijs On Feb 18, 2014, at 6:43 AM, jan-mathijs schoffelen wrote: > Hi Floris, > Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. > > Best, > Jan-Mathijs > > On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: > >> Hi Fieldtrippers, >> >> If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? >> >> Cheers, >> Ingmar >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Tue Feb 18 13:31:41 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Tue, 18 Feb 2014 12:31:41 +0000 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl>, Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F9649@PEXMB001B.vu.local> haha no worries, thanks for the reply! ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of jan-mathijs schoffelen [jan.schoffelen at donders.ru.nl] Sent: 18 February 2014 6:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] coherence vs magnitude squared coherence Hi Ingmar, Sorry for the mix up. Apparently I was not yet fully awake when typing my previous reply. Blame it on the offspring, which kept me awake during some crucial parts of the night: where I typed 'Floris', I of course meant to type 'Ingmar' ;-). To all Florises on the list: this was a free answer to a question you didn't know you wanted to ask. Best, Jan-Mathijs On Feb 18, 2014, at 6:43 AM, jan-mathijs schoffelen wrote: Hi Floris, Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. Best, Jan-Mathijs On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: Hi Fieldtrippers, If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? Cheers, Ingmar _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Feb 18 14:16:54 2014 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 18 Feb 2014 15:16:54 +0200 Subject: [FieldTrip] Antw: Creating a head model using OPENMEEG - Intersecting mesh error In-Reply-To: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> References: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> Message-ID: Dear Daniel and all, First, thank you very much for your advice and codes. They have proved very helpful, and now I have obtained some very good brain-skull-scalp meshes! I am now having a problem using OPENMEEG to actually compute the leadfield based on these meshes, using the following code on frequency domain data: cfg=[]; cfg.method = 'dics'; cfg.elec = elec; cfg.grid = grid; cfg.vol = vol; cfg.frequency = 10; % The mean frequency in the band cfg.keepfilter = 'yes'; sourceCombined = ft_sourceanalysis(cfg, freqCombined); The problem arises at the function "ft_leadfield_openmeeg" who tries using OPENMEEG installed on my PC (indeed there is a warning "warning('Sorry, Windows is not yet tested');" in this function). To fix onw of the bugs using a PC I changed line 94 to: basefile = tempname; [clearme basefile] = fileparts(basefile); clear clearme; but even so, every line who tries to actually use OPENMEEG, such as line 149: system([fullfile(OPENMEEG_PATH, 'om_check_geom'), ' -g ', geomFile]) fails to do so. For instance, I get a Windows error window that says "om_assemble.exe has stopped working" and "om_minverser.exe has stopped working", and also: Computing inverse head matrix 187 system([fullfile(OPENMEEG_PATH, 'om_minverser'), ' ', hmFile, ' ', hminvFile]); C:\OpenMEEG\bin\om_minverser version 2.1.0 (799) compiled at Aug 17 2011 19:50:11 | ------ C:\OpenMEEG\bin\om_minverser | C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin | C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hminv.bin | ----------------------- Exception: Unable to open the file C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin for reading Doing my best.... So it seems like OPENMEEG cannot open the file ending with "_hm.bin". This file indeed does no exist. I am using Matlab 2011b, full fieldtrip version of 17022014, Windows 7 64 bit, and OPENMEEG with om_assemble version 2.1.0 (799) compiled at Aug 17 2011 19:50:41. Must I use a Macintosh or Linux computer to make this work? Any ideas would be greatly appreciated! Thank you very much in advance, Roey On Mon, Jan 20, 2014 at 8:10 PM, Daniel Wong wrote: > You can try using the new iso2mesh meshing option that was recently added > by myself, Sarang Dalal, and Robert Oostenveld: > > cfg.method = 'iso2mesh'; > cfg.numvertices = 10000; % We'll decimate later - this gives nicer > results > bnd = ft_prepare_mesh(cfg,seg); > > % Decimate to a 1000, 2000, 3000 node mesh (scalp, skull, brain) > [bnd(1).pnt, bnd(1).tri] = meshresample(bnd(1).pnt, bnd(1).tri, > 1000/size(bnd(1).pnt,1)); > [bnd(2).pnt, bnd(2).tri] = meshresample(bnd(2).pnt, bnd(2).tri, > 2000/size(bnd(2).pnt,1)); > [bnd(3).pnt, bnd(3).tri] = meshresample(bnd(3).pnt, bnd(3).tri, > 3000/size(bnd(3).pnt,1)); > > The latest version of OpenMEEG automatically fixes mesh orientations, but > if you have an older version of OpenMEEG, you'll need to set bnd(ii).tri = > bnd(ii).tri(:,[3 2 1]) to fix the orientation error that you'll get - at > least until we hard code that fix into FieldTrip. > > Also, assuming your meshes look like they should (use ft_plot_mesh to > check), if you still have a problem with meshes intersecting each other, > you will find a subfunction called decouplesurf that is temporarily stashed > at the end of prepare_mesh_segmentation.m. Copy this function into a new > m-file (decouplesurf.m) and use it to fix those intersections as follows: > > bnd = decouplesurf(bnd); > > Note, this will not fix self-intersections. If you're really having a bad > day, try using the iso2mesh toolbox meshcheckrepair function: > % Check and repair mesh > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'dup'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'isolated'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'deep'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'meshfix'); > > This info should eventually find its way onto the FieldTrip tutorial > pages... > > > Best Regards, > Daniel Wong > > Daniel Wong, PhD (IBBME, University of Toronto) > Postdoctoral Researcher > Department of Psychology > University of Konstanz > > > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Tue Feb 18 16:55:55 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 18 Feb 2014 16:55:55 +0100 Subject: [FieldTrip] Recording Biosemi GSR data in GDF files In-Reply-To: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> References: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> Message-ID: <4A14FD77-D413-418C-B788-F45F0CD675AD@donders.ru.nl> Hi Eric, Although I don't have any real expertise in this matter, let me share my 2 cents: Your description suggests that the GSR is estimated using a 16Hz alternating current of constant (but presumably unknown) amplitude, and that GSR is estimated by solving Ohms law (V=I*R). Rather than doing an instantaneous estimate (which is noisy, especially if the current passes the zero-crossing) there will be a rectification and temporal smoothing of the voltage prior to the estimation. Or perhaps even better: a sliding window estimation: for a given time t take the signal from t-1/16s in the past up to t-0 (i.e. now) estimate the 16Hz amplitude using a DFT, this is a single positive number (either RMS, Vpeak, or Vpeak-to-peak) estimate R = V/I (this requires that you know the current I) You could determine I by connecting a known resistor of appropriate size to the electrodes. Or perhaps you don't even have to; if you are not interested in the absolute value but only in changes, you would just take R as proportional to V. Something like this (for the offline case) would do it time = (1:(fsample/16))/fsample; % just enough time for one oscillation model_c = cos(16*2*pi*time); model_s = sin(16*2*pi*time); model = model_c + i*model_s; % i is the complex number model = model./norm(model); signal = randn(1,10*fsample); % the raw signal amplitude = nan(size(signal)); % the estimated amplitude for t=1:length(signal) begsample = t - fsample/16 + 1; % note the +1, the segment should be 64 samples long endsample = t - 0; if begsample>=1 && endsample<=length(signal) segment = signal(begsample:endsample); amplitude(t) = segment*model'; % discrete fourier transform end end plot(abs(amplitude)) This can be translated to the online case by inserting it into one of the examples at http://fieldtrip.fcdonders.nl/development/realtime best regards, Robert On 18 Feb 2014, at 0:00, Eric Pohlmeyer wrote: > Fieldtrip users: > > Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file? This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. > > Some more details: > > Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine. We recently wanted to add GSR data to this. However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself. When we record the GSR data using Activew in a BDF file, the data is recorded fine. > > Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file. This is in contrasts to the 8 external channels which do not undergo such additional manipulations. > > So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? > > Thanks! > > Eric > > _______________________________________________ > 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 nathanweisz at mac.com Tue Feb 18 18:22:38 2014 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 18 Feb 2014 18:22:38 +0100 Subject: [FieldTrip] Neuroscience Master @cimec Message-ID: <45E8D277-A9E6-43CE-BCCE-9C6098543F55@mac.com> Dear Fieldtrippers, please find below infos for the Open Day dedicated to students interested in pursuing Master / PhD studies in cognitive neuroscience here at CIMeC. I encourage especially students interested in MEG to check out the program. I heard great things about the MEG lab there ;-) ciao, n --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Open Day for prospective graduate students in Mind/Brain Sciences Rovereto, 24 March 2014 The Open Day is dedicated to prospective MSc and PhD students from UniTN and other universities in Italy and abroad, interested in getting first hand information about the CIMeC Graduate Program in Cognitive and Brain Sciences: * Master's course in Cognitive Science * Doctoral course in Cognitive and Brain Sciences Throughout the day, students will have the opportunity to attend presentations of post-graduate studies available at CIMeC, get acquainted with admissions procedures and requirements, get information about financial aid and scholarship programs, get information on professional placement and research opportunities, take part in a guided tour of the CIMeC labs, and get more personalized information from faculty and students. For more information and schedule: http://international.unitn.it/news/open-day-prospective-graduate-students-in-cognitive-science If interested, please contact us at mcs at unitn.it (for prospective MSc students) orphd.cimec at unitn.it (for prospective PhD students) ______________________________ Dr. Nathan Weisz Associate Professor MEG & OBOB Lab CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY Tel +39 0461 28 3040 Fax +39 0461 28 3066 e-mail nathan.weisz at unitn.it Visit our homepage. Like us on facebook. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanger at uga.edu Tue Feb 18 20:44:28 2014 From: wanger at uga.edu (Timothy J Wanger) Date: Tue, 18 Feb 2014 19:44:28 +0000 Subject: [FieldTrip] timeseries analysis Message-ID: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> Hi, My name is Tim Wanger, I am a graduate student working with Dean Sabatinelli at the University of Georgia. This is my first attempt at using Field Trip. In order to familiarize myself with the software and learn how it can analyze data collected at our lab, I put together a small dataset containing fMRI timeseries from two different experimental conditions(arousing/not-arousing). After looking through the documentation on the Field Trip website, I came to the conclusion that 'ft_timelockanalysis' could be used to analyse timeseries data. After setting up a cfg variable, and importing my data(does not need preprocessing), I tried running ft_timelockanalysis, but there were some errors that I am not sure how to fix. I was wondering if anyone could help me sort this out. data.label=region'; % region info data.fsample=4; % 250ms sampling rate (4Hz) data.trial=timeseriesdata; % our data, <158x50 cell> matrix. trials have already been excised from raw data data.time=num2cell(1:length(timeseriesdata)); % represent time in samples data.trialinfo=arousalrating'; % experimental condition information cfg.channel='all'; cfg.trials= 'all'; cfg.covariance='no'; cfg.covariancewindow='all'; cfg.keeptrials='no'; cfg.removemean='yes'; cfg.vartrllength=2; % some trials are missing the 50th sample Here is the error I am currently receiving, with some relevant Matlab command window output. the input is raw data with 1 channels and 158 trials Warning: removing inconsistent sampleinfo > In ft_datatype_raw at 109 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 Warning: the data does not contain a trial definition > In utilities/private/warning_once at 116 In utilities/private/fixsampleinfo at 66 In ft_datatype_raw at 158 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 Warning: reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous recording > In utilities/private/warning_once at 116 In utilities/private/fixsampleinfo at 79 In ft_datatype_raw at 158 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 ??? Index exceeds matrix dimensions. Error in ==> fixsampleinfo at 95 offset(i) = time2offset(data.time{i}, data.fsample); Error in ==> ft_datatype_raw at 158 data = fixsampleinfo(data); Error in ==> ft_checkdata at 213 data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); Error in ==> ft_timelockanalysis at 105 data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in ==> testing_fieldtrip at 49 [timelock] = ft_timelockanalysis(cfg, data); So, my questions are: 1. Am I on the right track? 2. Is there a better function to be using? 3. Am I using the proper data format as an import? 4. The code is 'assuming that the trials are consecutive segments of a continuous recording', which is not the case for me, so what can/should I do about that? 5. Does anyone have a template matlab script and demo dataset (for timeseries analysis) that runs without errors, that I could look at? It would help me to just step through the analysis to see what's happening, and an example of input data/parameters. Thanks in advance! -Tim Wanger? -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Feb 19 16:57:20 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 19 Feb 2014 16:57:20 +0100 Subject: [FieldTrip] specifying the variables for ft_specest_mtmfft Message-ID: Dear all, I'm new to fieldtrip, and I would like to estimate the spectrum using ft_specest_mtmfft. With the help function, I understand that there are certain variables that I need to input in order for the mtmfft to work. I have some questions regarding the input variables. I have 4 intracranial channels and I cut my trials into segments of 2048 datapoints. My sampling resolution is 1000 Hz. Variables that I know what the inputs are: For dat, I know that this is the raw data for each segment. For time, I know that this is the time vector of each segment (in my case, it would be 0:0.001:2.048). For taper, I will be using 'hanning'. For freqoi, I'm interested in the frequency from 1:150. Variables that I don't know and not sure what to input: For ntaper, I would like to use multiple taper, however, I'm not sure how many number of tapers I should use. For spectrum, it states that it requires a matrix of taper*chan*freqoi of fourier coefficients. I'm not sure what this means at all. Could someone please help me with the variables that I'm not sure of? Thanks! Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Feb 19 17:37:20 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 19 Feb 2014 18:37:20 +0200 Subject: [FieldTrip] Antw: Creating a head model using OPENMEEG - Intersecting mesh error In-Reply-To: References: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> Message-ID: Otherwise, does anyone know if I could compute the leadfield using another program and import it to fieldtrip? Thank you once again, Hoping to resolve this issue soon, Roey On Tue, Feb 18, 2014 at 3:16 PM, Roey Schurr wrote: > Dear Daniel and all, > > First, thank you very much for your advice and codes. They have proved > very helpful, and now I have obtained some very good brain-skull-scalp > meshes! > > I am now having a problem using OPENMEEG to actually compute the leadfield > based on these meshes, using the following code on frequency domain data: > > cfg=[]; > cfg.method = 'dics'; > cfg.elec = elec; > cfg.grid = grid; > cfg.vol = vol; > cfg.frequency = 10; % The mean frequency in the band > cfg.keepfilter = 'yes'; > > sourceCombined = ft_sourceanalysis(cfg, freqCombined); > > > The problem arises at the function "ft_leadfield_openmeeg" who tries > using OPENMEEG installed on my PC (indeed there is a warning > "warning('Sorry, Windows is not yet tested');" in this function). > To fix onw of the bugs using a PC I changed line 94 to: > > basefile = tempname; > [clearme basefile] = fileparts(basefile); > clear clearme; > > but even so, every line who tries to actually use OPENMEEG, such as line > 149: > > system([fullfile(OPENMEEG_PATH, 'om_check_geom'), ' -g ', geomFile]) > > fails to do so. > For instance, I get a Windows error window that says "om_assemble.exe has > stopped working" and "om_minverser.exe has stopped working", and also: > > Computing inverse head matrix > 187 system([fullfile(OPENMEEG_PATH, 'om_minverser'), ' ', > hmFile, ' ', hminvFile]); > C:\OpenMEEG\bin\om_minverser version 2.1.0 (799) compiled at Aug 17 > 2011 19:50:11 > > | ------ C:\OpenMEEG\bin\om_minverser > | > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin > | > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hminv.bin > | ----------------------- > Exception: Unable to open the file > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin > for reading Doing my best.... > > So it seems like OPENMEEG cannot open the file ending with "_hm.bin". This > file indeed does no exist. > > > I am using Matlab 2011b, full fieldtrip version of 17022014, Windows 7 64 > bit, and OPENMEEG with om_assemble version 2.1.0 (799) compiled at Aug 17 > 2011 19:50:41. > > Must I use a Macintosh or Linux computer to make this work? > > Any ideas would be greatly appreciated! > Thank you very much in advance, > > Roey > > > On Mon, Jan 20, 2014 at 8:10 PM, Daniel Wong wrote: > >> You can try using the new iso2mesh meshing option that was recently added >> by myself, Sarang Dalal, and Robert Oostenveld: >> >> cfg.method = 'iso2mesh'; >> cfg.numvertices = 10000; % We'll decimate later - this gives nicer >> results >> bnd = ft_prepare_mesh(cfg,seg); >> >> % Decimate to a 1000, 2000, 3000 node mesh (scalp, skull, brain) >> [bnd(1).pnt, bnd(1).tri] = meshresample(bnd(1).pnt, bnd(1).tri, >> 1000/size(bnd(1).pnt,1)); >> [bnd(2).pnt, bnd(2).tri] = meshresample(bnd(2).pnt, bnd(2).tri, >> 2000/size(bnd(2).pnt,1)); >> [bnd(3).pnt, bnd(3).tri] = meshresample(bnd(3).pnt, bnd(3).tri, >> 3000/size(bnd(3).pnt,1)); >> >> The latest version of OpenMEEG automatically fixes mesh orientations, but >> if you have an older version of OpenMEEG, you'll need to set bnd(ii).tri = >> bnd(ii).tri(:,[3 2 1]) to fix the orientation error that you'll get - at >> least until we hard code that fix into FieldTrip. >> >> Also, assuming your meshes look like they should (use ft_plot_mesh to >> check), if you still have a problem with meshes intersecting each other, >> you will find a subfunction called decouplesurf that is temporarily stashed >> at the end of prepare_mesh_segmentation.m. Copy this function into a new >> m-file (decouplesurf.m) and use it to fix those intersections as follows: >> >> bnd = decouplesurf(bnd); >> >> Note, this will not fix self-intersections. If you're really having a bad >> day, try using the iso2mesh toolbox meshcheckrepair function: >> % Check and repair mesh >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'dup'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'isolated'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'deep'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'meshfix'); >> >> This info should eventually find its way onto the FieldTrip tutorial >> pages... >> >> >> Best Regards, >> Daniel Wong >> >> Daniel Wong, PhD (IBBME, University of Toronto) >> Postdoctoral Researcher >> Department of Psychology >> University of Konstanz >> >> >> >> _______________________________________________ >> 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 eelke.spaak at donders.ru.nl Wed Feb 19 18:04:27 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 19 Feb 2014 18:04:27 +0100 Subject: [FieldTrip] specifying the variables for ft_specest_mtmfft In-Reply-To: References: Message-ID: Dear Hweeling, ft_specest_mtmfft is one of the lower-level FieldTrip functions, which the end-user typically should not use. Instead, have a look at the documentation for ft_freqanalysis (type 'edit ft_freqanalysis' or look here: http://fieldtrip.fcdonders.nl/reference/ft_freqanalysis). There is a section specifically relating to options for mtmfft. All the options for ft_freqanalysis and other FieldTrip functions are specified using a 'cfg'-structure, e.g. like so: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 1:150; freq = ft_freqanalysis(cfg, data); Best, Eelke On 19 February 2014 16:57, Hwee Ling Lee wrote: > Dear all, > > I'm new to fieldtrip, and I would like to estimate the spectrum using > ft_specest_mtmfft. With the help function, I understand that there are > certain variables that I need to input in order for the mtmfft to work. > > I have some questions regarding the input variables. > > I have 4 intracranial channels and I cut my trials into segments of 2048 > datapoints. My sampling resolution is 1000 Hz. > > Variables that I know what the inputs are: > For dat, I know that this is the raw data for each segment. > For time, I know that this is the time vector of each segment (in my case, > it would be 0:0.001:2.048). > For taper, I will be using 'hanning'. > For freqoi, I'm interested in the frequency from 1:150. > > Variables that I don't know and not sure what to input: > For ntaper, I would like to use multiple taper, however, I'm not sure how > many number of tapers I should use. > For spectrum, it states that it requires a matrix of taper*chan*freqoi of > fourier coefficients. I'm not sure what this means at all. > > Could someone please help me with the variables that I'm not sure of? > > Thanks! > > Best regards, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Wed Feb 19 22:01:00 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 19 Feb 2014 16:01:00 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: Arjen, Thanks for answering all my previous questions. I was successfully able to incorporate head movements to my erf data. As I understand I have to do this separately for the time frequency data after keeping individual trials. I am interested in both beta and gamma bands [15:1:70]. my time frequency looks like this using wavelets, timefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x1500 double] powspctrm: [4-D double] cumtapcnt: [55x56 double] grad: [1x1 struct] elec: [1x1 struct] cfg: [1x1 struct] trialinfo: [55x1 double] After regressconfound hpicomptimefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x1500 double] powspctrm: [4-D double] cumtapcnt: [55x56 double] cfg: [1x1 struct] trialinfo: [55x1 double] beta: [4-D double] Regressconfound took about 1 hr and 30 mins, since its a huge matrix [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It will take an enoumous amount of time to process the data through regressconfound. Is there a workaround to make the processing faster or am I missing something. Any help would be of great help. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Feb 19 22:58:38 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <2108167665.5423215.1392847118322.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, Good to hear it's working out for you. A short answer would be 'no'. Reducing the size of your data matrix is likely going to speed up computations. Your time resolution seems pretty high (1500 frequency estimations per single trial); do you need that many? Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 19 februari 2014 22:01:00 > Onderwerp: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks for answering all my previous questions. I was successfully > able to incorporate head movements to my erf data. As I understand I > have to do this separately for the time frequency data after keeping > individual trials. I am interested in both beta and gamma bands > [15:1:70]. my time frequency looks like this using wavelets, > timefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > grad: [1x1 struct] > elec: [1x1 struct] > cfg: [1x1 struct] > trialinfo: [55x1 double] > After regressconfound > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > cfg: [1x1 struct] > trialinfo: [55x1 double] > beta: [4-D double] > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > will take an enoumous amount of time to process the data through > regressconfound. Is there a workaround to make the processing faster > or am I missing something. Any help would be of great help. > Thanks, > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Thu Feb 20 18:51:25 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 20 Feb 2014 18:51:25 +0100 Subject: [FieldTrip] source correlation. Message-ID: Hi Jan and Robert, Pls I have the following questions, 1. Regarding to attached picture, I calculated coherence using DICS method with ref channel T8 ( which is right temporal). I expect to see correlation or coherence by the the two side, but only found at the left temporal part but nothing on the seed point, the right temporal, or is there is any configuration i did not include or miss? I use the following configuration cfg2 = method: 'dics' frequency: 2 grid: [1x1 struct] vol: [1x1 struct] elec: [1x1 struct] channel: {63x1 cell} refchannel: 'T8' 2. I want to obtain connectivity matrix from the source. Will it be ok to calculate it from the power source using the following configuration cfg=[];cfg.method='powcorr'; The output powerspctrum only contains NaN. I am thinking if I could bring out only the inside dipoles and compute it differently. Can I obtain the same correlation matrix? Thank you! Azeez A. Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig1.png Type: image/png Size: 85415 bytes Desc: not available URL: From gopalar.ccf at gmail.com Thu Feb 20 22:12:28 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 20 Feb 2014 16:12:28 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: Arjen, Thanks, I reduced down the time resolution so computation can go faster. Now, my matrix looks like this hpicomptimefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x375 double] powspctrm: [4-D double] cumtapcnt: [59x56 double] cfg: [1x1 struct] trialinfo: [59x1 double] beta: [4-D double] ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. Thanks, Raghavan Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) From: "Stolk, A. (Arjen)" To: FieldTrip discussion list Subject: Re: [FieldTrip] regressconfound and frequency domain Message-ID: < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl> Content-Type: text/plain; charset="utf-8" Dear Raghavan, Good to hear it's working out for you. A short answer would be 'no'. Reducing the size of your data matrix is likely going to speed up computations. Your time resolution seems pretty high (1500 frequency estimations per single trial); do you need that many? Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 19 februari 2014 22:01:00 > Onderwerp: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks for answering all my previous questions. I was successfully > able to incorporate head movements to my erf data. As I understand I > have to do this separately for the time frequency data after keeping > individual trials. I am interested in both beta and gamma bands > [15:1:70]. my time frequency looks like this using wavelets, > timefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > grad: [1x1 struct] > elec: [1x1 struct] > cfg: [1x1 struct] > trialinfo: [55x1 double] > After regressconfound > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > cfg: [1x1 struct] > trialinfo: [55x1 double] > beta: [4-D double] > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > will take an enoumous amount of time to process the data through > regressconfound. Is there a workaround to make the processing faster > or am I missing something. Any help would be of great help. > Thanks, > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Thu Feb 20 22:45:58 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Thu, 20 Feb 2014 22:45:58 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <489473348.5444313.1392932758055.JavaMail.root@sculptor.zimbra.ru.nl> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks, I reduced down the time resolution so computation can go > faster. Now, m y matrix looks like this > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 struct] > trialinfo: [59x1 double] > beta: [4-D double] > ft_regressconfound run on timelock data seems to return output with > avg field. However, ft_regressconfound run on frequency data, does not > return average. I see the avg field being removed. Is there a reason? > Question - Since ft_regressconfound outputs power spectrum of > individual trials - 4D matrix (instead of average), can I simply > re-average the power spectrum over trials to see the average power for > that subject. Also, I need to run grand average (over subjects) before > running statistics. I hope these steps does not distort the data. > Please advise. > Thanks, > Raghavan > Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] regressconfound and frequency domain > Message-ID: > < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > > > Content-Type: text/plain; charset="utf-8" > Dear Raghavan, Good to hear it's working out for you. A short answer > would be 'no'. Reducing the size of your data matrix is likely going > to speed up computations. Your time resolution seems pretty high (1500 > frequency estimations per single trial); do you need that many? Yours, > Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: [FieldTrip] regressconfound and frequency domain > > Arjen, > > Thanks for answering all my previous questions. I was successfully > > able to incorporate head movements to my erf data. As I understand I > > have to do this separately for the time frequency data after keeping > > individual trials. I am interested in both beta and gamma bands > > [15:1:70]. my time frequency looks like this using wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > After regressconfound > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D double] > > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > > will take an enoumous amount of time to process the data through > > regressconfound. Is there a workaround to make the processing faster > > or am I missing something. Any help would be of great help. > > Thanks, > > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Thu Feb 20 23:33:18 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 20 Feb 2014 17:33:18 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> Thanks Arjen, Should I use ft_freqdescriptives to compute t descriptives for individual subjects, and then take that to group level instead of mean? If not, what are the other alternatives? Thanks, Raghavan Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks, I reduced down the time resolution so computation can go > faster. Now, m y matrix looks like this > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 struct] > trialinfo: [59x1 double] > beta: [4-D double] > ft_regressconfound run on timelock data seems to return output with > avg field. However, ft_regressconfound run on frequency data, does not > return average. I see the avg field being removed. Is there a reason? > Question - Since ft_regressconfound outputs power spectrum of > individual trials - 4D matrix (instead of average), can I simply > re-average the power spectrum over trials to see the average power for > that subject. Also, I need to run grand average (over subjects) before > running statistics. I hope these steps does not distort the data. > Please advise. > Thanks, > Raghavan > Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] regressconfound and frequency domain > Message-ID: > < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > > > Content-Type: text/plain; charset="utf-8" > Dear Raghavan, Good to hear it's working out for you. A short answer > would be 'no'. Reducing the size of your data matrix is likely going > to speed up computations. Your time resolution seems pretty high (1500 > frequency estimations per single trial); do you need that many? Yours, > Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: [FieldTrip] regressconfound and frequency domain > > Arjen, > > Thanks for answering all my previous questions. I was successfully > > able to incorporate head movements to my erf data. As I understand I > > have to do this separately for the time frequency data after keeping > > individual trials. I am interested in both beta and gamma bands > > [15:1:70]. my time frequency looks like this using wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > After regressconfound > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D double] > > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > > will take an enoumous amount of time to process the data through > > regressconfound. Is there a workaround to make the processing faster > > or am I missing something. Any help would be of great help. > > Thanks, > > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Fri Feb 21 09:23:49 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 21 Feb 2014 09:23:49 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> Message-ID: <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, To compute a t-descriptive on subject level freq data, you'll need to use ft_freqstatistics. Have a look here for instance: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq At the subject level, you do not need (non-parametric) cluster permutation testing (Maris & Oostenveld), as you're taking each subject's t-descriptives to the group level. At the group level, you can then test the hypothesis that there's a difference between tasks/conditions (H1) vs. no difference (H0). In order to do so, you'll need to create a dummy variable at the group level, that has the same number of 'subjects', but with zeros in all fields (in your case this will be a .stat field). At the group level, you thus call ft_freqstatistics again. This approach has the advantage that you're more sensitive (as compared to taking each subject's mean to the group level) to effects that are small but consistent over trials in each subject. Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 23:33:18 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Thanks Arjen, > Should I use ft_freqdescriptives to compute t descriptives for > individual subjects, and then take that to group level instead of > mean? If not, what are the other alternatives? > Thanks, > Raghavan > Hi Raghavan, ft_regressconfound run on timelock data seems to return > output with avg field. However, ft_regressconfound run on frequency > data, does not return average. I see the avg field being removed. Is > there a reason? >> Not intentionally, but not an issue either. You > could still use ft_freqdescriptives to compute the average for you, > but see my comment below. Question - Since ft_regressconfound outputs > power spectrum of individual trials - 4D matrix (instead of average), > can I simply re-average the power spectrum over trials to see the > average power for that subject. Also, I need to run grand average > (over subjects) before running statistics. I hope these steps does not > distort the data. Please advise. >> Remember that the mean over trials > is not affected by your clean-up of trial-by-trial variance due to > head movement. Taking each subject's mean (unaffected) to the group > level is an approach that will not benefit from your clean-up. In > order to benefit from reduced trial-by-trial variance, you'll need a > measure that depends on it, e.g. t-descriptive, neural > activity-behavior correlation (for taking to the group level). Hope > this helps, Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > Aan: > > fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 > > 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency > > domain > Arjen, > Thanks, I reduced down the time resolution so > > computation can go > faster. Now, m y matrix looks like this > > > hpicomptimefreq = > label: {204x1 cell} > dimord: > > 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > > > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 > > struct] > trialinfo: [59x1 double] > beta: [4-D double] > > > ft_regressconfound run on timelock data seems to return output with > > > avg field. However, ft_regressconfound run on frequency data, does > > not > return average. I see the avg field being removed. Is there a > > reason? > Question - Since ft_regressconfound outputs power spectrum > > of > individual trials - 4D matrix (instead of average), can I > > simply > re-average the power spectrum over trials to see the > > average power for > that subject. Also, I need to run grand average > > (over subjects) before > running statistics. I hope these steps does > > not distort the data. > Please advise. > Thanks, > Raghavan > Date: > > Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < > > a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < > > fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] > > regressconfound and frequency domain > Message-ID: > < > > 2108167665.5423215.1392847118322.JavaMail.root at > > sculptor.zimbra.ru.nl > > > Content-Type: text/plain; > > charset="utf-8" > Dear Raghavan, Good to hear it's working out for > > you. A short answer > would be 'no'. Reducing the size of your data > > matrix is likely going > to speed up computations. Your time > > resolution seems pretty high (1500 > frequency estimations per > > single trial); do you need that many? Yours, > Arjen ----- > > Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < > > gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: > > [FieldTrip] regressconfound and frequency domain > > Arjen, > > > > Thanks for answering all my previous questions. I was successfully > > > > able to incorporate head movements to my erf data. As I understand > > I > > have to do this separately for the time frequency data after > > keeping > > individual trials. I am interested in both beta and > > gamma bands > > [15:1:70]. my time frequency looks like this using > > wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > > > trialinfo: [55x1 double] > > After regressconfound > > > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D > > double] > > Regressconfound took about 1 hr and 30 mins, since its a > > huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for > > 20 subjects. It > > will take an enoumous amount of time to process > > the data through > > regressconfound. Is there a workaround to make > > the processing faster > > or am I missing something. Any help would > > be of great help. > > Thanks, > > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Feb 21 11:38:10 2014 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 21 Feb 2014 05:38:10 -0500 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> References: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Arjen, what you just described is more or less what I struggled to do last week and ultimately gave up as I was unable to figure out how to get FT to do it despite much meditation over tutorials and source files. Can you elaborate a bit more on what you are saying below -- not the ft_regressconfound bit, but the bit about how to get ft_statistics_montecarlo and its wrappers to do a trials-level analysis and permutation at the whole-group level? Especially, what does one put in cfg.design and how does one call the function? Everything I could find in the tutorials described the case of doing means at the subject level and then permutation of means at the group level, which as you point out is underpowered for subtle effects. My particular situation was timelock-analyzed trials (with keeptrials='yes'), but I could not find a way to set up cfg.design that did not throw error messages. The thing that really seemed to bother it was that there were different numbers of trials in the 2-3 conditions of interest, since some had to be removed for excessive artifact. Thanks for any help, Alik Alik Widge alik.widge at gmail.com (206) 866-5435 On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) wrote: > Dear Raghavan, > > To compute a t-descriptive on subject level freq data, you'll need to use > ft_freqstatistics. Have a look here for instance: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > At the subject level, you do not need (non-parametric) cluster permutation > testing (Maris & Oostenveld), as you're taking each subject's > t-descriptives to the group level. At the group level, you can then test > the hypothesis that there's a difference between tasks/conditions (H1) vs. > no difference (H0). In order to do so, you'll need to create a dummy > variable at the group level, that has the same number of 'subjects', but > with zeros in all fields (in your case this will be a .stat field). At the > group level, you thus call ft_freqstatistics again. This approach has the > advantage that you're more sensitive (as compared to taking each subject's > mean to the group level) to effects that are small but consistent over > trials in each subject. > > Arjen > > > ------------------------------ > > *Van: *"Raghavan Gopalakrishnan" > *Aan: *fieldtrip at science.ru.nl > *Verzonden: *Donderdag 20 februari 2014 23:33:18 > > *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain > > Thanks Arjen, > Should I use ft_freqdescriptives to compute t descriptives for individual > subjects, and then take that to group level instead of mean? If not, what > are the other alternatives? > Thanks, > Raghavan > > Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > >* Van: "Raghavan Gopalakrishnan" > > *>* Aan: fieldtrip at science.ru.nl > *>* Verzonden: Donderdag 20 februari 2014 22:12:28 > *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > *>* Arjen, > *>* Thanks, I reduced down the time resolution so computation can go > *>* faster. Now, m y matrix looks like this > *>* hpicomptimefreq = > *>* label: {204x1 cell} > *>* dimord: 'rpt_chan_freq_time' > *>* freq: [1x56 double] > *>* time: [1x375 double] > *>* powspctrm: [4-D double] > *>* cumtapcnt: [59x56 double] > *>* cfg: [1x1 struct] > *>* trialinfo: [59x1 double] > *>* beta: [4-D double] > *>* ft_regressconfound run on timelock data seems to return output with > *>* avg field. However, ft_regressconfound run on frequency data, does not > *>* return average. I see the avg field being removed. Is there a reason? > *>* Question - Since ft_regressconfound outputs power spectrum of > *>* individual trials - 4D matrix (instead of average), can I simply > *>* re-average the power spectrum over trials to see the average power for > *>* that subject. Also, I need to run grand average (over subjects) before > *>* running statistics. I hope these steps does not distort the data. > *>* Please advise. > *>* Thanks, > *>* Raghavan > *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > > *>* Subject: Re: [FieldTrip] regressconfound and frequency domain > *>* Message-ID: > *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > *>* > > *>* Content-Type: text/plain; charset="utf-8" > *>* Dear Raghavan, Good to hear it's working out for you. A short answer > *>* would be 'no'. Reducing the size of your data matrix is likely going > *>* to speed up computations. Your time resolution seems pretty high (1500 > *>* frequency estimations per single trial); do you need that many? Yours, > *>* Arjen ----- Oorspronkelijk bericht ----- > *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > *>* > Aan: fieldtrip at science.ru.nl > *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 > *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain > *>* > Arjen, > *>* > Thanks for answering all my previous questions. I was successfully > *>* > able to incorporate head movements to my erf data. As I understand I > *>* > have to do this separately for the time frequency data after keeping > *>* > individual trials. I am interested in both beta and gamma bands > *>* > [15:1:70]. my time frequency looks like this using wavelets, > *>* > timefreq = > *>* > label: {204x1 cell} > *>* > dimord: 'rpt_chan_freq_time' > *>* > freq: [1x56 double] > *>* > time: [1x1500 double] > *>* > powspctrm: [4-D double] > *>* > cumtapcnt: [55x56 double] > *>* > grad: [1x1 struct] > *>* > elec: [1x1 struct] > *>* > cfg: [1x1 struct] > *>* > trialinfo: [55x1 double] > *>* > After regressconfound > *>* > hpicomptimefreq = > *>* > label: {204x1 cell} > *>* > dimord: 'rpt_chan_freq_time' > *>* > freq: [1x56 double] > *>* > time: [1x1500 double] > *>* > powspctrm: [4-D double] > *>* > cumtapcnt: [55x56 double] > *>* > cfg: [1x1 struct] > *>* > trialinfo: [55x1 double] > *>* > beta: [4-D double] > *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > *>* > will take an enoumous amount of time to process the data through > *>* > regressconfound. Is there a workaround to make the processing faster > *>* > or am I missing something. Any help would be of great help. > *>* > Thanks, > *>* > Raghavan* > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Fri Feb 21 11:57:38 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Fri, 21 Feb 2014 11:57:38 +0100 Subject: [FieldTrip] timeseries analysis In-Reply-To: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> References: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> Message-ID: <53073122.7070305@donders.ru.nl> Hi Tim, interesting approach to use FieldTrip for fMRI data, keep us updated on your progress, please! Your error is rather straightforward. You need to specify a time-axis for each trial rather than a common time-axis. And pay attention to the dimensions. data.trial has to be cell-array where each trial is defined as nChans x nSamples. data.time needs to be cell-array and it's elements need to be 1 x nSamples. Lastly, data.label needs to be a cell-array with dimensions nChans x 1. for more information, see here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat Regarding your questions: > 1. Am I on the right track? yes, but maybe better define time in seconds than in samples, otherwise you're good. > 2. Is there a better function to be using? probably no, you need to hack it yourself together > 3. Am I using the proper data format as an import? if FT cannot read your data it by ft_read_data, then yes, this is the best (and only) way > 4. The code is 'assuming that the trials are consecutive segments of a > continuous recording', which is not the case for me, so what > can/should I do about that? you can define data.sampleinfo which specifies at what sample your trial started and ended relative to the actual recording. But, this information might not be necessary for now, so maybe just ignore the warning until you run into other problems. > 5. Does anyone have a template matlab script and demo dataset (for > timeseries analysis) that runs without errors, that I could look at? > It would help me to just step through the analysis to see what's > happening, and an example of input data/parameters. please see the link above for examples. Best, Jörn On 2/18/2014 8:44 PM, Timothy J Wanger wrote: > Hi, > > My name is Tim Wanger, I am a graduate student working with Dean > Sabatinelli at the University of Georgia. This is my first attempt at > using Field Trip. In order to familiarize myself with the software and > learn how it can analyze data collected at our lab, I put together a > small dataset containing fMRI timeseries from two different > experimental conditions(arousing/not-arousing). After looking through > the documentation on the Field Trip website, I came to the conclusion > that 'ft_timelockanalysis' could be used to analyse timeseries data. > After setting up a cfg variable, and importing my data(does not need > preprocessing), I tried running ft_timelockanalysis, but there were > some errors that I am not sure how to fix. I was wondering if anyone > could help me sort this out. > > data.label=region'; % region info > data.fsample=4; % 250ms sampling rate (4Hz) > data.trial=timeseriesdata; % our data, <158x50 cell> matrix. trials > have already been excised from raw data > data.time=num2cell(1:length(timeseriesdata)); % represent time in samples > data.trialinfo=arousalrating'; % experimental condition information > > cfg.channel='all'; > cfg.trials= 'all'; > cfg.covariance='no'; > cfg.covariancewindow='all'; > cfg.keeptrials='no'; > cfg.removemean='yes'; > cfg.vartrllength=2; % some trials are missing the 50th sample > > > Here is the error I am currently receiving, with some relevant Matlab > command window output. > > the input is raw data with 1 channels and 158 trials > Warning: removing inconsistent sampleinfo > > In ft_datatype_raw at 109 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > Warning: the data does not contain a trial definition > > In utilities/private/warning_once at 116 > In utilities/private/fixsampleinfo at 66 > In ft_datatype_raw at 158 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > Warning: reconstructing sampleinfo by assuming that the trials are > consecutive segments of a continuous > recording > > In utilities/private/warning_once at 116 > In utilities/private/fixsampleinfo at 79 > In ft_datatype_raw at 158 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > > ??? Index exceeds matrix dimensions. > Error in ==> fixsampleinfo at 95 > offset(i) = time2offset(data.time{i}, data.fsample); > Error in ==> ft_datatype_raw at 158 > data = fixsampleinfo(data); > Error in ==> ft_checkdata at 213 > data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); > Error in ==> ft_timelockanalysis at 105 > data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', > 'yes', 'hassampleinfo', 'yes'); > Error in ==> testing_fieldtrip at 49 > [timelock] = ft_timelockanalysis(cfg, data); > > > So, my questions are: > 1. Am I on the right track? > 2. Is there a better function to be using? > 3. Am I using the proper data format as an import? > 4. The code is 'assuming that the trials are consecutive segments of a > continuous recording', which is not the case for me, so what > can/should I do about that? > 5. Does anyone have a template matlab script and demo dataset (for > timeseries analysis) that runs without errors, that I could look at? > It would help me to just step through the analysis to see what's > happening, and an example of input data/parameters. > > Thanks in advance! > -Tim Wanger​ > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From gopalar.ccf at gmail.com Fri Feb 21 12:41:26 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Fri, 21 Feb 2014 06:41:26 -0500 Subject: [FieldTrip] sending mails to fieldtrip community Message-ID: Thanks Arjen Please respond to my trivial question. Thanks Raghavan ---------- Forwarded message ---------- From: *Stolk, A. (Arjen)* Date: Friday, February 21, 2014 Subject: mails to fieldtrip community To: Raghavan Gopalakrishnan Hi Raghavan, Ok, but let's keep it 'online' as other people might benefit from your questions as well. Yours, Arjen ------------------------------ *Van: *"Raghavan Gopalakrishnan" > *Aan: *"a stolk" > *Verzonden: *Donderdag 20 februari 2014 23:42:54 *Onderwerp: *mails to fieldtrip community Arjen, Whenever I try to post a message on Fieldtrip, it seems to appear as a separate message instead of creating a chain to the existing chain of mail exchanges. You could see that on the archives, I have three different chain with the same title - '[FieldTrip] regressconfound and frequency domain', though they all have the same subject. I thought it might be better for other users if they all form a chain instead of being separate. Thanks, Raghavan -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Fri Feb 21 15:53:35 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 21 Feb 2014 15:53:35 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Dear Alik, If I am correct, you're asking how to create subject-level t-descriptives, mentioned in the previous post? A quick answer would be to perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using ft_timelockstatistics (although you're not really 'testing' here, but only interested in that t-descriptive), in which trials are the unit of observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, ntrls_conditionB)]; ). Note that since an indepedent t-test tests for differences of the means of two conditions, it won't fail on unequal number of observations across the conditions (unlike a dependent/paired t-test). Hope this gets you kickstarted for the moment. I found a previous mail-conversation that goes more into detail, providing more overview of the steps involved: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html More useful documentation: http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Alik Widge" > Aan: "FieldTrip discussion list" > Verzonden: Vrijdag 21 februari 2014 11:38:10 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, what you just described is more or less what I struggled to do > last week and ultimately gave up as I was unable to figure out how to > get FT to do it despite much meditation over tutorials and source > files. Can you elaborate a bit more on what you are saying below -- > not the ft_regressconfound bit, but the bit about how to get > ft_statistics_montecarlo and its wrappers to do a trials-level > analysis and permutation at the whole-group level? Especially, what > does one put in cfg.design and how does one call the function? > Everything I could find in the tutorials described the case of doing > means at the subject level and then permutation of means at the group > level, which as you point out is underpowered for subtle effects. > My particular situation was timelock-analyzed trials (with > keeptrials='yes'), but I could not find a way to set up cfg.design > that did not throw error messages. The thing that really seemed to > bother it was that there were different numbers of trials in the 2-3 > conditions of interest, since some had to be removed for excessive > artifact. > Thanks for any help, > Alik > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > wrote: > > Dear Raghavan, > > To compute a t-descriptive on subject level freq data, you'll need > > to > > use ft_freqstatistics. Have a look here for instance: > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > At the subject level, you do not need (non-parametric) cluster > > permutation testing (Maris & Oostenveld), as you're taking each > > subject's t-descriptives to the group level. At the group level, you > > can then test the hypothesis that there's a difference between > > tasks/conditions (H1) vs. no difference (H0). In order to do so, > > you'll need to create a dummy variable at the group level, that has > > the same number of 'subjects', but with zeros in all fields (in your > > case this will be a .stat field). At the group level, you thus call > > ft_freqstatistics again. This approach has the advantage that you're > > more sensitive (as compared to taking each subject's mean to the > > group > > level) to effects that are small but consistent over trials in each > > subject. > > Arjen > > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > > Aan: fieldtrip at science.ru.nl > > > Verzonden: Donderdag 20 februari 2014 23:33:18 > > > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > > > Thanks Arjen, > > > Should I use ft_freqdescriptives to compute t descriptives for > > > individual subjects, and then take that to group level instead of > > > mean? If not, what are the other alternatives? > > > Thanks, > > > Raghavan > > > Hi Raghavan, ft_regressconfound run on timelock data seems to > > > return > > > output with avg field. However, ft_regressconfound run on > > > frequency > > > data, does not return average. I see the avg field being removed. > > > Is > > > there a reason? >> Not intentionally, but not an issue either. You > > > could still use ft_freqdescriptives to compute the average for > > > you, > > > but see my comment below. Question - Since ft_regressconfound > > > outputs > > > power spectrum of individual trials - 4D matrix (instead of > > > average), > > > can I simply re-average the power spectrum over trials to see the > > > average power for that subject. Also, I need to run grand average > > > (over subjects) before running statistics. I hope these steps does > > > not > > > distort the data. Please advise. >> Remember that the mean over > > > trials > > > is not affected by your clean-up of trial-by-trial variance due to > > > head movement. Taking each subject's mean (unaffected) to the > > > group > > > level is an approach that will not benefit from your clean-up. In > > > order to benefit from reduced trial-by-trial variance, you'll need > > > a > > > measure that depends on it, e.g. t-descriptive, neural > > > activity-behavior correlation (for taking to the group level). > > > Hope > > > this helps, Arjen ----- Oorspronkelijk bericht ----- > > > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > > > > Aan: > > > > fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari > > > > 2014 > > > > 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and > > > > frequency > > > > domain > Arjen, > Thanks, I reduced down the time resolution so > > > > computation can go > faster. Now, m y matrix looks like this > > > > > hpicomptimefreq = > label: {204x1 cell} > dimord: > > > > 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 > > > > double] > > > > > > > > > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 > > > > struct] > trialinfo: [59x1 double] > beta: [4-D double] > > > > > ft_regressconfound run on timelock data seems to return output > > > > with > > > > > avg field. However, ft_regressconfound run on frequency data, > > > > > does > > > > not > return average. I see the avg field being removed. Is > > > > there > > > > a > > > > reason? > Question - Since ft_regressconfound outputs power > > > > spectrum > > > > of > individual trials - 4D matrix (instead of average), can I > > > > simply > re-average the power spectrum over trials to see the > > > > average power for > that subject. Also, I need to run grand > > > > average > > > > (over subjects) before > running statistics. I hope these steps > > > > does > > > > not distort the data. > Please advise. > Thanks, > Raghavan > > > > > Date: > > > > Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. > > > > (Arjen)" > > > > < > > > > a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < > > > > fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] > > > > regressconfound and frequency domain > Message-ID: > < > > > > 2108167665.5423215.1392847118322.JavaMail.root at > > > > sculptor.zimbra.ru.nl > > > Content-Type: text/plain; > > > > charset="utf-8" > Dear Raghavan, Good to hear it's working out > > > > for > > > > you. A short answer > would be 'no'. Reducing the size of your > > > > data > > > > matrix is likely going > to speed up computations. Your time > > > > resolution seems pretty high (1500 > frequency estimations per > > > > single trial); do you need that many? Yours, > Arjen ----- > > > > Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" > > > > < > > > > gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > > > > > > > > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: > > > > [FieldTrip] regressconfound and frequency domain > > Arjen, > > > > > > Thanks for answering all my previous questions. I was > > > > successfully > > > > > > > > > > able to incorporate head movements to my erf data. As I > > > > > understand > > > > I > > have to do this separately for the time frequency data > > > > after > > > > keeping > > individual trials. I am interested in both beta and > > > > gamma bands > > [15:1:70]. my time frequency looks like this > > > > using > > > > wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: > > > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 > > > > double] > > > > > > > > > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 > > > > > struct] > > > > > > > > > > > trialinfo: [55x1 double] > > After regressconfound > > > > > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: > > > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 > > > > double] > > > > > > > > > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D > > > > double] > > Regressconfound took about 1 hr and 30 mins, since > > > > its > > > > a > > > > huge matrix > > [55x204x56x1500]. I have 25 such blocks of data > > > > for > > > > 20 subjects. It > > will take an enoumous amount of time to > > > > process > > > > the data through > > regressconfound. Is there a workaround to > > > > make > > > > the processing faster > > or am I missing something. Any help > > > > would > > > > be of great help. > > Thanks, > > Raghavan > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > > Phone: +31(0)243 68294 > > Web: www.arjenstolk.nl > > _______________________________________________ > > 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 -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Feb 21 16:14:04 2014 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 21 Feb 2014 10:14:04 -0500 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> References: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: I don't *think* I'm asking about how to do second-order analysis, unless I have missed something important. I did read the link/FAQ when I was working on this last week, and that seems different than the question I am asking. What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? Alik Alik Widge alik.widge at gmail.com (206) 866-5435 On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) wrote: > Dear Alik, > > If I am correct, you're asking how to create subject-level t-descriptives, > mentioned in the previous post? A quick answer would be to perform an > indepedent t-test ( cfg.statistic = indepsamplesT; ) using > ft_timelockstatistics (although you're not really 'testing' here, but only > interested in that t-descriptive), in which trials are the unit of > observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, > ntrls_conditionB)]; ). Note that since an indepedent t-test tests for > differences of the means of two conditions, it won't fail on unequal number > of observations across the conditions (unlike a dependent/paired t-test). > > Hope this gets you kickstarted for the moment. I found a previous > mail-conversation that goes more into detail, providing more overview of > the steps involved: > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html > More useful documentation: > > http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level > > Yours, > Arjen > > ------------------------------ > > *Van: *"Alik Widge" > *Aan: *"FieldTrip discussion list" > *Verzonden: *Vrijdag 21 februari 2014 11:38:10 > > *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain > > Arjen, what you just described is more or less what I struggled to do last > week and ultimately gave up as I was unable to figure out how to get FT to > do it despite much meditation over tutorials and source files. Can you > elaborate a bit more on what you are saying below -- not the > ft_regressconfound bit, but the bit about how to get > ft_statistics_montecarlo and its wrappers to do a trials-level analysis and > permutation at the whole-group level? Especially, what does one put in > cfg.design and how does one call the function? Everything I could find in > the tutorials described the case of doing means at the subject level and > then permutation of means at the group level, which as you point out is > underpowered for subtle effects. > > My particular situation was timelock-analyzed trials (with > keeptrials='yes'), but I could not find a way to set up cfg.design that > did not throw error messages. The thing that really seemed to bother it was > that there were different numbers of trials in the 2-3 conditions of > interest, since some had to be removed for excessive artifact. > > Thanks for any help, > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Raghavan, >> >> To compute a t-descriptive on subject level freq data, you'll need to use >> ft_freqstatistics. Have a look here for instance: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> >> At the subject level, you do not need (non-parametric) cluster >> permutation testing (Maris & Oostenveld), as you're taking each subject's >> t-descriptives to the group level. At the group level, you can then test >> the hypothesis that there's a difference between tasks/conditions (H1) vs. >> no difference (H0). In order to do so, you'll need to create a dummy >> variable at the group level, that has the same number of 'subjects', but >> with zeros in all fields (in your case this will be a .stat field). At the >> group level, you thus call ft_freqstatistics again. This approach has the >> advantage that you're more sensitive (as compared to taking each subject's >> mean to the group level) to effects that are small but consistent over >> trials in each subject. >> >> Arjen >> >> >> ------------------------------ >> >> *Van: *"Raghavan Gopalakrishnan" >> *Aan: *fieldtrip at science.ru.nl >> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Thanks Arjen, >> Should I use ft_freqdescriptives to compute t descriptives for individual >> subjects, and then take that to group level instead of mean? If not, what >> are the other alternatives? >> Thanks, >> Raghavan >> >> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >> >* Van: "Raghavan Gopalakrishnan" > >> *>* Aan: fieldtrip at science.ru.nl >> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >> *>* Arjen, >> *>* Thanks, I reduced down the time resolution so computation can go >> *>* faster. Now, m y matrix looks like this >> *>* hpicomptimefreq = >> *>* label: {204x1 cell} >> *>* dimord: 'rpt_chan_freq_time' >> *>* freq: [1x56 double] >> *>* time: [1x375 double] >> *>* powspctrm: [4-D double] >> *>* cumtapcnt: [59x56 double] >> *>* cfg: [1x1 struct] >> *>* trialinfo: [59x1 double] >> *>* beta: [4-D double] >> *>* ft_regressconfound run on timelock data seems to return output with >> *>* avg field. However, ft_regressconfound run on frequency data, does not >> *>* return average. I see the avg field being removed. Is there a reason? >> *>* Question - Since ft_regressconfound outputs power spectrum of >> *>* individual trials - 4D matrix (instead of average), can I simply >> *>* re-average the power spectrum over trials to see the average power for >> *>* that subject. Also, I need to run grand average (over subjects) before >> *>* running statistics. I hope these steps does not distort the data. >> *>* Please advise. >> *>* Thanks, >> *>* Raghavan >> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >> *>* Message-ID: >> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >> *>* > >> *>* Content-Type: text/plain; charset="utf-8" >> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >> *>* would be 'no'. Reducing the size of your data matrix is likely going >> *>* to speed up computations. Your time resolution seems pretty high (1500 >> *>* frequency estimations per single trial); do you need that many? Yours, >> *>* Arjen ----- Oorspronkelijk bericht ----- >> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >> *>* > Aan: fieldtrip at science.ru.nl >> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >> *>* > Arjen, >> *>* > Thanks for answering all my previous questions. I was successfully >> *>* > able to incorporate head movements to my erf data. As I understand I >> *>* > have to do this separately for the time frequency data after keeping >> *>* > individual trials. I am interested in both beta and gamma bands >> *>* > [15:1:70]. my time frequency looks like this using wavelets, >> *>* > timefreq = >> *>* > label: {204x1 cell} >> *>* > dimord: 'rpt_chan_freq_time' >> *>* > freq: [1x56 double] >> *>* > time: [1x1500 double] >> *>* > powspctrm: [4-D double] >> *>* > cumtapcnt: [55x56 double] >> *>* > grad: [1x1 struct] >> *>* > elec: [1x1 struct] >> *>* > cfg: [1x1 struct] >> *>* > trialinfo: [55x1 double] >> *>* > After regressconfound >> *>* > hpicomptimefreq = >> *>* > label: {204x1 cell} >> *>* > dimord: 'rpt_chan_freq_time' >> *>* > freq: [1x56 double] >> *>* > time: [1x1500 double] >> *>* > powspctrm: [4-D double] >> *>* > cumtapcnt: [55x56 double] >> *>* > cfg: [1x1 struct] >> *>* > trialinfo: [55x1 double] >> *>* > beta: [4-D double] >> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >> *>* > will take an enoumous amount of time to process the data through >> *>* > regressconfound. Is there a workaround to make the processing faster >> *>* > or am I missing something. Any help would be of great help. >> *>* > Thanks, >> *>* > Raghavan* >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> >> _______________________________________________ >> 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 > > > > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > > _______________________________________________ > 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 a.stolk8 at gmail.com Fri Feb 21 16:26:27 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Fri, 21 Feb 2014 16:26:27 +0100 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: References: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> >> _______________________________________________ >> 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 russgport at gmail.com Sat Feb 22 00:27:54 2014 From: russgport at gmail.com (Russell G Port) Date: Fri, 21 Feb 2014 18:27:54 -0500 Subject: [FieldTrip] sliding window for ICA Message-ID: Hi All, I have come across a problem and was hoping that someone had experience/knew things that could be useful.I have some MEG data, and the effort currently is to remove noise and artifact. I have the line noise reduction working fine, the question that faces me is the following. When I first read in my data I have the option of one of two methods. I can read it in as 1 second epoch for the whole length of the experiment (contiguous time bins, with no regard to events), or create 1 second epochs centered around a certain trigger (the data contains 4 different triggers). Initially I wanted to read in 1 second epochs (that spanned the entire dataset), clean it of artifacts (jumps, muscle, EOG,ECG, anything else), which would remove bad trials and components. I had then hoped to redefined the epoch, so that I could create 4 separate subsets of data, each centered around a separate trigger. It appears that I cannot do this (fieldtrip actually refuses this specifically). Is this because of issues with phase/jitter when putting the samples back together in different time sets? Second, it has been suggested that we perform ICA analysis to detect EOG and ECG artifacts on the data parsed just by timing (i.e. 1second bins contiguous for the entire length of the data but no relation to triggers), and have the component rejection scan my trials that are actually binned the based on triggers to remove the components; even though this is not the exact epochs used to classify the components. Is this possible? While I think it would be better to do the artifact correction on the whole dataset (all time/triggers included), would it actually be better to first define trials by triggers and then repeat everything (artifact rejection-wise)? This is very easy to do (and I have), the only issue comes when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as in http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg). I have the issue that when I used ft_artifact_ecg to detect peaks in the ECG channel (via z scores), zeros and NaNs are returned, and it fails to graph; since often the ECG timing occurs with such timing that the full pre/post time extends past what is actually in the trial. Is it proper just to remove all ECG events that cross the boundaries of the trigger based trials from the trial definitions used in next step. Here the sections of data contaminated with ECG are parsed and then tested to see coherence to the ICA components? I would fear that this would produce erroneous results, since the data for the ica would include the partial ECG event that I threw out. Best Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsauvigny at gmail.com Sat Feb 22 14:32:02 2014 From: tsauvigny at gmail.com (Thomas Sauvigny) Date: Sat, 22 Feb 2014 14:32:02 +0100 Subject: [FieldTrip] problem with EEG source reconstruction Message-ID: Dear fellow fiedtrippers, I would like to do a source reconstruction of EEG data using The FielTrip example MRI dataset via minimum-norm estimate. I stick close to the MNE tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and use a few steps from the EEG headmodel tutorial as well (http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I am struggling to combine the information from both tutorials in some crucial step prior to ft_sourceanalysis. My first approach has been to basically run through the MNE tutorial using the Fieltrip MRI dataset. As I could not save both the original anatomy and the masked anatomy in a freesurfer compatible format while using cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri = ft_volumesegment(cfg, mri); I instead proceeded as mentioned below and aligned the electrodes to the scalp in a second step (according to the headmodel tutorial). But when I want to combine the headmodel (vol) and the electrodes (elec_aligned2) into the leadfield, that does not work: using headmodel specified in the configuration using electrodes specified in the configuration Error using ft_prepare_vol_sens (line 534) unsupported volume conductor model for EEG Error in prepare_headmodel (line 94) [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ft_prepare_leadfield (line 124) [vol, sens, cfg] = prepare_headmodel(cfg, data); When I instead use the volume conduction model built in the headmodel tutorial (vol2) and the sourcespace from the MNE tutorial I get: Error using * Inner matrix dimensions must agree. Error in minimumnormestimate (line 179) A = P*A; % prewhitened leadfields Error in ft_sourceanalysis (line 869) dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, 'noisecov', squeeze(Cy(i,:,:))); In older posts in the mailing list there appeared to be problems with the scaling of the different components and I adapted the units, but that did not solve the problems. I would be very thankful for any help. cheers Thomas My script: clear all; mri = ft_read_mri('Subject01.mri'); save mri mri; disp(mri) cfg = []; cfg.resolution = 1; cfg.dim = [256 256 256]; mrirs = ft_volumereslice(cfg, mri); save mrirs mrirs; % segmentation of the mri % load mrirs; cfg = []; cfg.coordsys = 'ctf'; cfg.output = {'skullstrip' 'brain'}; seg = ft_volumesegment(cfg, mrirs); save seg seg; disp(seg(1)) %%% Thus, you need to identify the anterior commissure, the posterior commissure, and an interhemispheric point (which defines the XZ-plane). You can navigate across the slices with the arrows. %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel %%% coordinates of these landmarks are stored: % load mrirs; cfg = []; cfg.method = 'interactive'; mri_tal = ft_volumerealign(cfg, mrirs); save mri_tal mri_tal clear all; load mri_tal; load seg; % ensure that the skull-stripped anatomy is expressed in the same coordinate system as the anatomy seg.transform = mri_tal.transform; % save both the original anatomy, and the masked anatomy in a freesurfer compatible format cfg = []; cfg.filename = 'Subject01'; cfg.filetype = 'mgz'; cfg.parameter = 'anatomy'; ft_volumewrite(cfg, mri_tal); cfg.filename = 'Subject01masked'; ft_volumewrite(cfg, seg); %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% tcsh chsh -s /bin/tcsh setenv FREESURFER_HOME /Applications/freesurfer source $FREESURFER_HOME/SetUpFreeSurfer.csh setenv SUBJECTS_DIR /Applications/freesurfer/subjects setenv SUBJECT /Subject01 %%% .mgz files to mri folder cd $SUBJECTS_DIR/Subject01/mri/ mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz recon-all -talairach -subjid Subject01 recon-all -nuintensitycor -subjid Subject01 recon-all -normalization -subjid Subject01 cp T1.mgz brainmask.mgz recon-all -gcareg -subjid Subject01 recon-all -canorm -subjid Subject01 recon-all -careg -subjid Subject01 recon-all -calabel -subjid Subject01 recon-all -normalization2 -subjid Subject01 recon-all -segmentation -subjid Subject01 recon-all -fill -subjid Subject01 %%% This ends the part of the Freesurfer pipeline concerned with volumetric processing. At this stage you should have a file filled.mgz containing the segmentation of the cortical white matter (cerebellum is not included!). %%% You can check how this looks using FieldTrip, by doing the following: % % go to the Subject01/mri directory mri = ft_read_mri('filled.mgz'); cfg = []; cfg.interactive = 'yes'; figure;ft_sourceplot(cfg, mri); %%% back in Terminal: cd $SUBJECTS_DIR/Subject01/mri/ recon-all -tessellate -subjid Subject01 recon-all -smooth1 -subjid Subject01 recon-all -inflate1 -subjid Subject01 recon-all -qsphere -subjid Subject01 recon-all -fix -subjid Subject01 cp brain.mgz brain.finalsurfs.mgz recon-all -finalsurfs -subjid Subject01 recon-all -smooth2 -subjid Subject01 recon-all -inflate2 -subjid Subject01 recon-all -sphere -subjid Subject01 recon-all -surfreg -subjid Subject01 %%% MNE download and installation %%%%%%%%%%%%%% setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app source $MNE_ROOT/bin/mne_setup % http://martinos.org/mne/stable/manual/list.html cd $MNE_ROOT/bin ./mne_setup_sh setenv SUBJECTS_DIR /Applications/freesurfer/subjects setenv SUBJECT /Subject01 ./mne_setup_source_space --ico -6 --overwrite %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); figure;ft_plot_mesh(bnd); %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/mri mri_nom = ft_read_mri('orig-nomask.mgz'); cfg = []; cfg.method = 'interactive'; mri_nom_ctf = ft_volumerealign(cfg, mri_nom); %%% fiducials chosen, fiducials l,r,n mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/bem bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); sourcespace = ft_convert_units(bnd, 'cm'); sourcespace = ft_transform_geometry(T, sourcespace); save sourcespace sourcespace; save T T; %we will need the transformation matrix in the next step %%% Current Folder auf: /Applications/freesurfer/subjects/Subject01/Subject01/mri mri_nom = ft_read_mri('orig-nomask.mgz'); cfg = []; cfg.coordsys = 'spm'; cfg.output = {'brain'}; seg = ft_volumesegment(cfg, mri_nom); seg = ft_convert_units(seg,'cm'); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg,seg); vol.bnd = ft_transform_geometry(T, vol.bnd); save vol vol; % load vol % volume conduction model figure;hold on; ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight %%% so far, so good. >>> then I create the elec file: clear all; mri2 = ft_read_mri('Subject01.mri'); disp(mri2) save mri2 mri2; cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri2 = ft_volumesegment(cfg, mri2); save segmentedmri2 segmentedmri2 disp(segmentedmri2) cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 1000]; bnd2=ft_prepare_mesh(cfg,segmentedmri2); save bnd2 bnd2 disp(bnd2(1)) cfg = []; cfg.method ='dipoli'; vol2 = ft_prepare_headmodel(cfg, segmentedmri2); save vol2 vol2 disp(vol2) vol2 = ft_convert_units(vol2, 'cm'); figure; ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp figure; ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull figure; ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); elec2 = ft_read_sens('standard_1020.elc'); % may you need to define the path to the file disp(elec2) elec2 = ft_convert_units(elec2, 'cm'); % load volume conduction model load vol2; figure; % head surface (scalp) ft_plot_mesh(vol2.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % electrodes ft_plot_sens(elec2,'style', 'sk'); mri2 = ft_convert_units(mri2, 'cm'); nas=mri2.hdr.fiducial.mri.nas; lpa=mri2.hdr.fiducial.mri.lpa; rpa=mri2.hdr.fiducial.mri.rpa; transm=mri2.transform; nas=warp_apply(transm,nas, 'homogenous'); lpa=warp_apply(transm,lpa, 'homogenous'); rpa=warp_apply(transm,rpa, 'homogenous'); fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials fid.label = {'Nz','LPA','RPA'}; % same labels as in elec fid.unit = 'cm'; % same units as mri % alignment cfg = []; cfg.method = 'fiducial'; cfg.template = fid; % see above cfg.elec = elec2; cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec elec_aligned2 = ft_electroderealign(cfg); save elec_aligned2 elec_aligned2; % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); figure; ft_plot_sens(elec_aligned2,'style','sk'); hold on; ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', 'facecolor', [0.65 0.65 0.65]); %scalp cfg = []; cfg.method = 'interactive'; cfg.elec = elec_aligned2; cfg.headshape = vol2.bnd(1); elec_aligned2 = ft_electroderealign(cfg); %%%%% and here I am struggling: I can not get any of the above files to %%%%% work together: vol or vol2, elec_aligned2, sourcespace etc. vol = ft_convert_units(vol, 'cm'); elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); cfg = []; cfg.elec = elec_aligned2; % sensor positions cfg.channel = 'all'; % the used channels cfg.grid.pos = sourcespace.pnt; % source points cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are inside of the brain cfg.vol = vol; cfg.normalize = 'yes';% volume conduction model leadfield = ft_prepare_leadfield(cfg); save leadfield leadfield; clear all; load('GA1.mat') load('GA2.mat') load leadfield; load vol2; load elec_aligned2; cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned2; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; cfg.mne.normalize = 'yes'; sourceCERT0 = ft_sourceanalysis(cfg, GA1); sourceCERT3 = ft_sourceanalysis(cfg, GA2); -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Sat Feb 22 15:38:25 2014 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Sat, 22 Feb 2014 15:38:25 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: References: Message-ID: Hi Thomas, When I was working with actual data, once I got this error. At that time, it was the problem of having different number of electrodes for the forward solution (lead-field) i have created and for each subject recording electrodes. Each subject has different set of recording electrodes which gave this problem. I think we have to check the difference in electrodes or number of sensors. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > Dear fellow fiedtrippers, > > I would like to do a source reconstruction of EEG data using The FielTrip > example MRI dataset via minimum-norm estimate. I stick close to the MNE > tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and > use a few steps from the EEG headmodel tutorial as well ( > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I > am struggling to combine the information from both tutorials in some > crucial step prior to ft_sourceanalysis. > My first approach has been to basically run through the MNE tutorial using > the Fieltrip MRI dataset. As I could not save both the original anatomy and > the masked anatomy in a freesurfer compatible format while using > > *cfg = [];* > *cfg.output = {'brain','skull','scalp'};* > *segmentedmri = ft_volumesegment(cfg, mri);* > > I instead proceeded as mentioned below and aligned the electrodes to the > scalp in a second step (according to the headmodel tutorial). But when I > want to combine the headmodel (vol) and the electrodes (elec_aligned2) into > the leadfield, that does not work: > > *using headmodel specified in the configuration* > *using electrodes specified in the configuration* > *Error using ft_prepare_vol_sens (line 534)* > *unsupported volume conductor model for EEG* > > *Error in prepare_headmodel (line 94)* > *[vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order',* > *cfg.order);* > > *Error in ft_prepare_leadfield (line 124)* > *[vol, sens, cfg] = prepare_headmodel(cfg, data);* > > > When I instead use the volume conduction model built in the headmodel > tutorial (vol2) and the sourcespace from the MNE tutorial I get: > > > > > > > > > > *Error using * Inner matrix dimensions must agree.Error in > minimumnormestimate (line 179) A = P*A; % prewhitened > leadfieldsError in ft_sourceanalysis (line 869) dip(i) = > minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, > 'noisecov', squeeze(Cy(i,:,:)));* > > In older posts in the mailing list there appeared to be problems with the > scaling of the different components and I adapted the units, but that did > not solve the problems. > I would be very thankful for any help. > > > > cheers > Thomas > > > > > > > > > My script: > > clear all; > mri = ft_read_mri('Subject01.mri'); > save mri mri; > disp(mri) > > cfg = []; > cfg.resolution = 1; > cfg.dim = [256 256 256]; > mrirs = ft_volumereslice(cfg, mri); > save mrirs mrirs; > > % segmentation of the mri > % load mrirs; > cfg = []; > cfg.coordsys = 'ctf'; > cfg.output = {'skullstrip' 'brain'}; > seg = ft_volumesegment(cfg, mrirs); > save seg seg; > > disp(seg(1)) > > %%% Thus, you need to identify the anterior commissure, the posterior > commissure, and an interhemispheric point (which defines the XZ-plane). You > can navigate across the slices with the arrows. > %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel > %%% coordinates of these landmarks are stored: > % load mrirs; > cfg = []; > cfg.method = 'interactive'; > mri_tal = ft_volumerealign(cfg, mrirs); > save mri_tal mri_tal > > clear all; > load mri_tal; > load seg; > % ensure that the skull-stripped anatomy is expressed in the same > coordinate system as the anatomy > seg.transform = mri_tal.transform; > % save both the original anatomy, and the masked anatomy in a freesurfer > compatible format > cfg = []; > cfg.filename = 'Subject01'; > cfg.filetype = 'mgz'; > cfg.parameter = 'anatomy'; > ft_volumewrite(cfg, mri_tal); > cfg.filename = 'Subject01masked'; > ft_volumewrite(cfg, seg); > > %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% > tcsh > chsh -s /bin/tcsh > setenv FREESURFER_HOME /Applications/freesurfer > source $FREESURFER_HOME/SetUpFreeSurfer.csh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > %%% .mgz files to mri folder > cd $SUBJECTS_DIR/Subject01/mri/ > mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz > mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz > > recon-all -talairach -subjid Subject01 > recon-all -nuintensitycor -subjid Subject01 > recon-all -normalization -subjid Subject01 > cp T1.mgz brainmask.mgz > recon-all -gcareg -subjid Subject01 > recon-all -canorm -subjid Subject01 > recon-all -careg -subjid Subject01 > recon-all -calabel -subjid Subject01 > recon-all -normalization2 -subjid Subject01 > recon-all -segmentation -subjid Subject01 > recon-all -fill -subjid Subject01 > > > %%% This ends the part of the Freesurfer pipeline concerned with > volumetric processing. At this stage you should have a file filled.mgz > containing the segmentation of the cortical white matter (cerebellum is not > included!). > %%% You can check how this looks using FieldTrip, by doing the following: > % % go to the Subject01/mri directory > mri = ft_read_mri('filled.mgz'); > cfg = []; > cfg.interactive = 'yes'; > figure;ft_sourceplot(cfg, mri); > > %%% back in Terminal: > cd $SUBJECTS_DIR/Subject01/mri/ > recon-all -tessellate -subjid Subject01 > recon-all -smooth1 -subjid Subject01 > recon-all -inflate1 -subjid Subject01 > recon-all -qsphere -subjid Subject01 > recon-all -fix -subjid Subject01 > cp brain.mgz brain.finalsurfs.mgz > recon-all -finalsurfs -subjid Subject01 > recon-all -smooth2 -subjid Subject01 > recon-all -inflate2 -subjid Subject01 > recon-all -sphere -subjid Subject01 > recon-all -surfreg -subjid Subject01 > > %%% MNE download and installation %%%%%%%%%%%%%% > setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 > setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app > source $MNE_ROOT/bin/mne_setup > > % http://martinos.org/mne/stable/manual/list.html > cd $MNE_ROOT/bin > ./mne_setup_sh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > > ./mne_setup_source_space --ico -6 --overwrite > > %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > figure;ft_plot_mesh(bnd); > > %%% Current Folder : > /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > %%% fiducials chosen, fiducials l,r,n > > mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > %%% Current Folder : > /Applications/freesurfer/subjects/Subject01/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', > 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > %%% Current Folder auf: > /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.coordsys = 'spm'; > cfg.output = {'brain'}; > seg = ft_volumesegment(cfg, mri_nom); > seg = ft_convert_units(seg,'cm'); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg,seg); > vol.bnd = ft_transform_geometry(T, vol.bnd); > save vol vol; > > % load vol % volume conduction model > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > > > > %%% so far, so good. >>> then I create the elec file: > clear all; > mri2 = ft_read_mri('Subject01.mri'); > disp(mri2) > save mri2 mri2; > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri2 = ft_volumesegment(cfg, mri2); > save segmentedmri2 segmentedmri2 > disp(segmentedmri2) > > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd2=ft_prepare_mesh(cfg,segmentedmri2); > > save bnd2 bnd2 > > disp(bnd2(1)) > > cfg = []; > cfg.method ='dipoli'; > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > save vol2 vol2 > > disp(vol2) > > vol2 = ft_convert_units(vol2, 'cm'); > > > figure; > ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp > figure; > ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull > figure; > ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain > > ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, > 'edgecolor', [1 1 1], 'edgealpha', 0.05); > hold on; > ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); > hold on; > ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); > > elec2 = ft_read_sens('standard_1020.elc'); % may you need to > define the path to the file > > disp(elec2) > > elec2 = ft_convert_units(elec2, 'cm'); > > % load volume conduction model > load vol2; > figure; > % head surface (scalp) > ft_plot_mesh(vol2.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % electrodes > ft_plot_sens(elec2,'style', 'sk'); > > > mri2 = ft_convert_units(mri2, 'cm'); > > nas=mri2.hdr.fiducial.mri.nas; > lpa=mri2.hdr.fiducial.mri.lpa; > rpa=mri2.hdr.fiducial.mri.rpa; > > transm=mri2.transform; > > nas=warp_apply(transm,nas, 'homogenous'); > lpa=warp_apply(transm,lpa, 'homogenous'); > rpa=warp_apply(transm,rpa, 'homogenous'); > > fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials > fid.label = {'Nz','LPA','RPA'}; % same labels as in elec > fid.unit = 'cm'; % same units as mri > > % alignment > cfg = []; > cfg.method = 'fiducial'; > cfg.template = fid; % see above > cfg.elec = elec2; > cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid > and in elec > elec_aligned2 = ft_electroderealign(cfg); > > save elec_aligned2 elec_aligned2; > % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > figure; > ft_plot_sens(elec_aligned2,'style','sk'); > hold on; > ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', > 'facecolor', [0.65 0.65 0.65]); %scalp > > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec_aligned2; > cfg.headshape = vol2.bnd(1); > elec_aligned2 = ft_electroderealign(cfg); > > > *%%%%% and here I am struggling: I can not get any of the above files to* > *%%%%% work together: vol or vol2, elec_aligned2, sourcespace etc.* > > vol = ft_convert_units(vol, 'cm'); > elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > cfg = []; > cfg.elec = elec_aligned2; % sensor positions > cfg.channel = 'all'; % the used channels > cfg.grid.pos = sourcespace.pnt; % source points > cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are > inside of the brain > cfg.vol = vol; > cfg.normalize = 'yes';% volume conduction model > leadfield = ft_prepare_leadfield(cfg); > > save leadfield leadfield; > > clear all; > load('GA1.mat') > load('GA2.mat') > load leadfield; > load vol2; > load elec_aligned2; > > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned2; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > cfg.mne.normalize = 'yes'; > sourceCERT0 = ft_sourceanalysis(cfg, GA1); > sourceCERT3 = ft_sourceanalysis(cfg, GA2); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From aaron.schurger at gmail.com Sat Feb 22 16:37:27 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Sat, 22 Feb 2014 16:37:27 +0100 Subject: [FieldTrip] sliding window for ICA In-Reply-To: References: Message-ID: See below... On Sat, Feb 22, 2014 at 12:27 AM, Russell G Port wrote: > Hi All, > > I have come across a problem and was hoping that someone had experience/knew > things that could be useful.I have some MEG data, and the effort currently > is to remove noise and artifact. I have the line noise reduction working > fine, the question that faces me is the following. When I first read in my > data I have the option of one of two methods. I can read it in as 1 second > epoch for the whole length of the experiment (contiguous time bins, with no > regard to events), or create 1 second epochs centered around a certain > trigger (the data contains 4 different triggers). Initially I wanted to read > in 1 second epochs (that spanned the entire dataset), clean it of artifacts > (jumps, muscle, EOG,ECG, anything else), which would remove bad trials and > components. I had then hoped to redefined the epoch, so that I could create > 4 separate subsets of data, each centered around a separate trigger. It > appears that I cannot do this (fieldtrip actually refuses this > specifically). Is this because of issues with phase/jitter when putting the > samples back together in different time sets? Second, it has been suggested > that we perform ICA analysis to detect EOG and ECG artifacts on the data > parsed just by timing (i.e. 1second bins contiguous for the entire length of > the data but no relation to triggers), and have the component rejection scan > my trials that are actually binned the based on triggers to remove the > components; even though this is not the exact epochs used to classify the > components. Is this possible? This is the preferred way to do it. Read in all of your data in 1- or 2-second epochs at arbitrary points (just one right after another). Run ICA on these epochs and save the components that you get (call this 'comp'). Then make a note of the components that you want to remove (usually blink, eye movement, and heart). Now read in your data time-locked to your triggers and use the previously-defined components to clean up the data (use the cfg to specify which components you want to remove). [data] = ft_rejectcomponent(cfg, comp, data); > > While I think it would be better to do the artifact correction on the whole > dataset (all time/triggers included), would it actually be better to first > define trials by triggers and then repeat everything (artifact > rejection-wise)? This is very easy to do (and I have), the only issue comes > when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as in > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg). > I have the issue that when I used ft_artifact_ecg to detect peaks in the ECG > channel (via z scores), zeros and NaNs are returned, and it fails to graph; > since often the ECG timing occurs with such timing that the full pre/post > time extends past what is actually in the trial. Is it proper just to remove > all ECG events that cross the boundaries of the trigger based trials from > the trial definitions used in next step. Here the sections of data > contaminated with ECG are parsed and then tested to see coherence to the ICA > components? I would fear that this would produce erroneous results, since > the data for the ica would include the partial ECG event that I threw out. > > Best > Russ Port > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From russgport at gmail.com Sat Feb 22 19:49:17 2014 From: russgport at gmail.com (Russell G Port) Date: Sat, 22 Feb 2014 13:49:17 -0500 Subject: [FieldTrip] sliding window for ICA In-Reply-To: References: Message-ID: Thank you Dr Schurger, this is awesome On Sat, Feb 22, 2014 at 10:37 AM, Aaron Schurger wrote: > See below... > > > On Sat, Feb 22, 2014 at 12:27 AM, Russell G Port > wrote: > > Hi All, > > > > I have come across a problem and was hoping that someone had > experience/knew > > things that could be useful.I have some MEG data, and the effort > currently > > is to remove noise and artifact. I have the line noise reduction working > > fine, the question that faces me is the following. When I first read in > my > > data I have the option of one of two methods. I can read it in as 1 > second > > epoch for the whole length of the experiment (contiguous time bins, with > no > > regard to events), or create 1 second epochs centered around a certain > > trigger (the data contains 4 different triggers). Initially I wanted to > read > > in 1 second epochs (that spanned the entire dataset), clean it of > artifacts > > (jumps, muscle, EOG,ECG, anything else), which would remove bad trials > and > > components. I had then hoped to redefined the epoch, so that I could > create > > 4 separate subsets of data, each centered around a separate trigger. It > > appears that I cannot do this (fieldtrip actually refuses this > > specifically). Is this because of issues with phase/jitter when putting > the > > samples back together in different time sets? Second, it has been > suggested > > that we perform ICA analysis to detect EOG and ECG artifacts on the data > > parsed just by timing (i.e. 1second bins contiguous for the entire > length of > > the data but no relation to triggers), and have the component rejection > scan > > my trials that are actually binned the based on triggers to remove the > > components; even though this is not the exact epochs used to classify the > > components. Is this possible? > > This is the preferred way to do it. Read in all of your data in 1- or > 2-second epochs at arbitrary points (just one right after another). > Run ICA on these epochs and save the components that you get (call > this 'comp'). Then make a note of the components that you want to > remove (usually blink, eye movement, and heart). Now read in your data > time-locked to your triggers and use the previously-defined components > to clean up the data (use the cfg to specify which components you want > to remove). > [data] = ft_rejectcomponent(cfg, comp, data); > > > > > While I think it would be better to do the artifact correction on the > whole > > dataset (all time/triggers included), would it actually be better to > first > > define trials by triggers and then repeat everything (artifact > > rejection-wise)? This is very easy to do (and I have), the only issue > comes > > when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as > in > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg > ). > > I have the issue that when I used ft_artifact_ecg to detect peaks in the > ECG > > channel (via z scores), zeros and NaNs are returned, and it fails to > graph; > > since often the ECG timing occurs with such timing that the full pre/post > > time extends past what is actually in the trial. Is it proper just to > remove > > all ECG events that cross the boundaries of the trigger based trials from > > the trial definitions used in next step. Here the sections of data > > contaminated with ECG are parsed and then tested to see coherence to the > ICA > > components? I would fear that this would produce erroneous results, since > > the data for the ica would include the partial ECG event that I threw > out. > > > > Best > > Russ Port > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > 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 zizlsperger at gmail.com Sun Feb 23 13:14:37 2014 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Sun, 23 Feb 2014 13:14:37 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: References: Message-ID: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> Hello in view of your code: first check if elec2 = ft_read_sens('standard_1020.elc’); corresponds to the channel structure of your functional data (averages). Best to Hamburg Leo — Dr. med. Leopold Zizlsperger Klinik für Neurologie Uniklinik RWTH Aachen Pauwelsstrasse 30 52074 Aachen Tel: +49 241 80 35465 lzizlsperger at ukaachen.de Leopold Zizlsperger, MD Department of Neurology RWTH Aachen University Pauwelsstrasse 30 52074 Aachen, Germany Tel: +49 241 80 35465 lzizlsperger at ukaachen.de On 22 Feb 2014, at 15:38, Chaitanya Srinivas wrote: > Hi Thomas, > > When I was working with actual data, once I got this error. At that time, it was the problem of having different number of electrodes for the forward solution (lead-field) i have created and for each subject recording electrodes. Each subject has different set of recording electrodes which gave this problem. I think we have to check the difference in electrodes or number of sensors. > > > > =============================================== > > > > Best Regards > Chaitanya Srinivas Lanka > > Wiss. Mitarbeiter PhD Student > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for Neuroscience > Eberhard Karls University Eberhard Karls University > Otfried-Mueller-Str.45 Österbergstr. 3 > D-72076 Tuebingen D-72074 Tuebingen > Mobile Phone Number : +49-176-79035731 > =============================================== > > > On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > Dear fellow fiedtrippers, > > I would like to do a source reconstruction of EEG data using The FielTrip example MRI dataset via minimum-norm estimate. I stick close to the MNE tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and use a few steps from the EEG headmodel tutorial as well (http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I am struggling to combine the information from both tutorials in some crucial step prior to ft_sourceanalysis. > My first approach has been to basically run through the MNE tutorial using the Fieltrip MRI dataset. As I could not save both the original anatomy and the masked anatomy in a freesurfer compatible format while using > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri); > > I instead proceeded as mentioned below and aligned the electrodes to the scalp in a second step (according to the headmodel tutorial). But when I want to combine the headmodel (vol) and the electrodes (elec_aligned2) into the leadfield, that does not work: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Error using ft_prepare_vol_sens (line 534) > unsupported volume conductor model for EEG > > Error in prepare_headmodel (line 94) > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', > cfg.order); > > Error in ft_prepare_leadfield (line 124) > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > When I instead use the volume conduction model built in the headmodel tutorial (vol2) and the sourcespace from the MNE tutorial I get: > > Error using * > Inner matrix dimensions must agree. > > Error in minimumnormestimate (line 179) > A = P*A; % prewhitened leadfields > > Error in ft_sourceanalysis (line 869) > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, > 'noisecov', squeeze(Cy(i,:,:))); > > In older posts in the mailing list there appeared to be problems with the scaling of the different components and I adapted the units, but that did not solve the problems. > I would be very thankful for any help. > > > > cheers > Thomas > > > > > > > > > My script: > > clear all; > mri = ft_read_mri('Subject01.mri'); > save mri mri; > disp(mri) > > cfg = []; > cfg.resolution = 1; > cfg.dim = [256 256 256]; > mrirs = ft_volumereslice(cfg, mri); > save mrirs mrirs; > > % segmentation of the mri > % load mrirs; > cfg = []; > cfg.coordsys = 'ctf'; > cfg.output = {'skullstrip' 'brain'}; > seg = ft_volumesegment(cfg, mrirs); > save seg seg; > > disp(seg(1)) > > %%% Thus, you need to identify the anterior commissure, the posterior commissure, and an interhemispheric point (which defines the XZ-plane). You can navigate across the slices with the arrows. > %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel > %%% coordinates of these landmarks are stored: > % load mrirs; > cfg = []; > cfg.method = 'interactive'; > mri_tal = ft_volumerealign(cfg, mrirs); > save mri_tal mri_tal > > clear all; > load mri_tal; > load seg; > % ensure that the skull-stripped anatomy is expressed in the same coordinate system as the anatomy > seg.transform = mri_tal.transform; > % save both the original anatomy, and the masked anatomy in a freesurfer compatible format > cfg = []; > cfg.filename = 'Subject01'; > cfg.filetype = 'mgz'; > cfg.parameter = 'anatomy'; > ft_volumewrite(cfg, mri_tal); > cfg.filename = 'Subject01masked'; > ft_volumewrite(cfg, seg); > > %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% > tcsh > chsh -s /bin/tcsh > setenv FREESURFER_HOME /Applications/freesurfer > source $FREESURFER_HOME/SetUpFreeSurfer.csh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > %%% .mgz files to mri folder > cd $SUBJECTS_DIR/Subject01/mri/ > mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz > mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz > > recon-all -talairach -subjid Subject01 > recon-all -nuintensitycor -subjid Subject01 > recon-all -normalization -subjid Subject01 > cp T1.mgz brainmask.mgz > recon-all -gcareg -subjid Subject01 > recon-all -canorm -subjid Subject01 > recon-all -careg -subjid Subject01 > recon-all -calabel -subjid Subject01 > recon-all -normalization2 -subjid Subject01 > recon-all -segmentation -subjid Subject01 > recon-all -fill -subjid Subject01 > > > %%% This ends the part of the Freesurfer pipeline concerned with volumetric processing. At this stage you should have a file filled.mgz containing the segmentation of the cortical white matter (cerebellum is not included!). > %%% You can check how this looks using FieldTrip, by doing the following: > % % go to the Subject01/mri directory > mri = ft_read_mri('filled.mgz'); > cfg = []; > cfg.interactive = 'yes'; > figure;ft_sourceplot(cfg, mri); > > %%% back in Terminal: > cd $SUBJECTS_DIR/Subject01/mri/ > recon-all -tessellate -subjid Subject01 > recon-all -smooth1 -subjid Subject01 > recon-all -inflate1 -subjid Subject01 > recon-all -qsphere -subjid Subject01 > recon-all -fix -subjid Subject01 > cp brain.mgz brain.finalsurfs.mgz > recon-all -finalsurfs -subjid Subject01 > recon-all -smooth2 -subjid Subject01 > recon-all -inflate2 -subjid Subject01 > recon-all -sphere -subjid Subject01 > recon-all -surfreg -subjid Subject01 > > %%% MNE download and installation %%%%%%%%%%%%%% > setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 > setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app > source $MNE_ROOT/bin/mne_setup > > % http://martinos.org/mne/stable/manual/list.html > cd $MNE_ROOT/bin > ./mne_setup_sh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > > ./mne_setup_source_space --ico -6 --overwrite > > %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > figure;ft_plot_mesh(bnd); > > %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > %%% fiducials chosen, fiducials l,r,n > > mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > %%% Current Folder auf: /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.coordsys = 'spm'; > cfg.output = {'brain'}; > seg = ft_volumesegment(cfg, mri_nom); > seg = ft_convert_units(seg,'cm'); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg,seg); > vol.bnd = ft_transform_geometry(T, vol.bnd); > save vol vol; > > % load vol % volume conduction model > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > > > > %%% so far, so good. >>> then I create the elec file: > clear all; > mri2 = ft_read_mri('Subject01.mri'); > disp(mri2) > save mri2 mri2; > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri2 = ft_volumesegment(cfg, mri2); > save segmentedmri2 segmentedmri2 > disp(segmentedmri2) > > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd2=ft_prepare_mesh(cfg,segmentedmri2); > > save bnd2 bnd2 > > disp(bnd2(1)) > > cfg = []; > cfg.method ='dipoli'; > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > save vol2 vol2 > > disp(vol2) > > vol2 = ft_convert_units(vol2, 'cm'); > > > figure; > ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp > figure; > ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull > figure; > ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain > > ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > hold on; > ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); > hold on; > ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); > > elec2 = ft_read_sens('standard_1020.elc'); % may you need to define the path to the file > > disp(elec2) > > elec2 = ft_convert_units(elec2, 'cm'); > > % load volume conduction model > load vol2; > figure; > % head surface (scalp) > ft_plot_mesh(vol2.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % electrodes > ft_plot_sens(elec2,'style', 'sk'); > > > mri2 = ft_convert_units(mri2, 'cm'); > > nas=mri2.hdr.fiducial.mri.nas; > lpa=mri2.hdr.fiducial.mri.lpa; > rpa=mri2.hdr.fiducial.mri.rpa; > > transm=mri2.transform; > > nas=warp_apply(transm,nas, 'homogenous'); > lpa=warp_apply(transm,lpa, 'homogenous'); > rpa=warp_apply(transm,rpa, 'homogenous'); > > fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials > fid.label = {'Nz','LPA','RPA'}; % same labels as in elec > fid.unit = 'cm'; % same units as mri > > % alignment > cfg = []; > cfg.method = 'fiducial'; > cfg.template = fid; % see above > cfg.elec = elec2; > cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec > elec_aligned2 = ft_electroderealign(cfg); > > save elec_aligned2 elec_aligned2; > % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > figure; > ft_plot_sens(elec_aligned2,'style','sk'); > hold on; > ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', 'facecolor', [0.65 0.65 0.65]); %scalp > > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec_aligned2; > cfg.headshape = vol2.bnd(1); > elec_aligned2 = ft_electroderealign(cfg); > > > %%%%% and here I am struggling: I can not get any of the above files to > %%%%% work together: vol or vol2, elec_aligned2, sourcespace etc. > > vol = ft_convert_units(vol, 'cm'); > elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > cfg = []; > cfg.elec = elec_aligned2; % sensor positions > cfg.channel = 'all'; % the used channels > cfg.grid.pos = sourcespace.pnt; % source points > cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are inside of the brain > cfg.vol = vol; > cfg.normalize = 'yes';% volume conduction model > leadfield = ft_prepare_leadfield(cfg); > > save leadfield leadfield; > > clear all; > load('GA1.mat') > load('GA2.mat') > load leadfield; > load vol2; > load elec_aligned2; > > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned2; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > cfg.mne.normalize = 'yes'; > sourceCERT0 = ft_sourceanalysis(cfg, GA1); > sourceCERT3 = ft_sourceanalysis(cfg, GA2); > > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_Signatur.png Type: image/png Size: 3435 bytes Desc: not available URL: From tsauvigny at gmail.com Sun Feb 23 18:51:22 2014 From: tsauvigny at gmail.com (Thomas Sauvigny) Date: Sun, 23 Feb 2014 18:51:22 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> References: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> Message-ID: Awesome, Thank you Chaitanya and Leo! Am 23.02.2014 13:27 schrieb "Zizlsperger Leopold" : > Hello > in view of your code: first check if > elec2 = ft_read_sens('standard_1020.elc'); > corresponds to the channel structure of your functional data (averages). > Best to Hamburg > Leo > > -- > > > Dr. med. Leopold Zizlsperger > Klinik für Neurologie > Uniklinik RWTH Aachen > Pauwelsstrasse 30 > 52074 Aachen > Tel: +49 241 80 35465 > lzizlsperger at ukaachen.de > > > > > > Leopold Zizlsperger, MD > Department of Neurology > RWTH Aachen University > Pauwelsstrasse 30 > 52074 Aachen, Germany > Tel: +49 241 80 35465 > lzizlsperger at ukaachen.de > > > On 22 Feb 2014, at 15:38, Chaitanya Srinivas > wrote: > > Hi Thomas, > > When I was working with actual data, once I got this error. At that time, > it was the problem of having different number of electrodes for the forward > solution (lead-field) i have created and for each subject recording > electrodes. Each subject has different set of recording electrodes which > gave this problem. I think we have to check the difference in electrodes or > number of sensors. > > > > *=============================================== * > > > ***Best Regards* > > > *Chaitanya Srinivas Lanka Wiss. Mitarbeiter > * > > *PhD Student Functional and Restorative Neurosurgery Neural Information > ProcessingNeurosurgical University Hospital* > > * Graduate Training Center for Neuroscience Eberhard Karls > University Eberhard Karls University **Otfried-Mueller-Str.45 > Österbergstr. 3* > * D-72076 Tuebingen **D-72074 > Tuebingen* > > *Mobile Phone Number : +49-176-79035731* > *===============================================* > > > On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > >> Dear fellow fiedtrippers, >> >> I would like to do a source reconstruction of EEG data using The FielTrip >> example MRI dataset via minimum-norm estimate. I stick close to the MNE >> tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) >> and use a few steps from the EEG headmodel tutorial as well ( >> http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I >> am struggling to combine the information from both tutorials in some >> crucial step prior to ft_sourceanalysis. >> My first approach has been to basically run through the MNE tutorial >> using the Fieltrip MRI dataset. As I could not save both the original >> anatomy and the masked anatomy in a freesurfer compatible format while >> using >> >> *cfg = [];* >> *cfg.output = {'brain','skull','scalp'};* >> *segmentedmri = ft_volumesegment(cfg, mri);* >> >> I instead proceeded as mentioned below and aligned the electrodes to the >> scalp in a second step (according to the headmodel tutorial). But when I >> want to combine the headmodel (vol) and the electrodes (elec_aligned2) into >> the leadfield, that does not work: >> >> *using headmodel specified in the configuration* >> *using electrodes specified in the configuration* >> *Error using ft_prepare_vol_sens (line 534)* >> *unsupported volume conductor model for EEG* >> >> *Error in prepare_headmodel (line 94)* >> *[vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, >> 'order',* >> *cfg.order);* >> >> *Error in ft_prepare_leadfield (line 124)* >> *[vol, sens, cfg] = prepare_headmodel(cfg, data);* >> >> >> When I instead use the volume conduction model built in the headmodel >> tutorial (vol2) and the sourcespace from the MNE tutorial I get: >> >> >> >> >> >> >> >> >> >> *Error using * Inner matrix dimensions must agree.Error in >> minimumnormestimate (line 179) A = P*A; % prewhitened >> leadfieldsError in ft_sourceanalysis (line 869) dip(i) = >> minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, >> 'noisecov', squeeze(Cy(i,:,:)));* >> >> In older posts in the mailing list there appeared to be problems with the >> scaling of the different components and I adapted the units, but that did >> not solve the problems. >> I would be very thankful for any help. >> >> >> >> cheers >> Thomas >> >> >> >> >> >> >> >> >> My script: >> >> clear all; >> mri = ft_read_mri('Subject01.mri'); >> save mri mri; >> disp(mri) >> >> cfg = []; >> cfg.resolution = 1; >> cfg.dim = [256 256 256]; >> mrirs = ft_volumereslice(cfg, mri); >> save mrirs mrirs; >> >> % segmentation of the mri >> % load mrirs; >> cfg = []; >> cfg.coordsys = 'ctf'; >> cfg.output = {'skullstrip' 'brain'}; >> seg = ft_volumesegment(cfg, mrirs); >> save seg seg; >> >> disp(seg(1)) >> >> %%% Thus, you need to identify the anterior commissure, the posterior >> commissure, and an interhemispheric point (which defines the XZ-plane). You >> can navigate across the slices with the arrows. >> %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel >> %%% coordinates of these landmarks are stored: >> % load mrirs; >> cfg = []; >> cfg.method = 'interactive'; >> mri_tal = ft_volumerealign(cfg, mrirs); >> save mri_tal mri_tal >> >> clear all; >> load mri_tal; >> load seg; >> % ensure that the skull-stripped anatomy is expressed in the same >> coordinate system as the anatomy >> seg.transform = mri_tal.transform; >> % save both the original anatomy, and the masked anatomy in a freesurfer >> compatible format >> cfg = []; >> cfg.filename = 'Subject01'; >> cfg.filetype = 'mgz'; >> cfg.parameter = 'anatomy'; >> ft_volumewrite(cfg, mri_tal); >> cfg.filename = 'Subject01masked'; >> ft_volumewrite(cfg, seg); >> >> %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% >> tcsh >> chsh -s /bin/tcsh >> setenv FREESURFER_HOME /Applications/freesurfer >> source $FREESURFER_HOME/SetUpFreeSurfer.csh >> >> setenv SUBJECTS_DIR /Applications/freesurfer/subjects >> setenv SUBJECT /Subject01 >> %%% .mgz files to mri folder >> cd $SUBJECTS_DIR/Subject01/mri/ >> mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz >> mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz >> >> recon-all -talairach -subjid Subject01 >> recon-all -nuintensitycor -subjid Subject01 >> recon-all -normalization -subjid Subject01 >> cp T1.mgz brainmask.mgz >> recon-all -gcareg -subjid Subject01 >> recon-all -canorm -subjid Subject01 >> recon-all -careg -subjid Subject01 >> recon-all -calabel -subjid Subject01 >> recon-all -normalization2 -subjid Subject01 >> recon-all -segmentation -subjid Subject01 >> recon-all -fill -subjid Subject01 >> >> >> %%% This ends the part of the Freesurfer pipeline concerned with >> volumetric processing. At this stage you should have a file filled.mgz >> containing the segmentation of the cortical white matter (cerebellum is not >> included!). >> %%% You can check how this looks using FieldTrip, by doing the following: >> % % go to the Subject01/mri directory >> mri = ft_read_mri('filled.mgz'); >> cfg = []; >> cfg.interactive = 'yes'; >> figure;ft_sourceplot(cfg, mri); >> >> %%% back in Terminal: >> cd $SUBJECTS_DIR/Subject01/mri/ >> recon-all -tessellate -subjid Subject01 >> recon-all -smooth1 -subjid Subject01 >> recon-all -inflate1 -subjid Subject01 >> recon-all -qsphere -subjid Subject01 >> recon-all -fix -subjid Subject01 >> cp brain.mgz brain.finalsurfs.mgz >> recon-all -finalsurfs -subjid Subject01 >> recon-all -smooth2 -subjid Subject01 >> recon-all -inflate2 -subjid Subject01 >> recon-all -sphere -subjid Subject01 >> recon-all -surfreg -subjid Subject01 >> >> %%% MNE download and installation %%%%%%%%%%%%%% >> setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 >> setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app >> source $MNE_ROOT/bin/mne_setup >> >> % http://martinos.org/mne/stable/manual/list.html >> cd $MNE_ROOT/bin >> ./mne_setup_sh >> >> setenv SUBJECTS_DIR /Applications/freesurfer/subjects >> setenv SUBJECT /Subject01 >> >> ./mne_setup_source_space --ico -6 --overwrite >> >> %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem >> bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', >> 'mne_source'); >> figure;ft_plot_mesh(bnd); >> >> %%% Current Folder : >> /Applications/freesurfer/subjects/Subject01/Subject01/mri >> mri_nom = ft_read_mri('orig-nomask.mgz'); >> >> cfg = []; >> cfg.method = 'interactive'; >> mri_nom_ctf = ft_volumerealign(cfg, mri_nom); >> >> %%% fiducials chosen, fiducials l,r,n >> >> mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); >> T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); >> %%% Current Folder : >> /Applications/freesurfer/subjects/Subject01/Subject01/bem >> bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', >> 'mne_source'); >> sourcespace = ft_convert_units(bnd, 'cm'); >> sourcespace = ft_transform_geometry(T, sourcespace); >> save sourcespace sourcespace; >> save T T; %we will need the transformation matrix in the next step >> >> %%% Current Folder auf: >> /Applications/freesurfer/subjects/Subject01/Subject01/mri >> mri_nom = ft_read_mri('orig-nomask.mgz'); >> >> cfg = []; >> cfg.coordsys = 'spm'; >> cfg.output = {'brain'}; >> seg = ft_volumesegment(cfg, mri_nom); >> seg = ft_convert_units(seg,'cm'); >> >> cfg = []; >> cfg.method = 'singleshell'; >> vol = ft_prepare_headmodel(cfg,seg); >> vol.bnd = ft_transform_geometry(T, vol.bnd); >> save vol vol; >> >> % load vol % volume conduction model >> figure;hold on; >> ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; >> ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight >> >> >> >> %%% so far, so good. >>> then I create the elec file: >> clear all; >> mri2 = ft_read_mri('Subject01.mri'); >> disp(mri2) >> save mri2 mri2; >> >> cfg = []; >> cfg.output = {'brain','skull','scalp'}; >> segmentedmri2 = ft_volumesegment(cfg, mri2); >> save segmentedmri2 segmentedmri2 >> disp(segmentedmri2) >> >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.numvertices = [3000 2000 1000]; >> bnd2=ft_prepare_mesh(cfg,segmentedmri2); >> >> save bnd2 bnd2 >> >> disp(bnd2(1)) >> >> cfg = []; >> cfg.method ='dipoli'; >> vol2 = ft_prepare_headmodel(cfg, segmentedmri2); >> >> save vol2 vol2 >> >> disp(vol2) >> >> vol2 = ft_convert_units(vol2, 'cm'); >> >> >> figure; >> ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp >> figure; >> ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull >> figure; >> ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain >> >> ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, >> 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> hold on; >> ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); >> hold on; >> ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); >> >> elec2 = ft_read_sens('standard_1020.elc'); % may you need to >> define the path to the file >> >> disp(elec2) >> >> elec2 = ft_convert_units(elec2, 'cm'); >> >> % load volume conduction model >> load vol2; >> figure; >> % head surface (scalp) >> ft_plot_mesh(vol2.bnd(1), >> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); >> hold on; >> % electrodes >> ft_plot_sens(elec2,'style', 'sk'); >> >> >> mri2 = ft_convert_units(mri2, 'cm'); >> >> nas=mri2.hdr.fiducial.mri.nas; >> lpa=mri2.hdr.fiducial.mri.lpa; >> rpa=mri2.hdr.fiducial.mri.rpa; >> >> transm=mri2.transform; >> >> nas=warp_apply(transm,nas, 'homogenous'); >> lpa=warp_apply(transm,lpa, 'homogenous'); >> rpa=warp_apply(transm,rpa, 'homogenous'); >> >> fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials >> fid.label = {'Nz','LPA','RPA'}; % same labels as in elec >> fid.unit = 'cm'; % same units as mri >> >> % alignment >> cfg = []; >> cfg.method = 'fiducial'; >> cfg.template = fid; % see above >> cfg.elec = elec2; >> cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid >> and in elec >> elec_aligned2 = ft_electroderealign(cfg); >> >> save elec_aligned2 elec_aligned2; >> % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); >> figure; >> ft_plot_sens(elec_aligned2,'style','sk'); >> hold on; >> ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', >> 'facecolor', [0.65 0.65 0.65]); %scalp >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec_aligned2; >> cfg.headshape = vol2.bnd(1); >> elec_aligned2 = ft_electroderealign(cfg); >> >> >> *%%%%% and here I am struggling: I can not get any of the above files to* >> *%%%%% work together: vol or vol2, elec_aligned2, sourcespace etc.* >> >> vol = ft_convert_units(vol, 'cm'); >> elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); >> cfg = []; >> cfg.elec = elec_aligned2; % sensor positions >> cfg.channel = 'all'; % the used channels >> cfg.grid.pos = sourcespace.pnt; % source points >> cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are >> inside of the brain >> cfg.vol = vol; >> cfg.normalize = 'yes';% volume conduction model >> leadfield = ft_prepare_leadfield(cfg); >> >> save leadfield leadfield; >> >> clear all; >> load('GA1.mat') >> load('GA2.mat') >> load leadfield; >> load vol2; >> load elec_aligned2; >> >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned2; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> cfg.mne.normalize = 'yes'; >> sourceCERT0 = ft_sourceanalysis(cfg, GA1); >> sourceCERT3 = ft_sourceanalysis(cfg, GA2); >> >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_Signatur.png Type: image/png Size: 3435 bytes Desc: not available URL: From pgoodin at swin.edu.au Mon Feb 24 10:46:52 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 24 Feb 2014 09:46:52 +0000 Subject: [FieldTrip] Plotting group SD / CI over multiplottER data? Message-ID: Hi Fieldtrippers, As the subject says, is it possible to plot standard deviations / confidence intervals for group timelock data using multiplotter? After grandaveraging the data the var variable is removed, so is there a work around to either getting the timelockgrandaverage function to include a measure of group variance or adding one in? Thanks for any advice / assistance, Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Feb 24 23:01:26 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 24 Feb 2014 17:01:26 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: <8C6ABCDE-8D0A-4769-94A8-87BC7071251F@gmail.com> Hi Arjen, Alik Thanks for stimulating this discussion about second level statistics. I tried as suggested, but it would be great if one of you can detail the steps involved so I can make sure what am doing is indeed correct. It would be great if some more detail is provided on the field trip web page about this. Thanks, Raghavan What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Feb 25 10:32:39 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 25 Feb 2014 10:32:39 +0100 Subject: [FieldTrip] Referencing Message-ID: Dear all, I have 4 electrodes, and I would like to reference my data by subtracting from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. I was wondering if there is an easier way in fieldtrip to perform this calculation, and then to change the data structure with these new channel labels. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.andolina at ucl.ac.uk Tue Feb 25 11:25:02 2014 From: i.andolina at ucl.ac.uk (Ian M. Andolina) Date: Tue, 25 Feb 2014 10:25:02 +0000 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? Message-ID: <530C6F7E.2000702@ucl.ac.uk> Hi, I wanted to use Fieldtrip to recreate the methodology used in a paper by Leopold et al., 2003 — the relevant methods section is the following: /“The LFP signals were resampled to 1 kHz, and then band-pass filtered into seven frequency ranges using a second order, bi-directional, zero-phase Chebyshev type-1 filter. The frequency ranges, as well as their rough mapping onto classically defined electroencephalographic conventions, were the following: δ (1–4 Hz), θ (5–8 Hz), α (9–14 Hz), β (15–30 Hz), γL (30–50 Hz), γH (50–100 Hz), and γVH (100–150 Hz). The resulting band-limited signals were full-wave rectified by taking their absolute value. They were then resampled to 20 Hz after low-pass filtering with an eighth order Chebyshev type-1 filter (cutoff = 8 Hz).”/ My LFP data is sampled at 1kHz, and I manually pad with data either side of the event triggered region of interest. Fieldtrip doesn’t have a |chebyshev type-1| filter, but would a second order two-pass (aka zero phase?) butterworth be good enough considering the frequency bands used? I’m using the following cfg passed to |ft_preprocessing| for the initial bandpass filtering and rectification: |freq ={[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 150]}; for j =1:length(freq) cfg =[]; cfg.padding =0; cfg.bpfilter ='yes'; cfg.bpfilttype ='but'; cfg.bpfreq = freq{j}; cfg.bpfiltdir ='twopass'; cfg.bpfiltord =2; cfg.bpinstabilityfix ='reduce'; cfg.rectify ='yes'; bp{j} = ft_preprocessing(cfg,ft); end | As far as I can see in |ft_preprocessing| rectification occurs after filtering, so this is as specified by Leopold /et al.,/ Then for downsampling/resampling: |cfg =[]; cfg.padding =0; cfg.lpfilter ='yes'; cfg.lpfreq =8; cfg.lpfilttype ='but'; cfg.lpfiltdir ='twopass'; cfg.lpfiltord =8; cfg.lpinstabilityfix ='reduce'; bp{j} = ft_preprocessing(cfg,bp{j}); cfg =[]; cfg.resample ='yes'; cfg.resamplefs =20; cfg.detrend ='no'; bp{j} = ft_resampledata(cfg,bp{j}); | Does this seem a correct translation of this method in Fieldtrip? Are there any caveats other than the filter differences? Thanks, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Tue Feb 25 12:50:57 2014 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Tue, 25 Feb 2014 12:50:57 +0100 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: <530C6F7E.2000702@ucl.ac.uk> References: <530C6F7E.2000702@ucl.ac.uk> Message-ID: Hi Ian, If you want to approximate a chebyshev filter with butterworth, you obviously need a higher order than the actual chebyshev uses. Some simple calculations are involved on your data which basically suggests even to get a 3dB of stopband attenuation for the delta range, you would be needing an order of 3 for a chebyshev-1 type filter. Similarly you will be needing a 4th order butterworth filter. By default, even the filedtrip uses 4th order for butterworth filter. So I would suggest you to use a 4th order butterworth filter to approximate the chebyshev filter you mentioned here. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Tue, Feb 25, 2014 at 11:25 AM, Ian M. Andolina wrote: > Hi, I wanted to use Fieldtrip to recreate the methodology used in a > paper by Leopold et al., 2003 — the relevant methods section is the following: > > *“The LFP signals were resampled to 1 kHz, and then band-pass filtered > into seven frequency ranges using a second order, bi-directional, > zero-phase Chebyshev type-1 filter. The frequency ranges, as well as their > rough mapping onto classically defined electroencephalographic conventions, > were the following: δ (1–4 Hz), θ (5–8 Hz), α (9–14 Hz), β (15–30 Hz), γL > (30–50 Hz), γH (50–100 Hz), and γVH (100–150 Hz). The resulting > band-limited signals were full-wave rectified by taking their absolute > value. They were then resampled to 20 Hz after low-pass filtering with an > eighth order Chebyshev type-1 filter (cutoff = 8 Hz).”* > > My LFP data is sampled at 1kHz, and I manually pad with data either side > of the event triggered region of interest. Fieldtrip doesn’t have a chebyshev > type-1 filter, but would a second order two-pass (aka zero phase?) > butterworth be good enough considering the frequency bands used? I’m using > the following cfg passed to ft_preprocessing for the initial bandpass > filtering and rectification: > > freq = {[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 150]};for j = 1:length(freq) > cfg = []; > cfg.padding = 0; > cfg.bpfilter = 'yes'; > cfg.bpfilttype = 'but'; > cfg.bpfreq = freq{j}; > cfg.bpfiltdir = 'twopass'; > cfg.bpfiltord = 2; > cfg.bpinstabilityfix = 'reduce'; > cfg.rectify = 'yes'; > bp{j} = ft_preprocessing(cfg,ft);end > > As far as I can see in ft_preprocessing rectification occurs after > filtering, so this is as specified by Leopold *et al.,* > > Then for downsampling/resampling: > > cfg = [];cfg.padding = 0;cfg.lpfilter = 'yes';cfg.lpfreq = 8;cfg.lpfilttype = 'but';cfg.lpfiltdir = 'twopass';cfg.lpfiltord = 8;cfg.lpinstabilityfix = 'reduce'; > bp{j} = ft_preprocessing(cfg,bp{j}); > cfg = [];cfg.resample = 'yes';cfg.resamplefs = 20;cfg.detrend = 'no'; > bp{j} = ft_resampledata(cfg,bp{j}); > > Does this seem a correct translation of this method in Fieldtrip? Are > there any caveats other than the filter differences? > > Thanks, Ian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From conrado.bosman at gmail.com Tue Feb 25 13:47:24 2014 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Tue, 25 Feb 2014 13:47:24 +0100 Subject: [FieldTrip] Referencing In-Reply-To: References: Message-ID: <4B4052A2-BD50-4CE6-BBB5-D2846C86BD77@gmail.com> Dear Hweeling, There is indeed an easy way to re-referencing electrodes using local derivation in Fieldtrip. You need to create an structure call montage, that in your case should be: montage = [] montage.labelorg = {'E1' 'E2' 'E3' 'E4'} montage.labelnew = {'E2-E1' E3-E2' 'E4-E3'} montage.tra = [1 -1 0 0;0 -1 1 0;0 0 -1 1]; then... cfg = []; cfg.reref = 'yes' cfg.montage = montage; dat = ft_preprocessing(cfg,dat) % dat is your original data structure containing your original channels Hope it works! Best, Conrado On 25 Feb 2014, at 10:32, Hwee Ling Lee wrote: > Dear all, > > I have 4 electrodes, and I would like to reference my data by subtracting from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. > > I was wondering if there is an easier way in fieldtrip to perform this calculation, and then to change the data structure with these new channel labels. > > Thanks. > > Cheers, > Hweeling > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From pierre.megevand at gmail.com Tue Feb 25 17:14:42 2014 From: pierre.megevand at gmail.com (=?ISO-8859-1?Q?Pierre_M=E9gevand?=) Date: Tue, 25 Feb 2014 11:14:42 -0500 Subject: [FieldTrip] Referencing (Hwee Ling Lee) Message-ID: Dear Hweeling, ft_apply_montage is the function that you are looking for. http://fieldtrip.fcdonders.nl/reference/ft_apply_montage The documentation for that function shows exactly what you want to do. Pierre -- Pierre Mégevand, MD, PhD Post-doctoral research fellow Laboratory for Multimodal Human Brain Mapping Feinstein Institute for Medical Research Manhasset, NY, USA On Tue, Feb 25, 2014 at 6:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Referencing (Hwee Ling Lee) > 2. Band Limited Power Analysis in Fieldtrip? (Ian M. Andolina) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 25 Feb 2014 10:32:39 +0100 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Referencing > Message-ID: > BkryfFvXKuLR2SNpdTxsjWN_rQcAKEA at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I have 4 electrodes, and I would like to reference my data by subtracting > from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. > > I was wondering if there is an easier way in fieldtrip to perform this > calculation, and then to change the data structure with these new channel > labels. > > Thanks. > > Cheers, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140225/78be03db/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Tue, 25 Feb 2014 10:25:02 +0000 > From: "Ian M. Andolina" > To: > Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? > Message-ID: <530C6F7E.2000702 at ucl.ac.uk> > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi, I wanted to use Fieldtrip to recreate the methodology used in a > paper by Leopold et al., 2003 > ? the relevant methods > section is the following: > > /?The LFP signals were resampled to 1 kHz, and then band-pass filtered > into seven frequency ranges using a second order, bi-directional, > zero-phase Chebyshev type-1 filter. The frequency ranges, as well as > their rough mapping onto classically defined electroencephalographic > conventions, were the following: ? (1?4 Hz), ? (5?8 Hz), ? (9?14 Hz), ? > (15?30 Hz), ?L (30?50 Hz), ?H (50?100 Hz), and ?VH (100?150 Hz). The > resulting band-limited signals were full-wave rectified by taking their > absolute value. They were then resampled to 20 Hz after low-pass > filtering with an eighth order Chebyshev type-1 filter (cutoff = 8 Hz).?/ > > My LFP data is sampled at 1kHz, and I manually pad with data either side > of the event triggered region of interest. Fieldtrip doesn?t have a > |chebyshev type-1| filter, but would a second order two-pass (aka zero > phase?) butterworth be good enough considering the frequency bands used? > I?m using the following cfg passed to |ft_preprocessing| for the initial > bandpass filtering and rectification: > > |freq ={[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 > 150]}; > for j =1:length(freq) > cfg =[]; > cfg.padding =0; > cfg.bpfilter ='yes'; > cfg.bpfilttype ='but'; > cfg.bpfreq = freq{j}; > cfg.bpfiltdir ='twopass'; > cfg.bpfiltord =2; > cfg.bpinstabilityfix ='reduce'; > cfg.rectify ='yes'; > bp{j} = ft_preprocessing(cfg,ft); > end > | > > As far as I can see in |ft_preprocessing| rectification occurs after > filtering, so this is as specified by Leopold /et al.,/ > > Then for downsampling/resampling: > > |cfg =[]; > cfg.padding =0; > cfg.lpfilter ='yes'; > cfg.lpfreq =8; > cfg.lpfilttype ='but'; > cfg.lpfiltdir ='twopass'; > cfg.lpfiltord =8; > cfg.lpinstabilityfix ='reduce'; > bp{j} = ft_preprocessing(cfg,bp{j}); > cfg =[]; > cfg.resample ='yes'; > cfg.resamplefs =20; > cfg.detrend ='no'; > bp{j} = ft_resampledata(cfg,bp{j}); > | > > Does this seem a correct translation of this method in Fieldtrip? Are > there any caveats other than the filter differences? > > Thanks, Ian > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140225/a73da687/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 39, Issue 44 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Tue Feb 25 17:55:16 2014 From: michielb at tcd.ie (Bart Michiels) Date: Tue, 25 Feb 2014 16:55:16 +0000 Subject: [FieldTrip] non parametric statistics on connectivity data Message-ID: Hi all, I have two resting state coherence dataset (patient and control) both with the dimensions frequency x chan x chan and would like to do some non-parametric stats. Knowing that channel level analysis isn't the best idea to assess connectivity, which fieldtrip sub-function could I use to make some statistical inference about connectivity difference between patients and controls? I know that all statistical tools can be used for data dimensions: frequency x chan, but not the freq x chan x chan I was thinking of ft_statfun_indepsamplesZcoh but am not sure this is the right one. Thank you ! Best, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Feb 25 18:10:02 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 25 Feb 2014 18:10:02 +0100 Subject: [FieldTrip] non parametric statistics on connectivity data In-Reply-To: References: Message-ID: Dear Bart, one way to plug freq x chan x chan data into the statistics functions requiring freq x chan is to restructure your data to channel combinations, in a way that you end up with chan times chan elements in a freq x chan matrix. Of course you'll have to create new labels for your new channels. Hope this helps, if you need more specific advise, let me know. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 25.02.2014 um 17:55 schrieb Bart Michiels: > Hi all, > > I have two resting state coherence dataset (patient and control) both with the dimensions frequency x chan x chan and would like to do some non-parametric stats. > Knowing that channel level analysis isn't the best idea to assess connectivity, which fieldtrip sub-function could I use to make some statistical inference about connectivity difference between patients and controls? > > I know that all statistical tools can be used for data dimensions: frequency x chan, but not the freq x chan x chan > I was thinking of ft_statfun_indepsamplesZcoh but am not sure this is the right one. > > Thank you ! > Best, Bart > _______________________________________________ > 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 gopalar.ccf at gmail.com Tue Feb 25 23:01:17 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 25 Feb 2014 17:01:17 -0500 Subject: [FieldTrip] regressconfound and statistics Message-ID: <3F209DE8-FE47-49BE-9FA7-9AEE1477E37B@gmail.com> Arjen et al, I have the following output data from regressconfound pertaining to one block of data. hpicompfiltdata = avg: [306x1500 double] var: [306x1500 double] time: [1x1500 double] dof: [306x1500 double] label: {306x1 cell} trial: [59x306x1500 double] dimord: 'rpt_chan_time' trialinfo: [59x1 double] cfg: [1x1 struct] beta: [37x306x1500 double] Since I have 4 blocks for each subject, I appended them using ft_appenddata, and using ft_timelockanalysis (mentioning appropriate cfg.trial and cfg.keeptrials=‘yes’;) I split the data into 2 conditions timelock_cond1 (shown below) and timelock_cond2, retaining only 204 gradiometers ( i suppose I am not supposed to use ft_combineplanar at this level since it would distort the results). timelock_cond1 = avg: [204x1500 double] var: [204x1500 double] time: [1x1500 double] dof: [204x1500 double] label: {204x1 cell} trial: [143x204x1500 double] dimord: 'rpt_chan_time' trialinfo: [143x1 double] cfg: [1x1 struct] Then these are the steps I did, per your suggestion. 1. I gathered all the time lock (from above step) for all subjects in a cell matrix, timelock_cond1{:} and timelock_cond2{:} 3. Then I ran first level stats for each subject, with cfg.statistic= indepsamplesT and cfg.method=‘analytic’; cfg.design as you suggested, and rest of cfg. for sj = 1: size(subj,2) stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); end 4. Then, I did timelockgrandaverage cfg.keepindividual = 'yes'; cfg.parameter = 'stat'; stat2=ft_timelockgrandaverage(cfg,stat1{:}); 5. Created a dummy variable just like stat2 in the above step and replaced the field ‘individual’ with zeros dummy2=stat2; dummy2.individual=zeros(size(stat2.individual)); 6. Finally, ran the second level stats, with cfg. statistic = ‘depsamplesT’; cfg.method=‘montecarlo’; and rest of cfg. stat = ft_timelockstatistics(cfg, stat2, dummy2); However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn’t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong. Thanks, Raghavan What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Feb 26 09:20:05 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 26 Feb 2014 09:20:05 +0100 (CET) Subject: [FieldTrip] regressconfound and statistics In-Reply-To: <3F209DE8-FE47-49BE-9FA7-9AEE1477E37B@gmail.com> Message-ID: <1312202281.5535647.1393402805973.JavaMail.root@sculptor.zimbra.ru.nl> Hi Raghavan, Could you provide some more details on what statistical comparisons you are trying to make? It seems you have 4 blocks of recordings, each encompassing 2 task conditions, which you want to compare in terms of evoked/induced activity. If this is correct, you could 1) append data of the 4 blocks (subject-level) 2) regress out contributions from head movement using ft_regressconfound (subject-level) 3) split the trials into the 2 task conditions (subject-level) 4) compute t-scores using an independent samples t-test (subject-level) 5) non-parametric testing of effects using a dummy variable with zeros (group-level) From your descriptions, I got the impression you might have reversed the order of step 1 and 2. "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn’t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong." It's hard to tell from this information what might have caused this difference. For instance, the incorrect order of the steps above, or differences in neural processes you may be capturing through using a mean vs. a t-score, or maybe even head positions that are positively correlated with your effects, possibly because they're driving them (e.g. differential distances to the MEG sensors between the task conditions may cause the amplitude of the same ERP be more pronounced in one condition than another). I'd recommend looking into the (average) head positions of the different blocks/conditions, and see what is going on there (e.g. http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis? ). Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Dinsdag 25 februari 2014 23:01:17 > Onderwerp: Re: [FieldTrip] regressconfound and statistics > Arjen et al, > I have the following output data from regressconfound pertaining to > one block of data. > hpicompfiltdata = > avg: [306x1500 double] > var: [306x1500 double] > time: [1x1500 double] > dof: [306x1500 double] > label: {306x1 cell} > trial: [59x306x1500 double] > dimord: 'rpt_chan_time' > trialinfo: [59x1 double] > cfg: [1x1 struct] > beta: [37x306x1500 double] > Since I have 4 blocks for each subject, I appended them using > ft_appenddata, and using ft_timelockanalysis (mentioning appropriate > cfg.trial and cfg.keeptrials=‘yes’; ) I split the data into 2 > conditions timelock_cond1 (shown below) and timelock_cond2, retaining > only 204 gradiometers ( i suppose I am not supposed to use > ft_combineplanar at this level since it would distort the results). > timelock_cond1 = > avg: [204x1500 double] > var: [204x1500 double] > time: [1x1500 double] > dof: [204x1500 double] > label: {204x1 cell} > trial: [143x204x1500 double] > dimord: 'rpt_chan_time' > trialinfo: [143x1 double] > cfg: [1x1 struct] > Then these are the steps I did, per your suggestion. > 1. I gathered all the time lock (from above step) for all subjects in > a cell matrix, timelock_cond1{:} and timelock_cond2{:} > 3. Then I ran first level stats for each subject, with cfg.statistic= > indepsamplesT and cfg.method=‘analytic’; cfg.design as you suggested, > and rest of cfg. > for sj = 1: size(subj,2) > stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); > end > 4. Then, I did timelockgrandaverage > cfg.keepindividual = 'yes'; > cfg.parameter = 'stat'; > stat2=ft_timelockgrandaverage(cfg,stat1{:}); > 5. Created a dummy variable just like stat2 in the above step and > replaced the field ‘individual’ with zeros > dummy2=stat2; > dummy2.individual=zeros(size(stat2.individual)); > 6. Finally, ran the second level stats, with cfg. statistic = > ‘depsamplesT’; cfg.method=‘montecarlo’; and rest of cfg. > stat = ft_timelockstatistics(cfg, stat2, dummy2); > However, the problem is, whatever significance I found earlier (i.e. > by comparing means rather than t-statistic) doesn’t test significant > now. I thought it might get better by doing this, but seems to get > worse. Please correct me if I am doing anything wrong. > Thanks, > Raghavan > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, > still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of > that > within-subjects descriptive/difference. > >> Ok. That's indeed the procedure I tried to outline. In your earlier > >> reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance > having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I > misunderstood > your suggestion? > >> I might have not been clear there then. I was meant to say that one > >> could use ft_regressconfound on trials of two (or more) conditions > >> combined > of a single subject, prior to calculating the single subject > t-descriptive > (using ft_xxxstatistics). This allows one to compute a 'cleaner' > t-score, > or at least provide a good case that head movement did not > differentially > influence activity levels in the separate conditions. It was not > related to > pooling trials between subjects. > 2014-02-21 16:14 GMT+01:00 Alik Widge < alik.widge at gmail.com >: > > I don't *think* I'm asking about how to do second-order analysis, > > unless I > have missed something important. I did read the link/FAQ > > when I was working > on this last week, and that seems different > > than the question I am asking. > > What you described in your reply > > to me just now, calling > ft_timelockstatistics at the subject level > > to calculate descriptives, still > effectively reduces each subject > > to one "datapoint" -- the difference > between conditions of the > > selected t-descriptive for that subject. I > believe I understand > > how to do that, and how to then do nonparametric > shuffle testing > > at the between-subjects level for the signfiicance of that > > > within-subjects descriptive/difference. > > In your earlier reply to > > Raghavan, it sounded like you were suggesting > pooling the trials > > themselves between subjects (that is, all subjects' > trials go into > > one big "bucket"), with the trial-to-trial variance having > been > > removed via ft_regressconfound, *then* calling the ft_statistics > > > functions on this single large "bucket" of trials. Have I > > misunderstood > your suggestion? > > Alik > > Alik Widge > > > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, > > 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > > > wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to > > create subject-level >> t-descriptives, mentioned in the previous > > post? A quick answer would be to >> perform an indepedent t-test ( > > cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics > > (although you're not really 'testing' here, but only >> interested > > in that t-descriptive), in which trials are the unit of >> > > observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> > > ntrls_conditionB)]; ). Note that since an indepedent t-test tests > > for >> differences of the means of two conditions, it won't fail on > > unequal number >> of observations across the conditions (unlike a > > dependent/paired t-test). >> >> Hope this gets you kickstarted for > > the moment. I found a previous >> mail-conversation that goes more > > into detail, providing more overview of >> the steps involved: >> > > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html > > >> More useful documentation: >> >> > > http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level > > >> >> Yours, >> Arjen >> >> ------------------------------ >> >> > > *Van: *"Alik Widge" < alik.widge at gmail.com > >> *Aan: *"FieldTrip > > discussion list" < fieldtrip at science.ru.nl > >> *Verzonden: > > *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: > > [FieldTrip] regressconfound and frequency domain >> >> Arjen, what > > you just described is more or less what I struggled to do >> last > > week and ultimately gave up as I was unable to figure out how to get > > >> FT to do it despite much meditation over tutorials and source > > files. Can >> you elaborate a bit more on what you are saying below > > -- not the >> ft_regressconfound bit, but the bit about how to get > > >> ft_statistics_montecarlo and its wrappers to do a trials-level > > analysis and >> permutation at the whole-group level? Especially, > > what does one put in >> cfg.design and how does one call the > > function? Everything I could find in >> the tutorials described the > > case of doing means at the subject level and >> then permutation of > > means at the group level, which as you point out is >> underpowered > > for subtle effects. >> >> My particular situation was > > timelock-analyzed trials (with >> keeptrials='yes'), but I could not > > find a way to set up cfg.design that >> did not throw error > > messages. The thing that really seemed to bother it was >> that > > there were different numbers of trials in the 2-3 conditions of >> > > interest, since some had to be removed for excessive artifact. >> >> > > Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at > > gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 > > AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl > wrote: >> > > >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject > > level freq data, you'll need to >>> use ft_freqstatistics. Have a > > look here for instance: >>> > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> > > >>> At the subject level, you do not need (non-parametric) cluster > > >>> permutation testing (Maris & Oostenveld), as you're taking each > > subject's >>> t-descriptives to the group level. At the group level, > > you can then test >>> the hypothesis that there's a difference > > between tasks/conditions (H1) vs. >>> no difference (H0). In order > > to do so, you'll need to create a dummy >>> variable at the group > > level, that has the same number of 'subjects', but >>> with zeros in > > all fields (in your case this will be a .stat field). At the >>> > > group level, you thus call ft_freqstatistics again. This approach > > has the >>> advantage that you're more sensitive (as compared to > > taking each subject's >>> mean to the group level) to effects that > > are small but consistent over >>> trials in each subject. >>> >>> > > Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: > > *"Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *Aan: * > > fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari > > 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound > > and frequency domain >>> >>> Thanks Arjen, >>> Should I use > > ft_freqdescriptives to compute t descriptives for >>> individual > > subjects, and then take that to group level instead of mean? If >>> > > not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> > > >>> Hi Raghavan, ft_regressconfound run on timelock data seems to > > return output with avg field. However, ft_regressconfound run on > > frequency data, does not return average. I see the avg field being > > removed. Is there a reason? >> Not intentionally, but not an issue > > either. You could still use ft_freqdescriptives to compute the > > average for you, but see my comment below. Question - Since > > ft_regressconfound outputs power spectrum of individual trials - 4D > > matrix (instead of average), can I simply re-average the power > > spectrum over trials to see the average power for that subject. > > Also, I need to run grand average (over subjects) before running > > statistics. I hope these steps does not distort the data. Please > > advise. >> Remember that the mean over trials is not affected by > > your clean-up of trial-by-trial variance due to head movement. > > Taking each subject's mean (unaffected) to the group level is an > > approach that will not benefit from your clean-up. In order to > > benefit from reduced trial-by-trial variance, you'll need a measure > > that depends on it, e.g. t-descriptive, neural activity-behavior > > correlation (for taking to the group level). Hope this helps, Arjen > > ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan > > Gopalakrishnan" > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> *>* > > Aan: fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: > > Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, > > >>> *>* Thanks, I reduced down the time resolution so computation > > can go >>> *>* faster. Now, m y matrix looks like this >>> *>* > > hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: > > 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: > > [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: > > [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 > > double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on > > timelock data seems to return output with >>> *>* avg field. > > However, ft_regressconfound run on frequency data, does not >>> *>* > > return average. I see the avg field being removed. Is there a > > reason? >>> *>* Question - Since ft_regressconfound outputs power > > spectrum of >>> *>* individual trials - 4D matrix (instead of > > average), can I simply >>> *>* re-average the power spectrum over > > trials to see the average power for >>> *>* that subject. Also, I > > need to run grand average (over subjects) before >>> *>* running > > statistics. I hope these steps does not distort the data. >>> *>* > > Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, > > 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < > > a.stolk at fcdonders.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > To: FieldTrip discussion list < fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > Subject: Re: [FieldTrip] regressconfound and frequency domain >>> > > *>* Message-ID: >>> *>* < > > 2108167665.5423215.1392847118322.JavaMail.root at > > sculptor.zimbra.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear > > Raghavan, Good to hear it's working out for you. A short answer >>> > > *>* would be 'no'. Reducing the size of your data matrix is likely > > going >>> *>* to speed up computations. Your time resolution seems > > pretty high (1500 >>> *>* frequency estimations per single trial); > > do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk > > bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf > > at gmail.com < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > > Aan: fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: > > [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, > > >>> *>* > Thanks for answering all my previous questions. I was > > successfully >>> *>* > able to incorporate head movements to my erf > > data. As I understand I >>> *>* > have to do this separately for the > > time frequency data after keeping >>> *>* > individual trials. I am > > interested in both beta and gamma bands >>> *>* > [15:1:70]. my time > > frequency looks like this using wavelets, >>> *>* > timefreq = >>> > > *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> > > *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > > > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > > > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: > > [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After > > regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 > > cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 > > double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D > > double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 > > struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D > > double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since > > its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks > > of data for 20 subjects. It >>> *>* > will take an enoumous amount > > of time to process the data through >>> *>* > regressconfound. Is > > there a workaround to make the processing faster >>> *>* > or am I > > missing something. Any help would be of great help. >>> *>* > > > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> > > _______________________________________________ >>> fieldtrip > > mailing list >>> fieldtrip at donders.ru.nl >>> > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> > > >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour > > >>> Centre for Cognitive Neuroimaging >>> Radboud University > > Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: > > +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> > > _______________________________________________ >>> 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 >> >> >> >> > > >> -- >> Donders Institute for Brain, Cognition and Behaviour >> > > Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> > > >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: > > www.arjenstolk.nl >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.andolina at ucl.ac.uk Wed Feb 26 14:43:15 2014 From: i.andolina at ucl.ac.uk (Ian M. Andolina) Date: Wed, 26 Feb 2014 13:43:15 +0000 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: References: Message-ID: <530DEF73.3030605@ucl.ac.uk> On 25/02/2014 11:51, fieldtrip-request at science.ru.nl wrote: > Re: [FieldTrip] Band Limited Power Analysis in Fieldtrip? Thanks Chaitanya, I get instability for the 1-4Hz band using a 4th order butterworth, but it seems to work for the higher bands (using cfg.bpinstabilityfix = 'reduce' to fix it only for the bands that need it). Does anyone know if integrating a chebyshev type-1 filter into fieldtrip preprocessing has been attempted, it is present in the signal processing toolbox and I could do this manually but I'd rather use existing code if possible... Thanks again, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Wed Feb 26 17:38:23 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 26 Feb 2014 11:38:23 -0500 Subject: [FieldTrip] regressconfound and statistics In-Reply-To: References: Message-ID: Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.” I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Another question, is it ok to apply combineplanar to regressconfounded data? Thanks for your support. Raghavan > > > Date: Wed, 26 Feb 2014 09:20:05 +0100 (CET) > From: "Stolk, A. (Arjen)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] regressconfound and statistics > Message-ID: > <1312202281.5535647.1393402805973.JavaMail.root at sculptor.zimbra.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Raghavan, Could you provide some more details on what statistical comparisons you are trying to make? It seems you have 4 blocks of recordings, each encompassing 2 task conditions, which you want to compare in terms of evoked/induced activity. If this is correct, you could 1) append data of the 4 blocks (subject-level) 2) regress out contributions from head movement using ft_regressconfound (subject-level) 3) split the trials into the 2 task conditions (subject-level) 4) compute t-scores using an independent samples t-test (subject-level) 5) non-parametric testing of effects using a dummy variable with zeros (group-level) From your descriptions, I got the impression you might have reversed the order of step 1 and 2. "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong." It's hard to tell from this information what might have caused this difference. For instance, the incorrect order of the steps above, or differences in neural processes you may be capturing through using a mean vs. a t-score, or maybe even head positions that are positively correlated with your effects, possibly because they're driving them (e.g. differential distances to the MEG sensors between the task conditions may cause the amplitude of the same ERP be more pronounced in one condition than another). I'd recommend looking into the (average) head positions of the different blocks/conditions, and see what is going on there (e.g. http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis? ). Arjen ----- Oorspronkelijk bericht ----- >> Van: "Raghavan Gopalakrishnan" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Dinsdag 25 februari 2014 23:01:17 >> Onderwerp: Re: [FieldTrip] regressconfound and statistics >> Arjen et al, >> I have the following output data from regressconfound pertaining to >> one block of data. >> hpicompfiltdata = >> avg: [306x1500 double] >> var: [306x1500 double] >> time: [1x1500 double] >> dof: [306x1500 double] >> label: {306x1 cell} >> trial: [59x306x1500 double] >> dimord: 'rpt_chan_time' >> trialinfo: [59x1 double] >> cfg: [1x1 struct] >> beta: [37x306x1500 double] >> Since I have 4 blocks for each subject, I appended them using >> ft_appenddata, and using ft_timelockanalysis (mentioning appropriate >> cfg.trial and cfg.keeptrials=?yes?; ) I split the data into 2 >> conditions timelock_cond1 (shown below) and timelock_cond2, retaining >> only 204 gradiometers ( i suppose I am not supposed to use >> ft_combineplanar at this level since it would distort the results). >> timelock_cond1 = >> avg: [204x1500 double] >> var: [204x1500 double] >> time: [1x1500 double] >> dof: [204x1500 double] >> label: {204x1 cell} >> trial: [143x204x1500 double] >> dimord: 'rpt_chan_time' >> trialinfo: [143x1 double] >> cfg: [1x1 struct] >> Then these are the steps I did, per your suggestion. >> 1. I gathered all the time lock (from above step) for all subjects in >> a cell matrix, timelock_cond1{:} and timelock_cond2{:} >> 3. Then I ran first level stats for each subject, with cfg.statistic= >> indepsamplesT and cfg.method=?analytic?; cfg.design as you suggested, >> and rest of cfg. >> for sj = 1: size(subj,2) >> stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); >> end >> 4. Then, I did timelockgrandaverage >> cfg.keepindividual = 'yes'; >> cfg.parameter = 'stat'; >> stat2=ft_timelockgrandaverage(cfg,stat1{:}); >> 5. Created a dummy variable just like stat2 in the above step and >> replaced the field ?individual? with zeros >> dummy2=stat2; >> dummy2.individual=zeros(size(stat2.individual)); >> 6. Finally, ran the second level stats, with cfg. statistic = >> ?depsamplesT?; cfg.method=?montecarlo?; and rest of cfg. >> stat = ft_timelockstatistics(cfg, stat2, dummy2); >> However, the problem is, whatever significance I found earlier (i.e. >> by comparing means rather than t-statistic) doesn?t test significant >> now. I thought it might get better by doing this, but seems to get >> worse. Please correct me if I am doing anything wrong. >> Thanks, >> Raghavan >> What you described in your reply to me just now, calling >> ft_timelockstatistics at the subject level to calculate descriptives, >> still >> effectively reduces each subject to one "datapoint" -- the difference >> between conditions of the selected t-descriptive for that subject. I >> believe I understand how to do that, and how to then do nonparametric >> shuffle testing at the between-subjects level for the signfiicance of >> that >> within-subjects descriptive/difference. >>>> Ok. That's indeed the procedure I tried to outline. In your earlier >>>> reply to Raghavan, it sounded like you were suggesting >> pooling the trials themselves between subjects (that is, all subjects' >> trials go into one big "bucket"), with the trial-to-trial variance >> having >> been removed via ft_regressconfound, *then* calling the ft_statistics >> functions on this single large "bucket" of trials. Have I >> misunderstood >> your suggestion? >>>> I might have not been clear there then. I was meant to say that one >>>> could use ft_regressconfound on trials of two (or more) conditions >>>> combined >> of a single subject, prior to calculating the single subject >> t-descriptive >> (using ft_xxxstatistics). This allows one to compute a 'cleaner' >> t-score, >> or at least provide a good case that head movement did not >> differentially >> influence activity levels in the separate conditions. It was not >> related to >> pooling trials between subjects. >> 2014-02-21 16:14 GMT+01:00 Alik Widge < alik.widge at gmail.com >: >>> I don't *think* I'm asking about how to do second-order analysis, >>> unless I > have missed something important. I did read the link/FAQ >>> when I was working > on this last week, and that seems different >>> than the question I am asking. > > What you described in your reply >>> to me just now, calling > ft_timelockstatistics at the subject level >>> to calculate descriptives, still > effectively reduces each subject >>> to one "datapoint" -- the difference > between conditions of the >>> selected t-descriptive for that subject. I > believe I understand >>> how to do that, and how to then do nonparametric > shuffle testing >>> at the between-subjects level for the signfiicance of that > >>> within-subjects descriptive/difference. > > In your earlier reply to >>> Raghavan, it sounded like you were suggesting > pooling the trials >>> themselves between subjects (that is, all subjects' > trials go into >>> one big "bucket"), with the trial-to-trial variance having > been >>> removed via ft_regressconfound, *then* calling the ft_statistics > >>> functions on this single large "bucket" of trials. Have I >>> misunderstood > your suggestion? > > Alik > > Alik Widge > >>> alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, >>> 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > >>> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to >>> create subject-level >> t-descriptives, mentioned in the previous >>> post? A quick answer would be to >> perform an indepedent t-test ( >>> cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics >>> (although you're not really 'testing' here, but only >> interested >>> in that t-descriptive), in which trials are the unit of >> >>> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> >>> ntrls_conditionB)]; ). Note that since an indepedent t-test tests >>> for >> differences of the means of two conditions, it won't fail on >>> unequal number >> of observations across the conditions (unlike a >>> dependent/paired t-test). >> >> Hope this gets you kickstarted for >>> the moment. I found a previous >> mail-conversation that goes more >>> into detail, providing more overview of >> the steps involved: >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >>>>> More useful documentation: >> >> >>> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >>>>>>> Yours, >> Arjen >> >> ------------------------------ >> >> >>> *Van: *"Alik Widge" < alik.widge at gmail.com > >> *Aan: *"FieldTrip >>> discussion list" < fieldtrip at science.ru.nl > >> *Verzonden: >>> *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: >>> [FieldTrip] regressconfound and frequency domain >> >> Arjen, what >>> you just described is more or less what I struggled to do >> last >>> week and ultimately gave up as I was unable to figure out how to get >>>>> FT to do it despite much meditation over tutorials and source >>> files. Can >> you elaborate a bit more on what you are saying below >>> -- not the >> ft_regressconfound bit, but the bit about how to get >>>>> ft_statistics_montecarlo and its wrappers to do a trials-level >>> analysis and >> permutation at the whole-group level? Especially, >>> what does one put in >> cfg.design and how does one call the >>> function? Everything I could find in >> the tutorials described the >>> case of doing means at the subject level and >> then permutation of >>> means at the group level, which as you point out is >> underpowered >>> for subtle effects. >> >> My particular situation was >>> timelock-analyzed trials (with >> keeptrials='yes'), but I could not >>> find a way to set up cfg.design that >> did not throw error >>> messages. The thing that really seemed to bother it was >> that >>> there were different numbers of trials in the 2-3 conditions of >> >>> interest, since some had to be removed for excessive artifact. >> >> >>> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at >>> gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 >>> AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl > wrote: >> >>>>>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject >>> level freq data, you'll need to >>> use ft_freqstatistics. Have a >>> look here for instance: >>> >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>>>>> At the subject level, you do not need (non-parametric) cluster >>>>>> permutation testing (Maris & Oostenveld), as you're taking each >>> subject's >>> t-descriptives to the group level. At the group level, >>> you can then test >>> the hypothesis that there's a difference >>> between tasks/conditions (H1) vs. >>> no difference (H0). In order >>> to do so, you'll need to create a dummy >>> variable at the group >>> level, that has the same number of 'subjects', but >>> with zeros in >>> all fields (in your case this will be a .stat field). At the >>> >>> group level, you thus call ft_freqstatistics again. This approach >>> has the >>> advantage that you're more sensitive (as compared to >>> taking each subject's >>> mean to the group level) to effects that >>> are small but consistent over >>> trials in each subject. >>> >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: >>> *"Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *Aan: * >>> fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari >>> 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound >>> and frequency domain >>> >>> Thanks Arjen, >>> Should I use >>> ft_freqdescriptives to compute t descriptives for >>> individual >>> subjects, and then take that to group level instead of mean? If >>> >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>>>>> Hi Raghavan, ft_regressconfound run on timelock data seems to >>> return output with avg field. However, ft_regressconfound run on >>> frequency data, does not return average. I see the avg field being >>> removed. Is there a reason? >> Not intentionally, but not an issue >>> either. You could still use ft_freqdescriptives to compute the >>> average for you, but see my comment below. Question - Since >>> ft_regressconfound outputs power spectrum of individual trials - 4D >>> matrix (instead of average), can I simply re-average the power >>> spectrum over trials to see the average power for that subject. >>> Also, I need to run grand average (over subjects) before running >>> statistics. I hope these steps does not distort the data. Please >>> advise. >> Remember that the mean over trials is not affected by >>> your clean-up of trial-by-trial variance due to head movement. >>> Taking each subject's mean (unaffected) to the group level is an >>> approach that will not benefit from your clean-up. In order to >>> benefit from reduced trial-by-trial variance, you'll need a measure >>> that depends on it, e.g. t-descriptive, neural activity-behavior >>> correlation (for taking to the group level). Hope this helps, Arjen >>> ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan >>> Gopalakrishnan" >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> *>* >>> Aan: fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* >>> Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: >>> Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>>>>> *>* Thanks, I reduced down the time resolution so computation >>> can go >>> *>* faster. Now, m y matrix looks like this >>> *>* >>> hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: >>> 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: >>> [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: >>> [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 >>> double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on >>> timelock data seems to return output with >>> *>* avg field. >>> However, ft_regressconfound run on frequency data, does not >>> *>* >>> return average. I see the avg field being removed. Is there a >>> reason? >>> *>* Question - Since ft_regressconfound outputs power >>> spectrum of >>> *>* individual trials - 4D matrix (instead of >>> average), can I simply >>> *>* re-average the power spectrum over >>> trials to see the average power for >>> *>* that subject. Also, I >>> need to run grand average (over subjects) before >>> *>* running >>> statistics. I hope these steps does not distort the data. >>> *>* >>> Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, >>> 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < >>> a.stolk at fcdonders.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>> To: FieldTrip discussion list < fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>> Subject: Re: [FieldTrip] regressconfound and frequency domain >>> >>> *>* Message-ID: >>> *>* < >>> 2108167665.5423215.1392847118322.JavaMail.root at >>> sculptor.zimbra.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > >>>>>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear >>> Raghavan, Good to hear it's working out for you. A short answer >>> >>> *>* would be 'no'. Reducing the size of your data matrix is likely >>> going >>> *>* to speed up computations. Your time resolution seems >>> pretty high (1500 >>> *>* frequency estimations per single trial); >>> do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk >>> bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf >>> at gmail.com < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>>> Aan: fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > >>> Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: >>> [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>>>>> *>* > Thanks for answering all my previous questions. I was >>> successfully >>> *>* > able to incorporate head movements to my erf >>> data. As I understand I >>> *>* > have to do this separately for the >>> time frequency data after keeping >>> *>* > individual trials. I am >>> interested in both beta and gamma bands >>> *>* > [15:1:70]. my time >>> frequency looks like this using wavelets, >>> *>* > timefreq = >>> >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > >>> powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* >>>> grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: >>> [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After >>> regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 >>> cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 >>> double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D >>> double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 >>> struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D >>> double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since >>> its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks >>> of data for 20 subjects. It >>> *>* > will take an enoumous amount >>> of time to process the data through >>> *>* > regressconfound. Is >>> there a workaround to make the processing faster >>> *>* > or am I >>> missing something. Any help would be of great help. >>> *>* > >>> Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip >>> mailing list >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>>>>>>>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>> Radboud University >>> Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: >>> +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> >>> _______________________________________________ >>> 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 >> >> >> >> >>>>> -- >> Donders Institute for Brain, Cognition and Behaviour >> >>> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >>>>> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: >>> www.arjenstolk.nl >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 39, Issue 48 > ***************************************** From v.piai.research at gmail.com Wed Feb 26 19:03:55 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 26 Feb 2014 19:03:55 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' Message-ID: <530E2C8B.6070004@gmail.com> Hi all, Does anyone have some tips for getting a nice sourceplot using the 'ortho' method? I'm using functional data masked by the stats results. I see a lot of cerebellum activity as well as deeper sources, so a surface plot is very likely to be fooling me. I'm getting a very ugly figure, though, because of all the squares (activity and masks) bleeding outside of the skull outline. Anyone with experience on what works well to make that look nicer (eg., in Illustrator)? Thanks, Vitoria From a.stolk at fcdonders.ru.nl Wed Feb 26 22:43:59 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 26 Feb 2014 22:43:59 +0100 (CET) Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <530E2C8B.6070004@gmail.com> Message-ID: <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Hi Vitoria, I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Vitoria Piai" > Aan: fieldtrip at donders.ru.nl > Verzonden: Woensdag 26 februari 2014 19:03:55 > Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' > Hi all, > > Does anyone have some tips for getting a nice sourceplot using the > 'ortho' method? > I'm using functional data masked by the stats results. I see a lot of > cerebellum activity as well as deeper sources, so a surface plot is > very > likely to be fooling me. I'm getting a very ugly figure, though, > because > of all the squares (activity and masks) bleeding outside of the skull > outline. > Anyone with experience on what works well to make that look nicer > (eg., > in Illustrator)? > > Thanks, Vitoria > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl From notthemindprobe at yahoo.com Thu Feb 27 01:11:59 2014 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Wed, 26 Feb 2014 16:11:59 -0800 (PST) Subject: [FieldTrip] Recording Biosemi GSR data in GDF files In-Reply-To: Message-ID: <1393459919.4744.YahooMailBasic@web140204.mail.bf1.yahoo.com> Robert: Thanks for your suggestions, after doing some digging in the Actiview Labview code and some Biosemi forums posting I found there is some interesting variations in the Biosemi GSR sensors that affect how they are interpreted by the biosemi2ft code and then stored in the GDF files. Most significantly, for Biosemi there are two channels of analog data the correspond to 1 channel of GSR data. In other words, to use biosemi2ft to get EEG channels 1:32 you would specify channels 1, 2, .... 32 in the biosemi2ft config file. This corresponds to biosemi/BDF channels 1:32. Similarly, if you want the 8 Biosemi external analog channels [biosemi channels 257 to 264] you would specify channels 257 to 264 in the config file for biosemi2ft. However, if you specify that you want channels 265 and 266 in the biosemi2ft config this witll *not* give you the Biosemi GSR1 and Biosemi GSR2 channels. Instead you will get two voltage measurements that are both used by Actiview to calculate GSR1. Therefore you need to set up the biosemi2ft config file to recorded channels 265->268 [4 channels] in order the get the raw data that is used by Biosemi to calculate the contents of its channels 265(GSR1) and 266 (GSR2). Actiview does something along the following with the pairs of channels to calculate GSR (the following would be for GSR1, GSR2 would use channels 268&267) GSR1 = CH266-CH265 low pass filter GSR GSR1 = 13.3*GSR Max and minimum substraction in a sliding window (128 data points for a complete 16Hz excitation wave cycle when data is at 2048Hz, there is 50% window overlap) GSR1 = GSR1/8192 GSR1 = 1/GSR1 GSR1 = 1E+9 * GSR1 There can be some variation to account for different speed modes/sampling rates (I've been running at 2048Hz). There is also additional operations for verifying data integrity, and converting data types. Anyway, one of the big things to be aware of is that when you go beyond channel 264 there is no longer a 1:1 relationship in the Biosemi data channeling numbering and the way that the biosemi2ft is accessing the (raw) data. I haven't used any of the other Biosemi sensor data, but some of the messages in their forums suggest that the ERGO, RESP and TEMP sensors as well under go additional processing in Actiview. So I don't know if there are multiple channels of 'raw' data that correspond to each of those. Best, Eric ---------------------------------------------------------------------- Message: 1 Date: Tue, 18 Feb 2014 16:55:55 +0100 From: Robert Oostenveld To: FieldTrip discussion list Subject: Re: [FieldTrip] Recording Biosemi GSR data in GDF files Message-ID: <4A14FD77-D413-418C-B788-F45F0CD675AD at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Eric, Although I don't have any real expertise in this matter, let me share my 2 cents: Your description suggests that the GSR is estimated using a 16Hz alternating current  of constant (but presumably unknown) amplitude, and that GSR is estimated by solving Ohms law (V=I*R). Rather than doing an instantaneous estimate (which is noisy, especially if the current passes the zero-crossing)  there will be a rectification and temporal smoothing of the voltage prior to the estimation. Or perhaps even better: a sliding window estimation: for a given time t   take the signal from t-1/16s in the past up to t-0 (i.e. now)   estimate the 16Hz amplitude using a DFT, this is a single positive number (either RMS, Vpeak, or Vpeak-to-peak)   estimate R = V/I (this requires that you know the current I) You could determine I by connecting a known resistor of appropriate size to the electrodes. Or perhaps you don't even have to; if you are not interested in the absolute value but only in changes, you would just take R as proportional to V. Something like this (for the offline case) would do it time    = (1:(fsample/16))/fsample; % just enough time for one oscillation model_c = cos(16*2*pi*time); model_s = sin(16*2*pi*time); model   = model_c + i*model_s;      % i is the complex number model   = model./norm(model); signal    = randn(1,10*fsample);    % the raw signal amplitude = nan(size(signal));      % the estimated amplitude for t=1:length(signal)   begsample = t - fsample/16 + 1;   % note the +1, the segment should be 64 samples long   endsample = t - 0;   if begsample>=1 && endsample<=length(signal)     segment = signal(begsample:endsample);     amplitude(t) = segment*model'; % discrete fourier transform   end end plot(abs(amplitude)) This can be translated to the online case by inserting it into one of the examples at http://fieldtrip.fcdonders.nl/development/realtime best regards, Robert On 18 Feb 2014, at 0:00, Eric Pohlmeyer wrote: > Fieldtrip users: > > Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file?  This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. > > Some more details: > > Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine.  We recently wanted to add GSR data to this.  However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself.  When we record the GSR data using Activew in a BDF file, the data is recorded fine. > > Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file.  This is in contrasts to the 8 external channels which do not undergo such additional manipulations. > > So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? > > Thanks! > > Eric > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From barbara.schorr at uni-ulm.de Thu Feb 27 09:08:24 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Thu, 27 Feb 2014 09:08:24 +0100 Subject: [FieldTrip] Plotting ERP data: From topoplot to 3D brain surface plot Message-ID: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> Dear Fieldtripers, I have ERP data from a normal oddball task (low pitch tones vs. high pitch tones) resulting in a P300. I know how to plot them with the normal ft_topoplot command. For just visualization, this is fine, but for a publication I would like to plot my data on a 3D brain surface. I know how to do that with the ft_sourceplot command. I tried it with my data, but the result is not even close to what I see when I plot it with the ft_topoplot command (I don's see the nice big blob of activity in the parietal cortex). I guess the problem is that I do more analizyng steps in order to get the data structure which is needed for sourceplotting. What I really just want to do is putting my topoplot on a brainsurface. Is that possible in fieldtrip or do I need to use another software? Thank you very much for your help!! Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From eelke.spaak at donders.ru.nl Thu Feb 27 09:19:55 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 27 Feb 2014 09:19:55 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Vitória, When you are calling ft_sourceinterpolate, you can call it with different interpolation methods. I think the default is 'nearest', which results in interpolated blocky figures. You can also specify cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both of which result in smoother interpolations. Furthermore you can play around with the mask variable for plotting. I guess you are now using the binary mask resulting from the output of ft_sourcestatistics. You can also create a real-value mask based e.g. on the statistical or relative values (which results in opacity being ramped up according to effect size), and then apply the statistical map to that. This would be something like the following: tmp = int_stat.stat; oldmask = int_stat.mask; int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % set the new mask to range between 0 and 1 int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels where int_stat is the result of ft_sourceinterpolate. Note that because I used 'sphere_avg' interpolation in this case, the interpolated mask will not be strictly binary anymore, hence the test < 0.9, rather than == 1. (Also note that you should specify cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting with a mask like the above.) Does this do something like you want? Best, Eelke On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: > Hi Vitoria, > > I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, > > Arjen > > > ----- Oorspronkelijk bericht ----- >> Van: "Vitoria Piai" >> Aan: fieldtrip at donders.ru.nl >> Verzonden: Woensdag 26 februari 2014 19:03:55 >> Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' >> Hi all, >> >> Does anyone have some tips for getting a nice sourceplot using the >> 'ortho' method? >> I'm using functional data masked by the stats results. I see a lot of >> cerebellum activity as well as deeper sources, so a surface plot is >> very >> likely to be fooling me. I'm getting a very ugly figure, though, >> because >> of all the squares (activity and masks) bleeding outside of the skull >> outline. >> Anyone with experience on what works well to make that look nicer >> (eg., >> in Illustrator)? >> >> Thanks, Vitoria >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From v.piai.research at gmail.com Thu Feb 27 16:44:46 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Feb 2014 16:44:46 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: <530F5D6E.4030804@gmail.com> Hi Elke and Arjen, Thanks a lot, it almost solved the problem (see figure). It looks better than before anyways, so I guess I could just do the finishing in Illustrator. (Or can you tell from this figure that something is going wrong with the interpolation/projection?) Vitoria On 27-2-2014 9:19, Eelke Spaak wrote: > Hi Vitória, > > When you are calling ft_sourceinterpolate, you can call it with > different interpolation methods. I think the default is 'nearest', > which results in interpolated blocky figures. You can also specify > cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both > of which result in smoother interpolations. > > Furthermore you can play around with the mask variable for plotting. I > guess you are now using the binary mask resulting from the output of > ft_sourcestatistics. You can also create a real-value mask based e.g. > on the statistical or relative values (which results in opacity being > ramped up according to effect size), and then apply the statistical > map to that. This would be something like the following: > > tmp = int_stat.stat; > oldmask = int_stat.mask; > int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % > set the new mask to range between 0 and 1 > int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels > > where int_stat is the result of ft_sourceinterpolate. Note that > because I used 'sphere_avg' interpolation in this case, the > interpolated mask will not be strictly binary anymore, hence the test > < 0.9, rather than == 1. (Also note that you should specify > cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting > with a mask like the above.) > > Does this do something like you want? > > Best, > Eelke > > On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: >> Hi Vitoria, >> >> I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, >> >> Arjen >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "Vitoria Piai" >>> Aan: fieldtrip at donders.ru.nl >>> Verzonden: Woensdag 26 februari 2014 19:03:55 >>> Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' >>> Hi all, >>> >>> Does anyone have some tips for getting a nice sourceplot using the >>> 'ortho' method? >>> I'm using functional data masked by the stats results. I see a lot of >>> cerebellum activity as well as deeper sources, so a surface plot is >>> very >>> likely to be fooling me. I'm getting a very ugly figure, though, >>> because >>> of all the squares (activity and masks) bleeding outside of the skull >>> outline. >>> Anyone with experience on what works well to make that look nicer >>> (eg., >>> in Illustrator)? >>> >>> Thanks, Vitoria >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> _______________________________________________ >> 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 -- Vitória Piai PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition, Radboud University Nijmegen Montessorilaan 3, B.02.30 6525 HR Nijmegen The Netherlands Email : V.piai at donders.ru.nl Phone : +31 24 3612635 www.vitoriapiai.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dedabghb.png Type: image/png Size: 178693 bytes Desc: not available URL: From ayobimpe2004 at hotmail.com Thu Feb 27 22:37:50 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 27 Feb 2014 22:37:50 +0100 Subject: [FieldTrip] correlated sources with DICS Message-ID: Hello, I want to compute source coherence with DICS. I am not getting what I want with cfg.refdip option.Please how can I include two bilateral reference positions in leadfield computation or generally compute source coherence from one source location to other sources? Azeez A. Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Feb 28 08:50:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 28 Feb 2014 08:50:34 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <530F5D6E.4030804@gmail.com> References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> <530F5D6E.4030804@gmail.com> Message-ID: Hi Vitoria, I forgot to add: the default in ft_sourceinterpolate is to *always* use 'nearest' interpolation if the data field is logical (as is the case for the mask; hence still the blocky masking). This is a reasonable setting I guess, but I don't see a reason why you shouldn't be able to use 'smudge' or 'sphere_avg' for a mask as well. You can circumvent this by doing stat.mask = double(stat.mask); before the interpolation step. Best, Eelke On 27 February 2014 16:44, Vitoria Piai wrote: > Hi Elke and Arjen, > > Thanks a lot, it almost solved the problem (see figure). It looks better > than before anyways, so I guess I could just do the finishing in > Illustrator. > (Or can you tell from this figure that something is going wrong with the > interpolation/projection?) > > Vitoria > > > > On 27-2-2014 9:19, Eelke Spaak wrote: > > Hi Vitória, > > When you are calling ft_sourceinterpolate, you can call it with > different interpolation methods. I think the default is 'nearest', > which results in interpolated blocky figures. You can also specify > cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both > of which result in smoother interpolations. > > Furthermore you can play around with the mask variable for plotting. I > guess you are now using the binary mask resulting from the output of > ft_sourcestatistics. You can also create a real-value mask based e.g. > on the statistical or relative values (which results in opacity being > ramped up according to effect size), and then apply the statistical > map to that. This would be something like the following: > > tmp = int_stat.stat; > oldmask = int_stat.mask; > int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % > set the new mask to range between 0 and 1 > int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels > > where int_stat is the result of ft_sourceinterpolate. Note that > because I used 'sphere_avg' interpolation in this case, the > interpolated mask will not be strictly binary anymore, hence the test > < 0.9, rather than == 1. (Also note that you should specify > cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting > with a mask like the above.) > > Does this do something like you want? > > Best, > Eelke > > On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: > > Hi Vitoria, > > I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, > > Arjen > > > ----- Oorspronkelijk bericht ----- > > Van: "Vitoria Piai" > Aan: fieldtrip at donders.ru.nl > Verzonden: Woensdag 26 februari 2014 19:03:55 > Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' > Hi all, > > Does anyone have some tips for getting a nice sourceplot using the > 'ortho' method? > I'm using functional data masked by the stats results. I see a lot of > cerebellum activity as well as deeper sources, so a surface plot is > very > likely to be fooling me. I'm getting a very ugly figure, though, > because > of all the squares (activity and masks) bleeding outside of the skull > outline. > Anyone with experience on what works well to make that look nicer > (eg., > in Illustrator)? > > Thanks, Vitoria > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Vitória Piai > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition, Radboud University Nijmegen > Montessorilaan 3, B.02.30 > 6525 HR Nijmegen > The Netherlands > > Email : V.piai at donders.ru.nl > Phone : +31 24 3612635www.vitoriapiai.com > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dedabghb.png Type: image/png Size: 178693 bytes Desc: not available URL: From sauer.mpih at googlemail.com Fri Feb 28 12:08:41 2014 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Fri, 28 Feb 2014 12:08:41 +0100 Subject: [FieldTrip] Warning in topoplot function - 4D data Message-ID: Dear all, when plotting topoplots of 4D data using the 4D248 layout, Matlab gives me the warning "Some points fall outside the outline, please consider using another layout.". Indeed, two frontal sensors are placed outside the head. I am wondering why this message shows up and whether this influences results, i.e. a misplaced peak sensor. I tried with different fieldtrip versions, current ones and old ones. I get the warning all the time. Any help is appreciated! Thanks a lot and best regards, Andreas -- Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: andreas.sauer at brain.mpg.de www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-02-28 11:57:24.png Type: image/png Size: 15484 bytes Desc: not available URL: From albenin at mail.ru Fri Feb 28 15:28:40 2014 From: albenin at mail.ru (=?UTF-8?B?0JDQu9C10LrRgdC10Lkg0JHQtdC90LjQvQ==?=) Date: Fri, 28 Feb 2014 18:28:40 +0400 Subject: [FieldTrip] =?utf-8?q?Statistics_on_freq_data?= In-Reply-To: <1391612267.921368498@f293.i.mail.ru> References: <1391612267.921368498@f293.i.mail.ru> Message-ID: <1393597720.682131540@f250.i.mail.ru> Hi all! Does anyone have ideas? :) > > >Dear Fieldtripers, > >First of all big thanks for a wonderful tool and support! > >I have some questions about cluster based permutation test on TF data. >I perform a between-trials experiment and want to search differences say >on frequencies 10-30Hz and latencies 200-1200 ms from onset. >So I need to explore these ranges for possible differencies in powerspectrum. >When I use for example > >cfg.latency          = [0.2 1.2]; >cfg.frequency        = [10 30]; > >I find no significant clusters, and lowest p_value is very high, say 0,8. >But when I try to look at smaller time/frequency areas, like > >cfg.latency          = [0.2 0.3]; >cfg.frequency        = [15 16]; > >There can be one or two significant clusters with p_values<0.01. >So my question is: does the algorithm look for the whole specified TF window like >0.2-1.2s   10-30Hz and tries to find significant difference based on the whole length >of interval? This could explain why there are no significant clusters on bigger windows. >Such clusters appear when we shorten the toi and foi - it's much more probable to find differences >at smaller scales. >So the next question is: what should I do to explore the whole number of frequencies and latencies? >Shall I run a loop with parameters like this: > >Iteration 1 >cfg.latency          = [0.2 0.3]; >cfg.frequency        = [15 16]; > >Iteration 2 >cfg.latency          = [0.3 0.4]; >cfg.frequency        = [15 16]; > >... and so on? > >Or maybe I do not understand something in basis of method? >BTW, I've read all tutorials and appropriate papers like >Nonparametric statistical testing of EEG, but could not find the answer. > > >Thanks in advance, > >Alex > > > >_______________________________________________ >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 jm.horschig at donders.ru.nl Mon Feb 3 09:10:39 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 09:10:39 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: Message-ID: <52EF4EFF.3010304@donders.ru.nl> Hi Joram, this might be a stupid question, but is there a grandavg{1}.anatomy field at all? Best, Jörn On 1/31/2014 12:44 PM, Joram van Driel wrote: > Hi all, > > I'm trying to plot the grand average of a source analysis. However no > matter what I try, the result of ft_sourcegrandaverage keeps giving me > only the functional data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell structure): > > temp = zeros([length(nsubjects) size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one subject one condition > customavg.avg.pow = squeeze(mean(temp,1)); % and replace power with > the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Feb 3 09:19:35 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 09:19:35 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> Message-ID: <52EF5117.6070700@donders.ru.nl> Hi Victoria, is there anything wrong with the code you used below? By smoothing, do you refer to smoothing in the frequency domain? Best, Jörn On 1/30/2014 11:33 AM, Victoria Schröder wrote: > Hello > > I am currently working on a freqanalysis as a first step to do a > connectivityanalysis. I am a bit unsure about the method to use for > the freqanalysis. My stimuli are very long: between 29 and 30 sec. In > total i have 4 stimuli per condition and 2 seperate conditions. I am > looking at the beta range so fairly low frequencies. > > this is my code: > Am i using the right taper and method. Should i smooth the data? and > if so, what should such a smoothing parameter depend on? > > %fourier analysis > cfg=[]; > cfg.output='fourier'; > cfg.method='mtmfft'; > cfg.foi=[12:30]; > cfg.taper='hanning'; > cfg.keeptrials='yes'; > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > frefourier=ft_freqanalysis(cfg,data_clean); > > > %coherence analysis > cfg=[]; > cfg.method='coh'; > cfg.channelcmb={'B3' 'C15' > 'B3' 'C10' > 'B23' 'C15' > 'B23' 'C10'} > coherence=ft_connectivityanalysis(cfg, frefourier); > > > Thank you very much for the suggestions! > Best > Victoria > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From joramvandriel at gmail.com Mon Feb 3 09:59:20 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 3 Feb 2014 09:59:20 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: <52EF4EFF.3010304@donders.ru.nl> References: <52EF4EFF.3010304@donders.ru.nl> Message-ID: Hi Jörn, Not a stupid question at all, because indeed there isn't. I thought that was the problem too; I already tried putting the .anatomy field of one of the (normalized) subjects into the grandavg structure, but that resulted in a bunch of errors due to an error in the cornerpoints function. This is how the grandavg structure looks like after ft_sourcegrandaverage (fieldtrip version 20140127): pos: [7109137x3 double] dim: [181 217 181] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' inside: [1550519x1 double] outside: [5558618x1 double] df: [7109137x1 double] cfg: [1x1 struct] This my cfg: grandavg = cell(1,2); cfg = []; cfg.parameter = 'avg.pow'; cfg.keepindividual = 'no'; grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition 1 grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition 2 Hope you can find out what the problem is..! Thanks a lot, Joram On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Joram, > > this might be a stupid question, but is there a grandavg{1}.anatomy field > at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > >> Hi all, >> >> I'm trying to plot the grand average of a source analysis. However no >> matter what I try, the result of ft_sourcegrandaverage keeps giving me only >> the functional data, no anatomy. >> >> My cfg for ft_sourceplot is: >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'no'; >> cfg.funparameter = 'avg.pow'; >> cfg.maskparameter = cfg.funparameter; >> cfg.funcolorlim = [0 0.2]; >> cfg.opacitylim = [0 0.2]; >> cfg.opacitymap = 'rampup'; >> >> ft_sourceplot(cfg,grandavg{1}) >> >> I thus created my own grandaverage, like this (where sourceDiffAll{:,:} >> is a subject-by-condition cell structure): >> >> temp = zeros([length(nsubjects) size(sourceDiffAll{1,1}.avg.pow)]); >> for s=1:length(nsubjects) >> temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - >> sourceDiffAll{s,1}.avg.pow; % create condition contrast >> end >> customavg = sourceDiffAll{1,1}; % just copy one subject one condition >> customavg.avg.pow = squeeze(mean(temp,1)); % and replace power with the >> grand average power condition-contrast >> >> Now using ft_sourceplot on customavg works just fine. >> Any idea of what's going wrong with ft_sourceplot on >> ft_sourcegrandaverage? >> Thanks! >> >> - Joram >> >> >> -- >> Joram van Driel, MSc. >> PhD student @ University of Amsterdam >> Brain & Cognition @ Department of Psychology >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Mon Feb 3 10:56:34 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 10:56:34 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: <52EF4EFF.3010304@donders.ru.nl> Message-ID: <52EF67D2.1050208@donders.ru.nl> Hi Joram, you probably need to interpolate to a template and then put the pos and dim field from the template you used in the source structure. You do not have to interpolate, but then make sure that the dimensions of your anatomy match the dimensions of your sourcemodel. Not sure if you followed any tutorial, but this is a good one: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended Best, Jörn On 2/3/2014 9:59 AM, Joram van Driel wrote: > Hi Jörn, > Not a stupid question at all, because indeed there isn't. I thought > that was the problem too; I already tried putting the .anatomy field > of one of the (normalized) subjects into the grandavg structure, but > that resulted in a bunch of errors due to an error in the cornerpoints > function. > This is how the grandavg structure looks like after > ft_sourcegrandaverage (fieldtrip version 20140127): > > pos: [7109137x3 double] > dim: [181 217 181] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > inside: [1550519x1 double] > outside: [5558618x1 double] > df: [7109137x1 double] > cfg: [1x1 struct] > > This my cfg: > > grandavg = cell(1,2); > cfg = []; > cfg.parameter = 'avg.pow'; > cfg.keepindividual = 'no'; > grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition 1 > grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition 2 > > Hope you can find out what the problem is..! > > Thanks a lot, > Joram > > > > On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" > > wrote: > > Hi Joram, > > this might be a stupid question, but is there a > grandavg{1}.anatomy field at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > > Hi all, > > I'm trying to plot the grand average of a source analysis. > However no matter what I try, the result of > ft_sourcegrandaverage keeps giving me only the functional > data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell structure): > > temp = zeros([length(nsubjects) > size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one subject one > condition > customavg.avg.pow = squeeze(mean(temp,1)); % and replace power > with the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- > Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From victorias at dsv.su.se Mon Feb 3 11:15:07 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Mon, 03 Feb 2014 11:15:07 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF5117.6070700@donders.ru.nl> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> Message-ID: <087550bc51e8099724e221be5016154f@dsv.su.se> Dear Jörn, the code works but i dont know whether my data is logical and whether i decided to use the right method etc. My trials are pretty long (approx 30 sec but all are not the same length) and i am interested in beta frequency. First, it is not really clear to me whether i should use cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the latter calculates the FFT for shorter self-specified time windows to look at changes in power over time. Is that right? however, if i have more stimuli for one condition, how is the time component then taken into account? does mtmconvol take all trials of one condition and average the the power for each time window over all trials? Or is each trial treated seperatly? Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq when using cfg.taper='hanning'? As i understand hanning if appropriate for lower freuquencies so i should use this taper to assess beta frequencies. Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? Thank you a lot for the help Best Victoria 2014-02-03 09:19 skrev Jörn M. Horschig: > Hi Victoria, > > is there anything wrong with the code you used below? By smoothing, > do you refer to smoothing in the frequency domain? > > Best, > Jörn > > > On 1/30/2014 11:33 AM, Victoria Schröder wrote: >> Hello >> >> I am currently working on a freqanalysis as a first step to do a >> connectivityanalysis. I am a bit unsure about the method to use for >> the freqanalysis. My stimuli are very long: between 29 and 30 sec. In >> total i have 4 stimuli per condition and 2 seperate conditions. I am >> looking at the beta range so fairly low frequencies. >> >> this is my code: >> Am i using the right taper and method. Should i smooth the data? and >> if so, what should such a smoothing parameter depend on? >> >> %fourier analysis >> cfg=[]; >> cfg.output='fourier'; >> cfg.method='mtmfft'; >> cfg.foi=[12:30]; >> cfg.taper='hanning'; >> cfg.keeptrials='yes'; >> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >> frefourier=ft_freqanalysis(cfg,data_clean); >> >> >> %coherence analysis >> cfg=[]; >> cfg.method='coh'; >> cfg.channelcmb={'B3' 'C15' >> 'B3' 'C10' >> 'B23' 'C15' >> 'B23' 'C10'} >> coherence=ft_connectivityanalysis(cfg, frefourier); >> >> >> Thank you very much for the suggestions! >> Best >> Victoria >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From jm.horschig at donders.ru.nl Mon Feb 3 11:42:06 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 03 Feb 2014 11:42:06 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <087550bc51e8099724e221be5016154f@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> Message-ID: <52EF727E.2080902@donders.ru.nl> Hi Victoria, you might want to read the relevant part of the walkthrough for your questions on mtmconvol and mtmfft: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis Then, also doing this tutorial might help in understanding what the different methods are doing: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis And lastly, to shortly answer your questions, see below ;) On 2/3/2014 11:15 AM, Victoria Schröder wrote: > Dear Jörn, Hi ;) > > the code works but i dont know whether my data is logical and whether > i decided to use the right method etc. maybe you should try to get into one of the FieldTrip courses :) This might tremendously help you in understanding what's being done and why. Otherwise, try to read as much as you can, read methods of papers and discuss with your supervisor and colleagues. Of course, on the mailing list we also like to help a lot. > > My trials are pretty long (approx 30 sec but all are not the same > length) and i am interested in beta frequency. > > First, it is not really clear to me whether i should use > cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the > latter calculates the FFT for shorter self-specified time windows to > look at changes in power over time. Is that right? yep, about right. > however, if i have more stimuli for one condition, how is the time > component then taken into account? it depends on how you segmented your data. FieldTrip is just transforming your preprocessed data, so whatever you put in is what you get out. > does mtmconvol take all trials of one condition and average the the > power for each time window over all trials? Or is each trial treated > seperatly? depends on whether you specify cfg.keeptrials = 'yes' or 'no' > > Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq > when using cfg.taper='hanning'? no, a hanning taper is always a single taper. Only when combining multiple tapers you can effectively smooth in the frequency domain. this is implemented as taper='dpss' > As i understand hanning if appropriate for lower freuquencies so i > should use this taper to assess beta frequencies. this is a rule of thumb, but there is nothing wrong with using multitapering for lower frequencies. It depends on what you expect from your data and what you want to achieve. > > Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? this depends on the frequencies you are interested in. I wouldn't trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. > > Thank you a lot for the help you're welcome, hope this helps > Best > Victoria Likewise, Jörn > > > 2014-02-03 09:19 skrev Jörn M. Horschig: >> Hi Victoria, >> >> is there anything wrong with the code you used below? By smoothing, >> do you refer to smoothing in the frequency domain? >> >> Best, >> Jörn >> >> >> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>> Hello >>> >>> I am currently working on a freqanalysis as a first step to do a >>> connectivityanalysis. I am a bit unsure about the method to use for >>> the freqanalysis. My stimuli are very long: between 29 and 30 sec. >>> In total i have 4 stimuli per condition and 2 seperate conditions. I >>> am looking at the beta range so fairly low frequencies. >>> >>> this is my code: >>> Am i using the right taper and method. Should i smooth the data? and >>> if so, what should such a smoothing parameter depend on? >>> >>> %fourier analysis >>> cfg=[]; >>> cfg.output='fourier'; >>> cfg.method='mtmfft'; >>> cfg.foi=[12:30]; >>> cfg.taper='hanning'; >>> cfg.keeptrials='yes'; >>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>> frefourier=ft_freqanalysis(cfg,data_clean); >>> >>> >>> %coherence analysis >>> cfg=[]; >>> cfg.method='coh'; >>> cfg.channelcmb={'B3' 'C15' >>> 'B3' 'C10' >>> 'B23' 'C15' >>> 'B23' 'C10'} >>> coherence=ft_connectivityanalysis(cfg, frefourier); >>> >>> >>> Thank you very much for the suggestions! >>> Best >>> Victoria >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From eelke.spaak at donders.ru.nl Mon Feb 3 11:38:21 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 3 Feb 2014 11:38:21 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <087550bc51e8099724e221be5016154f@dsv.su.se> References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> Message-ID: Dear Victoria, Those are all very good questions. It might be very beneficial for you to go through the following tutorial once: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis I think many of the questions you have will be answered along the way. If not (or if you've already read the tutorial), feel free to ask of course! Best, Eelke On 3 February 2014 11:15, Victoria Schröder wrote: > Dear Jörn, > > the code works but i dont know whether my data is logical and whether i > decided to use the right method etc. > > My trials are pretty long (approx 30 sec but all are not the same length) > and i am interested in beta frequency. > > First, it is not really clear to me whether i should use cfg.method=mtmfft > or cfg.method=mtmconvol. As i understand , the latter calculates the FFT > for shorter self-specified time windows to look at changes in power over > time. Is that right? however, if i have more stimuli for one condition, how > is the time component then taken into account? does mtmconvol take all > trials of one condition and average the the power for each time window over > all trials? Or is each trial treated seperatly? > > Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq when > using cfg.taper='hanning'? As i understand hanning if appropriate for lower > freuquencies so i should use this taper to assess beta frequencies. > > Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? > > Thank you a lot for the help > Best > Victoria > > > 2014-02-03 09:19 skrev Jörn M. Horschig: > >> Hi Victoria, >> >> is there anything wrong with the code you used below? By smoothing, >> do you refer to smoothing in the frequency domain? >> >> Best, >> Jörn >> >> >> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>> >>> Hello >>> >>> I am currently working on a freqanalysis as a first step to do a >>> connectivityanalysis. I am a bit unsure about the method to use for the >>> freqanalysis. My stimuli are very long: between 29 and 30 sec. In total i >>> have 4 stimuli per condition and 2 seperate conditions. I am looking at the >>> beta range so fairly low frequencies. >>> >>> this is my code: >>> Am i using the right taper and method. Should i smooth the data? and if >>> so, what should such a smoothing parameter depend on? >>> >>> %fourier analysis >>> cfg=[]; >>> cfg.output='fourier'; >>> cfg.method='mtmfft'; >>> cfg.foi=[12:30]; >>> cfg.taper='hanning'; >>> cfg.keeptrials='yes'; >>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>> frefourier=ft_freqanalysis(cfg,data_clean); >>> >>> >>> %coherence analysis >>> cfg=[]; >>> cfg.method='coh'; >>> cfg.channelcmb={'B3' 'C15' >>> 'B3' 'C10' >>> 'B23' 'C15' >>> 'B23' 'C10'} >>> coherence=ft_connectivityanalysis(cfg, frefourier); >>> >>> >>> Thank you very much for the suggestions! >>> Best >>> Victoria >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 victorias at dsv.su.se Mon Feb 3 12:14:07 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Mon, 03 Feb 2014 12:14:07 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF727E.2080902@donders.ru.nl> References: "<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> Message-ID: <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> Thank Jörn, Thank for the advice for the tutorials but i have already looked at them a lot. Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged power over trials? what happens then when the trials do not have the same length? and a last question :) what does cfg.toi depend on ? in the tutorial time frequency analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the case? I hope this should be it for now Best Victoria 2014-02-03 11:42 skrev Jörn M. Horschig: > Hi Victoria, > > you might want to read the relevant part of the walkthrough for your > questions on mtmconvol and mtmfft: > http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis > > Then, also doing this tutorial might help in understanding what the > different methods are doing: > http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis > > And lastly, to shortly answer your questions, see below ;) > > On 2/3/2014 11:15 AM, Victoria Schröder wrote: >> Dear Jörn, > Hi ;) > >> >> the code works but i dont know whether my data is logical and >> whether i decided to use the right method etc. > maybe you should try to get into one of the FieldTrip courses :) This > might tremendously help you in understanding what's being done and > why. Otherwise, try to read as much as you can, read methods of > papers > and discuss with your supervisor and colleagues. Of course, on the > mailing list we also like to help a lot. >> >> My trials are pretty long (approx 30 sec but all are not the same >> length) and i am interested in beta frequency. >> >> First, it is not really clear to me whether i should use >> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >> latter calculates the FFT for shorter self-specified time windows to >> look at changes in power over time. Is that right? yep, about right. > >> however, if i have more stimuli for one condition, how is the time >> component then taken into account? it depends on how you segmented >> your data. FieldTrip is just transforming your preprocessed data, so >> whatever you put in is what you get out. > >> does mtmconvol take all trials of one condition and average the the >> power for each time window over all trials? Or is each trial treated >> seperatly? > depends on whether you specify cfg.keeptrials = 'yes' or 'no' >> >> Say i would use cfg.method=mtmfft do i need to specify a >> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >> always a single taper. Only when combining multiple tapers you can >> effectively smooth in the frequency domain. this is implemented as >> taper='dpss' > >> As i understand hanning if appropriate for lower freuquencies so i >> should use this taper to assess beta frequencies. > this is a rule of thumb, but there is nothing wrong with using > multitapering for lower frequencies. It depends on what you expect > from your data and what you want to achieve. >> >> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? > this depends on the frequencies you are interested in. I wouldn't > trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. > >> >> Thank you a lot for the help > you're welcome, hope this helps >> Best >> Victoria > Likewise, > Jörn > >> >> >> 2014-02-03 09:19 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> is there anything wrong with the code you used below? By smoothing, >>> do you refer to smoothing in the frequency domain? >>> >>> Best, >>> Jörn >>> >>> >>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>> Hello >>>> >>>> I am currently working on a freqanalysis as a first step to do a >>>> connectivityanalysis. I am a bit unsure about the method to use for >>>> the freqanalysis. My stimuli are very long: between 29 and 30 sec. >>>> In total i have 4 stimuli per condition and 2 seperate conditions. I >>>> am looking at the beta range so fairly low frequencies. >>>> >>>> this is my code: >>>> Am i using the right taper and method. Should i smooth the data? >>>> and if so, what should such a smoothing parameter depend on? >>>> >>>> %fourier analysis >>>> cfg=[]; >>>> cfg.output='fourier'; >>>> cfg.method='mtmfft'; >>>> cfg.foi=[12:30]; >>>> cfg.taper='hanning'; >>>> cfg.keeptrials='yes'; >>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>> >>>> >>>> %coherence analysis >>>> cfg=[]; >>>> cfg.method='coh'; >>>> cfg.channelcmb={'B3' 'C15' >>>> 'B3' 'C10' >>>> 'B23' 'C15' >>>> 'B23' 'C10'} >>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>> >>>> >>>> Thank you very much for the suggestions! >>>> Best >>>> Victoria >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From joramvandriel at gmail.com Mon Feb 3 12:19:52 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Mon, 3 Feb 2014 12:19:52 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: <52EF67D2.1050208@donders.ru.nl> References: <52EF4EFF.3010304@donders.ru.nl> <52EF67D2.1050208@donders.ru.nl> Message-ID: Hi Jörn, Hi Joram, > > you probably need to interpolate to a template and then put the pos and > dim field from the template you used in the source structure. With source structure you mean the result from ft_sourcegrandaverage? That already has a pos and dim field. Or the subject individual source structures, *after* ft_sourceinterpolate but *before* ft_volumenormalise? > You do not have to interpolate, but then make sure that the dimensions of > your anatomy match the dimensions of your sourcemodel. > I'm not sure what you mean here. I did for each subject ft_sourceinterpolate and ft_volumenormalise. Shouldn't then ft_sourcegrandaverage give me something that I could plot with ft_sourceplot? Or am I asking too much of FieldTrip right now :) According to the regular beamforming tutorial this should be possible. But I will try the steps from the extended tutorial (and this one might be useful as well: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) and see how far that brings me! Thanks, Joram > > Not sure if you followed any tutorial, but this is a good one: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended > > Best, > Jörn > > > > On 2/3/2014 9:59 AM, Joram van Driel wrote: > >> Hi Jörn, >> Not a stupid question at all, because indeed there isn't. I thought that >> was the problem too; I already tried putting the .anatomy field of one of >> the (normalized) subjects into the grandavg structure, but that resulted in >> a bunch of errors due to an error in the cornerpoints function. >> This is how the grandavg structure looks like after ft_sourcegrandaverage >> (fieldtrip version 20140127): >> >> pos: [7109137x3 double] >> dim: [181 217 181] >> avg: [1x1 struct] >> var: [1x1 struct] >> dimord: 'voxel' >> inside: [1550519x1 double] >> outside: [5558618x1 double] >> df: [7109137x1 double] >> cfg: [1x1 struct] >> >> This my cfg: >> >> grandavg = cell(1,2); >> cfg = []; >> cfg.parameter = 'avg.pow'; >> cfg.keepindividual = 'no'; >> grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % condition >> 1 >> grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % condition >> 2 >> >> Hope you can find out what the problem is..! >> >> Thanks a lot, >> Joram >> >> >> >> On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" < >> jm.horschig at donders.ru.nl > wrote: >> >> Hi Joram, >> >> this might be a stupid question, but is there a >> grandavg{1}.anatomy field at all? >> >> Best, >> Jörn >> >> >> On 1/31/2014 12:44 PM, Joram van Driel wrote: >> >> Hi all, >> >> I'm trying to plot the grand average of a source analysis. >> However no matter what I try, the result of >> ft_sourcegrandaverage keeps giving me only the functional >> data, no anatomy. >> >> My cfg for ft_sourceplot is: >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'no'; >> cfg.funparameter = 'avg.pow'; >> cfg.maskparameter = cfg.funparameter; >> cfg.funcolorlim = [0 0.2]; >> cfg.opacitylim = [0 0.2]; >> cfg.opacitymap = 'rampup'; >> >> ft_sourceplot(cfg,grandavg{1}) >> >> I thus created my own grandaverage, like this (where >> sourceDiffAll{:,:} is a subject-by-condition cell structure): >> >> temp = zeros([length(nsubjects) >> size(sourceDiffAll{1,1}.avg.pow)]); >> for s=1:length(nsubjects) >> temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - >> sourceDiffAll{s,1}.avg.pow; % create condition contrast >> end >> customavg = sourceDiffAll{1,1}; % just copy one subject one >> condition >> customavg.avg.pow = squeeze(mean(temp,1)); % and replace power >> with the grand average power condition-contrast >> >> Now using ft_sourceplot on customavg works just fine. >> Any idea of what's going wrong with ft_sourceplot on >> ft_sourcegrandaverage? >> Thanks! >> >> - Joram >> >> >> -- Joram van Driel, MSc. >> PhD student @ University of Amsterdam >> Brain & Cognition @ Department of Psychology >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Mon Feb 3 13:37:44 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 03 Feb 2014 13:37:44 +0100 Subject: [FieldTrip] missing anatomy in source plot of ft_sourcegrandaverage In-Reply-To: References: <52EF4EFF.3010304@donders.ru.nl> <52EF67D2.1050208@donders.ru.nl> Message-ID: <52EF8D98.5030202@donders.ru.nl> Hi Joram, the (regular) beamforming tutorial is dealing only with the single subject case. The extended sets the stage for averaging over subjects as well. I think all of your questions will be answered when you went through that one. Otherwise, feel free to ask any questions that remain open ;) Best, Jörn On 2/3/2014 12:19 PM, Joram van Driel wrote: > Hi Jörn, > > Hi Joram, > > you probably need to interpolate to a template and then put the > pos and dim field from the template you used in the source structure. > > > With source structure you mean the result from ft_sourcegrandaverage? > That already has a pos and dim field. Or the subject individual source > structures, *after* ft_sourceinterpolate but *before* ft_volumenormalise? > > You do not have to interpolate, but then make sure that the > dimensions of your anatomy match the dimensions of your sourcemodel. > > > I'm not sure what you mean here. I did for each subject > ft_sourceinterpolate and ft_volumenormalise. Shouldn't then > ft_sourcegrandaverage give me something that I could plot with > ft_sourceplot? Or am I asking too much of FieldTrip right now :) > According to the regular beamforming tutorial this should be possible. > > But I will try the steps from the extended tutorial (and this one > might be useful as well: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > and see how far that brings me! > > Thanks, > Joram > > > Not sure if you followed any tutorial, but this is a good one: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended > > Best, > Jörn > > > > On 2/3/2014 9:59 AM, Joram van Driel wrote: > > Hi Jörn, > Not a stupid question at all, because indeed there isn't. I > thought that was the problem too; I already tried putting the > .anatomy field of one of the (normalized) subjects into the > grandavg structure, but that resulted in a bunch of errors due > to an error in the cornerpoints function. > This is how the grandavg structure looks like after > ft_sourcegrandaverage (fieldtrip version 20140127): > > pos: [7109137x3 double] > dim: [181 217 181] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > inside: [1550519x1 double] > outside: [5558618x1 double] > df: [7109137x1 double] > cfg: [1x1 struct] > > This my cfg: > > grandavg = cell(1,2); > cfg = []; > cfg.parameter = 'avg.pow'; > cfg.keepindividual = 'no'; > grandavg{1} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,1}); % > condition 1 > grandavg{2} = ft_sourcegrandaverage(cfg,sourceDiffAll{:,2}); % > condition 2 > > Hope you can find out what the problem is..! > > Thanks a lot, > Joram > > > > On Mon, Feb 3, 2014 at 9:10 AM, "Jörn M. Horschig" > > >> wrote: > > Hi Joram, > > this might be a stupid question, but is there a > grandavg{1}.anatomy field at all? > > Best, > Jörn > > > On 1/31/2014 12:44 PM, Joram van Driel wrote: > > Hi all, > > I'm trying to plot the grand average of a source analysis. > However no matter what I try, the result of > ft_sourcegrandaverage keeps giving me only the functional > data, no anatomy. > > My cfg for ft_sourceplot is: > > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'no'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0 0.2]; > cfg.opacitylim = [0 0.2]; > cfg.opacitymap = 'rampup'; > > ft_sourceplot(cfg,grandavg{1}) > > I thus created my own grandaverage, like this (where > sourceDiffAll{:,:} is a subject-by-condition cell > structure): > > temp = zeros([length(nsubjects) > size(sourceDiffAll{1,1}.avg.pow)]); > for s=1:length(nsubjects) > temp(s,:,:,:) = sourceDiffAll{s,2}.avg.pow - > sourceDiffAll{s,1}.avg.pow; % create condition contrast > end > customavg = sourceDiffAll{1,1}; % just copy one > subject one > condition > customavg.avg.pow = squeeze(mean(temp,1)); % and > replace power > with the grand average power condition-contrast > > Now using ft_sourceplot on customavg works just fine. > Any idea of what's going wrong with ft_sourceplot on > ft_sourcegrandaverage? > Thanks! > > - Joram > > > -- Joram van Driel, MSc. > PhD student @ University of Amsterdam > Brain & Cognition @ Department of Psychology > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > > > > Tel: +31-(0)24-36-68493 > > > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > 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 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Mon Feb 3 13:40:55 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Mon, 03 Feb 2014 13:40:55 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> References: "<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> Message-ID: <52EF8E57.6060207@donders.ru.nl> Hi Victoria, On 2/3/2014 12:14 PM, Victoria Schröder wrote: > Thank Jörn, > > Thank for the advice for the tutorials but i have already looked at > them a lot. > > Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged > power over trials? Well, it might sound obvious, but if you say 'yes' to keep trials, you keep the trials, whereas if you say 'no' you do not keep the trials and instead get an average. > what happens then when the trials do not have the same length? The average will be made with all data that is available. If some trials go to 30s but all trials go to 29s, then the average of the last one second is made of less data then the first 29s. This is a crucial point for doing statistics as the degrees of freedom, signal-to noise ration etc. will be different for different time points. > > and a last question :) > > what does cfg.toi depend on ? in the tutorial time frequency analysis > this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the > case? it depends on what time you are interested in and how much memory (and cpu time aka patience) you got. Good luck ;) Best, Jörn > > I hope this should be it for now > Best > Victoria > > > 2014-02-03 11:42 skrev Jörn M. Horschig: >> Hi Victoria, >> >> you might want to read the relevant part of the walkthrough for your >> questions on mtmconvol and mtmfft: >> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >> >> Then, also doing this tutorial might help in understanding what the >> different methods are doing: >> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >> >> And lastly, to shortly answer your questions, see below ;) >> >> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>> Dear Jörn, >> Hi ;) >> >>> >>> the code works but i dont know whether my data is logical and >>> whether i decided to use the right method etc. >> maybe you should try to get into one of the FieldTrip courses :) This >> might tremendously help you in understanding what's being done and >> why. Otherwise, try to read as much as you can, read methods of papers >> and discuss with your supervisor and colleagues. Of course, on the >> mailing list we also like to help a lot. >>> >>> My trials are pretty long (approx 30 sec but all are not the same >>> length) and i am interested in beta frequency. >>> >>> First, it is not really clear to me whether i should use >>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>> latter calculates the FFT for shorter self-specified time windows to >>> look at changes in power over time. Is that right? yep, about right. >> >>> however, if i have more stimuli for one condition, how is the time >>> component then taken into account? it depends on how you segmented >>> your data. FieldTrip is just transforming your preprocessed data, so >>> whatever you put in is what you get out. >> >>> does mtmconvol take all trials of one condition and average the the >>> power for each time window over all trials? Or is each trial treated >>> seperatly? >> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>> >>> Say i would use cfg.method=mtmfft do i need to specify a >>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >>> always a single taper. Only when combining multiple tapers you can >>> effectively smooth in the frequency domain. this is implemented as >>> taper='dpss' >> >>> As i understand hanning if appropriate for lower freuquencies so i >>> should use this taper to assess beta frequencies. >> this is a rule of thumb, but there is nothing wrong with using >> multitapering for lower frequencies. It depends on what you expect >> from your data and what you want to achieve. >>> >>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >> this depends on the frequencies you are interested in. I wouldn't >> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >> >>> >>> Thank you a lot for the help >> you're welcome, hope this helps >>> Best >>> Victoria >> Likewise, >> Jörn >> >>> >>> >>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>> Hi Victoria, >>>> >>>> is there anything wrong with the code you used below? By smoothing, >>>> do you refer to smoothing in the frequency domain? >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>> Hello >>>>> >>>>> I am currently working on a freqanalysis as a first step to do a >>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>> for the freqanalysis. My stimuli are very long: between 29 and 30 >>>>> sec. In total i have 4 stimuli per condition and 2 seperate >>>>> conditions. I am looking at the beta range so fairly low frequencies. >>>>> >>>>> this is my code: >>>>> Am i using the right taper and method. Should i smooth the data? >>>>> and if so, what should such a smoothing parameter depend on? >>>>> >>>>> %fourier analysis >>>>> cfg=[]; >>>>> cfg.output='fourier'; >>>>> cfg.method='mtmfft'; >>>>> cfg.foi=[12:30]; >>>>> cfg.taper='hanning'; >>>>> cfg.keeptrials='yes'; >>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>> >>>>> >>>>> %coherence analysis >>>>> cfg=[]; >>>>> cfg.method='coh'; >>>>> cfg.channelcmb={'B3' 'C15' >>>>> 'B3' 'C10' >>>>> 'B23' 'C15' >>>>> 'B23' 'C10'} >>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>> >>>>> >>>>> Thank you very much for the suggestions! >>>>> Best >>>>> Victoria >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jkhartshorne at gmail.com Mon Feb 3 22:19:41 2014 From: jkhartshorne at gmail.com (Joshua Hartshorne) Date: Mon, 3 Feb 2014 16:19:41 -0500 Subject: [FieldTrip] Interactions Message-ID: Hi Eric, I tried the simulations as you suggested. Rather I simulated several different types of 2X2 datasets. For all of them, permutation analysis worked just fine. Of course, it's possible that I'm doing something wrong, so I'd appreciate your feedback. Here's how I created the data: *between/between*. Normally-distributed data in each of 4 cells. The effect size for e1 and e2 were each set to 1, with a SD of 1. The interaction (if present) was .75 with an SD of 1. There were 40 subjects per cell. *within/within. *For each participant, I generated a random intercept (M=0, SD=.25) and random slopes for both e1 and e2 (M=1, SD=.25) and for the interaction, if present (M=.75, SD=.25). Having generated that, for each participant in each condition, I drew a single sample where the mean was the sum of the effects just listed and the SD=1. *within/between. *The first factor was within subjects and the second was between. Each subject had a random intercept (SD=.25) and a random slope for factor 1 (M=1, SD=.25). The subjects in Level 1 for both factors had a random intercept (M=.75, SD=.25). The between-subject factor was 1. As above, I then generated a single datapoint from a normal distribution (M=1, SD=1). In each case, I ran 500 simulations with an interaction and 500 without. For each, I analyzed either with an ANOVA (ezANOVA in R) or a 500-sample permutation test, as follows: Permutations respected the structure of the data. So in the between/between case, condition labels were permuted freely. In the within/within case, for each subject, I randomly flipped the levels of each factor, preserving structure. That is, each subject had two cells where factor 1 was 0 and two where factor 1 was 1. If the codes switched, both the 1s were turned to 0s and both the 0s were turned to 1s. The same was done for Factor 2. I dealt with the within/between data in an analogous fashion, with the constraint that the same number of subjects be in the each of the between-subject conditions. Having done my permuting, I then calculated the F-stat for the interaction. I then compared the actual F-stat against the resulting distribution. The short description of the result is I got basically the same results for the permutation tests and the ANOVA. For instance, in the within/within case, when there was an actual interaction in the generative model, I got an average p-value of .0844 using ezANOVA and .0858 using permutations. The Type II error was .318 and .312, respectively. When there was no interaction, I got average p-values of .5052 and .5066, respectively, and a Type I error of .036 and .038, respectively. I got analogous results for between/between and within/within. Incidentally, I understand that it isn't strictly necessary to permute condition codes for both factors. But it doesn't seem to do any harm, either. I actually tried the within/between case permuting only the between factor, with similar results. Thanks, Josh On Sun, Jan 26, 2014 at 4:44 AM, wrote: > Hi Steve and Josh, > > > Josh writes > > > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > > and it would be great to see it. > > In general, questions like these are very hard to answer satisfactorily on > a > discussion list. It is dealt with much more easily in person, say at one of > the Fieldtrip courses. However, let me give it a try. > > To prove that something does not work it suffices to produces a single > example that shows the contrary. > > Try the following: > > Generate random data in a 2-by-2 between-subjects design (say, normally > distributed within every cell). Add large main effects (relative to the > within-cell variance; say, MS_beween 50 times larger than MS_within) and no > interaction effect. Take a small number of subjects (say, 5 per cell). Now, > calculate a permutation p-value for the interaction-effect F-statistic by > permuting across all 4 cells. Do this for a large number of simulated data > set. My prediction is that, on average, the F-statistic p-value is less > than > 0.05, which it should be (because there is no interaction effect). > > I have not run this simulation study myself. Let me know if it does not > produce the predicted result. (I cannot guarantee that I'm not missing > something when producing this recipe.) > > > > Best, > > Eric > > > > > > > > -----Original Message----- > > From: Stephen Politzer-Ahles [mailto:politzerahless at gmail.com] > > Sent: zondag 26 januari 2014 8:25 > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] interactions > > > > Hi Josh, > > > > Have you seen this [admittedly pretty old now] message from the > > archives: http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > > January/003447.html > > ? My understanding was that it is ok to test interactions in within- > > subjects designs, and that you could do it by faking a dataset that > > represents the interaction (step 3 in that message) and then doing a > > dependent samples t-test. I had never heard before that interactions > > can't be tested in a within-subjects design, but also it's been a long > > time since I've looked at this issue--I'd definitely be interested to > > hear if this is no longer the recommended way to test interactions. I > > have seen messages saying that it doesn't work for between-subjects > > designs (e.g. > > http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > > September/004244.html), > > but I'm not sure if that's still current. Hopefully someone on the list > > can offer more insight about the second question. > > > > Best, > > Steve > > > > > > > > Message: 2 > > > Date: Fri, 24 Jan 2014 10:54:10 -0500 > > > From: Joshua Hartshorne > > > To: fieldtrip at science.ru.nl > > > Subject: [FieldTrip] interactions > > > Message-ID: > > > > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > > > Hi List! > > > > > > I have seen around a dozen comments in the archives that interactions > > > can't be tested by permutation for within-subject designs. I haven't > > > been able to find a thread that explains why not. It seems like in a > > > 2x2 design, you could still pick one of the conditions and permute > > the > > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > > and it would be great to see it. > > > > > > Similarly, for the mixed design, why permute the between-subject > > labels? > > > Why not permute the within-subject labels instead? Actually, why not > > > do both? I follow the reasoning why permuting both is overkill, but > > > not why it's wrong. > > > > > > If someone could explain, it would be much appreciated. Knowing what > > > to do is good, but it would be even better to understand why. > > > > > > Thanks, > > > Josh > > > -------------- next part -------------- An HTML attachment was > > > scrubbed... > > > URL: > > > > > > b885cb4a/attachment-0001.html> > > > > > > > ------------------------------ > > Message: 2 > Date: Sun, 26 Jan 2014 10:43:58 +0100 > From: Azeez Adebimpe > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group > level > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi Chaitanya , > I would suggest you try analyitcs instead of montecarlo and use stat= > ft_sourcestatitics(cfg, source1a, source2a .................., > source1b,source2b.............);a and b are for the conditions. > Azeez Adebimpe > > > Date: Sun, 26 Jan 2014 09:46:03 +0100 > From: chaitanya.pro at gmail.com > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level > > Hi Eelke, > > No significant results then in my data. I wonder how my boss takes it :P. > Anyway, thanks for your help on a Sunday that too. > >From your reply I also understand that the code doesn't have any mistakes > :) > > =============================================== > > > > Best RegardsChaitanya Srinivas Lanka > > > Wiss. Mitarbeiter PhD Student > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > Eberhard Karls University Eberhard Karls > University > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > D-72076 Tuebingen D-72074 Tuebingen > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > On Sun, Jan 26, 2014 at 9:40 AM, Eelke Spaak > wrote: > > Hi Chaitanya, > stat.prob reflects the 'p-values' resulting from your statistical test. So > voxels expressing e.g. stat.prob < 0.05 should be considered reflecting a > significant difference between conditions. The NaNs correspond to voxels > outside the brain. > > > Since stat.mask is all zeros (which by default is just stat.prob < 0.05), > this indicates there are no significant differences between your > conditions. There is nothing we can help you with in this respect :) > > > Best,Eelke > > On 26 January 2014 09:06, Chaitanya Srinivas > wrote: > > > Hi Eelke, > > I looked at the stat.stat values if that is what you mean. There > are some NaNs , but also some values. Similarly in stat.prob, there are > some 1's. The stat.mask is all zeros as you say. > > > > > Any further suggestions from you? > Thank you > > =============================================== > > > > Best RegardsChaitanya Srinivas Lanka > > > > > Wiss. Mitarbeiter PhD Student > > > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > > > Eberhard Karls University Eberhard Karls > University > > > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > > > D-72076 Tuebingen D-72074 Tuebingen > > > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > > > On Sun, Jan 26, 2014 at 8:53 AM, Eelke Spaak > wrote: > > > > Dear Chaitanya, > Perhaps an obvious question: do you find any significant differences in > the statistics step (inspect the stat structure)? If not, the mask will > consist of all zeroes, hence giving you a 'blank' plot. > > > > > Best,Eelke > > On 26 January 2014 08:46, Chaitanya Srinivas > wrote: > > > > > Dear fieldtrip users, > I would like to do sourcestatistics on a group level with eeg data. I have > a > pre and post intervention measurement for each of my 10 subjects > . After source reconstruction using an DICS beamformer > and volume normalization, I calculated the sourcegrandaverage for the pre > and > post condition and i have avg.pow for each subject. > > However, when I use the grandaverage results in ft_sourcestatistics in the > configuration shown below and plot the result I just get a blank anatomical > mri. It only runs with cfg.parameter="pow" .I tried with cfg.parameter = > 'avg.pow' it doesnt run. > Do I have to set any additional parameters or am I making some mistake? > > > cfg=[]; > cfg.dim = grandAVGsourcePre.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > > nsubj=length(sourcePre.trial); > cfg.design(1,:) = [1:nsubj 1:nsubj]; > cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; > cfg.uvar = 1; > cfg.ivar = 2; > stat = ft_sourcestatistics(cfg, grandAVGsourcePre, grandAVGsourcePost); > and next interpolation > > cfg = []; > > > > > > cfg.voxelcoord = 'no'; > cfg.parameter = 'mask'; > cfg.interpmethod = 'nearest'; > cfg.coordsys = 'mni'; > > > > > > mask = > ft_sourceinterpolate(cfg,stat,mri); > statplot.mask = mask.mask; > > > and then for plotting > > > > > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'stat'; > cfg.maskparameter = 'mask'; > cfg.funcolorlim = [-0.1 0.1]; > cfg.opacitylim = [-0.1 0.1]; > figure > ft_sourceplot(cfg, statplot); > > > > > > > > > > > > > > > > > > > > =============================================== > > > > > > > > Best RegardsChaitanya Srinivas Lanka > > Wiss. Mitarbeiter PhD Student > > > > > > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for > Neuroscience > > > > > > Eberhard Karls University Eberhard Karls > University > > > > > > Otfried-Mueller-Str.45 ?sterbergstr. 3 > > > > > > D-72076 Tuebingen D-72074 Tuebingen > > > > > > Mobile Phone Number : +49-176-79035731 > =============================================== > > > > > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140126/9c7c30c0/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: image.png > Type: image/png > Size: 23195 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140126/9c7c30c0/attachment.png > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 38, Issue 49 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa.filevich at gmail.com Tue Feb 4 10:36:56 2014 From: elisa.filevich at gmail.com (elisa filevich) Date: Tue, 4 Feb 2014 10:36:56 +0100 Subject: [FieldTrip] FFT on a single concatenate trial Message-ID: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Dear all, I'm doing frequency tagging on relatively short epochs. My frequency components are clearly there, but the signal-to-noise ratio is very low. In order to improve SNR, I want to try to concatenate the individual trials (with the appropriate epoch length to keep the frequency constant). I simply concatenated all trial and timepoints vectors into a single trial structure, and I now have may data in a structure that has the following fields: appended = label: {1x22 cell} fsample: 512 elec: [1x1 struct] trial: [22x157990 single] time: [1x157990 double] I then run the FFT below, and I get the following error: error('the data does not contain a dimord, but it also does not resemble raw or component data'); Is it possible to run FFT on a single trial? Is there a way to work around this? Best Elisa cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 5:.5:35; cfg.keeptrials = 'no'; FFThann = ft_freqanalysis(cfg, epoched); -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Feb 4 10:44:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 4 Feb 2014 10:44:34 +0100 Subject: [FieldTrip] FFT on a single concatenate trial In-Reply-To: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> References: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Message-ID: Dear Elisa, Raw data is represented with time axes and trials in a cell array (one element per trial), so if you do appended.trial = {appended.trial}; appended.time = {appended.time}; it should work. Best, Eelke On 4 February 2014 10:36, elisa filevich wrote: > Dear all, > > I'm doing frequency tagging on relatively short epochs. My frequency > components are clearly there, but the signal-to-noise ratio is very low. In > order to improve SNR, I want to try to concatenate the individual trials > (with the appropriate epoch length to keep the frequency constant). > > I simply concatenated all trial and timepoints vectors into a single trial > structure, and I now have may data in a structure that has the following > fields: > > > appended = > > label: {1x22 cell} > fsample: 512 > elec: [1x1 struct] > trial: [22x157990 single] > time: [1x157990 double] > > > I then run the FFT below, and I get the following error: > > error('the data does not contain a dimord, but it also does not resemble > raw or component data'); > > Is it possible to run FFT on a single trial? Is there a way to work around > this? > > Best > Elisa > > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'all'; > cfg.method = 'mtmfft'; > cfg.taper = 'hanning'; > cfg.foi = 5:.5:35; > cfg.keeptrials = 'no'; > FFThann = ft_freqanalysis(cfg, epoched); > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From elisa.filevich at gmail.com Tue Feb 4 11:01:29 2014 From: elisa.filevich at gmail.com (elisa filevich) Date: Tue, 4 Feb 2014 11:01:29 +0100 Subject: [FieldTrip] FFT on a single concatenate trial In-Reply-To: References: <1DFB1476-F3E1-4640-BEAB-3127864B47CB@gmail.com> Message-ID: <2221B484-313D-4870-ACD3-28A8FDE2BDD1@gmail.com> It did work, many thanks! On Feb 4, 2014, at 10:44 AM, Eelke Spaak wrote: > Dear Elisa, > > Raw data is represented with time axes and trials in a cell array (one > element per trial), so if you do > > appended.trial = {appended.trial}; > appended.time = {appended.time}; > > it should work. > > Best, > Eelke > > On 4 February 2014 10:36, elisa filevich wrote: >> Dear all, >> >> I'm doing frequency tagging on relatively short epochs. My frequency >> components are clearly there, but the signal-to-noise ratio is very low. In >> order to improve SNR, I want to try to concatenate the individual trials >> (with the appropriate epoch length to keep the frequency constant). >> >> I simply concatenated all trial and timepoints vectors into a single trial >> structure, and I now have may data in a structure that has the following >> fields: >> >> >> appended = >> >> label: {1x22 cell} >> fsample: 512 >> elec: [1x1 struct] >> trial: [22x157990 single] >> time: [1x157990 double] >> >> >> I then run the FFT below, and I get the following error: >> >> error('the data does not contain a dimord, but it also does not resemble >> raw or component data'); >> >> Is it possible to run FFT on a single trial? Is there a way to work around >> this? >> >> Best >> Elisa >> >> >> cfg = []; >> cfg.output = 'pow'; >> cfg.channel = 'all'; >> cfg.method = 'mtmfft'; >> cfg.taper = 'hanning'; >> cfg.foi = 5:.5:35; >> cfg.keeptrials = 'no'; >> FFThann = ft_freqanalysis(cfg, epoched); >> >> >> >> _______________________________________________ >> 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 Feb 4 12:16:34 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 4 Feb 2014 12:16:34 +0100 (CET) Subject: [FieldTrip] Interactions In-Reply-To: References: Message-ID: <004e01cf219a$8eb3ec30$ac1bc490$@maris@psych.ru.nl> Hi Josh, You may have found something that is worth exploring. However, it will be challenge to provide a formal proof of the fact that the permutation analysis provides false alarm rate control under the null hypothesis of no interaction effect. The crucial design here is the full between-subjects design, because for the other designs a valid permutation analysis exists (as demonstrated by formal proof). I would embark on a testing-the-limits simulation study: between/between. Normally-distributed data in each of 4 cells. The effect size for e1 and e2 were each set to 1, with a SD of 1. The interaction (if present) was .75 with an SD of 1. There were 40 subjects per cell. Set the effect sizes to 20, reduce the number of subjects to 5 per cell, and simulate data without an interaction effect. I'm curious how the simulated false alarm rate of the permutation test looks like. (After this email, I will not continue this discussion any further. It is becoming a scientific project; interesting though .) Best, Eric within/within. For each participant, I generated a random intercept (M=0, SD=.25) and random slopes for both e1 and e2 (M=1, SD=.25) and for the interaction, if present (M=.75, SD=.25). Having generated that, for each participant in each condition, I drew a single sample where the mean was the sum of the effects just listed and the SD=1. within/between. The first factor was within subjects and the second was between. Each subject had a random intercept (SD=.25) and a random slope for factor 1 (M=1, SD=.25). The subjects in Level 1 for both factors had a random intercept (M=.75, SD=.25). The between-subject factor was 1. As above, I then generated a single datapoint from a normal distribution (M=1, SD=1). In each case, I ran 500 simulations with an interaction and 500 without. For each, I analyzed either with an ANOVA (ezANOVA in R) or a 500-sample permutation test, as follows: Permutations respected the structure of the data. So in the between/between case, condition labels were permuted freely. In the within/within case, for each subject, I randomly flipped the levels of each factor, preserving structure. That is, each subject had two cells where factor 1 was 0 and two where factor 1 was 1. If the codes switched, both the 1s were turned to 0s and both the 0s were turned to 1s. The same was done for Factor 2. I dealt with the within/between data in an analogous fashion, with the constraint that the same number of subjects be in the each of the between-subject conditions. Having done my permuting, I then calculated the F-stat for the interaction. I then compared the actual F-stat against the resulting distribution. The short description of the result is I got basically the same results for the permutation tests and the ANOVA. For instance, in the within/within case, when there was an actual interaction in the generative model, I got an average p-value of .0844 using ezANOVA and .0858 using permutations. The Type II error was .318 and .312, respectively. When there was no interaction, I got average p-values of .5052 and .5066, respectively, and a Type I error of .036 and .038, respectively. I got analogous results for between/between and within/within. Incidentally, I understand that it isn't strictly necessary to permute condition codes for both factors. But it doesn't seem to do any harm, either. I actually tried the within/between case permuting only the between factor, with similar results. Thanks, Josh On Sun, Jan 26, 2014 at 4:44 AM, wrote: Hi Steve and Josh, Josh writes > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > and it would be great to see it. In general, questions like these are very hard to answer satisfactorily on a discussion list. It is dealt with much more easily in person, say at one of the Fieldtrip courses. However, let me give it a try. To prove that something does not work it suffices to produces a single example that shows the contrary. Try the following: Generate random data in a 2-by-2 between-subjects design (say, normally distributed within every cell). Add large main effects (relative to the within-cell variance; say, MS_beween 50 times larger than MS_within) and no interaction effect. Take a small number of subjects (say, 5 per cell). Now, calculate a permutation p-value for the interaction-effect F-statistic by permuting across all 4 cells. Do this for a large number of simulated data set. My prediction is that, on average, the F-statistic p-value is less than 0.05, which it should be (because there is no interaction effect). I have not run this simulation study myself. Let me know if it does not produce the predicted result. (I cannot guarantee that I'm not missing something when producing this recipe.) Best, Eric > -----Original Message----- > From: Stephen Politzer-Ahles [mailto:politzerahless at gmail.com] > Sent: zondag 26 januari 2014 8:25 > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] interactions > > Hi Josh, > > Have you seen this [admittedly pretty old now] message from the > archives: http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > January/003447.html > ? My understanding was that it is ok to test interactions in within- > subjects designs, and that you could do it by faking a dataset that > represents the interaction (step 3 in that message) and then doing a > dependent samples t-test. I had never heard before that interactions > can't be tested in a within-subjects design, but also it's been a long > time since I've looked at this issue--I'd definitely be interested to > hear if this is no longer the recommended way to test interactions. I > have seen messages saying that it doesn't work for between-subjects > designs (e.g. > http://mailman.science.ru.nl/pipermail/fieldtrip/2011- > September/004244.html), > but I'm not sure if that's still current. Hopefully someone on the list > can offer more insight about the second question. > > Best, > Steve > > > > > Message: 2 > > Date: Fri, 24 Jan 2014 10:54:10 -0500 > > From: Joshua Hartshorne > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] interactions > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi List! > > > > I have seen around a dozen comments in the archives that interactions > > can't be tested by permutation for within-subject designs. I haven't > > been able to find a thread that explains why not. It seems like in a > > 2x2 design, you could still pick one of the conditions and permute > the > > labels. I'm sure there's a proof somewhere for why this doesn't work, > > and it would be great to see it. > > > > Similarly, for the mixed design, why permute the between-subject > labels? > > Why not permute the within-subject labels instead? Actually, why not > > do both? I follow the reasoning why permuting both is overkill, but > > not why it's wrong. > > > > If someone could explain, it would be much appreciated. Knowing what > > to do is good, but it would be even better to understand why. > > > > Thanks, > > Josh > > -------------- next part -------------- An HTML attachment was > > scrubbed... > > URL: > > > b885cb4a/attachment-0001.html> > > ------------------------------ Message: 2 Date: Sun, 26 Jan 2014 10:43:58 +0100 From: Azeez Adebimpe To: FieldTrip discussion list Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Chaitanya , I would suggest you try analyitcs instead of montecarlo and use stat= ft_sourcestatitics(cfg, source1a, source2a .................., source1b,source2b.............);a and b are for the conditions. Azeez Adebimpe Date: Sun, 26 Jan 2014 09:46:03 +0100 From: chaitanya.pro at gmail.com To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Urgent: Error in Source Statistics, Group level Hi Eelke, No significant results then in my data. I wonder how my boss takes it :P. Anyway, thanks for your help on a Sunday that too. >From your reply I also understand that the code doesn't have any mistakes :) =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== On Sun, Jan 26, 2014 at 9:40 AM, Eelke Spaak wrote: Hi Chaitanya, stat.prob reflects the 'p-values' resulting from your statistical test. So voxels expressing e.g. stat.prob < 0.05 should be considered reflecting a significant difference between conditions. The NaNs correspond to voxels outside the brain. Since stat.mask is all zeros (which by default is just stat.prob < 0.05), this indicates there are no significant differences between your conditions. There is nothing we can help you with in this respect :) Best,Eelke On 26 January 2014 09:06, Chaitanya Srinivas wrote: Hi Eelke, I looked at the stat.stat values if that is what you mean. There are some NaNs , but also some values. Similarly in stat.prob, there are some 1's. The stat.mask is all zeros as you say. Any further suggestions from you? Thank you =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== On Sun, Jan 26, 2014 at 8:53 AM, Eelke Spaak wrote: Dear Chaitanya, Perhaps an obvious question: do you find any significant differences in the statistics step (inspect the stat structure)? If not, the mask will consist of all zeroes, hence giving you a 'blank' plot. Best,Eelke On 26 January 2014 08:46, Chaitanya Srinivas wrote: Dear fieldtrip users, I would like to do sourcestatistics on a group level with eeg data. I have a pre and post intervention measurement for each of my 10 subjects . After source reconstruction using an DICS beamformer and volume normalization, I calculated the sourcegrandaverage for the pre and post condition and i have avg.pow for each subject. However, when I use the grandaverage results in ft_sourcestatistics in the configuration shown below and plot the result I just get a blank anatomical mri. It only runs with cfg.parameter="pow" .I tried with cfg.parameter = 'avg.pow' it doesnt run. Do I have to set any additional parameters or am I making some mistake? cfg=[]; cfg.dim = grandAVGsourcePre.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; nsubj=length(sourcePre.trial); cfg.design(1,:) = [1:nsubj 1:nsubj]; cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; cfg.uvar = 1; cfg.ivar = 2; stat = ft_sourcestatistics(cfg, grandAVGsourcePre, grandAVGsourcePost); and next interpolation cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'mask'; cfg.interpmethod = 'nearest'; cfg.coordsys = 'mni'; mask = ft_sourceinterpolate(cfg,stat,mri); statplot.mask = mask.mask; and then for plotting cfg = []; cfg.method = 'slice'; cfg.funparameter = 'stat'; cfg.maskparameter = 'mask'; cfg.funcolorlim = [-0.1 0.1]; cfg.opacitylim = [-0.1 0.1]; figure ft_sourceplot(cfg, statplot); =============================================== Best RegardsChaitanya Srinivas Lanka Wiss. Mitarbeiter PhD Student Functional and Restorative Neurosurgery Neural Information Processing Neurosurgical University Hospital Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University Otfried-Mueller-Str.45 ?sterbergstr. 3 D-72076 Tuebingen D-72074 Tuebingen Mobile Phone Number : +49-176-79035731 =============================================== _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 38, Issue 49 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Tue Feb 4 14:52:58 2014 From: barbara.schorr at uni-ulm.de (Barbara Schorr) Date: Tue, 04 Feb 2014 14:52:58 +0100 Subject: [FieldTrip] Plotting fieldtrip porcessed data with EMEGS Message-ID: <52F0F0B9.8020102@uni-ulm.de> Dear Fieldtripers, I would like to make graphics (topoplots) of ERP data I processed in fieldtrip. For first visualization I usually just use ft_topoplotTFR. Now I want to try EMEGS and the implemented 3D plots. I am not sure how to import my timelocked data into EMEGS. Can anybody help? I also asked the EMEGS developers for help, but I thought I also try it here, because maybe someone else already did this. I hope I was clear enough, and I would appreciate any help. Best regards, Barbara Schorr -- Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm Therapiezentrum Burgau Kapuzinerstraße 34 89331 Burgau From julian.keil at gmail.com Tue Feb 4 16:07:05 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 4 Feb 2014 16:07:05 +0100 Subject: [FieldTrip] Plotting fieldtrip porcessed data with EMEGS In-Reply-To: <52F0F0B9.8020102@uni-ulm.de> References: <52F0F0B9.8020102@uni-ulm.de> Message-ID: Dear Barbara, as far as I remember, the easies way to interact with EMEGS is using ASCII-Files, which you then convert to their own SCADS format. I'm pretty sure there is a function for this (ascii2scads.m or something). So the way to go - as long as it's just for visualization - would be: * Export your Grand Average (.avg field in your ERP data) as ASCII with rows for channels and colums for time points. * Convert ASCII files to SCADS * Load SCADS to EMEGS Note, that you need a 3d Sensor position file in order to plot the EMEGS data. Good Luck, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 04.02.2014 um 14:52 schrieb Barbara Schorr: > Dear Fieldtripers, > > I would like to make graphics (topoplots) of ERP data I processed in fieldtrip. For first visualization I usually just use ft_topoplotTFR. Now I want to try EMEGS and the implemented 3D plots. > I am not sure how to import my timelocked data into EMEGS. Can anybody help? I also asked the EMEGS developers for help, but I thought I also try it here, because maybe someone else already did this. > I hope I was clear enough, and I would appreciate any help. > > Best regards, > Barbara Schorr > > > -- > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > Therapiezentrum Burgau > Kapuzinerstraße 34 > 89331 Burgau > > _______________________________________________ > 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 ivano_triggiani at yahoo.it Tue Feb 4 18:01:07 2014 From: ivano_triggiani at yahoo.it (Ivano Triggiani) Date: Tue, 4 Feb 2014 17:01:07 +0000 (GMT) Subject: [FieldTrip] Still about channel repair Message-ID: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> Hi Fieldtrippers, I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: cfg                = []; replace_channels   = ft_channelselection('gui',hdr.label); cfg.badchannel     = replace_channels; cfg.layout         = 'EEG_layout.lay'; cfg.method         = 'triangulation'; cfg.elecfile       = 'EEG_cap.sfp'; cfg.neighbours     = neighbours; cfg.trials         = 'all'; elec.label         = hdr.label; data.elec          = ft_prepare_layout(cfg); repaired_data      = ft_channelrepair(cfg,rawdataout);   but it returns: ??? Error using ==> ft_channelrepair at 92 the data should contain either an electrode or a gradiometer definition I cannot find into documentation what it means. I guess I have to specify the kind of measurement (EEG/MEG), but where? Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? Thanks a lot, Ivano ------------------------------------------------------------------------ "No man can wear one face to himself and another to the multitude, without finally getting bewildered as to which one is true." Nathaniel Hawthorne -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 4 18:08:37 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 4 Feb 2014 18:08:37 +0100 Subject: [FieldTrip] Still about channel repair In-Reply-To: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> References: <1391533267.13847.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62@donders.ru.nl> Hi Ivano, Please have a look at the link attached. http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > Hi Fieldtrippers, > > I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: > cfg = []; > replace_channels = ft_channelselection('gui',hdr.label); > cfg.badchannel = replace_channels; > cfg.layout = 'EEG_layout.lay'; > cfg.method = 'triangulation'; > cfg.elecfile = 'EEG_cap.sfp'; > cfg.neighbours = neighbours; > cfg.trials = 'all'; > elec.label = hdr.label; > data.elec = ft_prepare_layout(cfg); > repaired_data = ft_channelrepair(cfg,rawdataout); > > but it returns: > ??? Error using ==> ft_channelrepair at 92 > the data should contain either an electrode or a gradiometer definition > > I cannot find into documentation what it means. > I guess I have to specify the kind of measurement (EEG/MEG), but where? > Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? > > Thanks a lot, > > Ivano > ------------------------------------------------------------------------ > > > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkhartshorne at gmail.com Tue Feb 4 20:32:38 2014 From: jkhartshorne at gmail.com (Joshua Hartshorne) Date: Tue, 4 Feb 2014 14:32:38 -0500 Subject: [FieldTrip] Interactions In-Reply-To: <4CD13553-340E-4104-B84E-CE018C4AB241@gmail.com> References: <52f0cc13.48d30e0a.1197.ffff8e6bSMTPIN_ADDED_BROKEN@mx.google.com> <4CD13553-340E-4104-B84E-CE018C4AB241@gmail.com> Message-ID: Hi Eric, I tried effect sizes of 20 and 4 subjects per condition. With 200 iterations, the false alarm rate was *lower* for permutations (.02) than for a standard ANOVA (.025). For good measure, I also tried with effect sizes of 10, with the same result (.02 vs. .03). I still don't see what the problem would be. I always understood that the main thing permutation tests need is exchangeability, and it doesn't get much more exchangeable than in a between/between design. I'm reading the original work now, though, so maybe I'll discover something. Josh On Tue, Feb 4, 2014 at 6:16 AM, Eric Maris wrote: > Hi Josh, > > > > You may have found something that is worth exploring. However, it will be > challenge to provide a formal proof of the fact that the permutation > analysis provides false alarm rate control under the null hypothesis of no > interaction effect. The crucial design here is the full between-subjects > design, because for the other designs a valid permutation analysis exists > (as demonstrated by formal proof). > > > > I would embark on a testing-the-limits simulation study: > > > > *between/between*. Normally-distributed data in each of 4 cells. The > effect size for e1 and e2 were each set to 1, with a SD of 1. The > interaction (if present) was .75 with an SD of 1. There were 40 subjects > per cell. > > > > Set the effect sizes to 20, reduce the number of subjects to 5 per cell, > and simulate data without an interaction effect. I'm curious how the > simulated false alarm rate of the permutation test looks like. > > > > (After this email, I will not continue this discussion any further. It is > becoming a scientific project; interesting though ...) > > > > Best, > > > > Eric > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivano_triggiani at yahoo.it Wed Feb 5 10:25:44 2014 From: ivano_triggiani at yahoo.it (Ivano Triggiani) Date: Wed, 5 Feb 2014 09:25:44 +0000 (GMT) Subject: [FieldTrip] Still about channel repair (jan-mathijs schoffelen) In-Reply-To: References: Message-ID: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> Dear Jan-Mathijs, Thanks a lot for you quick answer, but I can assure you that I read every document before sending any boring message to community :-D . I prepared that electrodes position file (although it is not so clear how to prepare channels position file!), but I don't understand where it has to be declared... I searched for some template scripts but nothing seems to help. My problem seems easy. I have a bad channel (P3 referred to AFz, from standard 10-10 System), and I want to 'repair' it...  Ivano   ------------------------------------------------------------------------ "No man can wear one face to himself and another to the multitude, without finally getting bewildered as to which one is true." Nathaniel Hawthorne ------------------------------ Message: 4 Date: Tue, 4 Feb 2014 18:08:37 +0100 From: jan-mathijs schoffelen To: Fieldtrip List Subject: Re: [FieldTrip] Still about channel repair Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62 at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Ivano, Please have a look at the link attached. http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described Best, Jan-Mathijs On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > Hi Fieldtrippers, > > I read many answers about problems on channel repair, but still something miss me to understand hot to fix a channel. I tried with: > cfg                = []; > replace_channels  = ft_channelselection('gui',hdr.label); > cfg.badchannel    = replace_channels; > cfg.layout        = 'EEG_layout.lay'; > cfg.method        = 'triangulation'; > cfg.elecfile      = 'EEG_cap.sfp'; > cfg.neighbours    = neighbours; > cfg.trials        = 'all'; > elec.label        = hdr.label; > data.elec          = ft_prepare_layout(cfg); > repaired_data      = ft_channelrepair(cfg,rawdataout); >  > but it returns: > ??? Error using ==> ft_channelrepair at 92 > the data should contain either an electrode or a gradiometer definition > > I cannot find into documentation what it means. > I guess I have to specify the kind of measurement (EEG/MEG), but where? > Furthermore I read the docs about electrode position , channel position and so on, but can we get some example? > > Thanks a lot, > > Ivano > ------------------------------------------------------------------------ > > > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From victorias at dsv.su.se Wed Feb 5 12:40:56 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Wed, 05 Feb 2014 12:40:56 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52EF8E57.6060207@donders.ru.nl> References: "\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: Dear Jörn, I still am dealing with finding the right cfg.toi when doing a time frequency analysis. Depending on the time resolution i get NaN values in the first matrixes in the resulting powspctrm and crsspctrm. It seems that for the first times selected there is no data. If i choose a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start below 1 i get Nan values. This is my code for the analysis. I would appreciate some concrete advice and suggestions why i run into this problem. % time-frequency analysis cfg = []; cfg.output = 'powandcsd'; % different for convol than for fft cfg.channel={'C15' 'C10' 'B23' 'B3'}; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.trials=data_clean.trialinfo(:,1) < 20; cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' 'B13' 'D31' 'B11'}; cfg.channelcmb={'C29' 'D23' 'C29' 'D31' 'C29' 'D29' 'C31' 'D23' 'C31' 'D31' 'C31' 'D29' 'C26' 'D23' 'C26' 'D31' 'C26' 'D29' 'C16' 'B26' 'C16' 'B11' 'C16' 'B13' 'C13' 'B26' 'C13' 'B11' 'C13' 'B13' 'C9' 'B26' 'C9' 'B11' 'C9' 'B13'} ; cfg.foi = 12:2:30; % 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:0.05:1; freq_convol = ft_freqanalysis(cfg, data_clean); Thank you a lot Victoria 2014-02-03 13:40 skrev Jörn M. Horschig: > Hi Victoria, > > On 2/3/2014 12:14 PM, Victoria Schröder wrote: >> Thank Jörn, >> >> Thank for the advice for the tutorials but i have already looked at >> them a lot. >> >> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >> averaged power over trials? Well, it might sound obvious, but if you >> say 'yes' to keep trials, you keep the trials, whereas if you say 'no' >> you do not keep the trials and instead get an average. > >> what happens then when the trials do not have the same length? > The average will be made with all data that is available. If some > trials go to 30s but all trials go to 29s, then the average of the > last one second is made of less data then the first 29s. This is a > crucial point for doing statistics as the degrees of freedom, > signal-to noise ration etc. will be different for different time > points. > >> >> and a last question :) >> >> what does cfg.toi depend on ? in the tutorial time frequency >> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is >> that the case? > it depends on what time you are interested in and how much memory > (and cpu time aka patience) you got. > > Good luck ;) > Best, > Jörn > >> >> I hope this should be it for now >> Best >> Victoria >> >> >> 2014-02-03 11:42 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> you might want to read the relevant part of the walkthrough for >>> your >>> questions on mtmconvol and mtmfft: >>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>> >>> Then, also doing this tutorial might help in understanding what the >>> different methods are doing: >>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>> >>> And lastly, to shortly answer your questions, see below ;) >>> >>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>> Dear Jörn, >>> Hi ;) >>> >>>> >>>> the code works but i dont know whether my data is logical and >>>> whether i decided to use the right method etc. >>> maybe you should try to get into one of the FieldTrip courses :) >>> This >>> might tremendously help you in understanding what's being done and >>> why. Otherwise, try to read as much as you can, read methods of >>> papers >>> and discuss with your supervisor and colleagues. Of course, on the >>> mailing list we also like to help a lot. >>>> >>>> My trials are pretty long (approx 30 sec but all are not the same >>>> length) and i am interested in beta frequency. >>>> >>>> First, it is not really clear to me whether i should use >>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>> latter calculates the FFT for shorter self-specified time windows to >>>> look at changes in power over time. Is that right? yep, about right. >>> >>>> however, if i have more stimuli for one condition, how is the time >>>> component then taken into account? it depends on how you segmented >>>> your data. FieldTrip is just transforming your preprocessed data, so >>>> whatever you put in is what you get out. >>> >>>> does mtmconvol take all trials of one condition and average the >>>> the power for each time window over all trials? Or is each trial >>>> treated seperatly? >>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>> >>>> Say i would use cfg.method=mtmfft do i need to specify a >>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper is >>>> always a single taper. Only when combining multiple tapers you can >>>> effectively smooth in the frequency domain. this is implemented as >>>> taper='dpss' >>> >>>> As i understand hanning if appropriate for lower freuquencies so i >>>> should use this taper to assess beta frequencies. >>> this is a rule of thumb, but there is nothing wrong with using >>> multitapering for lower frequencies. It depends on what you expect >>> from your data and what you want to achieve. >>>> >>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>> this depends on the frequencies you are interested in. I wouldn't >>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>> >>>> >>>> Thank you a lot for the help >>> you're welcome, hope this helps >>>> Best >>>> Victoria >>> Likewise, >>> Jörn >>> >>>> >>>> >>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>> Hi Victoria, >>>>> >>>>> is there anything wrong with the code you used below? By >>>>> smoothing, >>>>> do you refer to smoothing in the frequency domain? >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> >>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>> Hello >>>>>> >>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>>> for the freqanalysis. My stimuli are very long: between 29 and 30 >>>>>> sec. In total i have 4 stimuli per condition and 2 seperate >>>>>> conditions. I am looking at the beta range so fairly low >>>>>> frequencies. >>>>>> >>>>>> this is my code: >>>>>> Am i using the right taper and method. Should i smooth the data? >>>>>> and if so, what should such a smoothing parameter depend on? >>>>>> >>>>>> %fourier analysis >>>>>> cfg=[]; >>>>>> cfg.output='fourier'; >>>>>> cfg.method='mtmfft'; >>>>>> cfg.foi=[12:30]; >>>>>> cfg.taper='hanning'; >>>>>> cfg.keeptrials='yes'; >>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>> >>>>>> >>>>>> %coherence analysis >>>>>> cfg=[]; >>>>>> cfg.method='coh'; >>>>>> cfg.channelcmb={'B3' 'C15' >>>>>> 'B3' 'C10' >>>>>> 'B23' 'C15' >>>>>> 'B23' 'C10'} >>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>> >>>>>> >>>>>> Thank you very much for the suggestions! >>>>>> Best >>>>>> Victoria >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>>> >>>>> -- Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From eelke.spaak at donders.ru.nl Wed Feb 5 12:45:56 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 5 Feb 2014 12:45:56 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: References: <4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se> <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se> <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: Dear Victoria, Please have a look here: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans Best, Eelke On 5 February 2014 12:40, Victoria Schröder wrote: > Dear Jörn, > > I still am dealing with finding the right cfg.toi when doing a time > frequency analysis. Depending on the time resolution i get NaN values in the > first matrixes in the resulting powspctrm and crsspctrm. It seems that for > the first times selected there is no data. If i choose a cfg.toi 1:0.05:2 > then i get no Nan values but as soon as I start below 1 i get Nan values. > > This is my code for the analysis. I would appreciate some concrete advice > and suggestions why i run into this problem. > > % time-frequency analysis > cfg = []; > cfg.output = 'powandcsd'; % different for convol than for fft > > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.trials=data_clean.trialinfo(:,1) < 20; > cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' 'B13' > 'D31' 'B11'}; > cfg.channelcmb={'C29' 'D23' > 'C29' 'D31' > 'C29' 'D29' > 'C31' 'D23' > 'C31' 'D31' > 'C31' 'D29' > 'C26' 'D23' > 'C26' 'D31' > 'C26' 'D29' > 'C16' 'B26' > 'C16' 'B11' > 'C16' 'B13' > 'C13' 'B26' > 'C13' 'B11' > 'C13' 'B13' > 'C9' 'B26' > 'C9' 'B11' > 'C9' 'B13'} ; > cfg.foi = 12:2:30; % 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:0.05:1; > freq_convol = ft_freqanalysis(cfg, data_clean); > > Thank you a lot > Victoria > > > 2014-02-03 13:40 skrev Jörn M. Horschig: > >> Hi Victoria, >> >> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>> >>> Thank Jörn, >>> >>> Thank for the advice for the tutorials but i have already looked at them >>> a lot. >>> >>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the averaged >>> power over trials? Well, it might sound obvious, but if you say 'yes' to >>> keep trials, you keep the trials, whereas if you say 'no' you do not keep >>> the trials and instead get an average. >> >> >>> what happens then when the trials do not have the same length? >> >> The average will be made with all data that is available. If some >> trials go to 30s but all trials go to 29s, then the average of the >> last one second is made of less data then the first 29s. This is a >> crucial point for doing statistics as the degrees of freedom, >> signal-to noise ration etc. will be different for different time >> points. >> >>> >>> and a last question :) >>> >>> what does cfg.toi depend on ? in the tutorial time frequency analysis >>> this is chosen : cfg.toi = -0.5:0.05:1.5; .. why is that the case? >> >> it depends on what time you are interested in and how much memory >> (and cpu time aka patience) you got. >> >> Good luck ;) >> Best, >> Jörn >> >>> >>> I hope this should be it for now >>> Best >>> Victoria >>> >>> >>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>> >>>> Hi Victoria, >>>> >>>> you might want to read the relevant part of the walkthrough for your >>>> questions on mtmconvol and mtmfft: >>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>> >>>> Then, also doing this tutorial might help in understanding what the >>>> different methods are doing: >>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>> >>>> And lastly, to shortly answer your questions, see below ;) >>>> >>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>> >>>>> Dear Jörn, >>>> >>>> Hi ;) >>>> >>>>> >>>>> the code works but i dont know whether my data is logical and whether i >>>>> decided to use the right method etc. >>>> >>>> maybe you should try to get into one of the FieldTrip courses :) This >>>> might tremendously help you in understanding what's being done and >>>> why. Otherwise, try to read as much as you can, read methods of papers >>>> and discuss with your supervisor and colleagues. Of course, on the >>>> mailing list we also like to help a lot. >>>>> >>>>> >>>>> My trials are pretty long (approx 30 sec but all are not the same >>>>> length) and i am interested in beta frequency. >>>>> >>>>> First, it is not really clear to me whether i should use >>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the latter >>>>> calculates the FFT for shorter self-specified time windows to look at >>>>> changes in power over time. Is that right? yep, about right. >>>> >>>> >>>>> however, if i have more stimuli for one condition, how is the time >>>>> component then taken into account? it depends on how you segmented your >>>>> data. FieldTrip is just transforming your preprocessed data, so whatever you >>>>> put in is what you get out. >>>> >>>> >>>>> does mtmconvol take all trials of one condition and average the the >>>>> power for each time window over all trials? Or is each trial treated >>>>> seperatly? >>>> >>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>> >>>>> >>>>> Say i would use cfg.method=mtmfft do i need to specify a cfg.tapsmofrq >>>>> when using cfg.taper='hanning'? no, a hanning taper is always a single >>>>> taper. Only when combining multiple tapers you can effectively smooth in the >>>>> frequency domain. this is implemented as taper='dpss' >>>> >>>> >>>>> As i understand hanning if appropriate for lower freuquencies so i >>>>> should use this taper to assess beta frequencies. >>>> >>>> this is a rule of thumb, but there is nothing wrong with using >>>> multitapering for lower frequencies. It depends on what you expect >>>> from your data and what you want to achieve. >>>>> >>>>> >>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>>> >>>> this depends on the frequencies you are interested in. I wouldn't >>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>>> >>>>> >>>>> Thank you a lot for the help >>>> >>>> you're welcome, hope this helps >>>>> >>>>> Best >>>>> Victoria >>>> >>>> Likewise, >>>> Jörn >>>> >>>>> >>>>> >>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>> >>>>>> Hi Victoria, >>>>>> >>>>>> is there anything wrong with the code you used below? By smoothing, >>>>>> do you refer to smoothing in the frequency domain? >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>> >>>>>>> Hello >>>>>>> >>>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>>> connectivityanalysis. I am a bit unsure about the method to use for the >>>>>>> freqanalysis. My stimuli are very long: between 29 and 30 sec. In total i >>>>>>> have 4 stimuli per condition and 2 seperate conditions. I am looking at the >>>>>>> beta range so fairly low frequencies. >>>>>>> >>>>>>> this is my code: >>>>>>> Am i using the right taper and method. Should i smooth the data? and >>>>>>> if so, what should such a smoothing parameter depend on? >>>>>>> >>>>>>> %fourier analysis >>>>>>> cfg=[]; >>>>>>> cfg.output='fourier'; >>>>>>> cfg.method='mtmfft'; >>>>>>> cfg.foi=[12:30]; >>>>>>> cfg.taper='hanning'; >>>>>>> cfg.keeptrials='yes'; >>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>> >>>>>>> >>>>>>> %coherence analysis >>>>>>> cfg=[]; >>>>>>> cfg.method='coh'; >>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>> 'B3' 'C10' >>>>>>> 'B23' 'C15' >>>>>>> 'B23' 'C10'} >>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>> >>>>>>> >>>>>>> Thank you very much for the suggestions! >>>>>>> Best >>>>>>> Victoria >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>>> >>>>>> >>>>>> -- Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>>> >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> 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 jm.horschig at donders.ru.nl Wed Feb 5 12:47:46 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 05 Feb 2014 12:47:46 +0100 Subject: [FieldTrip] Still about channel repair (jan-mathijs schoffelen) In-Reply-To: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> References: <1391592344.20418.YahooMailNeo@web28806.mail.ir2.yahoo.com> Message-ID: <52F224E2.9080908@donders.ru.nl> Hi Ivano, your input seems a bit ambigious and wrong. First of, try using a new FieldTrip version. Second, you specify cfg.elecfile, then you set data.elec to some layout, and finally you do not use the data variable but rawdataout as your input to ft_channelrepair. Resolving these issues and, let me repeat, updating to a new FT version, will resolve your issues. Buono fortuna, Jörn On 2/5/2014 10:25 AM, Ivano Triggiani wrote: > Dear Jan-Mathijs, > > Thanks a lot for you quick answer, but I can assure you that I read > every document before sending any boring message to community :-D . > I prepared that electrodes position file (although it is not so clear > how to prepare channels position file!), but I don't understand where > it has to be declared... I searched for some template scripts but > nothing seems to help. > My problem seems easy. I have a bad channel (P3 referred to AFz, from > standard 10-10 System), and I want to 'repair' it... > > Ivano > > ------------------------------------------------------------------------ > > > "No man can wear one face to himself > and another to the multitude, > without finally getting bewildered > as to which one is true." > > > Nathaniel Hawthorne > > > > ------------------------------ > > Message: 4 > Date: Tue, 4 Feb 2014 18:08:37 +0100 > From: jan-mathijs schoffelen > > To: Fieldtrip List > > Subject: Re: [FieldTrip] Still about channel repair > Message-ID: <0AF44F48-1472-4609-86AE-3CFFB5E20D62 at donders.ru.nl > > > Content-Type: text/plain; charset="us-ascii" > > Hi Ivano, > Please have a look at the link attached. > > http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described > > Best, > Jan-Mathijs > > On Feb 4, 2014, at 6:01 PM, Ivano Triggiani wrote: > > > Hi Fieldtrippers, > > > > I read many answers about problems on channel repair, but still > something miss me to understand hot to fix a channel. I tried with: > > cfg = []; > > replace_channels = ft_channelselection('gui',hdr.label); > > cfg.badchannel = replace_channels; > > cfg.layout = 'EEG_layout.lay'; > > cfg.method = 'triangulation'; > > cfg.elecfile = 'EEG_cap.sfp'; > > cfg.neighbours = neighbours; > > cfg.trials = 'all'; > > elec.label = hdr.label; > > data.elec = ft_prepare_layout(cfg); > > repaired_data = ft_channelrepair(cfg,rawdataout); > > > > but it returns: > > ??? Error using ==> ft_channelrepair at 92 > > the data should contain either an electrode or a gradiometer definition > > > > I cannot find into documentation what it means. > > I guess I have to specify the kind of measurement (EEG/MEG), but where? > > Furthermore I read the docs about electrode position , channel > position and so on, but can we get some example? > > > > Thanks a lot, > > > > Ivano > > ------------------------------------------------------------------------ > > > > > > > > > > "No man can wear one face to himself > > and another to the multitude, > > without finally getting bewildered > > as to which one is true." > > > > > > Nathaniel Hawthorne > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Wed Feb 5 12:49:38 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Wed, 05 Feb 2014 12:49:38 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: References: "\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se> <52EF8E57.6060207@donders.ru.nl> Message-ID: <52F22552.3030109@donders.ru.nl> Hi Victoria, see: http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans?s[]=tfr&s[]=nan and: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis These should answer your question ;) Best, Jörn On 2/5/2014 12:40 PM, Victoria Schröder wrote: > Dear Jörn, > > I still am dealing with finding the right cfg.toi when doing a time > frequency analysis. Depending on the time resolution i get NaN values > in the first matrixes in the resulting powspctrm and crsspctrm. It > seems that for the first times selected there is no data. If i choose > a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start > below 1 i get Nan values. > > This is my code for the analysis. I would appreciate some concrete > advice and suggestions why i run into this problem. > > % time-frequency analysis > cfg = []; > cfg.output = 'powandcsd'; % different for convol than for fft > cfg.channel={'C15' 'C10' 'B23' 'B3'}; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.trials=data_clean.trialinfo(:,1) < 20; > cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' > 'B13' 'D31' 'B11'}; > cfg.channelcmb={'C29' 'D23' > 'C29' 'D31' > 'C29' 'D29' > 'C31' 'D23' > 'C31' 'D31' > 'C31' 'D29' > 'C26' 'D23' > 'C26' 'D31' > 'C26' 'D29' > 'C16' 'B26' > 'C16' 'B11' > 'C16' 'B13' > 'C13' 'B26' > 'C13' 'B11' > 'C13' 'B13' > 'C9' 'B26' > 'C9' 'B11' > 'C9' 'B13'} ; > cfg.foi = 12:2:30; % 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:0.05:1; > freq_convol = ft_freqanalysis(cfg, data_clean); > > Thank you a lot > Victoria > > > 2014-02-03 13:40 skrev Jörn M. Horschig: >> Hi Victoria, >> >> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>> Thank Jörn, >>> >>> Thank for the advice for the tutorials but i have already looked at >>> them a lot. >>> >>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >>> averaged power over trials? Well, it might sound obvious, but if you >>> say 'yes' to keep trials, you keep the trials, whereas if you say >>> 'no' you do not keep the trials and instead get an average. >> >>> what happens then when the trials do not have the same length? >> The average will be made with all data that is available. If some >> trials go to 30s but all trials go to 29s, then the average of the >> last one second is made of less data then the first 29s. This is a >> crucial point for doing statistics as the degrees of freedom, >> signal-to noise ration etc. will be different for different time >> points. >> >>> >>> and a last question :) >>> >>> what does cfg.toi depend on ? in the tutorial time frequency >>> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why >>> is that the case? >> it depends on what time you are interested in and how much memory >> (and cpu time aka patience) you got. >> >> Good luck ;) >> Best, >> Jörn >> >>> >>> I hope this should be it for now >>> Best >>> Victoria >>> >>> >>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>> Hi Victoria, >>>> >>>> you might want to read the relevant part of the walkthrough for your >>>> questions on mtmconvol and mtmfft: >>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>> >>>> Then, also doing this tutorial might help in understanding what the >>>> different methods are doing: >>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>> >>>> And lastly, to shortly answer your questions, see below ;) >>>> >>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>> Dear Jörn, >>>> Hi ;) >>>> >>>>> >>>>> the code works but i dont know whether my data is logical and >>>>> whether i decided to use the right method etc. >>>> maybe you should try to get into one of the FieldTrip courses :) This >>>> might tremendously help you in understanding what's being done and >>>> why. Otherwise, try to read as much as you can, read methods of papers >>>> and discuss with your supervisor and colleagues. Of course, on the >>>> mailing list we also like to help a lot. >>>>> >>>>> My trials are pretty long (approx 30 sec but all are not the same >>>>> length) and i am interested in beta frequency. >>>>> >>>>> First, it is not really clear to me whether i should use >>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>>> latter calculates the FFT for shorter self-specified time windows >>>>> to look at changes in power over time. Is that right? yep, about >>>>> right. >>>> >>>>> however, if i have more stimuli for one condition, how is the time >>>>> component then taken into account? it depends on how you segmented >>>>> your data. FieldTrip is just transforming your preprocessed data, >>>>> so whatever you put in is what you get out. >>>> >>>>> does mtmconvol take all trials of one condition and average the >>>>> the power for each time window over all trials? Or is each trial >>>>> treated seperatly? >>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>> >>>>> Say i would use cfg.method=mtmfft do i need to specify a >>>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper >>>>> is always a single taper. Only when combining multiple tapers you >>>>> can effectively smooth in the frequency domain. this is >>>>> implemented as taper='dpss' >>>> >>>>> As i understand hanning if appropriate for lower freuquencies so i >>>>> should use this taper to assess beta frequencies. >>>> this is a rule of thumb, but there is nothing wrong with using >>>> multitapering for lower frequencies. It depends on what you expect >>>> from your data and what you want to achieve. >>>>> >>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is appropriate? >>>> this depends on the frequencies you are interested in. I wouldn't >>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least 300ms. >>>> >>>>> >>>>> Thank you a lot for the help >>>> you're welcome, hope this helps >>>>> Best >>>>> Victoria >>>> Likewise, >>>> Jörn >>>> >>>>> >>>>> >>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>> Hi Victoria, >>>>>> >>>>>> is there anything wrong with the code you used below? By smoothing, >>>>>> do you refer to smoothing in the frequency domain? >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>> Hello >>>>>>> >>>>>>> I am currently working on a freqanalysis as a first step to do a >>>>>>> connectivityanalysis. I am a bit unsure about the method to use >>>>>>> for the freqanalysis. My stimuli are very long: between 29 and >>>>>>> 30 sec. In total i have 4 stimuli per condition and 2 seperate >>>>>>> conditions. I am looking at the beta range so fairly low >>>>>>> frequencies. >>>>>>> >>>>>>> this is my code: >>>>>>> Am i using the right taper and method. Should i smooth the data? >>>>>>> and if so, what should such a smoothing parameter depend on? >>>>>>> >>>>>>> %fourier analysis >>>>>>> cfg=[]; >>>>>>> cfg.output='fourier'; >>>>>>> cfg.method='mtmfft'; >>>>>>> cfg.foi=[12:30]; >>>>>>> cfg.taper='hanning'; >>>>>>> cfg.keeptrials='yes'; >>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>> >>>>>>> >>>>>>> %coherence analysis >>>>>>> cfg=[]; >>>>>>> cfg.method='coh'; >>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>> 'B3' 'C10' >>>>>>> 'B23' 'C15' >>>>>>> 'B23' 'C10'} >>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>> >>>>>>> >>>>>>> Thank you very much for the suggestions! >>>>>>> Best >>>>>>> Victoria >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>>> >>>>>> -- Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> -- Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From victorias at dsv.su.se Wed Feb 5 12:57:31 2014 From: victorias at dsv.su.se (=?UTF-8?Q?Victoria_Schr=C3=B6der?=) Date: Wed, 05 Feb 2014 12:57:31 +0100 Subject: [FieldTrip] freqanalysis In-Reply-To: <52F22552.3030109@donders.ru.nl> References: "\"\\\"<4cf9dcb0c4ce6d9726b56a7ee78e1653@dsv.su.se>\\\" <52EF5117.6070700@donders.ru.nl> <087550bc51e8099724e221be5016154f@dsv.su.se>\" <52EF727E.2080902@donders.ru.nl> <326a3e057b2c7ce9b01de0c6cd56bed0@dsv.su.se>" <52EF8E57.6060207@donders.ru.nl> <52F22552.3030109@donders.ru.nl> Message-ID: <9d84b751ebbaefe3ace5c3405cbc9a7c@dsv.su.se> Dear Eelke and Jörn Yes, this really answers my question. Really cool! Thanks Victoria 2014-02-05 12:49 skrev Jörn M. Horschig: > Hi Victoria, > > see: > > http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_contain_nans?s[]=tfr&s[]=nan > and: http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis > > These should answer your question ;) > > Best, > Jörn > > On 2/5/2014 12:40 PM, Victoria Schröder wrote: >> Dear Jörn, >> >> I still am dealing with finding the right cfg.toi when doing a time >> frequency analysis. Depending on the time resolution i get NaN values >> in the first matrixes in the resulting powspctrm and crsspctrm. It >> seems that for the first times selected there is no data. If i choose >> a cfg.toi 1:0.05:2 then i get no Nan values but as soon as I start >> below 1 i get Nan values. >> >> This is my code for the analysis. I would appreciate some concrete >> advice and suggestions why i run into this problem. >> >> % time-frequency analysis >> cfg = []; >> cfg.output = 'powandcsd'; % different for convol than for fft >> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >> cfg.method = 'mtmconvol'; >> cfg.taper = 'hanning'; >> cfg.keeptrials = 'yes'; >> cfg.trials=data_clean.trialinfo(:,1) < 20; >> cfg.channel={'C29' 'C16' 'C31' 'C9' 'C26' 'C13' 'D23' 'B26' 'D29' >> 'B13' 'D31' 'B11'}; >> cfg.channelcmb={'C29' 'D23' >> 'C29' 'D31' >> 'C29' 'D29' >> 'C31' 'D23' >> 'C31' 'D31' >> 'C31' 'D29' >> 'C26' 'D23' >> 'C26' 'D31' >> 'C26' 'D29' >> 'C16' 'B26' >> 'C16' 'B11' >> 'C16' 'B13' >> 'C13' 'B26' >> 'C13' 'B11' >> 'C13' 'B13' >> 'C9' 'B26' >> 'C9' 'B11' >> 'C9' 'B13'} ; >> cfg.foi = 12:2:30; % 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:0.05:1; >> freq_convol = ft_freqanalysis(cfg, data_clean); >> >> Thank you a lot >> Victoria >> >> >> 2014-02-03 13:40 skrev Jörn M. Horschig: >>> Hi Victoria, >>> >>> On 2/3/2014 12:14 PM, Victoria Schröder wrote: >>>> Thank Jörn, >>>> >>>> Thank for the advice for the tutorials but i have already looked >>>> at them a lot. >>>> >>>> Anyhow, suppose i say cfg.keeptrials = 'yes', then i get the >>>> averaged power over trials? Well, it might sound obvious, but if you >>>> say 'yes' to keep trials, you keep the trials, whereas if you say >>>> 'no' you do not keep the trials and instead get an average. >>> >>>> what happens then when the trials do not have the same length? >>> The average will be made with all data that is available. If some >>> trials go to 30s but all trials go to 29s, then the average of the >>> last one second is made of less data then the first 29s. This is a >>> crucial point for doing statistics as the degrees of freedom, >>> signal-to noise ration etc. will be different for different time >>> points. >>> >>>> >>>> and a last question :) >>>> >>>> what does cfg.toi depend on ? in the tutorial time frequency >>>> analysis this is chosen : cfg.toi = -0.5:0.05:1.5; .. why >>>> is that the case? >>> it depends on what time you are interested in and how much memory >>> (and cpu time aka patience) you got. >>> >>> Good luck ;) >>> Best, >>> Jörn >>> >>>> >>>> I hope this should be it for now >>>> Best >>>> Victoria >>>> >>>> >>>> 2014-02-03 11:42 skrev Jörn M. Horschig: >>>>> Hi Victoria, >>>>> >>>>> you might want to read the relevant part of the walkthrough for >>>>> your >>>>> questions on mtmconvol and mtmfft: >>>>> http://fieldtrip.fcdonders.nl/walkthrough#frequency_analysis >>>>> >>>>> Then, also doing this tutorial might help in understanding what >>>>> the >>>>> different methods are doing: >>>>> http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis >>>>> >>>>> And lastly, to shortly answer your questions, see below ;) >>>>> >>>>> On 2/3/2014 11:15 AM, Victoria Schröder wrote: >>>>>> Dear Jörn, >>>>> Hi ;) >>>>> >>>>>> >>>>>> the code works but i dont know whether my data is logical and >>>>>> whether i decided to use the right method etc. >>>>> maybe you should try to get into one of the FieldTrip courses :) >>>>> This >>>>> might tremendously help you in understanding what's being done >>>>> and >>>>> why. Otherwise, try to read as much as you can, read methods of >>>>> papers >>>>> and discuss with your supervisor and colleagues. Of course, on >>>>> the >>>>> mailing list we also like to help a lot. >>>>>> >>>>>> My trials are pretty long (approx 30 sec but all are not the >>>>>> same length) and i am interested in beta frequency. >>>>>> >>>>>> First, it is not really clear to me whether i should use >>>>>> cfg.method=mtmfft or cfg.method=mtmconvol. As i understand , the >>>>>> latter calculates the FFT for shorter self-specified time windows >>>>>> to look at changes in power over time. Is that right? yep, about >>>>>> right. >>>>> >>>>>> however, if i have more stimuli for one condition, how is the >>>>>> time component then taken into account? it depends on how you >>>>>> segmented your data. FieldTrip is just transforming your >>>>>> preprocessed data, so whatever you put in is what you get out. >>>>> >>>>>> does mtmconvol take all trials of one condition and average the >>>>>> the power for each time window over all trials? Or is each trial >>>>>> treated seperatly? >>>>> depends on whether you specify cfg.keeptrials = 'yes' or 'no' >>>>>> >>>>>> Say i would use cfg.method=mtmfft do i need to specify a >>>>>> cfg.tapsmofrq when using cfg.taper='hanning'? no, a hanning taper >>>>>> is always a single taper. Only when combining multiple tapers you >>>>>> can effectively smooth in the frequency domain. this is >>>>>> implemented as taper='dpss' >>>>> >>>>>> As i understand hanning if appropriate for lower freuquencies so >>>>>> i should use this taper to assess beta frequencies. >>>>> this is a rule of thumb, but there is nothing wrong with using >>>>> multitapering for lower frequencies. It depends on what you >>>>> expect >>>>> from your data and what you want to achieve. >>>>>> >>>>>> Say i use cfg.method=mtmconvol what cfg.t_ftimwin is >>>>>> appropriate? >>>>> this depends on the frequencies you are interested in. I wouldn't >>>>> trust anything below 3 cycles, i.e. for 10Hz alpha at least >>>>> 300ms. >>>>> >>>>>> >>>>>> Thank you a lot for the help >>>>> you're welcome, hope this helps >>>>>> Best >>>>>> Victoria >>>>> Likewise, >>>>> Jörn >>>>> >>>>>> >>>>>> >>>>>> 2014-02-03 09:19 skrev Jörn M. Horschig: >>>>>>> Hi Victoria, >>>>>>> >>>>>>> is there anything wrong with the code you used below? By >>>>>>> smoothing, >>>>>>> do you refer to smoothing in the frequency domain? >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> >>>>>>> On 1/30/2014 11:33 AM, Victoria Schröder wrote: >>>>>>>> Hello >>>>>>>> >>>>>>>> I am currently working on a freqanalysis as a first step to do >>>>>>>> a connectivityanalysis. I am a bit unsure about the method to >>>>>>>> use for the freqanalysis. My stimuli are very long: between 29 >>>>>>>> and 30 sec. In total i have 4 stimuli per condition and 2 >>>>>>>> seperate conditions. I am looking at the beta range so fairly >>>>>>>> low frequencies. >>>>>>>> >>>>>>>> this is my code: >>>>>>>> Am i using the right taper and method. Should i smooth the >>>>>>>> data? and if so, what should such a smoothing parameter depend >>>>>>>> on? >>>>>>>> >>>>>>>> %fourier analysis >>>>>>>> cfg=[]; >>>>>>>> cfg.output='fourier'; >>>>>>>> cfg.method='mtmfft'; >>>>>>>> cfg.foi=[12:30]; >>>>>>>> cfg.taper='hanning'; >>>>>>>> cfg.keeptrials='yes'; >>>>>>>> cfg.channel={'C15' 'C10' 'B23' 'B3'}; >>>>>>>> frefourier=ft_freqanalysis(cfg,data_clean); >>>>>>>> >>>>>>>> >>>>>>>> %coherence analysis >>>>>>>> cfg=[]; >>>>>>>> cfg.method='coh'; >>>>>>>> cfg.channelcmb={'B3' 'C15' >>>>>>>> 'B3' 'C10' >>>>>>>> 'B23' 'C15' >>>>>>>> 'B23' 'C10'} >>>>>>>> coherence=ft_connectivityanalysis(cfg, frefourier); >>>>>>>> >>>>>>>> >>>>>>>> Thank you very much for the suggestions! >>>>>>>> Best >>>>>>>> Victoria >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>>> >>>>>>> -- Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> -- Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- From joramvandriel at gmail.com Wed Feb 5 13:10:16 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 5 Feb 2014 13:10:16 +0100 Subject: [FieldTrip] cluster-based permutation stats with combined-planar neuromag data Message-ID: Hi all, I want to do statistics on frequency domain MEG data using cluster-based permutation testing, but I get stuck with the neighbour construction. I have Neuromag data, 204 sensors (excluding magnetometers), on which I did frequency analysis, after which I used ft_combineplanar to get a final set of 102 sensors. I have two freq cell structures corresponding to 2 conditions, 10 subjects each (within-subject design). I know the layout, template and neighbour approach for Neuromag is tricky because of the different sensor types, but here's what I did: cfg = []; cfg_lay.layout = 'neuromag306cmb.lay'; cfg_lay.grad = freq{1}.grad; cfg_neighb.layout = ft_prepare_layout(cfg_lay,freq{1}); cfg_neighb.method = 'template'; cfg_neighb.template = 'neuromag306cmb_neighb.mat'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb,freq{1}); cfg.minnbchan = 2; ... And then the cfg continues with standard settings for cluster-based permutation testing. When I run: stat = ft_freqstatistics(cfg, freq{2}, freq{1}); I get the error: ??? Error using ==> findcluster at 56 invalid dimension of spatdimneighbstructmat Error in ==> clusterstat at 185 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> ft_statistics_montecarlo at 361 [stat, cfg] = clusterstat(cfg, statrand, statobs); Error in ==> ft_freqstatistics at 323 [stat, cfg] = statmethod(cfg, dat, cfg.design); I digged into these embedded functions but can't wrap my head around what went wrong. The later constructed cfg.connectivity seems to be empty; my guess is that produces channeighbstructmat to be empty, which produces the error. The output of ft_prepare_layout says there are on average 6.8 neighbours per channel, and the result of ft_neighbourplot looks perfectly fine: [image: Inline image 1] [image: Inline image 2] Does anybody have a suggestion how to tackle this problem? Any help is much appreciated! Thanks, Joram -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 25532 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 22254 bytes Desc: not available URL: From i.e.j.de.vries at student.vu.nl Wed Feb 5 13:29:33 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 5 Feb 2014 12:29:33 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Wed Feb 5 13:38:09 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Wed, 5 Feb 2014 12:38:09 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> p.s. And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? Greetings ________________________________ From: Vries, I.E.J. de Sent: 05 February 2014 13:29 To: fieldtrip at science.ru.nl Subject: corticomuscular and intermuscular coherence Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Feb 5 14:02:27 2014 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 5 Feb 2014 14:02:27 +0100 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local> Message-ID: Dear Ingmar, I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: > p.s. > > And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? > > Greetings > > From: Vries, I.E.J. de > Sent: 05 February 2014 13:29 > To: fieldtrip at science.ru.nl > Subject: corticomuscular and intermuscular coherence > > Dear Fieldtrippers, > > I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. > My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... > > Thanks in advance, > Greetings, > Ingmar > _______________________________________________ > 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 albenin at mail.ru Wed Feb 5 15:57:47 2014 From: albenin at mail.ru (=?UTF-8?B?0JDQu9C10LrRgdC10Lkg0JHQtdC90LjQvQ==?=) Date: Wed, 05 Feb 2014 18:57:47 +0400 Subject: [FieldTrip] =?utf-8?q?Statistics_on_freq_data?= Message-ID: <1391612267.921368498@f293.i.mail.ru> Dear Fieldtripers, First of all big thanks for a wonderful tool and support! I have some questions about cluster based permutation test on TF data. I perform a between-trials experiment and want to search differences say on frequencies 10-30Hz and latencies 200-1200 ms from onset. So I need to explore these ranges for possible differencies in powerspectrum. When I use for example cfg.latency          = [0.2 1.2]; cfg.frequency        = [10 30]; I find no significant clusters, and lowest p_value is very high, say 0,8. But when I try to look at smaller time/frequency areas, like cfg.latency          = [0.2 0.3]; cfg.frequency        = [15 16]; There can be one or two significant clusters with p_values<0.01. So my question is: does the algorithm look for the whole specified TF window like 0.2-1.2s   10-30Hz and tries to find significant difference based on the whole length of interval? This could explain why there are no significant clusters on bigger windows. Such clusters appear when we shorten the toi and foi - it's much more probable to find differences at smaller scales. So the next question is: what should I do to explore the whole number of frequencies and latencies? Shall I run a loop with parameters like this: Iteration 1 cfg.latency          = [0.2 0.3]; cfg.frequency        = [15 16]; Iteration 2 cfg.latency          = [0.3 0.4]; cfg.frequency        = [15 16]; ... and so on? Or maybe I do not understand something in basis of method? BTW, I've read all tutorials and appropriate papers like Nonparametric statistical testing of EEG, but could not find the answer. Thanks in advance, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From edueeg at gmail.com Wed Feb 5 17:54:37 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Wed, 5 Feb 2014 14:54:37 -0200 Subject: [FieldTrip] eeglab2fieldtrip segmented data Message-ID: <722C334C-5EA5-43FD-BD0D-F493D42718DA@gmail.com> Hello There, I am trying to export continuous data segmented in EEGLab (using the eeg_rejepochs function) to fieldtrip using eeglab2fieldtrip, but it does not seem to correctly understand the segmentation done in EEGLab, issuing a warning that "the data does not contain a trial definition" and another stating that "reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous dataset" (which I know they're not) Has anybody gone through something similar and can help me figure out how to solve this, please? many thanks eduardo From sviter33 at gmail.com Thu Feb 6 13:01:02 2014 From: sviter33 at gmail.com (=?KOI8-R?B?7NXLz9HOz9cg7cHL08nN?=) Date: Thu, 6 Feb 2014 16:01:02 +0400 Subject: [FieldTrip] Coherence statistics between two groups of subjects Message-ID: Can anyone help me to understand the best way to calculate coherence of continuous data and compare results for two groups of subjects? The problem is that length of records is not equal for different subjects and for every subject I have several files. However, total length of records is not less than 30 s (Fs=500 Hz). I want to be sure that unequal length is not effect on results of statistical comparison between groups. Is it better to process these files separately and then average results or use ft_appenddata for each subject's files before the analysis? My second question is how to make a statistical test on the results of ft_connectivityanalysis between two groups of subjects. I have read all mail archive about this topic but with no progress. May anyone provide simple code example? Thenks for your help, Maxim Lukoyanov J. Researcher, NNMST -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Thu Feb 6 14:22:50 2014 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Thu, 06 Feb 2014 14:22:50 +0100 Subject: [FieldTrip] Gradiometer definition after ft_appenddata Message-ID: <52F38CAA.5070301@uni-tuebingen.de> Dear all, I have a question concerning ft_appenddata dropping the gradiometer definition to make sure one is not using a grad definition that does not fit the data (see [1] for an earlier quick discussion). I have an MEG data set in which some subjects had a short break during recording. The fiducial markers remained in place during the break. For each of these subjects, I would like to define trials in both data parts and then append them before doing further analysis. Is it valid to use the first part's grad definition for the combined data set? The grad definitions in the two parts are not identical. I assume this is because the subjects moved during the break and the grad definition is in relation to the fiducial markers at recording onset? Thanks in advance for your help! All the best, Jens P.S.: Sorry in case there is information on that on the fieldtrip website. I could only find an earlier quick exchange on this mailinglist: [1] http://mailman.science.ru.nl/pipermail/fieldtrip/2013-April/006405.html Here, Eelke Spaak said one can attach gradiometer data as long as one is sure it's the correct one. But how do I know it is correct? ...and the general info about the grad definitions: [2] http://fieldtrip.fcdonders.nl/faq/how_are_electrodes_magnetometers_or_gradiometers_described From i.e.j.de.vries at student.vu.nl Fri Feb 7 00:51:10 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Thu, 6 Feb 2014 23:51:10 +0000 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Hi Julian, Thanks for the reply. Yes I understand coherence of 1 time series is not possible, but I figured if you have a long enough trial and separate this in enough time windows, you could calculate the average coherence (so not time-resolved) over the whole trial. Anyway I have 10 trials per condition so I'll never calculate the coherence for a single trial. cheers, Ingmar ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] Sent: 05 February 2014 14:02 To: FieldTrip discussion list Subject: Re: [FieldTrip] corticomuscular and intermuscular coherence Dear Ingmar, I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: p.s. And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? Greetings ________________________________ From: Vries, I.E.J. de Sent: 05 February 2014 13:29 To: fieldtrip at science.ru.nl Subject: corticomuscular and intermuscular coherence Dear Fieldtrippers, I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... Thanks in advance, Greetings, Ingmar _______________________________________________ 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 julian.keil at gmail.com Fri Feb 7 10:22:01 2014 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 7 Feb 2014 10:22:01 +0100 Subject: [FieldTrip] corticomuscular and intermuscular coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Message-ID: Hi Ingmar, it is definitively possible to cut your long (15 s) trials into smaller segments (i.e. 2 s) using ft_redefinetrial. The input would look something like this, in case you haven't tried this: for t = 1:length(in.trials) % loop over trials cfg=[]; cfg.trials = t; % only take on trial at a time cfg.length = 2; % length of the new trials cfg.overlap = .5 % How much of trial n should overlap with trial n+1 out{t} = ft_redefinetrial(cfg,in); % This gives you an output of your 90 trials, cut into smaller "sub trials" end This way, you could actually compute the coherence of each of your 90 long trials separately. However, I'm not sure if this is correct at all or not oversampling your data. If anyone objects, please correct me! Best, Julian Am 07.02.2014 um 00:51 schrieb Vries, I.E.J. de: > Hi Julian, > > Thanks for the reply. Yes I understand coherence of 1 time series is not possible, but I figured if you have a long enough trial and separate this in enough time windows, you could calculate the average coherence (so not time-resolved) over the whole trial. Anyway I have 10 trials per condition so I'll never calculate the coherence for a single trial. > > cheers, > Ingmar > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Julian Keil [julian.keil at gmail.com] > Sent: 05 February 2014 14:02 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] corticomuscular and intermuscular coherence > > Dear Ingmar, > > I'm not too sure about how exactly coherence is calculated, but be aware that it is not possible to compute single trial coherence. This has been discussed numerous times on this list. > > In case you absolutely need a single-trial analysis of connectivity, you might want to look up my recent paper: > > Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2013). Prestimulus Beta Power and Phase Synchrony Influence the Sound-Induced Flash Illusion. Cerebral Cortex (New York, NY : 1991), 1–11. doi:10.1093/cercor/bhs409 > > In this paper, I describe how to use the difference between the phases of two signals compared to the mean phase difference can give an indication of single trial functional connectivity. > > Best, > > Julian > > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 05.02.2014 um 13:38 schrieb Vries, I.E.J. de: > >> p.s. >> >> And if this is indeed the case, is there a way to change these settings, e.g. calculate the coherence for each trial separately? >> >> Greetings >> >> From: Vries, I.E.J. de >> Sent: 05 February 2014 13:29 >> To: fieldtrip at science.ru.nl >> Subject: corticomuscular and intermuscular coherence >> >> Dear Fieldtrippers, >> >> I have a small question. When I run a ft_connectivityanalysis with coherence as method on a data set of 90 trials of each 15 seconds, the command window gives the output text that coherence is averaged over rpt (replicates). Besides that, for each trial of 15 seconds, 149 tapers are used. >> My question, over which parts is the coherence calculated and then averaged. It seems to me now that first the coherence is calculated over all of the 149 * 90 = 13410 epochs, and then averaged over all of these. Is this the order that ft_connectivity analysis applies? I tried to look it up in the code but got a bit lost there with all the variable names etc... >> >> Thanks in advance, >> Greetings, >> Ingmar >> _______________________________________________ >> 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 aaron.schurger at gmail.com Fri Feb 7 12:43:04 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Fri, 7 Feb 2014 12:43:04 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output Message-ID: Hi, I am running a time-frequency analysis using ft_freqanalysis with the wavelet method. I assume that the output in each frequency band is temporally aligned to the midpoint of the wavelet (thinking in terms of convolution): i.e. the power value that I get at time 0.300, for a given frequency f, is precisely the dot product of f's wavelet CENTERED at 0.300 sec in the data. Is that correct? If so, how can I ask for the output of freqanalysis to be time aligned to the leading edge of the wavelet rather than the center? I.e. I want to make sure that each point in the output only has information about the past and knows nothing about the future, with respect to that time. Is there a simple way to do this? Thanks! Aaron -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From eelke.spaak at donders.ru.nl Fri Feb 7 12:56:13 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 7 Feb 2014 12:56:13 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi Aaron, Indeed, the value you get at t = 0.3 will correspond to the wavelet (or, equivalently, the time window that was tapered and Fourier-transformed) centered at that time point. So if your time window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched from t = 0.1 to t = 0.5 s. There is no default option to align the time points of interest to an edge of the wavelet. However, there is a very straightforward solution to what you are asking: if you want to make sure that the wavelet 'knows nothing' of the future after e.g. t = 0.5s, then only consider the time points up to and including t = 0.3s for any subsequent analyses. (Or more general up to t = tA - W/2, where tA is the point of interest beyond which no info can bleed into the wavelet, and W is the window length.) Best, Eelke On 7 February 2014 12:43, Aaron Schurger wrote: > Hi, > I am running a time-frequency analysis using ft_freqanalysis with the > wavelet method. I assume that the output in each frequency band is > temporally aligned to the midpoint of the wavelet (thinking in terms > of convolution): i.e. the power value that I get at time 0.300, for a > given frequency f, is precisely the dot product of f's wavelet > CENTERED at 0.300 sec in the data. Is that correct? If so, how can I > ask for the output of freqanalysis to be time aligned to the leading > edge of the wavelet rather than the center? I.e. I want to make sure > that each point in the output only has information about the past and > knows nothing about the future, with respect to that time. Is there a > simple way to do this? > Thanks! > Aaron > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Fri Feb 7 17:03:40 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Fri, 7 Feb 2014 11:03:40 -0500 Subject: [FieldTrip] ft_regressconfound Message-ID: Dear all, I am using regressconfound on Neuromag data. In CTF data, data for coil1, coil2 and coil3 are generated and then circumcenter function is called to compute 3 translational and 3 rotational dof. Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT channels that provide quarternion parameters q1 through q6, where q4,q5 and q6 are translations in x, y and z directions. I am using these q4,q5 and q6 to directly compute the rotational orientations (using the last part of the circumcenter.m script). It is said regressconfound must be used as a last step prior to stats. I have 4 blocks of data for each subject. Which option below should I follow? 1. Apply regress confound separately to four blocks? But, then I have to average these four blocks once again using ft_timelockanalysis, then grand average using ft_timelockgrandaverage before computing stats. 2. Or should I append the four blocks first, then perform regressconfound? In this case, I directly go to grandaverage and stats. Any suggestion is appreciated. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Fri Feb 7 17:39:17 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Fri, 7 Feb 2014 17:39:17 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi, Eelke, Thank you for your reply - that is very helpful indeed. One question remains then: how do I know what W is for each frequency band? I think W will of course depend on the frequency (in the case of morlet wavelets), being shorter for higher frequencies and longer for lower frequencies. I know that wavelets are defined in terms of the standard deviation of the envelope, but the window itself of course extends out beyond 1 std of the envelope, to some point beyond where the wavelet tapers to zero (I guess). So, if you know how I can compute W for any arbitrary frequency band, in the case of morlet wavelets, I would be very grateful. Thanks again! Aaron On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: > Hi Aaron, > > Indeed, the value you get at t = 0.3 will correspond to the wavelet > (or, equivalently, the time window that was tapered and > Fourier-transformed) centered at that time point. So if your time > window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched > from t = 0.1 to t = 0.5 s. > > There is no default option to align the time points of interest to an > edge of the wavelet. However, there is a very straightforward solution > to what you are asking: if you want to make sure that the wavelet > 'knows nothing' of the future after e.g. t = 0.5s, then only consider > the time points up to and including t = 0.3s for any subsequent > analyses. (Or more general up to t = tA - W/2, where tA is the point > of interest beyond which no info can bleed into the wavelet, and W is > the window length.) > > Best, > Eelke > > On 7 February 2014 12:43, Aaron Schurger wrote: >> Hi, >> I am running a time-frequency analysis using ft_freqanalysis with the >> wavelet method. I assume that the output in each frequency band is >> temporally aligned to the midpoint of the wavelet (thinking in terms >> of convolution): i.e. the power value that I get at time 0.300, for a >> given frequency f, is precisely the dot product of f's wavelet >> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >> ask for the output of freqanalysis to be time aligned to the leading >> edge of the wavelet rather than the center? I.e. I want to make sure >> that each point in the output only has information about the past and >> knows nothing about the future, with respect to that time. Is there a >> simple way to do this? >> Thanks! >> Aaron >> >> -- >> Aaron Schurger, PhD >> Senior researcher >> Laboratory of Cognitive Neuroscience >> Brain-Mind Institute, Department of Life Sciences >> École Polytechnique Fédérale de Lausanne >> Station 19, AI 2101 >> 1015 Lausanne, Switzerland >> +41 21 693 1771 >> aaron.schurger at epfl.ch >> http://lnco.epfl.ch/ >> >> _______________________________________________ >> 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 -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From eelke.spaak at donders.ru.nl Fri Feb 7 17:57:31 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 7 Feb 2014 17:57:31 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi Aaron, I had been assuming you were using cfg.method = 'mtmconvol', which does an implicit wavelet convolution, but lets you specify the parameters in terms of a window length, taper to use, and smoothing parameter (if using slepian taper sequence). Mtmconvol is the method I would almost always use, as it provides a greater degree of control over and flexibility in the parameters. However, now I understand you might be using cfg.method = 'wavelet'. Could you post the entire cfg you are using for ft_freqanalysis? Best, Eelke On 7 February 2014 17:39, Aaron Schurger wrote: > Hi, Eelke, > Thank you for your reply - that is very helpful indeed. One question > remains then: how do I know what W is for each frequency band? I think > W will of course depend on the frequency (in the case of morlet > wavelets), being shorter for higher frequencies and longer for lower > frequencies. I know that wavelets are defined in terms of the standard > deviation of the envelope, but the window itself of course extends out > beyond 1 std of the envelope, to some point beyond where the wavelet > tapers to zero (I guess). So, if you know how I can compute W for any > arbitrary frequency band, in the case of morlet wavelets, I would be > very grateful. > Thanks again! > Aaron > > On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: >> Hi Aaron, >> >> Indeed, the value you get at t = 0.3 will correspond to the wavelet >> (or, equivalently, the time window that was tapered and >> Fourier-transformed) centered at that time point. So if your time >> window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched >> from t = 0.1 to t = 0.5 s. >> >> There is no default option to align the time points of interest to an >> edge of the wavelet. However, there is a very straightforward solution >> to what you are asking: if you want to make sure that the wavelet >> 'knows nothing' of the future after e.g. t = 0.5s, then only consider >> the time points up to and including t = 0.3s for any subsequent >> analyses. (Or more general up to t = tA - W/2, where tA is the point >> of interest beyond which no info can bleed into the wavelet, and W is >> the window length.) >> >> Best, >> Eelke >> >> On 7 February 2014 12:43, Aaron Schurger wrote: >>> Hi, >>> I am running a time-frequency analysis using ft_freqanalysis with the >>> wavelet method. I assume that the output in each frequency band is >>> temporally aligned to the midpoint of the wavelet (thinking in terms >>> of convolution): i.e. the power value that I get at time 0.300, for a >>> given frequency f, is precisely the dot product of f's wavelet >>> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >>> ask for the output of freqanalysis to be time aligned to the leading >>> edge of the wavelet rather than the center? I.e. I want to make sure >>> that each point in the output only has information about the past and >>> knows nothing about the future, with respect to that time. Is there a >>> simple way to do this? >>> Thanks! >>> Aaron >>> >>> -- >>> Aaron Schurger, PhD >>> Senior researcher >>> Laboratory of Cognitive Neuroscience >>> Brain-Mind Institute, Department of Life Sciences >>> École Polytechnique Fédérale de Lausanne >>> Station 19, AI 2101 >>> 1015 Lausanne, Switzerland >>> +41 21 693 1771 >>> aaron.schurger at epfl.ch >>> http://lnco.epfl.ch/ >>> >>> _______________________________________________ >>> 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 > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From edueeg at gmail.com Fri Feb 7 17:56:52 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Fri, 7 Feb 2014 14:56:52 -0200 Subject: [FieldTrip] ft_channelrepair layout problem Message-ID: Hello all, I am having dificulties with the function ft_channelrepair because one of it's inputs must be cfg.elec (electrode positions) but I can't figure out how to convert my layout (I have it as an ascii .lay as well as .mat with the "lay" struct) to the proper format for ft_channelrepair Already tried the tutorials and ft_readsens and ft_datatype_sens but unfortunately I am still having trouble to solve this Can anyone help me out please?? many thanks eduardo From a.stolk at fcdonders.ru.nl Fri Feb 7 17:59:49 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 7 Feb 2014 17:59:49 +0100 (CET) Subject: [FieldTrip] ft_regressconfound In-Reply-To: Message-ID: <1180822759.5206965.1391792389190.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, It is indeed recommended to use ft_regressconfound as a last step prior to statistical assessment. It will remove trial-by-trial variance in the neural data that can be attributed to trial-by-trial variance in head position. The latter is approximated with regressors containing trial-by-trial information on head positions deviating from the session/experiment mean. Because the head position timeseries is mean-subtracted, the mean neural activity over trials is not affected by ft_regressconfound; only the variance over trials is, which should result in a cleaner representation of the data. In order to estimate the contribution of different head positions to the neural data, ft_regressconfound relies on general linear modeling. Applying ft_regressconfound to the four blocks separately (your option 1) will involve four different model estimations and their associated errors. Because these errors may differ per estimation, the quality of treatment of the neural data may also differ per block. This will not affect the mean neural activity in each block, but it may affect the grand mean over all four blocks as for trials in one block more contribution from head position may be regressed out than for another. Applying ft_regressconfound on the data of the four blocks together (your option 2), will not affect the grand mean over the trials from all four blocks. It will reduce the influence of head movement on trial-by-trial variance in neural activity. This can be for better, or for worse: namely, if there are consistent differences in head positions between two conditions (captured in those four blocks), it may bring the means of neural activity evoked in these two conditions closer to each other, reducing effect sizes. In fact, the employment of ft_regressconfound allows one to make a good case that an observed effect (i.e. differential neural activity between the two conditions) cannot be attributed to differences in head positions when recording those conditions (note that the same analysis could also be performed with eye-movement related activity, or any other measure of a potential confound). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Vrijdag 7 februari 2014 17:03:40 > Onderwerp: [FieldTrip] ft_regressconfound > Dear all, > I am using regressconfound on Neuromag data. In CTF data, data for > coil1, coil2 and coil3 are generated and then circumcenter function is > called to compute 3 translational and 3 rotational dof. > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > channels that provide quarternion parameters q1 through q6, where > q4,q5 and q6 are translations in x, y and z directions. I am using > these q4,q5 and q6 to directly compute the rotational orientations > (using the last part of the circumcenter.m script). > It is said regressconfound must be used as a last step prior to stats. > I have 4 blocks of data for each subject. Which option below should I > follow? > 1. Apply regress confound separately to four blocks? But, then I have > to average these four blocks once again using ft_timelockanalysis, > then grand average using ft_timelockgrandaverage before computing > stats. > 2. Or should I append the four blocks first, then perform > regressconfound? In this case, I directly go to grandaverage and > stats. > Any suggestion is appreciated. > Thanks, > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Sat Feb 8 10:33:01 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Sat, 8 Feb 2014 10:33:01 +0100 Subject: [FieldTrip] time-frequency analysis: temporal alignment of output In-Reply-To: References: Message-ID: Hi, Eelke, Sure, here it is: cfg=[]; cfg.method = 'wavelet'; % or 'tfr' cfg.toi = []; cfg.foi = [1:12,14:2:30,35:5:100]; cfg.width = 7; cfg.gwidth = 5; cfg.trials = btn; I would be keen on using the mtmconvol method, but then I have to decide how to choose all of the parameters. Any guidelines? Thanks! Aaron On Fri, Feb 7, 2014 at 5:57 PM, Eelke Spaak wrote: > Hi Aaron, > > I had been assuming you were using cfg.method = 'mtmconvol', which > does an implicit wavelet convolution, but lets you specify the > parameters in terms of a window length, taper to use, and smoothing > parameter (if using slepian taper sequence). Mtmconvol is the method I > would almost always use, as it provides a greater degree of control > over and flexibility in the parameters. However, now I understand you > might be using cfg.method = 'wavelet'. Could you post the entire cfg > you are using for ft_freqanalysis? > > Best, > Eelke > > On 7 February 2014 17:39, Aaron Schurger wrote: >> Hi, Eelke, >> Thank you for your reply - that is very helpful indeed. One question >> remains then: how do I know what W is for each frequency band? I think >> W will of course depend on the frequency (in the case of morlet >> wavelets), being shorter for higher frequencies and longer for lower >> frequencies. I know that wavelets are defined in terms of the standard >> deviation of the envelope, but the window itself of course extends out >> beyond 1 std of the envelope, to some point beyond where the wavelet >> tapers to zero (I guess). So, if you know how I can compute W for any >> arbitrary frequency band, in the case of morlet wavelets, I would be >> very grateful. >> Thanks again! >> Aaron >> >> On Fri, Feb 7, 2014 at 12:56 PM, Eelke Spaak wrote: >>> Hi Aaron, >>> >>> Indeed, the value you get at t = 0.3 will correspond to the wavelet >>> (or, equivalently, the time window that was tapered and >>> Fourier-transformed) centered at that time point. So if your time >>> window (cfg.t_ftimwin) is 400ms long, the wavelet will have stretched >>> from t = 0.1 to t = 0.5 s. >>> >>> There is no default option to align the time points of interest to an >>> edge of the wavelet. However, there is a very straightforward solution >>> to what you are asking: if you want to make sure that the wavelet >>> 'knows nothing' of the future after e.g. t = 0.5s, then only consider >>> the time points up to and including t = 0.3s for any subsequent >>> analyses. (Or more general up to t = tA - W/2, where tA is the point >>> of interest beyond which no info can bleed into the wavelet, and W is >>> the window length.) >>> >>> Best, >>> Eelke >>> >>> On 7 February 2014 12:43, Aaron Schurger wrote: >>>> Hi, >>>> I am running a time-frequency analysis using ft_freqanalysis with the >>>> wavelet method. I assume that the output in each frequency band is >>>> temporally aligned to the midpoint of the wavelet (thinking in terms >>>> of convolution): i.e. the power value that I get at time 0.300, for a >>>> given frequency f, is precisely the dot product of f's wavelet >>>> CENTERED at 0.300 sec in the data. Is that correct? If so, how can I >>>> ask for the output of freqanalysis to be time aligned to the leading >>>> edge of the wavelet rather than the center? I.e. I want to make sure >>>> that each point in the output only has information about the past and >>>> knows nothing about the future, with respect to that time. Is there a >>>> simple way to do this? >>>> Thanks! >>>> Aaron >>>> >>>> -- >>>> Aaron Schurger, PhD >>>> Senior researcher >>>> Laboratory of Cognitive Neuroscience >>>> Brain-Mind Institute, Department of Life Sciences >>>> École Polytechnique Fédérale de Lausanne >>>> Station 19, AI 2101 >>>> 1015 Lausanne, Switzerland >>>> +41 21 693 1771 >>>> aaron.schurger at epfl.ch >>>> http://lnco.epfl.ch/ >>>> >>>> _______________________________________________ >>>> 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 >> >> >> >> -- >> Aaron Schurger, PhD >> Senior researcher >> Laboratory of Cognitive Neuroscience >> Brain-Mind Institute, Department of Life Sciences >> École Polytechnique Fédérale de Lausanne >> Station 19, AI 2101 >> 1015 Lausanne, Switzerland >> +41 21 693 1771 >> aaron.schurger at epfl.ch >> http://lnco.epfl.ch/ >> >> _______________________________________________ >> 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 -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From jm.horschig at donders.ru.nl Mon Feb 10 09:24:28 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 10 Feb 2014 09:24:28 +0100 Subject: [FieldTrip] ft_channelrepair layout problem In-Reply-To: References: Message-ID: <52F88CBC.7090804@donders.ru.nl> Hi Eduardo, it might help if you read in one of the template sensor descriptions (FieldTrip/template/electrode/) and check http://fieldtrip.fcdonders.nl/reference/ft_datatype_sens to get an idea what you need and what to do. Maybe there even is already an electrode template available for you. Best, Jörn On 2/7/2014 5:56 PM, Eduardo Schenberg wrote: > Hello all, > > I am having dificulties with the function ft_channelrepair because one of it's inputs must be cfg.elec (electrode positions) but I can't figure out how to convert my layout (I have it as an ascii .lay as well as .mat with the "lay" struct) to the proper format for ft_channelrepair > > Already tried the tutorials and ft_readsens and ft_datatype_sens but unfortunately I am still having trouble to solve this > > Can anyone help me out please?? > > many thanks > > eduardo > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From bingshuo.li at student.uni-tuebingen.de Mon Feb 10 15:05:51 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Mon, 10 Feb 2014 15:05:51 +0100 Subject: [FieldTrip] TMS-EEG Decay Artifact Message-ID: Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Mon Feb 10 15:24:39 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 10 Feb 2014 15:24:39 +0100 (CET) Subject: [FieldTrip] TMS-EEG Decay Artifact In-Reply-To: References: Message-ID: <007f01cf266b$d5524ad0$7ff6e070$@herring@fcdonders.ru.nl> Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the 'evil' decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Feb 10 17:02:34 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 10 Feb 2014 11:02:34 -0500 Subject: [FieldTrip] ft_regressconfound Message-ID: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> Dear Arjen Thanks for your prompt response. I understand your point regarding using ft_regressconfound with all 4 blocks together. I think that makes more sense. I have another question. I understand ft_regressconfound must be the last step. However, can time frequency calculation be done on data after employing regressconfound? Or would you suggest doing trial by trial time frequency calculation, then compensate using regressconfound and then compute timelock? Is there a reason not to do the former way? Thanks, Raghavan Dear Raghavan, It is indeed recommended to use ft_regressconfound as a last step prior to statistical assessment. It will remove trial-by-trial variance in the neural data that can be attributed to trial-by-trial variance in head position. The latter is approximated with regressors containing trial-by-trial information on head positions deviating from the session/experiment mean. Because the head position timeseries is mean-subtracted, the mean neural activity over trials is not affected by ft_regressconfound; only the variance over trials is, which should result in a cleaner representation of the data. In order to estimate the contribution of different head positions to the neural data, ft_regressconfound relies on general linear modeling. Applying ft_regressconfound to the four blocks separately (your option 1) will involve four different model estimations and their associated errors. Because these errors may differ per estimation, the quality of treatment of the neural data may also differ per block. This will not affect the mean neural activity in each block, but it may affect the grand mean over all four blocks as for trials in one block more contribution from head position may be regressed out than for another. Applying ft_regressconfound on the data of the four blocks together (your option 2), will not affect the grand mean over the trials from all four blocks. It will reduce the influence of head movement on trial-by-trial variance in neural activity. This can be for better, or for worse: namely, if there are consistent differences in head positions between two conditions (captured in those four blocks), it may bring the means of neural activity evoked in these two conditions closer to each other, reducing effect sizes. In fact, the employment of ft_regressconfound allows one to make a good case that an observed effect (i.e. differential neural activity between the two conditions) cannot be attributed to differences in head positions when recording those conditions (note that the same analysis could also be performed with eye-movement related activity, or any other measure of a potential confound). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Vrijdag 7 februari 2014 17:03:40 > Onderwerp: [FieldTrip] ft_regressconfound > Dear all, > I am using regressconfound on Neuromag data. In CTF data, data for > coil1, coil2 and coil3 are generated and then circumcenter function is > called to compute 3 translational and 3 rotational dof. > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > channels that provide quarternion parameters q1 through q6, where > q4,q5 and q6 are translations in x, y and z directions. I am using > these q4,q5 and q6 to directly compute the rotational orientations > (using the last part of the circumcenter.m script). > It is said regressconfound must be used as a last step prior to stats. > I have 4 blocks of data for each subject. Which option below should I > follow? > 1. Apply regress confound separately to four blocks? But, then I have > to average these four blocks once again using ft_timelockanalysis, > then grand average using ft_timelockgrandaverage before computing > stats. > 2. Or should I append the four blocks first, then perform > regressconfound? In this case, I directly go to grandaverage and > stats. > Any suggestion is appreciated. > Thanks, > Raghavan From cmoisello at gmail.com Mon Feb 10 18:03:06 2014 From: cmoisello at gmail.com (Clara Moisello) Date: Mon, 10 Feb 2014 12:03:06 -0500 Subject: [FieldTrip] question about ft_statfun_actvsblT Message-ID: Hello Fieldtrip community, I have a question re: ft_statfun_actvsblT What I would like to do is to identify electrodes whose power changes significantly from baseline at SINGLE subject level, i.e. across trials instead than across subjects. I was thinking that the function above would answer my needs, but I realized that it is probably meant for a between-subject type of comparison. Could someone shed some light on the issue, or has addressed the issue in any other way? Thanks! Clara -- Clara Moisello, PhD Dept Physiology, Pharmacology & Neuroscience City College of New York Harris Hall - Room 202 phone: +12126507487 fax: +12126507726 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Mon Feb 10 19:13:58 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Mon, 10 Feb 2014 19:13:58 +0100 (CET) Subject: [FieldTrip] ft_regressconfound In-Reply-To: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> Message-ID: <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, > I have another question. I understand ft_regressconfound must be the > last > step. However, can time frequency calculation be done on data after > employing regressconfound? Or would you suggest doing trial by trial > time > frequency calculation, then compensate using regressconfound and then > compute timelock? Is there a reason not to do the former way? I would recommend doing the latter, provided that you meant to say 'compute statistics' instead of 'compute timelock'. When ft_regressconfound is applied to raw/ERF data, trial-by-trial adjustments are made to the data, according to explained variance by head movements (and thus differences in distances to the sensors). Subsequently performing time frequency analysis on this data may give a distorted view of signal frequency powers. Note that if a source reconstruction analysis is also one of your follow-up steps, it is recommended to do this on the 'original' data, and then use ft_regressconfound at the source level. See 'Practical issues' on this page for the rationale behind this: http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis In sum, ft_regressconfound is best used as a last step prior ft_xxxstatistics. Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Maandag 10 februari 2014 17:02:34 > Onderwerp: Re: [FieldTrip] ft_regressconfound > Dear Arjen > Thanks for your prompt response. I understand your point regarding > using > ft_regressconfound with all 4 blocks together. I think that makes more > sense. > I have another question. I understand ft_regressconfound must be the > last > step. However, can time frequency calculation be done on data after > employing regressconfound? Or would you suggest doing trial by trial > time > frequency calculation, then compensate using regressconfound and then > compute timelock? Is there a reason not to do the former way? > > Thanks, > Raghavan > > Dear Raghavan, It is indeed recommended to use ft_regressconfound as a > last > step prior to statistical assessment. It will remove trial-by-trial > variance > in the neural data that can be attributed to trial-by-trial variance > in head > position. The latter is approximated with regressors containing > trial-by-trial information on head positions deviating from the > session/experiment mean. Because the head position timeseries is > mean-subtracted, the mean neural activity over trials is not affected > by > ft_regressconfound; only the variance over trials is, which should > result in > a cleaner representation of the data. In order to estimate the > contribution > of different head positions to the neural data, ft_regressconfound > relies on > general linear modeling. Applying ft_regressconfound to the four > blocks > separately (your option 1) will involve four different model > estimations and > their associated errors. Because these errors may differ per > estimation, the > quality of treatment of the neural data may also differ per block. > This will > not affect the mean neural activity in each block, but it may affect > the > grand mean over all four blocks as for trials in one block more > contribution > from head position may be regressed out than for another. Applying > ft_regressconfound on the data of the four blocks together (your > option 2), > will not affect the grand mean over the trials from all four blocks. > It will > reduce the influence of head movement on trial-by-trial variance in > neural > activity. This can be for better, or for worse: namely, if there are > consistent differences in head positions between two conditions > (captured in > those four blocks), it may bring the means of neural activity evoked > in > these two conditions closer to each other, reducing effect sizes. In > fact, > the employment of ft_regressconfound allows one to make a good case > that an > observed effect (i.e. differential neural activity between the two > conditions) cannot be attributed to differences in head positions when > recording those conditions (note that the same analysis could also be > performed with eye-movement related activity, or any other measure of > a > potential confound). Hope this helps, Arjen ----- Oorspronkelijk > bericht > ----- > > Van: "Raghavan Gopalakrishnan" > > Aan: fieldtrip at science.ru.nl > > Verzonden: Vrijdag 7 februari 2014 17:03:40 > > Onderwerp: [FieldTrip] ft_regressconfound > > Dear all, > > I am using regressconfound on Neuromag data. In CTF data, data for > > coil1, coil2 and coil3 are generated and then circumcenter function > > is > > called to compute 3 translational and 3 rotational dof. > > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > > channels that provide quarternion parameters q1 through q6, where > > q4,q5 and q6 are translations in x, y and z directions. I am using > > these q4,q5 and q6 to directly compute the rotational orientations > > (using the last part of the circumcenter.m script). > > It is said regressconfound must be used as a last step prior to > > stats. > > I have 4 blocks of data for each subject. Which option below should > > I > > follow? > > 1. Apply regress confound separately to four blocks? But, then I > > have > > to average these four blocks once again using ft_timelockanalysis, > > then grand average using ft_timelockgrandaverage before computing > > stats. > > 2. Or should I append the four blocks first, then perform > > regressconfound? In this case, I directly go to grandaverage and > > stats. > > Any suggestion is appreciated. > > Thanks, > > Raghavan > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl From e.maris at psych.ru.nl Mon Feb 10 21:14:27 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 10 Feb 2014 21:14:27 +0100 (CET) Subject: [FieldTrip] question about ft_statfun_actvsblT In-Reply-To: References: Message-ID: <060301cf269c$af87a5d0$0e96f170$@maris@psych.ru.nl> Hi Laura, What I would like to do is to identify electrodes whose power changes significantly from baseline at SINGLE subject level, i.e. across trials instead than across subjects. I was thinking that the function above would answer my needs, but I realized that it is probably meant for a between-subject type of comparison. Could someone shed some light on the issue, or has addressed the issue in any other way? No problem. You can do this. Have a look here: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq, and in particular in the section "Within-trials experiments". Best, Eric Maris Thanks! Clara -- Clara Moisello, PhD Dept Physiology, Pharmacology & Neuroscience City College of New York Harris Hall - Room 202 phone: +12126507487 fax: +12126507726 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Tue Feb 11 16:16:23 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Tue, 11 Feb 2014 15:16:23 +0000 Subject: [FieldTrip] Issue with ft_databrowser Message-ID: <52FA3EC7.9010600@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Tue Feb 11 16:54:01 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Tue, 11 Feb 2014 16:54:01 +0100 (CET) Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <52FA3EC7.9010600@glasgow.ac.uk> Message-ID: <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> Hi May, The first possible options is that you need to use Matlab2011b - anything more updated can lead to a change in calculations (which may not give an error) or a crash (which might be what is happening). However, I'm not the most familiar with the output below, if this is not the solution I'm sure someone else can help. Best, Nietzsche ----- Original Message ----- > From: "Heng-Ru May Tan" > To: fieldtrip at science.ru.nl > Sent: Tuesday, 11 February, 2014 4:16:23 PM > Subject: [FieldTrip] Issue with ft_databrowser > Hello, > > I have been unable to use ft_databrowser today to view ICA components; > which is slightly strange. It used to work... > I have just installed fieldtrip-20140210 and using Matlab13b on 64bit > machine -- which led to repeated crash issue, as with > fieldtrip-20140114 which I tried on Matlab12a and 13b. > > Does anyone have any ideas as to what could lead to the problem? > Quoted below is structure of input compASSR and what Matlab spewed > when attempting to continue. > > Thanks in advance, > May > > > > > >> compASSR > > compASSR = > > fsample: 1.0172e+03 > time: {1x104 cell} > trial: {1x104 cell} > topo: [233x50 double] > unmixing: [50x233 double] > label: {50x1 cell} > topolabel: {233x1 cell} > sampleinfo: [104x2 double] > cfg: [1x1 struct] > > > > >> cfg=[]; > > % cfg.channel=[{'MEG'} badChansList]; > cfg.continuous = 'yes'; > cfg.channels = [1:10]; > cfg.layout = '4D248.lay'; > cfg.viewmode = 'component'; > >> ft_databrowser(cfg,compASSR) > reading layout from file 4D248.lay > the call to "ft_prepare_layout" took 0 seconds > the input is component data with 50 components and 233 original > channels > detected 0 visual artifacts > > ------------------------------------------------------------------------ > Access violation detected at Tue Feb 11 14:54:01 2014 > ------------------------------------------------------------------------ > > Configuration: > Crash Decoding : Disabled > Default Encoding : windows-1252 > MATLAB Architecture: win64 > MATLAB Root : C:\Program Files\MATLAB\R2013b > MATLAB Version : 8.2.0.701 (R2013b) > Operating System : Microsoft Windows 7 > Processor ID : x86 Family 6 Model 26 Stepping 5, GenuineIntel > Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java > HotSpot(TM) 64-Bit Server VM mixed mode > Window System : Version 6.1 (Build 7601: Service Pack 1) > > Fault Count: 1 > > > Abnormal termination: > Access violation > > Register State (from fault): > RAX = 00000000000001a4 RBX = 0000000027620080 > RCX = 00000000000262de RDX = 00000000000001b2 > RSP = 0000000004023340 RBP = 000000000000007e > RSI = 00000001240fbcd0 RDI = 00000001394eb996 > > R8 = 00000000000262de R9 = 0000000000000230 > R10 = 0000000000000000 R11 = 0000000004023418 > R12 = 0000000000f206cd R13 = 00000000a4f5fe90 > R14 = 000000000002635c R15 = 00000000000006c8 > > RIP = 0000000006583211 EFL = 00010216 > > CS = 0033 FS = 0053 GS = 002b > > Stack Trace (from fault): > [ 0] 0x0000000006583211 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02896401 > RenderEngineBase::~RenderEngineBase+00148801 > [ 1] 0x00000000064fc8ae C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02345134 text_to_pixel+00005038 > [ 2] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 3] 0x000000000646573d C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01726269 > renderAnimatedKids+00000509 > [ 4] 0x000000000646a5ad C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01746349 getARDonAxis+00010413 > [ 5] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 6] 0x000000000648c51a C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01885466 > FigureSetVisualAutoMode+00001594 > [ 7] 0x00000000064912ed C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01905389 > UIJ_CreatePeerWindow+00001789 > [ 8] 0x0000000006531733 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > GO_TransformObject+00000915 > [ 9] 0x0000000006589358 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+02921304 > RenderEngineBase::~RenderEngineBase+00173704 > [ 10] 0x000000000648df14 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01892116 > FigureSetVisualAutoMode+00008244 > [ 11] 0x000000000648df8d C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01892237 > FigureSetVisualAutoMode+00008365 > [ 12] 0x00000000060db67f C:\Program > Files\MATLAB\R2013b\bin\win64\libmwgui.dll+00439935 > wm_ExposeFcn_Pre_Optional+00000303 > [ 13] 0x000000006b6fae14 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00175636 > GetframeJava+00001124 > [ 14] 0x000000006b6fcd5e C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00183646 > UIJ_IsWindowShowing+00000430 > [ 15] 0x000000006b6feab8 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191160 > UIJ_clearWaitForResize+00002472 > [ 16] 0x000000006b6febcd C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191437 > UIJ_ExposeFcn+00000141 > [ 17] 0x000000006b6d3bce C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015310 > UIJ_MarkEventFinished+00005998 > [ 18] 0x000000006b6d3c20 C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015392 > UIJ_MarkEventFinished+00006080 > [ 19] 0x000000006b6f795c C:\Program > Files\MATLAB\R2013b\bin\win64\libuij.dll+00162140 > uij::JavaDraw2D::paintQuadStrip+00001500 > [ 20] 0x000000006c68ae38 C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00241208 > uddSetListenerRecursionWarning+00000680 > [ 21] 0x000000006c68b48c C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00242828 > UDListenerManagerHost::notifyEvent+00000076 > [ 22] 0x000000006c6838dd C:\Program > Files\MATLAB\R2013b\bin\win64\udd.dll+00211165 > UDEventInfo::send+00000093 > [ 23] 0x000000006b2f7d7f C:\Program > Files\MATLAB\R2013b\bin\win64\udd_mi.dll+00032127 > MErrorException::operator=+00027919 > [ 24] 0x000000006b01fa96 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > UIW_IsUserMessage+00000086 > [ 25] 0x000000006b020175 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > UIW_SetGLIMUserMsg+00000117 > [ 26] 0x000000006b0201f9 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > UIW_SetGLIMUserMsg+00000249 > [ 27] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > GetMenuBarInfo+00000638 > [ 28] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > SystemParametersInfoW+00000235 > [ 29] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > IsProcessDPIAware+00000465 > [ 30] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > KiUserCallbackDispatcher+00000031 > [ 31] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > PeekMessageW+00000186 > [ 32] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > GetKeyState+00000238 > [ 33] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > PeekMessageA+00000087 > [ 34] 0x000000006aff94db C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > UIW_SetCurrentDialog+00000731 > [ 35] 0x000000006b021632 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > ws_FreeSystemFont+00000482 > [ 36] 0x000000006f156600 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > [ 37] 0x000000006f156fc5 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > [ 38] 0x000000006f157e10 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > [ 39] 0x000000006f160596 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > sysq::removeProcessPendingEventsHook+00010998 > [ 40] 0x000000006f16089a C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > svWS_ProcessPendingEvents+00000138 > [ 41] 0x00000000064937f0 C:\Program > Files\MATLAB\R2013b\bin\win64\hg.dll+01914864 > hgWaitforbuttonpress+00001552 > [ 42] 0x000000018000d7ff C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00055295 > Mfh_file::dispatch_fh+00001167 > [ 43] 0x000000018000ddb7 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00056759 > Mfunction_handle::dispatch+00000487 > [ 44] 0x0000000004e96a81 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > inFunctionHandleInterface::DestroyWorkspace+00308737 > [ 45] 0x0000000004e9303e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00471102 > inFunctionHandleInterface::DestroyWorkspace+00293822 > [ 46] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 47] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 48] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 49] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 50] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 51] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 52] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 53] 0x0000000004e6c634 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00312884 > inFunctionHandleInterface::DestroyWorkspace+00135604 > [ 54] 0x0000000004e7fa37 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00391735 > inFunctionHandleInterface::DestroyWorkspace+00214455 > [ 55] 0x0000000004e9dc4f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00515151 > inFunctionHandleInterface::DestroyWorkspace+00337871 > [ 56] 0x0000000004e86639 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00419385 > inFunctionHandleInterface::DestroyWorkspace+00242105 > [ 57] 0x0000000004e8feaf C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00458415 > inFunctionHandleInterface::DestroyWorkspace+00281135 > [ 58] 0x0000000004e92e23 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00470563 > inFunctionHandleInterface::DestroyWorkspace+00293283 > [ 59] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 60] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 61] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 62] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 63] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 64] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 65] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 66] 0x0000000004e96a81 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > inFunctionHandleInterface::DestroyWorkspace+00308737 > [ 67] 0x0000000004f20657 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01050199 > inEachVisibleName+00015383 > [ 68] 0x0000000004e946c2 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00476866 > inFunctionHandleInterface::DestroyWorkspace+00299586 > [ 69] 0x0000000004e7b85f C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > inFunctionHandleInterface::DestroyWorkspace+00197599 > [ 70] 0x0000000004e7b7c8 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > inFunctionHandleInterface::DestroyWorkspace+00197448 > [ 71] 0x0000000004e9ebbd C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > inFunctionHandleInterface::DestroyWorkspace+00341821 > [ 72] 0x0000000004e9b5cc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > inFunctionHandleInterface::DestroyWorkspace+00328012 > [ 73] 0x0000000004e7e529 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > inFunctionHandleInterface::DestroyWorkspace+00209065 > [ 74] 0x000000018000d612 C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > Mfh_file::dispatch_fh+00000674 > [ 75] 0x000000018000defa C:\Program > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > Mfunction_handle::dispatch+00000810 > [ 76] 0x0000000004f3438e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01131406 > inSetWorkSpaces+00001262 > [ 77] 0x0000000004f406f5 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01181429 > SetInterpreter+00000325 > [ 78] 0x0000000004f42cb5 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191093 > inEvalCmd+00008789 > [ 79] 0x0000000004f42c82 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191042 > inEvalCmd+00008738 > [ 80] 0x0000000004f42c47 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01190983 > inEvalCmd+00008679 > [ 81] 0x000000000532ad0c C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05287180 > inMexPutVariable+00008364 > [ 82] 0x000000000532b066 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05288038 > inMexPutVariable+00009222 > [ 83] 0x000000000532b49e C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289118 > inMexPutVariable+00010302 > [ 84] 0x000000000532b7dc C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289948 > inMexPutVariable+00011132 > [ 85] 0x000000000523ff91 C:\Program > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+04325265 > inEvalCmdWithLocalReturn+00000065 > [ 86] 0x000000006c71be9d C:\Program > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00048797 > mnDebugPrompt+00000109 > [ 87] 0x000000006c71cf7f C:\Program > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00053119 > mnParser+00000735 > [ 88] 0x000000006e4ff4b4 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00193716 > mcrInstance::mnParser_on_interpreter_thread+00000036 > [ 89] 0x000000006e4e44b0 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083120 > mcr::runtime::setInterpreterThreadToCurrent+00029472 > [ 90] 0x000000006e4e4510 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083216 > mcr::runtime::setInterpreterThreadToCurrent+00029568 > [ 91] 0x000000006b01fa96 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > UIW_IsUserMessage+00000086 > [ 92] 0x000000006b020175 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > UIW_SetGLIMUserMsg+00000117 > [ 93] 0x000000006b0201f9 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > UIW_SetGLIMUserMsg+00000249 > [ 94] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > GetMenuBarInfo+00000638 > [ 95] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > SystemParametersInfoW+00000235 > [ 96] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > IsProcessDPIAware+00000465 > [ 97] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > KiUserCallbackDispatcher+00000031 > [ 98] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > PeekMessageW+00000186 > [ 99] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > GetKeyState+00000238 > [100] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > PeekMessageA+00000087 > [101] 0x000000006aff94db C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > UIW_SetCurrentDialog+00000731 > [102] 0x000000006b021632 C:\Program > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > ws_FreeSystemFont+00000482 > [103] 0x000000006f156600 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > [104] 0x000000006f156fc5 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > [105] 0x000000006f157e10 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > [106] 0x000000006f160596 C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > sysq::removeProcessPendingEventsHook+00010998 > [107] 0x000000006f16089a C:\Program > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > svWS_ProcessPendingEvents+00000138 > [108] 0x000000006e4e552d C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00087341 > mcr::runtime::setInterpreterThreadToCurrent+00033693 > [109] 0x000000006e4e57fb C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00088059 > mcr::runtime::setInterpreterThreadToCurrent+00034411 > [110] 0x000000006e4d9545 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00038213 > mcrInstantiationError::operator=+00003221 > [111] 0x000000006e4dc872 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00051314 > mcr_invoke_on_interpreter_thread+00001602 > [112] 0x000000006e4e98e6 C:\Program > Files\MATLAB\R2013b\bin\win64\mcr.dll+00104678 mcrDesktopMain+00000230 > [113] 0x0000000140004f0b C:\Program > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00020235 > [114] 0x0000000140006a07 C:\Program > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00027143 > [115] 0x0000000076cb652d C:\Windows\system32\kernel32.dll+00091437 > BaseThreadInitThunk+00000013 > [116] 0x0000000076dec541 C:\Windows\SYSTEM32\ntdll.dll+00181569 > RtlUserThreadStart+00000033 > > > If this problem is reproducible, please submit a Service Request via: > http://www.mathworks.com/support/contact_us/ > > A technical support engineer might contact you with further > information. > > Thank you for your help.** This crash report has been saved to disk as > C:\Users\######\AppData\Local\Temp\matlab_crash_dump.11620-1 ** > > > Error using setappdata > Invalid object handle > > Error in ft_databrowser>redraw_cb (line 1896) > setappdata(h, 'opt', opt); > > Error in ft_databrowser (line 676) > redraw_cb(h); > > [Please exit and restart MATLAB]>> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From alik.widge at gmail.com Tue Feb 11 17:11:54 2014 From: alik.widge at gmail.com (Alik Widge) Date: Tue, 11 Feb 2014 11:11:54 -0500 Subject: [FieldTrip] ft_timelockgrandaverage -- bug or as-designed? Message-ID: I have encountered a behavior with ft_timelockgrandaverage that seems to me to be a bug, but I'm not quite sure. Hence why I am asking here and not just filing a bug. I'm using the attached .mat, and you can replicate the behavior with: cfg = []; cfg.channel = 'all'; cfg.keepindividual = 'no'; cfg.method = 'within'; out_data = ft_timelockgrandaverage(cfg,Dstruct.on.MSITOnset.global.x{:}); This will crash due to an array dimension mismatch. It does so because my different subjects/blocks in x{:} have different numbers of samples. Up around line 147, the ft_ function goes through varargin{:} and cuts down the averaged variable (in my case, 'avg') so that it has the same number of samples in each of the varargin{:} data structures. The thing that I feel is a bug: it cuts the data, (expressed as varargin{i}.(cfg.parameter) ), but it does NOT similarly cut the variance ( varargin{i}.var ) or the per-timepoint DOF ( varargin{i}.dof ). As a result, when it gets to line 193 and tries to do avgmat(s, :, :) = varargin{s}.(cfg.parameter).*varargin{s}.dof; the (cfg.parameter) and dof matrices are now of different sizes, and we crash. I can add my desired behavior to a local copy of the function and keep working, but would appreciate some advice on whether this is actually a bug, or somehow a design feature that I've failed to understand. Alik Widge alik.widge at gmail.com (206) 866-5435 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 11 17:24:24 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 11 Feb 2014 17:24:24 +0100 Subject: [FieldTrip] ft_timelockgrandaverage -- bug or as-designed? In-Reply-To: References: Message-ID: <693C3ECE-ABE6-4E18-88B5-08D5E2354109@donders.ru.nl> Dear Alik, Thanks for reporting this. To me it sounds indeed like a bug. It would be great if you could file this as such on our bugzilla bug-tracking system. www.bugzilla.fcdonders.nl. If you create yourself an account and file a new bug, with the contents of this e-mail, we can take it from there. If you already have a fixed version of the code, feel free to attach it as attachment to the bug ;-). Best wishes, Jan-Mathijs On Feb 11, 2014, at 5:11 PM, Alik Widge wrote: > I have encountered a behavior with ft_timelockgrandaverage that seems to me to be a bug, but I'm not quite sure. Hence why I am asking here and not just filing a bug. I'm using the attached .mat, and you can replicate the behavior with: > > cfg = []; > cfg.channel = 'all'; > cfg.keepindividual = 'no'; > cfg.method = 'within'; > > out_data = ft_timelockgrandaverage(cfg,Dstruct.on.MSITOnset.global.x{:}); > > > This will crash due to an array dimension mismatch. It does so because my different subjects/blocks in x{:} have different numbers of samples. Up around line 147, the ft_ function goes through varargin{:} and cuts down the averaged variable (in my case, 'avg') so that it has the same number of samples in each of the varargin{:} data structures. > The thing that I feel is a bug: it cuts the data, (expressed as varargin{i}.(cfg.parameter) ), but it does NOT similarly cut the variance ( varargin{i}.var ) or the per-timepoint DOF ( varargin{i}.dof ). As a result, when it gets to line 193 and tries to do > > avgmat(s, :, :) = varargin{s}.(cfg.parameter).*varargin{s}.dof; > > the (cfg.parameter) and dof matrices are now of different sizes, and we crash. > > I can add my desired behavior to a local copy of the function and keep working, but would appreciate some advice on whether this is actually a bug, or somehow a design feature that I've failed to understand. > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From elmeri.syrjanen at gmail.com Tue Feb 11 17:25:55 2014 From: elmeri.syrjanen at gmail.com (=?ISO-8859-1?Q?Elmeri_Syrj=E4nen?=) Date: Tue, 11 Feb 2014 17:25:55 +0100 Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> References: <52FA3EC7.9010600@glasgow.ac.uk> <1944142992.759534.1392134041895.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear May, this is a reported bug that appeared sometime in September in the fieldtrip code. Here's the bugzilla thread: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2316 /elmeri On Tue, Feb 11, 2014 at 4:54 PM, Lam, Nietzsche wrote: > Hi May, > > The first possible options is that you need to use Matlab2011b - anything > more updated can lead to a change in calculations (which may not give an > error) or a crash (which might be what is happening). However, I'm not the > most familiar with the output below, if this is not the solution I'm sure > someone else can help. > > Best, > Nietzsche > > ----- Original Message ----- > > From: "Heng-Ru May Tan" > > To: fieldtrip at science.ru.nl > > Sent: Tuesday, 11 February, 2014 4:16:23 PM > > Subject: [FieldTrip] Issue with ft_databrowser > > Hello, > > > > I have been unable to use ft_databrowser today to view ICA components; > > which is slightly strange. It used to work... > > I have just installed fieldtrip-20140210 and using Matlab13b on 64bit > > machine -- which led to repeated crash issue, as with > > fieldtrip-20140114 which I tried on Matlab12a and 13b. > > > > Does anyone have any ideas as to what could lead to the problem? > > Quoted below is structure of input compASSR and what Matlab spewed > > when attempting to continue. > > > > Thanks in advance, > > May > > > > > > > > > > >> compASSR > > > > compASSR = > > > > fsample: 1.0172e+03 > > time: {1x104 cell} > > trial: {1x104 cell} > > topo: [233x50 double] > > unmixing: [50x233 double] > > label: {50x1 cell} > > topolabel: {233x1 cell} > > sampleinfo: [104x2 double] > > cfg: [1x1 struct] > > > > > > > > >> cfg=[]; > > > > % cfg.channel=[{'MEG'} badChansList]; > > cfg.continuous = 'yes'; > > cfg.channels = [1:10]; > > cfg.layout = '4D248.lay'; > > cfg.viewmode = 'component'; > > >> ft_databrowser(cfg,compASSR) > > reading layout from file 4D248.lay > > the call to "ft_prepare_layout" took 0 seconds > > the input is component data with 50 components and 233 original > > channels > > detected 0 visual artifacts > > > > ------------------------------------------------------------------------ > > Access violation detected at Tue Feb 11 14:54:01 2014 > > ------------------------------------------------------------------------ > > > > Configuration: > > Crash Decoding : Disabled > > Default Encoding : windows-1252 > > MATLAB Architecture: win64 > > MATLAB Root : C:\Program Files\MATLAB\R2013b > > MATLAB Version : 8.2.0.701 (R2013b) > > Operating System : Microsoft Windows 7 > > Processor ID : x86 Family 6 Model 26 Stepping 5, GenuineIntel > > Virtual Machine : Java 1.7.0_11-b21 with Oracle Corporation Java > > HotSpot(TM) 64-Bit Server VM mixed mode > > Window System : Version 6.1 (Build 7601: Service Pack 1) > > > > Fault Count: 1 > > > > > > Abnormal termination: > > Access violation > > > > Register State (from fault): > > RAX = 00000000000001a4 RBX = 0000000027620080 > > RCX = 00000000000262de RDX = 00000000000001b2 > > RSP = 0000000004023340 RBP = 000000000000007e > > RSI = 00000001240fbcd0 RDI = 00000001394eb996 > > > > R8 = 00000000000262de R9 = 0000000000000230 > > R10 = 0000000000000000 R11 = 0000000004023418 > > R12 = 0000000000f206cd R13 = 00000000a4f5fe90 > > R14 = 000000000002635c R15 = 00000000000006c8 > > > > RIP = 0000000006583211 EFL = 00010216 > > > > CS = 0033 FS = 0053 GS = 002b > > > > Stack Trace (from fault): > > [ 0] 0x0000000006583211 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02896401 > > RenderEngineBase::~RenderEngineBase+00148801 > > [ 1] 0x00000000064fc8ae C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02345134 text_to_pixel+00005038 > > [ 2] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 3] 0x000000000646573d C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01726269 > > renderAnimatedKids+00000509 > > [ 4] 0x000000000646a5ad C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01746349 getARDonAxis+00010413 > > [ 5] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 6] 0x000000000648c51a C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01885466 > > FigureSetVisualAutoMode+00001594 > > [ 7] 0x00000000064912ed C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01905389 > > UIJ_CreatePeerWindow+00001789 > > [ 8] 0x0000000006531733 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02561843 > > GO_TransformObject+00000915 > > [ 9] 0x0000000006589358 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+02921304 > > RenderEngineBase::~RenderEngineBase+00173704 > > [ 10] 0x000000000648df14 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01892116 > > FigureSetVisualAutoMode+00008244 > > [ 11] 0x000000000648df8d C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01892237 > > FigureSetVisualAutoMode+00008365 > > [ 12] 0x00000000060db67f C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwgui.dll+00439935 > > wm_ExposeFcn_Pre_Optional+00000303 > > [ 13] 0x000000006b6fae14 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00175636 > > GetframeJava+00001124 > > [ 14] 0x000000006b6fcd5e C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00183646 > > UIJ_IsWindowShowing+00000430 > > [ 15] 0x000000006b6feab8 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191160 > > UIJ_clearWaitForResize+00002472 > > [ 16] 0x000000006b6febcd C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00191437 > > UIJ_ExposeFcn+00000141 > > [ 17] 0x000000006b6d3bce C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015310 > > UIJ_MarkEventFinished+00005998 > > [ 18] 0x000000006b6d3c20 C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00015392 > > UIJ_MarkEventFinished+00006080 > > [ 19] 0x000000006b6f795c C:\Program > > Files\MATLAB\R2013b\bin\win64\libuij.dll+00162140 > > uij::JavaDraw2D::paintQuadStrip+00001500 > > [ 20] 0x000000006c68ae38 C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00241208 > > uddSetListenerRecursionWarning+00000680 > > [ 21] 0x000000006c68b48c C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00242828 > > UDListenerManagerHost::notifyEvent+00000076 > > [ 22] 0x000000006c6838dd C:\Program > > Files\MATLAB\R2013b\bin\win64\udd.dll+00211165 > > UDEventInfo::send+00000093 > > [ 23] 0x000000006b2f7d7f C:\Program > > Files\MATLAB\R2013b\bin\win64\udd_mi.dll+00032127 > > MErrorException::operator=+00027919 > > [ 24] 0x000000006b01fa96 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > > UIW_IsUserMessage+00000086 > > [ 25] 0x000000006b020175 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > > UIW_SetGLIMUserMsg+00000117 > > [ 26] 0x000000006b0201f9 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > > UIW_SetGLIMUserMsg+00000249 > > [ 27] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > > GetMenuBarInfo+00000638 > > [ 28] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > > SystemParametersInfoW+00000235 > > [ 29] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > > IsProcessDPIAware+00000465 > > [ 30] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > > KiUserCallbackDispatcher+00000031 > > [ 31] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > > PeekMessageW+00000186 > > [ 32] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > > GetKeyState+00000238 > > [ 33] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > > PeekMessageA+00000087 > > [ 34] 0x000000006aff94db C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > > UIW_SetCurrentDialog+00000731 > > [ 35] 0x000000006b021632 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > > ws_FreeSystemFont+00000482 > > [ 36] 0x000000006f156600 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > > [ 37] 0x000000006f156fc5 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > > [ 38] 0x000000006f157e10 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > > [ 39] 0x000000006f160596 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > > sysq::removeProcessPendingEventsHook+00010998 > > [ 40] 0x000000006f16089a C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > > svWS_ProcessPendingEvents+00000138 > > [ 41] 0x00000000064937f0 C:\Program > > Files\MATLAB\R2013b\bin\win64\hg.dll+01914864 > > hgWaitforbuttonpress+00001552 > > [ 42] 0x000000018000d7ff C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00055295 > > Mfh_file::dispatch_fh+00001167 > > [ 43] 0x000000018000ddb7 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00056759 > > Mfunction_handle::dispatch+00000487 > > [ 44] 0x0000000004e96a81 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > > inFunctionHandleInterface::DestroyWorkspace+00308737 > > [ 45] 0x0000000004e9303e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00471102 > > inFunctionHandleInterface::DestroyWorkspace+00293822 > > [ 46] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 47] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 48] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 49] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 50] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 51] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 52] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 53] 0x0000000004e6c634 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00312884 > > inFunctionHandleInterface::DestroyWorkspace+00135604 > > [ 54] 0x0000000004e7fa37 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00391735 > > inFunctionHandleInterface::DestroyWorkspace+00214455 > > [ 55] 0x0000000004e9dc4f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00515151 > > inFunctionHandleInterface::DestroyWorkspace+00337871 > > [ 56] 0x0000000004e86639 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00419385 > > inFunctionHandleInterface::DestroyWorkspace+00242105 > > [ 57] 0x0000000004e8feaf C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00458415 > > inFunctionHandleInterface::DestroyWorkspace+00281135 > > [ 58] 0x0000000004e92e23 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00470563 > > inFunctionHandleInterface::DestroyWorkspace+00293283 > > [ 59] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 60] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 61] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 62] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 63] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 64] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 65] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 66] 0x0000000004e96a81 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00486017 > > inFunctionHandleInterface::DestroyWorkspace+00308737 > > [ 67] 0x0000000004f20657 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01050199 > > inEachVisibleName+00015383 > > [ 68] 0x0000000004e946c2 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00476866 > > inFunctionHandleInterface::DestroyWorkspace+00299586 > > [ 69] 0x0000000004e7b85f C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374879 > > inFunctionHandleInterface::DestroyWorkspace+00197599 > > [ 70] 0x0000000004e7b7c8 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00374728 > > inFunctionHandleInterface::DestroyWorkspace+00197448 > > [ 71] 0x0000000004e9ebbd C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00519101 > > inFunctionHandleInterface::DestroyWorkspace+00341821 > > [ 72] 0x0000000004e9b5cc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00505292 > > inFunctionHandleInterface::DestroyWorkspace+00328012 > > [ 73] 0x0000000004e7e529 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+00386345 > > inFunctionHandleInterface::DestroyWorkspace+00209065 > > [ 74] 0x000000018000d612 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00054802 > > Mfh_file::dispatch_fh+00000674 > > [ 75] 0x000000018000defa C:\Program > > Files\MATLAB\R2013b\bin\win64\m_dispatcher.dll+00057082 > > Mfunction_handle::dispatch+00000810 > > [ 76] 0x0000000004f3438e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01131406 > > inSetWorkSpaces+00001262 > > [ 77] 0x0000000004f406f5 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01181429 > > SetInterpreter+00000325 > > [ 78] 0x0000000004f42cb5 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191093 > > inEvalCmd+00008789 > > [ 79] 0x0000000004f42c82 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01191042 > > inEvalCmd+00008738 > > [ 80] 0x0000000004f42c47 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+01190983 > > inEvalCmd+00008679 > > [ 81] 0x000000000532ad0c C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05287180 > > inMexPutVariable+00008364 > > [ 82] 0x000000000532b066 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05288038 > > inMexPutVariable+00009222 > > [ 83] 0x000000000532b49e C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289118 > > inMexPutVariable+00010302 > > [ 84] 0x000000000532b7dc C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+05289948 > > inMexPutVariable+00011132 > > [ 85] 0x000000000523ff91 C:\Program > > Files\MATLAB\R2013b\bin\win64\m_interpreter.dll+04325265 > > inEvalCmdWithLocalReturn+00000065 > > [ 86] 0x000000006c71be9d C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00048797 > > mnDebugPrompt+00000109 > > [ 87] 0x000000006c71cf7f C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwbridge.dll+00053119 > > mnParser+00000735 > > [ 88] 0x000000006e4ff4b4 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00193716 > > mcrInstance::mnParser_on_interpreter_thread+00000036 > > [ 89] 0x000000006e4e44b0 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083120 > > mcr::runtime::setInterpreterThreadToCurrent+00029472 > > [ 90] 0x000000006e4e4510 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00083216 > > mcr::runtime::setInterpreterThreadToCurrent+00029568 > > [ 91] 0x000000006b01fa96 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00391830 > > UIW_IsUserMessage+00000086 > > [ 92] 0x000000006b020175 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393589 > > UIW_SetGLIMUserMsg+00000117 > > [ 93] 0x000000006b0201f9 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00393721 > > UIW_SetGLIMUserMsg+00000249 > > [ 94] 0x0000000076bc87fe C:\Windows\system32\USER32.dll+00165886 > > GetMenuBarInfo+00000638 > > [ 95] 0x0000000076baf5fb C:\Windows\system32\USER32.dll+00062971 > > SystemParametersInfoW+00000235 > > [ 96] 0x0000000076bb4895 C:\Windows\system32\USER32.dll+00084117 > > IsProcessDPIAware+00000465 > > [ 97] 0x0000000076e111f5 C:\Windows\SYSTEM32\ntdll.dll+00332277 > > KiUserCallbackDispatcher+00000031 > > [ 98] 0x0000000076bb908a C:\Windows\system32\USER32.dll+00102538 > > PeekMessageW+00000186 > > [ 99] 0x0000000076bb50fe C:\Windows\system32\USER32.dll+00086270 > > GetKeyState+00000238 > > [100] 0x0000000076bb3a6f C:\Windows\system32\USER32.dll+00080495 > > PeekMessageA+00000087 > > [101] 0x000000006aff94db C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00234715 > > UIW_SetCurrentDialog+00000731 > > [102] 0x000000006b021632 C:\Program > > Files\MATLAB\R2013b\bin\win64\uiw.dll+00398898 > > ws_FreeSystemFont+00000482 > > [103] 0x000000006f156600 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01009152 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00055552 > > [104] 0x000000006f156fc5 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01011653 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00058053 > > [105] 0x000000006f157e10 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01015312 > > services::system_events::PpeDispatchHook::~PpeDispatchHook+00061712 > > [106] 0x000000006f160596 C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050006 > > sysq::removeProcessPendingEventsHook+00010998 > > [107] 0x000000006f16089a C:\Program > > Files\MATLAB\R2013b\bin\win64\libmwservices.dll+01050778 > > svWS_ProcessPendingEvents+00000138 > > [108] 0x000000006e4e552d C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00087341 > > mcr::runtime::setInterpreterThreadToCurrent+00033693 > > [109] 0x000000006e4e57fb C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00088059 > > mcr::runtime::setInterpreterThreadToCurrent+00034411 > > [110] 0x000000006e4d9545 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00038213 > > mcrInstantiationError::operator=+00003221 > > [111] 0x000000006e4dc872 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00051314 > > mcr_invoke_on_interpreter_thread+00001602 > > [112] 0x000000006e4e98e6 C:\Program > > Files\MATLAB\R2013b\bin\win64\mcr.dll+00104678 mcrDesktopMain+00000230 > > [113] 0x0000000140004f0b C:\Program > > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00020235 > > [114] 0x0000000140006a07 C:\Program > > Files\MATLAB\R2013b\bin\win64\MATLAB.exe+00027143 > > [115] 0x0000000076cb652d C:\Windows\system32\kernel32.dll+00091437 > > BaseThreadInitThunk+00000013 > > [116] 0x0000000076dec541 C:\Windows\SYSTEM32\ntdll.dll+00181569 > > RtlUserThreadStart+00000033 > > > > > > If this problem is reproducible, please submit a Service Request via: > > http://www.mathworks.com/support/contact_us/ > > > > A technical support engineer might contact you with further > > information. > > > > Thank you for your help.** This crash report has been saved to disk as > > C:\Users\######\AppData\Local\Temp\matlab_crash_dump.11620-1 ** > > > > > > Error using setappdata > > Invalid object handle > > > > Error in ft_databrowser>redraw_cb (line 1896) > > setappdata(h, 'opt', opt); > > > > Error in ft_databrowser (line 676) > > redraw_cb(h); > > > > [Please exit and restart MATLAB]>> > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > 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 Heng-RuMay.Tan at glasgow.ac.uk Tue Feb 11 18:02:51 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Tue, 11 Feb 2014 17:02:51 +0000 Subject: [FieldTrip] Issue with ft_databrowser In-Reply-To: <52FA3EC7.9010600@glasgow.ac.uk> References: <52FA3EC7.9010600@glasgow.ac.uk> Message-ID: <52FA57BB.50402@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed Feb 12 08:47:38 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 12 Feb 2014 08:47:38 +0100 Subject: [FieldTrip] ft_regressconfound In-Reply-To: <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> References: <005d01cf2679$83d0c7f0$8b7257d0$@gmail.com> <1232836598.5244038.1392056038962.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Dear Raghavan, I've followed your conversation with Arjen with great interest. Although I have worked with the headposition based on the location coils in the CTF system, I am now working with an Elekta Neuromag Vectorview system. I would be very interested to hear how you approach this issue using Maxfilter and cHPI in the Neuromag setup. And not only me - I'm sure the Neuromag / FieldTrip community would greatly appreciate your experience and approach. Please let me know if you are willing to share your procedure. Best wishes, Stephen On 10 February 2014 19:13, Stolk, A. (Arjen) wrote: > Dear Raghavan, > > > I have another question. I understand ft_regressconfound must be the > > last > > step. However, can time frequency calculation be done on data after > > employing regressconfound? Or would you suggest doing trial by trial > > time > > frequency calculation, then compensate using regressconfound and then > > compute timelock? Is there a reason not to do the former way? > > I would recommend doing the latter, provided that you meant to say > 'compute statistics' instead of 'compute timelock'. When ft_regressconfound > is applied to raw/ERF data, trial-by-trial adjustments are made to the > data, according to explained variance by head movements (and thus > differences in distances to the sensors). Subsequently performing time > frequency analysis on this data may give a distorted view of signal > frequency powers. > > Note that if a source reconstruction analysis is also one of your > follow-up steps, it is recommended to do this on the 'original' data, and > then use ft_regressconfound at the source level. See 'Practical issues' on > this page for the rationale behind this: > > > http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis > > In sum, ft_regressconfound is best used as a last step prior > ft_xxxstatistics. > > Yours, > Arjen > > > ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" > > Aan: fieldtrip at science.ru.nl > > Verzonden: Maandag 10 februari 2014 17:02:34 > > Onderwerp: Re: [FieldTrip] ft_regressconfound > > Dear Arjen > > Thanks for your prompt response. I understand your point regarding > > using > > ft_regressconfound with all 4 blocks together. I think that makes more > > sense. > > I have another question. I understand ft_regressconfound must be the > > last > > step. However, can time frequency calculation be done on data after > > employing regressconfound? Or would you suggest doing trial by trial > > time > > frequency calculation, then compensate using regressconfound and then > > compute timelock? Is there a reason not to do the former way? > > > > Thanks, > > Raghavan > > > > Dear Raghavan, It is indeed recommended to use ft_regressconfound as a > > last > > step prior to statistical assessment. It will remove trial-by-trial > > variance > > in the neural data that can be attributed to trial-by-trial variance > > in head > > position. The latter is approximated with regressors containing > > trial-by-trial information on head positions deviating from the > > session/experiment mean. Because the head position timeseries is > > mean-subtracted, the mean neural activity over trials is not affected > > by > > ft_regressconfound; only the variance over trials is, which should > > result in > > a cleaner representation of the data. In order to estimate the > > contribution > > of different head positions to the neural data, ft_regressconfound > > relies on > > general linear modeling. Applying ft_regressconfound to the four > > blocks > > separately (your option 1) will involve four different model > > estimations and > > their associated errors. Because these errors may differ per > > estimation, the > > quality of treatment of the neural data may also differ per block. > > This will > > not affect the mean neural activity in each block, but it may affect > > the > > grand mean over all four blocks as for trials in one block more > > contribution > > from head position may be regressed out than for another. Applying > > ft_regressconfound on the data of the four blocks together (your > > option 2), > > will not affect the grand mean over the trials from all four blocks. > > It will > > reduce the influence of head movement on trial-by-trial variance in > > neural > > activity. This can be for better, or for worse: namely, if there are > > consistent differences in head positions between two conditions > > (captured in > > those four blocks), it may bring the means of neural activity evoked > > in > > these two conditions closer to each other, reducing effect sizes. In > > fact, > > the employment of ft_regressconfound allows one to make a good case > > that an > > observed effect (i.e. differential neural activity between the two > > conditions) cannot be attributed to differences in head positions when > > recording those conditions (note that the same analysis could also be > > performed with eye-movement related activity, or any other measure of > > a > > potential confound). Hope this helps, Arjen ----- Oorspronkelijk > > bericht > > ----- > > > Van: "Raghavan Gopalakrishnan" > > > Aan: fieldtrip at science.ru.nl > > > Verzonden: Vrijdag 7 februari 2014 17:03:40 > > > Onderwerp: [FieldTrip] ft_regressconfound > > > Dear all, > > > I am using regressconfound on Neuromag data. In CTF data, data for > > > coil1, coil2 and coil3 are generated and then circumcenter function > > > is > > > called to compute 3 translational and 3 rotational dof. > > > Unlike, CTF, Neuromag maxfilter allows to compute CHPI or QUAT > > > channels that provide quarternion parameters q1 through q6, where > > > q4,q5 and q6 are translations in x, y and z directions. I am using > > > these q4,q5 and q6 to directly compute the rotational orientations > > > (using the last part of the circumcenter.m script). > > > It is said regressconfound must be used as a last step prior to > > > stats. > > > I have 4 blocks of data for each subject. Which option below should > > > I > > > follow? > > > 1. Apply regress confound separately to four blocks? But, then I > > > have > > > to average these four blocks once again using ft_timelockanalysis, > > > then grand average using ft_timelockgrandaverage before computing > > > stats. > > > 2. Or should I append the four blocks first, then perform > > > regressconfound? In this case, I directly go to grandaverage and > > > stats. > > > Any suggestion is appreciated. > > > Thanks, > > > Raghavan > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > 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 gopalar.ccf at gmail.com Thu Feb 13 16:18:59 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 13 Feb 2014 10:18:59 -0500 Subject: [FieldTrip] timelock statistics Message-ID: Dear all, I have a question regarding statistics. I am doing cluster analysis using monte carlo. I have 2 conditions (cond-1 and cond-2). Each condition has 3 sub-conditions that are temporally separated (lets say cond-1a/2a, cond-1b/2b and cond-1c/2c). I did the statistics 1. on cond-1 vs cond-2 as a whole. 2. cond-1a vs cond-2a, cond-1b vs cond-2b and cond-1c vs 2c separately after splitting the conditions cond-1 and cond-2 using ft_selectdata. I was expecting the answers from #1 and #2 above to be the same. #2 showed one significant cluster in each of the three individual comparisons, totaling 3 clusters. However, #1 above showed only one significant cluster corresponding to one of the three individual cluster in #2. Can anyone explain why results are different? Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From werkle at mpib-berlin.mpg.de Thu Feb 13 17:12:04 2014 From: werkle at mpib-berlin.mpg.de (MWB) Date: Thu, 13 Feb 2014 17:12:04 +0100 Subject: [FieldTrip] PhD-position at the Max Planck Institute for HUman Development, Berlin In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F314E@PEXMB001B.vu.local> <19DD7427D34B7E47B33093FB4C3CFDD201094F315B@PEXMB001B.vu.local>, <19DD7427D34B7E47B33093FB4C3CFDD201094F31E8@PEXMB001B.vu.local> Message-ID: <52FCEED4.2030805@mpib-berlin.mpg.de> Dear colleagues, the project "Cognitive and Neural Dynamics of Memory Across the Lifespan (CONMEM) at the Center for Lifespan Psychology, Max Planck Institute for Human Development, Berlin, is seeking applications for a Predoctoral Research Fellow. Please see the details about the available position in the attached PDF-file. Best regards, Markus Werkle-Bergner -- ************************************************************** Dr. rer. nat. Markus Werkle-Bergner, Dipl. Psych. Research Scientist Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Announcement_2014_V1.pdf Type: application/pdf Size: 189067 bytes Desc: PhD_Announcement_2014_V1.pdf URL: From kai.hwang at gmail.com Thu Feb 13 18:57:03 2014 From: kai.hwang at gmail.com (Kai Hwang) Date: Thu, 13 Feb 2014 12:57:03 -0500 Subject: [FieldTrip] Postdoctoral Position, Pittsburgh Message-ID: Postdoctoral Position Laboratory of Neurocognitive Development Department of Psychiatry University of Pittsburgh, Pennsylvania Principal investigator: Bea Luna, Ph.D. Applicants are invited for a funded postdoctoral position at the University of Pittsburgh investigating cognitive development using a multimodal neuroimaging approach combining fMRI, DTI, MEG, and behavioral testing. We are looking for exceptional Ph.D. researchers with prior experience in MEG/EEG methodology and neuroimaging data analyses. Inherent interest in developmental cognitive neuroscience is a plus. Potential projects will involve investigating the development of functional brain networks supporting cognitive control and/or cognitive-affect interactions during adolescence. Applicants should be willing to commit to a minimum two year appointment. Applicants will be reviewed on an on-going basis until the position is filled. Applicants should send a CV, statement of research interest and contact information of three referees to Dr. Bea Luna (lunab at upmc.edu). -------------- next part -------------- An HTML attachment was scrubbed... URL: From ericksonb.eng at gmail.com Thu Feb 13 22:14:32 2014 From: ericksonb.eng at gmail.com (Erickson) Date: Thu, 13 Feb 2014 16:14:32 -0500 Subject: [FieldTrip] 10-05 Electrode File co-registration Message-ID: List, In the documentation, two pages appear to conflict concerning the head model to which the standard_1005.elc electrode location file is co-registered to. http://fieldtrip.fcdonders.nl/template/electrode advises that the standard_1005.elc file is coregistered to a spherical head model (with coordinates in MNI space). (see the link to http://www.ncbi.nlm.nih.gov/pubmed/11275545on this page) http://fieldtrip.fcdonders.nl/template/headmodel appears to contradict this by stating that the standard_1005.elc file's positions are co-registered to MNI space geometry based on the Colin27 model (which is exactly what I'm looking for). However this page also says that the segmentation is based on the same paper as I linked above. Perhaps I do not understand what is meant by a segmentation. Are these electrode positions (in the file standard_1005.elc) referenced to a spherical head model or to the Colin27 model? Your time is very appreciated! Brian Erickson Ph.D. candidate, ACBS Program Drexel University Psychology Department ericksonb.eng at gmail.com 215 760 7253 -------------- next part -------------- An HTML attachment was scrubbed... URL: From catanese.julien at gmail.com Thu Feb 13 23:18:30 2014 From: catanese.julien at gmail.com (Julien Catanese) Date: Thu, 13 Feb 2014 17:18:30 -0500 Subject: [FieldTrip] ft_connectivityanalysis for one long trial In-Reply-To: References: Message-ID: It works fine if I artificially slice the data into trials. (nb: MATLAB's mscohere() works fine without chopping into trials, so I was guessing it was also possible with the fieldtrip functions, but apparently not, sorry about that, not a big deal). Julien C On Wed, Jan 22, 2014 at 1:22 PM, Julien Catanese wrote: > > Hi dear FieldTrip community, > > I'm trying to get the coherence spectrum between 2 LFP signals (based on > the tutorial: "Analysis of sensor- and source-level connectivity"). > > This is sleep data, so I have only one long "trial" generated with > ft_redefinetrial(). > > I can run ft_freqanalysis() without problems, but both for 'mtmconvol' and > 'mtmfft' the next step, ft_connectivityanalysis(), fails: > > 1/ using 'mtmconvol': the cohspctrum consists of all '1' (the same > happens when using 'fourier' instead of 'powandcsd') > 2/ using 'mtmfft': "Error using ft_connectivityplot (line 99) the data > should have a dimord of chan_chan_freq or chancmb_freq" > > How can I get a coherence spectrum for this data? Do I have to > artificially chop it up into say, 2-second "fake trials"? > > notice that MATLAB's mscohere() works fine on the same data (so data are > ok). > > > > More details below: > > 1/ using mtmconvol : > > %% starting point: loaded data > data = > hdr: [1x1 struct] > label: {'LFP1' 'LFP2'} > time: {[1x200000 double]} > trial: {[2x200000 double]} > fsample: 2000 > cfg: [1x1 struct] > sampleinfo: [1 200000] > > %% make one long trial > cfg = []; > cfg.trl = [1 200000 0]; > data_faketrl = ft_redefinetrial(cfg,data); > > %% do frequqency anlaysis > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 1:1:150; > cfg.t_ftimwin = ones(size(cfg.foi)).*2; % 2-second window > cfg.toi = 0:1:10; > cfg.keeptrials = 'yes'; > cfg.channel = {'LFP1', 'LFP2'}; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> freq = ft_freqanalysis(cfg, data_faketrl) > > freq = > label: {'LFP1' 'LFP2'} > dimord: 'rpt_chan_freq_time' > freq: [1x150 double] > time: [0 1 2 3 4 5 6 7 8 9 10] > powspctrm: [4-D double] > labelcmb: {'LFP1' 'LFP2'} > crsspctrm: [4-D double] > cumtapcnt: [1x150 double] > cfg: [1x1 struct] > > %% coherence spectrum has all ones > cfg = []; > cfg.method = 'coh'; > coh = ft_connectivityanalysis(cfg, freq); > > coh = > > labelcmb: {'LFP1' 'LFP2'} > dimord: 'chan_freq_time' > cohspctrm: [1x150x11 double] > freq: [1x150 double] > time: [0 1 2 3 4 5 6 7 8 9 10] > dof: 150 > cfg: [1x1 struct] > > % coh.cohspctrm(:,:,2:end) is all ones --> fail > > 2/ using mtmfft: > %% > cfg = []; > cfg.output = 'powandcsd' > cfg.method = 'mtmfft'; > cfg.taper = 'hanning'; > cfg.foi = 1:1:150; > cfg.channel = {'LFP1', 'LFP2'}; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> freq = ft_freqanalysis(cfg, data_faketrl) > > freq = > > label: {'LFP1' 'LFP2'} > dimord: 'rpt_chan_freq' > freq: [1x150 double] > powspctrm: [1x2x150 double] > labelcmb: {'LFP1' 'LFP2'} > crsspctrm: [1x1x150 double] > cumsumcnt: 200000 > cumtapcnt: 1 > cfg: [1x1 struct] > > %% coherence spectrum fails: > cfg = []; > cfg.parameter = 'cohspctrm'; > cfg.channelcmb = {'LFP1', 'LFP2'}; > > >> ft_connectivityplot(cfg, coh); > > Error using ft_connectivityplot (line 99) > the data should have a dimord of chan_chan_freq or chancmb_freq > > coh = > labelcmb: {'LFP1' 'LFP2'} > dimord: 'chan_freq' > cohspctrm: [1x150 double] > freq: [1x150 double] > dof: 1 > cfg: [1x1 struct] > > >> unique([coh.cohspctrm(:)]) > > ans = > > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > 1.000000000000000 > > > Thanks for your help, > > Julien C > > -- > > *Dr. Julien Catanese* > > *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada. * > *cell : +1 (519) 781 7575 <%2B1%20%28519%29%20781%207575>* > *tel lab : +1 (519) 888 4567 ext 31354 > <%2B1%20%28519%29%20888%204567%20ext%2031354>* > -- *Dr. Julien Catanese* *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada.* *cell : +1 (519) 781 7575* *tel lab : +1 (519) 888 4567 ext 31354* -------------- next part -------------- An HTML attachment was scrubbed... URL: From sviter33 at gmail.com Fri Feb 14 08:35:28 2014 From: sviter33 at gmail.com (=?KOI8-R?B?7NXLz9HOz9cg7cHL08nN?=) Date: Fri, 14 Feb 2014 11:35:28 +0400 Subject: [FieldTrip] ft_connectivityanalysis for one long trial In-Reply-To: References: Message-ID: Hi Julien, I suppose you may to try to use cfg.keeptapers = 'yes' with ft_freqanalysis. It's working for me. Best, Maxim Lukoyanov 2014-02-14 2:18 GMT+04:00 Julien Catanese : > It works fine if I artificially slice the data into trials. > > (nb: MATLAB's mscohere() works fine without chopping into trials, so I was > guessing it was also possible with the fieldtrip functions, but apparently > not, sorry about that, not a big deal). > > Julien C > > > > On Wed, Jan 22, 2014 at 1:22 PM, Julien Catanese < > catanese.julien at gmail.com> wrote: > >> >> Hi dear FieldTrip community, >> >> I'm trying to get the coherence spectrum between 2 LFP signals (based on >> the tutorial: "Analysis of sensor- and source-level connectivity"). >> >> This is sleep data, so I have only one long "trial" generated with >> ft_redefinetrial(). >> >> I can run ft_freqanalysis() without problems, but both for 'mtmconvol' >> and 'mtmfft' the next step, ft_connectivityanalysis(), fails: >> >> 1/ using 'mtmconvol': the cohspctrum consists of all '1' (the same >> happens when using 'fourier' instead of 'powandcsd') >> 2/ using 'mtmfft': "Error using ft_connectivityplot (line 99) the data >> should have a dimord of chan_chan_freq or chancmb_freq" >> >> How can I get a coherence spectrum for this data? Do I have to >> artificially chop it up into say, 2-second "fake trials"? >> >> notice that MATLAB's mscohere() works fine on the same data (so data are >> ok). >> >> >> >> More details below: >> >> 1/ using mtmconvol : >> >> %% starting point: loaded data >> data = >> hdr: [1x1 struct] >> label: {'LFP1' 'LFP2'} >> time: {[1x200000 double]} >> trial: {[2x200000 double]} >> fsample: 2000 >> cfg: [1x1 struct] >> sampleinfo: [1 200000] >> >> %% make one long trial >> cfg = []; >> cfg.trl = [1 200000 0]; >> data_faketrl = ft_redefinetrial(cfg,data); >> >> %% do frequqency anlaysis >> cfg = []; >> cfg.output = 'powandcsd'; >> cfg.method = 'mtmconvol'; >> cfg.taper = 'hanning'; >> cfg.foi = 1:1:150; >> cfg.t_ftimwin = ones(size(cfg.foi)).*2; % 2-second window >> cfg.toi = 0:1:10; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'LFP1', 'LFP2'}; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> freq = ft_freqanalysis(cfg, data_faketrl) >> >> freq = >> label: {'LFP1' 'LFP2'} >> dimord: 'rpt_chan_freq_time' >> freq: [1x150 double] >> time: [0 1 2 3 4 5 6 7 8 9 10] >> powspctrm: [4-D double] >> labelcmb: {'LFP1' 'LFP2'} >> crsspctrm: [4-D double] >> cumtapcnt: [1x150 double] >> cfg: [1x1 struct] >> >> %% coherence spectrum has all ones >> cfg = []; >> cfg.method = 'coh'; >> coh = ft_connectivityanalysis(cfg, freq); >> >> coh = >> >> labelcmb: {'LFP1' 'LFP2'} >> dimord: 'chan_freq_time' >> cohspctrm: [1x150x11 double] >> freq: [1x150 double] >> time: [0 1 2 3 4 5 6 7 8 9 10] >> dof: 150 >> cfg: [1x1 struct] >> >> % coh.cohspctrm(:,:,2:end) is all ones --> fail >> >> 2/ using mtmfft: >> %% >> cfg = []; >> cfg.output = 'powandcsd' >> cfg.method = 'mtmfft'; >> cfg.taper = 'hanning'; >> cfg.foi = 1:1:150; >> cfg.channel = {'LFP1', 'LFP2'}; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> freq = ft_freqanalysis(cfg, data_faketrl) >> >> freq = >> >> label: {'LFP1' 'LFP2'} >> dimord: 'rpt_chan_freq' >> freq: [1x150 double] >> powspctrm: [1x2x150 double] >> labelcmb: {'LFP1' 'LFP2'} >> crsspctrm: [1x1x150 double] >> cumsumcnt: 200000 >> cumtapcnt: 1 >> cfg: [1x1 struct] >> >> %% coherence spectrum fails: >> cfg = []; >> cfg.parameter = 'cohspctrm'; >> cfg.channelcmb = {'LFP1', 'LFP2'}; >> >> >> ft_connectivityplot(cfg, coh); >> >> Error using ft_connectivityplot (line 99) >> the data should have a dimord of chan_chan_freq or chancmb_freq >> >> coh = >> labelcmb: {'LFP1' 'LFP2'} >> dimord: 'chan_freq' >> cohspctrm: [1x150 double] >> freq: [1x150 double] >> dof: 1 >> cfg: [1x1 struct] >> >> >> unique([coh.cohspctrm(:)]) >> >> ans = >> >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> 1.000000000000000 >> >> >> Thanks for your help, >> >> Julien C >> >> -- >> >> *Dr. Julien Catanese* >> >> *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada. * >> *cell : +1 (519) 781 7575 <%2B1%20%28519%29%20781%207575>* >> *tel lab : +1 (519) 888 4567 ext 31354 >> <%2B1%20%28519%29%20888%204567%20ext%2031354>* >> > > > > -- > > *Dr. Julien Catanese* > > *VanderMeerLab post-doc. University of Waterloo, Ontario, Canada.* > *cell : +1 (519) 781 7575* > *tel lab : +1 (519) 888 4567 ext 31354* > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Mon Feb 17 08:59:00 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 17 Feb 2014 08:59:00 +0100 Subject: [FieldTrip] MEG/EEG toolkit course in Nijmegen - registration is open Message-ID: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> Dear FieldTrip mailing list On May 6-9, 2014 we will host the "Toolkit of Cognitive Neuroscience: advanced data analysis and source modelling of EEG and MEG data" at the Donders Institute in Nijmegen. This 4-day toolkit course will teach you advanced MEG and EEG data analysis skills. Preprocessing, frequency analysis, source reconstruction and various statistical methods will be covered. The toolkit will consist of a number of lectures, followed by hands-on sessions in which you will be tutored through the complete analysis of an MEG data set using the FieldTrip toolbox. There will be plenty of time to ask questions and discuss analysis methods pertaining to your reseach questions. In the last hands-on session you will get started with the analysis on the data that you will bring yourself The registration for this toolkit course is now open and can be found on http://www.ru.nl/donders/course-information/courses/toolkit-cognitive-4/ The fee for senior participants is € 400. The (PhD) student fee is € 200. Registration fee includes coffee/tea, Dutch sandwich lunches and one dinner. Please note that in the past years the course was oversubscribed and we expect that as well for this year. We will be able to host approximately 40 participants and consequently we are likely to be required to make a selection that is based on the information that you provide on the registration form. Note that neither being a very novice or a very expert in EEG/MEG disqualifies you from participating; we select the participants on basis of their motivation, research background and skills, and whether we expect the course to pay off for the participant (i.e. whether there is a match between course content and the expectations and requirements for fruitfull use of the analysis methods that we'll cover). Furthermore, we try to make a nice group of participants with a homogenous level and with sufficient broad coverage of research interests. The deadline for the initial registration is March 14, 2014. You can have a look at our Facebook page on http://www.facebook.com/fieldtriptoolbox to get an impression from the previous "MEG/EEG toolkit courses". Best regards, Robert Oostenveld and Jan-Mathijs Schoffelen ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging skype: r.oostenveld ----------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Mon Feb 17 10:49:40 2014 From: michielb at tcd.ie (Bart Michiels) Date: Mon, 17 Feb 2014 09:49:40 +0000 Subject: [FieldTrip] MEG/EEG toolkit course in Nijmegen - registration is open In-Reply-To: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> References: <00A10464-6975-4D84-B121-2C2DF1431188@donders.ru.nl> Message-ID: Hey Ed, Just need your opinion (as prof will ask the same to you): Would this be a good event to attend? Bests, Bart On 17 February 2014 07:59, Robert Oostenveld wrote: > Dear FieldTrip mailing list > > On May 6-9, 2014 we will host the "Toolkit of Cognitive Neuroscience: > advanced data analysis and source modelling of EEG and MEG data" at the > Donders Institute in Nijmegen. > > This 4-day toolkit course will teach you advanced MEG and EEG data > analysis skills. Preprocessing, frequency analysis, source reconstruction > and various statistical methods will be covered. The toolkit will consist > of a number of lectures, followed by hands-on sessions in which you will be > tutored through the complete analysis of an MEG data set using the > FieldTrip toolbox. There will be plenty of time to ask questions and > discuss analysis methods pertaining to your reseach questions. In the last > hands-on session you will get started with the analysis on the data that > you will bring yourself > > The registration for this toolkit course is now open and can be found on > http://www.ru.nl/donders/course-information/courses/toolkit-cognitive-4/ > > The fee for senior participants is EURO 400. The (PhD) student fee is EURO 200. > Registration fee includes coffee/tea, Dutch sandwich lunches and one dinner. > > Please note that in the past years the course was oversubscribed and we > expect that as well for this year. We will be able to host approximately 40 > participants and consequently we are likely to be required to make a > selection that is based on the information that you provide on the > registration form. Note that neither being a very novice or a very expert > in EEG/MEG disqualifies you from participating; we select the participants > on basis of their motivation, research background and skills, and whether > we expect the course to pay off for the participant (i.e. whether there is > a match between course content and the expectations and requirements for > fruitfull use of the analysis methods that we'll cover). Furthermore, we > try to make a nice group of participants with a homogenous level and with > sufficient broad coverage of research interests. The deadline for the > initial registration is March 14, 2014. > > You can have a look at our Facebook page on > http://www.facebook.com/fieldtriptoolbox to get an impression from the > previous "MEG/EEG toolkit courses". > > Best regards, > > Robert Oostenveld and Jan-Mathijs Schoffelen > > > ----------------------------------------------------------- > Robert Oostenveld, PhD > Senior Researcher & MEG Physicist > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > tel.: +31 (0)24 3619695 > e-mail: r.oostenveld at donders.ru.nl > web: http://www.ru.nl/neuroimaging > skype: r.oostenveld > ----------------------------------------------------------- > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Bart Michiels, Student 2d master, School of Engineering, Trinity College Institute of Neuroscience and Trinity Centre for Bioengineering, Trinity College Dublin, Dublin 2, Ireland Email: michielb at tcd.ie Web: http://www.mee.tcd.ie/neuraleng/People/Bart Phone: +353 - 83 443 3315 -------------- next part -------------- An HTML attachment was scrubbed... URL: From notthemindprobe at yahoo.com Tue Feb 18 00:00:17 2014 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Mon, 17 Feb 2014 15:00:17 -0800 (PST) Subject: [FieldTrip] Recording Biosemi GSR data in GDF files Message-ID: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> Fieldtrip users: Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file? This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. Some more details: Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine. We recently wanted to add GSR data to this. However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself. When we record the GSR data using Activew in a BDF file, the data is recorded fine. Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file. This is in contrasts to the 8 external channels which do not undergo such additional manipulations. So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? Thanks! Eric From i.e.j.de.vries at student.vu.nl Tue Feb 18 00:00:29 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Mon, 17 Feb 2014 23:00:29 +0000 Subject: [FieldTrip] coherence vs magnitude squared coherence Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> Hi Fieldtrippers, If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? Cheers, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 18 06:43:08 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 18 Feb 2014 06:43:08 +0100 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> Message-ID: <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> Hi Floris, Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. Best, Jan-Mathijs On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: > Hi Fieldtrippers, > > If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? > > Cheers, > Ingmar > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Feb 18 06:57:31 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 18 Feb 2014 06:57:31 +0100 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl> Message-ID: Hi Ingmar, Sorry for the mix up. Apparently I was not yet fully awake when typing my previous reply. Blame it on the offspring, which kept me awake during some crucial parts of the night: where I typed 'Floris', I of course meant to type 'Ingmar' ;-). To all Florises on the list: this was a free answer to a question you didn't know you wanted to ask. Best, Jan-Mathijs On Feb 18, 2014, at 6:43 AM, jan-mathijs schoffelen wrote: > Hi Floris, > Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. > > Best, > Jan-Mathijs > > On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: > >> Hi Fieldtrippers, >> >> If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? >> >> Cheers, >> Ingmar >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.e.j.de.vries at student.vu.nl Tue Feb 18 13:31:41 2014 From: i.e.j.de.vries at student.vu.nl (Vries, I.E.J. de) Date: Tue, 18 Feb 2014 12:31:41 +0000 Subject: [FieldTrip] coherence vs magnitude squared coherence In-Reply-To: References: <19DD7427D34B7E47B33093FB4C3CFDD201094F9600@PEXMB001B.vu.local> <78867230-F4CA-4F28-B5E6-AC809F41561A@donders.ru.nl>, Message-ID: <19DD7427D34B7E47B33093FB4C3CFDD201094F9649@PEXMB001B.vu.local> haha no worries, thanks for the reply! ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of jan-mathijs schoffelen [jan.schoffelen at donders.ru.nl] Sent: 18 February 2014 6:57 To: FieldTrip discussion list Subject: Re: [FieldTrip] coherence vs magnitude squared coherence Hi Ingmar, Sorry for the mix up. Apparently I was not yet fully awake when typing my previous reply. Blame it on the offspring, which kept me awake during some crucial parts of the night: where I typed 'Floris', I of course meant to type 'Ingmar' ;-). To all Florises on the list: this was a free answer to a question you didn't know you wanted to ask. Best, Jan-Mathijs On Feb 18, 2014, at 6:43 AM, jan-mathijs schoffelen wrote: Hi Floris, Yes, if you want magnitude squared coherence, you need to square the value fieldtrip computes for you. Note that there is no single convention in the literature: some people report coherence, some report coherence squared. Best, Jan-Mathijs On Feb 18, 2014, at 12:00 AM, Vries, I.E.J. de wrote: Hi Fieldtrippers, If I got it correctly, if you choose to calculate coherence (cfg.method='coh') with ft_connectivityanalysis, and you choose cfg.complex='abs' (which is the default), you get the absolute value of coherency, i.e. coherence. But not yet the magnitude squared coherence, which is usually reported in the literature for coherence. So all I need to do is square the coherence value calculated by Fieldtrip right? Cheers, Ingmar _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Feb 18 14:16:54 2014 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 18 Feb 2014 15:16:54 +0200 Subject: [FieldTrip] Antw: Creating a head model using OPENMEEG - Intersecting mesh error In-Reply-To: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> References: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> Message-ID: Dear Daniel and all, First, thank you very much for your advice and codes. They have proved very helpful, and now I have obtained some very good brain-skull-scalp meshes! I am now having a problem using OPENMEEG to actually compute the leadfield based on these meshes, using the following code on frequency domain data: cfg=[]; cfg.method = 'dics'; cfg.elec = elec; cfg.grid = grid; cfg.vol = vol; cfg.frequency = 10; % The mean frequency in the band cfg.keepfilter = 'yes'; sourceCombined = ft_sourceanalysis(cfg, freqCombined); The problem arises at the function "ft_leadfield_openmeeg" who tries using OPENMEEG installed on my PC (indeed there is a warning "warning('Sorry, Windows is not yet tested');" in this function). To fix onw of the bugs using a PC I changed line 94 to: basefile = tempname; [clearme basefile] = fileparts(basefile); clear clearme; but even so, every line who tries to actually use OPENMEEG, such as line 149: system([fullfile(OPENMEEG_PATH, 'om_check_geom'), ' -g ', geomFile]) fails to do so. For instance, I get a Windows error window that says "om_assemble.exe has stopped working" and "om_minverser.exe has stopped working", and also: Computing inverse head matrix 187 system([fullfile(OPENMEEG_PATH, 'om_minverser'), ' ', hmFile, ' ', hminvFile]); C:\OpenMEEG\bin\om_minverser version 2.1.0 (799) compiled at Aug 17 2011 19:50:11 | ------ C:\OpenMEEG\bin\om_minverser | C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin | C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hminv.bin | ----------------------- Exception: Unable to open the file C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin for reading Doing my best.... So it seems like OPENMEEG cannot open the file ending with "_hm.bin". This file indeed does no exist. I am using Matlab 2011b, full fieldtrip version of 17022014, Windows 7 64 bit, and OPENMEEG with om_assemble version 2.1.0 (799) compiled at Aug 17 2011 19:50:41. Must I use a Macintosh or Linux computer to make this work? Any ideas would be greatly appreciated! Thank you very much in advance, Roey On Mon, Jan 20, 2014 at 8:10 PM, Daniel Wong wrote: > You can try using the new iso2mesh meshing option that was recently added > by myself, Sarang Dalal, and Robert Oostenveld: > > cfg.method = 'iso2mesh'; > cfg.numvertices = 10000; % We'll decimate later - this gives nicer > results > bnd = ft_prepare_mesh(cfg,seg); > > % Decimate to a 1000, 2000, 3000 node mesh (scalp, skull, brain) > [bnd(1).pnt, bnd(1).tri] = meshresample(bnd(1).pnt, bnd(1).tri, > 1000/size(bnd(1).pnt,1)); > [bnd(2).pnt, bnd(2).tri] = meshresample(bnd(2).pnt, bnd(2).tri, > 2000/size(bnd(2).pnt,1)); > [bnd(3).pnt, bnd(3).tri] = meshresample(bnd(3).pnt, bnd(3).tri, > 3000/size(bnd(3).pnt,1)); > > The latest version of OpenMEEG automatically fixes mesh orientations, but > if you have an older version of OpenMEEG, you'll need to set bnd(ii).tri = > bnd(ii).tri(:,[3 2 1]) to fix the orientation error that you'll get - at > least until we hard code that fix into FieldTrip. > > Also, assuming your meshes look like they should (use ft_plot_mesh to > check), if you still have a problem with meshes intersecting each other, > you will find a subfunction called decouplesurf that is temporarily stashed > at the end of prepare_mesh_segmentation.m. Copy this function into a new > m-file (decouplesurf.m) and use it to fix those intersections as follows: > > bnd = decouplesurf(bnd); > > Note, this will not fix self-intersections. If you're really having a bad > day, try using the iso2mesh toolbox meshcheckrepair function: > % Check and repair mesh > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'dup'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'isolated'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'deep'); > [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, > 'meshfix'); > > This info should eventually find its way onto the FieldTrip tutorial > pages... > > > Best Regards, > Daniel Wong > > Daniel Wong, PhD (IBBME, University of Toronto) > Postdoctoral Researcher > Department of Psychology > University of Konstanz > > > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Tue Feb 18 16:55:55 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 18 Feb 2014 16:55:55 +0100 Subject: [FieldTrip] Recording Biosemi GSR data in GDF files In-Reply-To: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> References: <1392678017.96713.YahooMailBasic@web140203.mail.bf1.yahoo.com> Message-ID: <4A14FD77-D413-418C-B788-F45F0CD675AD@donders.ru.nl> Hi Eric, Although I don't have any real expertise in this matter, let me share my 2 cents: Your description suggests that the GSR is estimated using a 16Hz alternating current of constant (but presumably unknown) amplitude, and that GSR is estimated by solving Ohms law (V=I*R). Rather than doing an instantaneous estimate (which is noisy, especially if the current passes the zero-crossing) there will be a rectification and temporal smoothing of the voltage prior to the estimation. Or perhaps even better: a sliding window estimation: for a given time t take the signal from t-1/16s in the past up to t-0 (i.e. now) estimate the 16Hz amplitude using a DFT, this is a single positive number (either RMS, Vpeak, or Vpeak-to-peak) estimate R = V/I (this requires that you know the current I) You could determine I by connecting a known resistor of appropriate size to the electrodes. Or perhaps you don't even have to; if you are not interested in the absolute value but only in changes, you would just take R as proportional to V. Something like this (for the offline case) would do it time = (1:(fsample/16))/fsample; % just enough time for one oscillation model_c = cos(16*2*pi*time); model_s = sin(16*2*pi*time); model = model_c + i*model_s; % i is the complex number model = model./norm(model); signal = randn(1,10*fsample); % the raw signal amplitude = nan(size(signal)); % the estimated amplitude for t=1:length(signal) begsample = t - fsample/16 + 1; % note the +1, the segment should be 64 samples long endsample = t - 0; if begsample>=1 && endsample<=length(signal) segment = signal(begsample:endsample); amplitude(t) = segment*model'; % discrete fourier transform end end plot(abs(amplitude)) This can be translated to the online case by inserting it into one of the examples at http://fieldtrip.fcdonders.nl/development/realtime best regards, Robert On 18 Feb 2014, at 0:00, Eric Pohlmeyer wrote: > Fieldtrip users: > > Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file? This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. > > Some more details: > > Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine. We recently wanted to add GSR data to this. However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself. When we record the GSR data using Activew in a BDF file, the data is recorded fine. > > Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file. This is in contrasts to the 8 external channels which do not undergo such additional manipulations. > > So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? > > Thanks! > > Eric > > _______________________________________________ > 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 nathanweisz at mac.com Tue Feb 18 18:22:38 2014 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 18 Feb 2014 18:22:38 +0100 Subject: [FieldTrip] Neuroscience Master @cimec Message-ID: <45E8D277-A9E6-43CE-BCCE-9C6098543F55@mac.com> Dear Fieldtrippers, please find below infos for the Open Day dedicated to students interested in pursuing Master / PhD studies in cognitive neuroscience here at CIMeC. I encourage especially students interested in MEG to check out the program. I heard great things about the MEG lab there ;-) ciao, n --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Open Day for prospective graduate students in Mind/Brain Sciences Rovereto, 24 March 2014 The Open Day is dedicated to prospective MSc and PhD students from UniTN and other universities in Italy and abroad, interested in getting first hand information about the CIMeC Graduate Program in Cognitive and Brain Sciences: * Master's course in Cognitive Science * Doctoral course in Cognitive and Brain Sciences Throughout the day, students will have the opportunity to attend presentations of post-graduate studies available at CIMeC, get acquainted with admissions procedures and requirements, get information about financial aid and scholarship programs, get information on professional placement and research opportunities, take part in a guided tour of the CIMeC labs, and get more personalized information from faculty and students. For more information and schedule: http://international.unitn.it/news/open-day-prospective-graduate-students-in-cognitive-science If interested, please contact us at mcs at unitn.it (for prospective MSc students) orphd.cimec at unitn.it (for prospective PhD students) ______________________________ Dr. Nathan Weisz Associate Professor MEG & OBOB Lab CIMeC - Center for Mind/Brain Sciences Università degli Studi di Trento via delle Regole, 101 Mattarello (TN) - ITALY Tel +39 0461 28 3040 Fax +39 0461 28 3066 e-mail nathan.weisz at unitn.it Visit our homepage. Like us on facebook. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanger at uga.edu Tue Feb 18 20:44:28 2014 From: wanger at uga.edu (Timothy J Wanger) Date: Tue, 18 Feb 2014 19:44:28 +0000 Subject: [FieldTrip] timeseries analysis Message-ID: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> Hi, My name is Tim Wanger, I am a graduate student working with Dean Sabatinelli at the University of Georgia. This is my first attempt at using Field Trip. In order to familiarize myself with the software and learn how it can analyze data collected at our lab, I put together a small dataset containing fMRI timeseries from two different experimental conditions(arousing/not-arousing). After looking through the documentation on the Field Trip website, I came to the conclusion that 'ft_timelockanalysis' could be used to analyse timeseries data. After setting up a cfg variable, and importing my data(does not need preprocessing), I tried running ft_timelockanalysis, but there were some errors that I am not sure how to fix. I was wondering if anyone could help me sort this out. data.label=region'; % region info data.fsample=4; % 250ms sampling rate (4Hz) data.trial=timeseriesdata; % our data, <158x50 cell> matrix. trials have already been excised from raw data data.time=num2cell(1:length(timeseriesdata)); % represent time in samples data.trialinfo=arousalrating'; % experimental condition information cfg.channel='all'; cfg.trials= 'all'; cfg.covariance='no'; cfg.covariancewindow='all'; cfg.keeptrials='no'; cfg.removemean='yes'; cfg.vartrllength=2; % some trials are missing the 50th sample Here is the error I am currently receiving, with some relevant Matlab command window output. the input is raw data with 1 channels and 158 trials Warning: removing inconsistent sampleinfo > In ft_datatype_raw at 109 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 Warning: the data does not contain a trial definition > In utilities/private/warning_once at 116 In utilities/private/fixsampleinfo at 66 In ft_datatype_raw at 158 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 Warning: reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous recording > In utilities/private/warning_once at 116 In utilities/private/fixsampleinfo at 79 In ft_datatype_raw at 158 In ft_checkdata at 213 In ft_timelockanalysis at 105 In testing_fieldtrip at 49 ??? Index exceeds matrix dimensions. Error in ==> fixsampleinfo at 95 offset(i) = time2offset(data.time{i}, data.fsample); Error in ==> ft_datatype_raw at 158 data = fixsampleinfo(data); Error in ==> ft_checkdata at 213 data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); Error in ==> ft_timelockanalysis at 105 data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Error in ==> testing_fieldtrip at 49 [timelock] = ft_timelockanalysis(cfg, data); So, my questions are: 1. Am I on the right track? 2. Is there a better function to be using? 3. Am I using the proper data format as an import? 4. The code is 'assuming that the trials are consecutive segments of a continuous recording', which is not the case for me, so what can/should I do about that? 5. Does anyone have a template matlab script and demo dataset (for timeseries analysis) that runs without errors, that I could look at? It would help me to just step through the analysis to see what's happening, and an example of input data/parameters. Thanks in advance! -Tim Wanger? -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Feb 19 16:57:20 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 19 Feb 2014 16:57:20 +0100 Subject: [FieldTrip] specifying the variables for ft_specest_mtmfft Message-ID: Dear all, I'm new to fieldtrip, and I would like to estimate the spectrum using ft_specest_mtmfft. With the help function, I understand that there are certain variables that I need to input in order for the mtmfft to work. I have some questions regarding the input variables. I have 4 intracranial channels and I cut my trials into segments of 2048 datapoints. My sampling resolution is 1000 Hz. Variables that I know what the inputs are: For dat, I know that this is the raw data for each segment. For time, I know that this is the time vector of each segment (in my case, it would be 0:0.001:2.048). For taper, I will be using 'hanning'. For freqoi, I'm interested in the frequency from 1:150. Variables that I don't know and not sure what to input: For ntaper, I would like to use multiple taper, however, I'm not sure how many number of tapers I should use. For spectrum, it states that it requires a matrix of taper*chan*freqoi of fourier coefficients. I'm not sure what this means at all. Could someone please help me with the variables that I'm not sure of? Thanks! Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Feb 19 17:37:20 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 19 Feb 2014 18:37:20 +0200 Subject: [FieldTrip] Antw: Creating a head model using OPENMEEG - Intersecting mesh error In-Reply-To: References: <20140120131051.9fkbl6n8ysg0og4s@webmail.utoronto.ca> Message-ID: Otherwise, does anyone know if I could compute the leadfield using another program and import it to fieldtrip? Thank you once again, Hoping to resolve this issue soon, Roey On Tue, Feb 18, 2014 at 3:16 PM, Roey Schurr wrote: > Dear Daniel and all, > > First, thank you very much for your advice and codes. They have proved > very helpful, and now I have obtained some very good brain-skull-scalp > meshes! > > I am now having a problem using OPENMEEG to actually compute the leadfield > based on these meshes, using the following code on frequency domain data: > > cfg=[]; > cfg.method = 'dics'; > cfg.elec = elec; > cfg.grid = grid; > cfg.vol = vol; > cfg.frequency = 10; % The mean frequency in the band > cfg.keepfilter = 'yes'; > > sourceCombined = ft_sourceanalysis(cfg, freqCombined); > > > The problem arises at the function "ft_leadfield_openmeeg" who tries > using OPENMEEG installed on my PC (indeed there is a warning > "warning('Sorry, Windows is not yet tested');" in this function). > To fix onw of the bugs using a PC I changed line 94 to: > > basefile = tempname; > [clearme basefile] = fileparts(basefile); > clear clearme; > > but even so, every line who tries to actually use OPENMEEG, such as line > 149: > > system([fullfile(OPENMEEG_PATH, 'om_check_geom'), ' -g ', geomFile]) > > fails to do so. > For instance, I get a Windows error window that says "om_assemble.exe has > stopped working" and "om_minverser.exe has stopped working", and also: > > Computing inverse head matrix > 187 system([fullfile(OPENMEEG_PATH, 'om_minverser'), ' ', > hmFile, ' ', hminvFile]); > C:\OpenMEEG\bin\om_minverser version 2.1.0 (799) compiled at Aug 17 > 2011 19:50:11 > > | ------ C:\OpenMEEG\bin\om_minverser > | > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin > | > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hminv.bin > | ----------------------- > Exception: Unable to open the file > C:\Users\Roey\AppData\Local\Temp\ft-om\tp2f33a1b9_510f_4d55_805d_7ed6ce3b22e3_hm.bin > for reading Doing my best.... > > So it seems like OPENMEEG cannot open the file ending with "_hm.bin". This > file indeed does no exist. > > > I am using Matlab 2011b, full fieldtrip version of 17022014, Windows 7 64 > bit, and OPENMEEG with om_assemble version 2.1.0 (799) compiled at Aug 17 > 2011 19:50:41. > > Must I use a Macintosh or Linux computer to make this work? > > Any ideas would be greatly appreciated! > Thank you very much in advance, > > Roey > > > On Mon, Jan 20, 2014 at 8:10 PM, Daniel Wong wrote: > >> You can try using the new iso2mesh meshing option that was recently added >> by myself, Sarang Dalal, and Robert Oostenveld: >> >> cfg.method = 'iso2mesh'; >> cfg.numvertices = 10000; % We'll decimate later - this gives nicer >> results >> bnd = ft_prepare_mesh(cfg,seg); >> >> % Decimate to a 1000, 2000, 3000 node mesh (scalp, skull, brain) >> [bnd(1).pnt, bnd(1).tri] = meshresample(bnd(1).pnt, bnd(1).tri, >> 1000/size(bnd(1).pnt,1)); >> [bnd(2).pnt, bnd(2).tri] = meshresample(bnd(2).pnt, bnd(2).tri, >> 2000/size(bnd(2).pnt,1)); >> [bnd(3).pnt, bnd(3).tri] = meshresample(bnd(3).pnt, bnd(3).tri, >> 3000/size(bnd(3).pnt,1)); >> >> The latest version of OpenMEEG automatically fixes mesh orientations, but >> if you have an older version of OpenMEEG, you'll need to set bnd(ii).tri = >> bnd(ii).tri(:,[3 2 1]) to fix the orientation error that you'll get - at >> least until we hard code that fix into FieldTrip. >> >> Also, assuming your meshes look like they should (use ft_plot_mesh to >> check), if you still have a problem with meshes intersecting each other, >> you will find a subfunction called decouplesurf that is temporarily stashed >> at the end of prepare_mesh_segmentation.m. Copy this function into a new >> m-file (decouplesurf.m) and use it to fix those intersections as follows: >> >> bnd = decouplesurf(bnd); >> >> Note, this will not fix self-intersections. If you're really having a bad >> day, try using the iso2mesh toolbox meshcheckrepair function: >> % Check and repair mesh >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'dup'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'isolated'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'deep'); >> [bnd(ii).pnt, bnd(ii).tri] = meshcheckrepair(bnd(ii).pnt, bnd(ii).tri, >> 'meshfix'); >> >> This info should eventually find its way onto the FieldTrip tutorial >> pages... >> >> >> Best Regards, >> Daniel Wong >> >> Daniel Wong, PhD (IBBME, University of Toronto) >> Postdoctoral Researcher >> Department of Psychology >> University of Konstanz >> >> >> >> _______________________________________________ >> 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 eelke.spaak at donders.ru.nl Wed Feb 19 18:04:27 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 19 Feb 2014 18:04:27 +0100 Subject: [FieldTrip] specifying the variables for ft_specest_mtmfft In-Reply-To: References: Message-ID: Dear Hweeling, ft_specest_mtmfft is one of the lower-level FieldTrip functions, which the end-user typically should not use. Instead, have a look at the documentation for ft_freqanalysis (type 'edit ft_freqanalysis' or look here: http://fieldtrip.fcdonders.nl/reference/ft_freqanalysis). There is a section specifically relating to options for mtmfft. All the options for ft_freqanalysis and other FieldTrip functions are specified using a 'cfg'-structure, e.g. like so: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 1:150; freq = ft_freqanalysis(cfg, data); Best, Eelke On 19 February 2014 16:57, Hwee Ling Lee wrote: > Dear all, > > I'm new to fieldtrip, and I would like to estimate the spectrum using > ft_specest_mtmfft. With the help function, I understand that there are > certain variables that I need to input in order for the mtmfft to work. > > I have some questions regarding the input variables. > > I have 4 intracranial channels and I cut my trials into segments of 2048 > datapoints. My sampling resolution is 1000 Hz. > > Variables that I know what the inputs are: > For dat, I know that this is the raw data for each segment. > For time, I know that this is the time vector of each segment (in my case, > it would be 0:0.001:2.048). > For taper, I will be using 'hanning'. > For freqoi, I'm interested in the frequency from 1:150. > > Variables that I don't know and not sure what to input: > For ntaper, I would like to use multiple taper, however, I'm not sure how > many number of tapers I should use. > For spectrum, it states that it requires a matrix of taper*chan*freqoi of > fourier coefficients. I'm not sure what this means at all. > > Could someone please help me with the variables that I'm not sure of? > > Thanks! > > Best regards, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Wed Feb 19 22:01:00 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 19 Feb 2014 16:01:00 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: Arjen, Thanks for answering all my previous questions. I was successfully able to incorporate head movements to my erf data. As I understand I have to do this separately for the time frequency data after keeping individual trials. I am interested in both beta and gamma bands [15:1:70]. my time frequency looks like this using wavelets, timefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x1500 double] powspctrm: [4-D double] cumtapcnt: [55x56 double] grad: [1x1 struct] elec: [1x1 struct] cfg: [1x1 struct] trialinfo: [55x1 double] After regressconfound hpicomptimefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x1500 double] powspctrm: [4-D double] cumtapcnt: [55x56 double] cfg: [1x1 struct] trialinfo: [55x1 double] beta: [4-D double] Regressconfound took about 1 hr and 30 mins, since its a huge matrix [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It will take an enoumous amount of time to process the data through regressconfound. Is there a workaround to make the processing faster or am I missing something. Any help would be of great help. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Feb 19 22:58:38 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <2108167665.5423215.1392847118322.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, Good to hear it's working out for you. A short answer would be 'no'. Reducing the size of your data matrix is likely going to speed up computations. Your time resolution seems pretty high (1500 frequency estimations per single trial); do you need that many? Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 19 februari 2014 22:01:00 > Onderwerp: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks for answering all my previous questions. I was successfully > able to incorporate head movements to my erf data. As I understand I > have to do this separately for the time frequency data after keeping > individual trials. I am interested in both beta and gamma bands > [15:1:70]. my time frequency looks like this using wavelets, > timefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > grad: [1x1 struct] > elec: [1x1 struct] > cfg: [1x1 struct] > trialinfo: [55x1 double] > After regressconfound > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > cfg: [1x1 struct] > trialinfo: [55x1 double] > beta: [4-D double] > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > will take an enoumous amount of time to process the data through > regressconfound. Is there a workaround to make the processing faster > or am I missing something. Any help would be of great help. > Thanks, > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Thu Feb 20 18:51:25 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 20 Feb 2014 18:51:25 +0100 Subject: [FieldTrip] source correlation. Message-ID: Hi Jan and Robert, Pls I have the following questions, 1. Regarding to attached picture, I calculated coherence using DICS method with ref channel T8 ( which is right temporal). I expect to see correlation or coherence by the the two side, but only found at the left temporal part but nothing on the seed point, the right temporal, or is there is any configuration i did not include or miss? I use the following configuration cfg2 = method: 'dics' frequency: 2 grid: [1x1 struct] vol: [1x1 struct] elec: [1x1 struct] channel: {63x1 cell} refchannel: 'T8' 2. I want to obtain connectivity matrix from the source. Will it be ok to calculate it from the power source using the following configuration cfg=[];cfg.method='powcorr'; The output powerspctrum only contains NaN. I am thinking if I could bring out only the inside dipoles and compute it differently. Can I obtain the same correlation matrix? Thank you! Azeez A. Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig1.png Type: image/png Size: 85415 bytes Desc: not available URL: From gopalar.ccf at gmail.com Thu Feb 20 22:12:28 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 20 Feb 2014 16:12:28 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: Arjen, Thanks, I reduced down the time resolution so computation can go faster. Now, my matrix looks like this hpicomptimefreq = label: {204x1 cell} dimord: 'rpt_chan_freq_time' freq: [1x56 double] time: [1x375 double] powspctrm: [4-D double] cumtapcnt: [59x56 double] cfg: [1x1 struct] trialinfo: [59x1 double] beta: [4-D double] ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. Thanks, Raghavan Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) From: "Stolk, A. (Arjen)" To: FieldTrip discussion list Subject: Re: [FieldTrip] regressconfound and frequency domain Message-ID: < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl> Content-Type: text/plain; charset="utf-8" Dear Raghavan, Good to hear it's working out for you. A short answer would be 'no'. Reducing the size of your data matrix is likely going to speed up computations. Your time resolution seems pretty high (1500 frequency estimations per single trial); do you need that many? Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 19 februari 2014 22:01:00 > Onderwerp: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks for answering all my previous questions. I was successfully > able to incorporate head movements to my erf data. As I understand I > have to do this separately for the time frequency data after keeping > individual trials. I am interested in both beta and gamma bands > [15:1:70]. my time frequency looks like this using wavelets, > timefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > grad: [1x1 struct] > elec: [1x1 struct] > cfg: [1x1 struct] > trialinfo: [55x1 double] > After regressconfound > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x1500 double] > powspctrm: [4-D double] > cumtapcnt: [55x56 double] > cfg: [1x1 struct] > trialinfo: [55x1 double] > beta: [4-D double] > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > will take an enoumous amount of time to process the data through > regressconfound. Is there a workaround to make the processing faster > or am I missing something. Any help would be of great help. > Thanks, > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Thu Feb 20 22:45:58 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Thu, 20 Feb 2014 22:45:58 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <489473348.5444313.1392932758055.JavaMail.root@sculptor.zimbra.ru.nl> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks, I reduced down the time resolution so computation can go > faster. Now, m y matrix looks like this > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 struct] > trialinfo: [59x1 double] > beta: [4-D double] > ft_regressconfound run on timelock data seems to return output with > avg field. However, ft_regressconfound run on frequency data, does not > return average. I see the avg field being removed. Is there a reason? > Question - Since ft_regressconfound outputs power spectrum of > individual trials - 4D matrix (instead of average), can I simply > re-average the power spectrum over trials to see the average power for > that subject. Also, I need to run grand average (over subjects) before > running statistics. I hope these steps does not distort the data. > Please advise. > Thanks, > Raghavan > Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] regressconfound and frequency domain > Message-ID: > < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > > > Content-Type: text/plain; charset="utf-8" > Dear Raghavan, Good to hear it's working out for you. A short answer > would be 'no'. Reducing the size of your data matrix is likely going > to speed up computations. Your time resolution seems pretty high (1500 > frequency estimations per single trial); do you need that many? Yours, > Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: [FieldTrip] regressconfound and frequency domain > > Arjen, > > Thanks for answering all my previous questions. I was successfully > > able to incorporate head movements to my erf data. As I understand I > > have to do this separately for the time frequency data after keeping > > individual trials. I am interested in both beta and gamma bands > > [15:1:70]. my time frequency looks like this using wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > After regressconfound > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D double] > > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > > will take an enoumous amount of time to process the data through > > regressconfound. Is there a workaround to make the processing faster > > or am I missing something. Any help would be of great help. > > Thanks, > > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Thu Feb 20 23:33:18 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 20 Feb 2014 17:33:18 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> Thanks Arjen, Should I use ft_freqdescriptives to compute t descriptives for individual subjects, and then take that to group level instead of mean? If not, what are the other alternatives? Thanks, Raghavan Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, > Thanks, I reduced down the time resolution so computation can go > faster. Now, m y matrix looks like this > hpicomptimefreq = > label: {204x1 cell} > dimord: 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 struct] > trialinfo: [59x1 double] > beta: [4-D double] > ft_regressconfound run on timelock data seems to return output with > avg field. However, ft_regressconfound run on frequency data, does not > return average. I see the avg field being removed. Is there a reason? > Question - Since ft_regressconfound outputs power spectrum of > individual trials - 4D matrix (instead of average), can I simply > re-average the power spectrum over trials to see the average power for > that subject. Also, I need to run grand average (over subjects) before > running statistics. I hope these steps does not distort the data. > Please advise. > Thanks, > Raghavan > Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] regressconfound and frequency domain > Message-ID: > < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > > > Content-Type: text/plain; charset="utf-8" > Dear Raghavan, Good to hear it's working out for you. A short answer > would be 'no'. Reducing the size of your data matrix is likely going > to speed up computations. Your time resolution seems pretty high (1500 > frequency estimations per single trial); do you need that many? Yours, > Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: [FieldTrip] regressconfound and frequency domain > > Arjen, > > Thanks for answering all my previous questions. I was successfully > > able to incorporate head movements to my erf data. As I understand I > > have to do this separately for the time frequency data after keeping > > individual trials. I am interested in both beta and gamma bands > > [15:1:70]. my time frequency looks like this using wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > After regressconfound > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D double] > > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > > will take an enoumous amount of time to process the data through > > regressconfound. Is there a workaround to make the processing faster > > or am I missing something. Any help would be of great help. > > Thanks, > > Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Fri Feb 21 09:23:49 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 21 Feb 2014 09:23:49 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> Message-ID: <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> Dear Raghavan, To compute a t-descriptive on subject level freq data, you'll need to use ft_freqstatistics. Have a look here for instance: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq At the subject level, you do not need (non-parametric) cluster permutation testing (Maris & Oostenveld), as you're taking each subject's t-descriptives to the group level. At the group level, you can then test the hypothesis that there's a difference between tasks/conditions (H1) vs. no difference (H0). In order to do so, you'll need to create a dummy variable at the group level, that has the same number of 'subjects', but with zeros in all fields (in your case this will be a .stat field). At the group level, you thus call ft_freqstatistics again. This approach has the advantage that you're more sensitive (as compared to taking each subject's mean to the group level) to effects that are small but consistent over trials in each subject. Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 23:33:18 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Thanks Arjen, > Should I use ft_freqdescriptives to compute t descriptives for > individual subjects, and then take that to group level instead of > mean? If not, what are the other alternatives? > Thanks, > Raghavan > Hi Raghavan, ft_regressconfound run on timelock data seems to return > output with avg field. However, ft_regressconfound run on frequency > data, does not return average. I see the avg field being removed. Is > there a reason? >> Not intentionally, but not an issue either. You > could still use ft_freqdescriptives to compute the average for you, > but see my comment below. Question - Since ft_regressconfound outputs > power spectrum of individual trials - 4D matrix (instead of average), > can I simply re-average the power spectrum over trials to see the > average power for that subject. Also, I need to run grand average > (over subjects) before running statistics. I hope these steps does not > distort the data. Please advise. >> Remember that the mean over trials > is not affected by your clean-up of trial-by-trial variance due to > head movement. Taking each subject's mean (unaffected) to the group > level is an approach that will not benefit from your clean-up. In > order to benefit from reduced trial-by-trial variance, you'll need a > measure that depends on it, e.g. t-descriptive, neural > activity-behavior correlation (for taking to the group level). Hope > this helps, Arjen ----- Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > Aan: > > fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari 2014 > > 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and frequency > > domain > Arjen, > Thanks, I reduced down the time resolution so > > computation can go > faster. Now, m y matrix looks like this > > > hpicomptimefreq = > label: {204x1 cell} > dimord: > > 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 double] > > > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 > > struct] > trialinfo: [59x1 double] > beta: [4-D double] > > > ft_regressconfound run on timelock data seems to return output with > > > avg field. However, ft_regressconfound run on frequency data, does > > not > return average. I see the avg field being removed. Is there a > > reason? > Question - Since ft_regressconfound outputs power spectrum > > of > individual trials - 4D matrix (instead of average), can I > > simply > re-average the power spectrum over trials to see the > > average power for > that subject. Also, I need to run grand average > > (over subjects) before > running statistics. I hope these steps does > > not distort the data. > Please advise. > Thanks, > Raghavan > Date: > > Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. (Arjen)" < > > a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < > > fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] > > regressconfound and frequency domain > Message-ID: > < > > 2108167665.5423215.1392847118322.JavaMail.root at > > sculptor.zimbra.ru.nl > > > Content-Type: text/plain; > > charset="utf-8" > Dear Raghavan, Good to hear it's working out for > > you. A short answer > would be 'no'. Reducing the size of your data > > matrix is likely going > to speed up computations. Your time > > resolution seems pretty high (1500 > frequency estimations per > > single trial); do you need that many? Yours, > Arjen ----- > > Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" < > > gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: > > [FieldTrip] regressconfound and frequency domain > > Arjen, > > > > Thanks for answering all my previous questions. I was successfully > > > > able to incorporate head movements to my erf data. As I understand > > I > > have to do this separately for the time frequency data after > > keeping > > individual trials. I am interested in both beta and > > gamma bands > > [15:1:70]. my time frequency looks like this using > > wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 struct] > > > > trialinfo: [55x1 double] > > After regressconfound > > > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 double] > > > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D > > double] > > Regressconfound took about 1 hr and 30 mins, since its a > > huge matrix > > [55x204x56x1500]. I have 25 such blocks of data for > > 20 subjects. It > > will take an enoumous amount of time to process > > the data through > > regressconfound. Is there a workaround to make > > the processing faster > > or am I missing something. Any help would > > be of great help. > > Thanks, > > Raghavan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Feb 21 11:38:10 2014 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 21 Feb 2014 05:38:10 -0500 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> References: <98E05FC4-ECD3-401B-80FE-15D6C0781816@gmail.com> <391192430.5446526.1392971029115.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Arjen, what you just described is more or less what I struggled to do last week and ultimately gave up as I was unable to figure out how to get FT to do it despite much meditation over tutorials and source files. Can you elaborate a bit more on what you are saying below -- not the ft_regressconfound bit, but the bit about how to get ft_statistics_montecarlo and its wrappers to do a trials-level analysis and permutation at the whole-group level? Especially, what does one put in cfg.design and how does one call the function? Everything I could find in the tutorials described the case of doing means at the subject level and then permutation of means at the group level, which as you point out is underpowered for subtle effects. My particular situation was timelock-analyzed trials (with keeptrials='yes'), but I could not find a way to set up cfg.design that did not throw error messages. The thing that really seemed to bother it was that there were different numbers of trials in the 2-3 conditions of interest, since some had to be removed for excessive artifact. Thanks for any help, Alik Alik Widge alik.widge at gmail.com (206) 866-5435 On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) wrote: > Dear Raghavan, > > To compute a t-descriptive on subject level freq data, you'll need to use > ft_freqstatistics. Have a look here for instance: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > At the subject level, you do not need (non-parametric) cluster permutation > testing (Maris & Oostenveld), as you're taking each subject's > t-descriptives to the group level. At the group level, you can then test > the hypothesis that there's a difference between tasks/conditions (H1) vs. > no difference (H0). In order to do so, you'll need to create a dummy > variable at the group level, that has the same number of 'subjects', but > with zeros in all fields (in your case this will be a .stat field). At the > group level, you thus call ft_freqstatistics again. This approach has the > advantage that you're more sensitive (as compared to taking each subject's > mean to the group level) to effects that are small but consistent over > trials in each subject. > > Arjen > > > ------------------------------ > > *Van: *"Raghavan Gopalakrishnan" > *Aan: *fieldtrip at science.ru.nl > *Verzonden: *Donderdag 20 februari 2014 23:33:18 > > *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain > > Thanks Arjen, > Should I use ft_freqdescriptives to compute t descriptives for individual > subjects, and then take that to group level instead of mean? If not, what > are the other alternatives? > Thanks, > Raghavan > > Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > >* Van: "Raghavan Gopalakrishnan" > > *>* Aan: fieldtrip at science.ru.nl > *>* Verzonden: Donderdag 20 februari 2014 22:12:28 > *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > *>* Arjen, > *>* Thanks, I reduced down the time resolution so computation can go > *>* faster. Now, m y matrix looks like this > *>* hpicomptimefreq = > *>* label: {204x1 cell} > *>* dimord: 'rpt_chan_freq_time' > *>* freq: [1x56 double] > *>* time: [1x375 double] > *>* powspctrm: [4-D double] > *>* cumtapcnt: [59x56 double] > *>* cfg: [1x1 struct] > *>* trialinfo: [59x1 double] > *>* beta: [4-D double] > *>* ft_regressconfound run on timelock data seems to return output with > *>* avg field. However, ft_regressconfound run on frequency data, does not > *>* return average. I see the avg field being removed. Is there a reason? > *>* Question - Since ft_regressconfound outputs power spectrum of > *>* individual trials - 4D matrix (instead of average), can I simply > *>* re-average the power spectrum over trials to see the average power for > *>* that subject. Also, I need to run grand average (over subjects) before > *>* running statistics. I hope these steps does not distort the data. > *>* Please advise. > *>* Thanks, > *>* Raghavan > *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) > *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > > *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > > *>* Subject: Re: [FieldTrip] regressconfound and frequency domain > *>* Message-ID: > *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl > *>* > > *>* Content-Type: text/plain; charset="utf-8" > *>* Dear Raghavan, Good to hear it's working out for you. A short answer > *>* would be 'no'. Reducing the size of your data matrix is likely going > *>* to speed up computations. Your time resolution seems pretty high (1500 > *>* frequency estimations per single trial); do you need that many? Yours, > *>* Arjen ----- Oorspronkelijk bericht ----- > *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > *>* > Aan: fieldtrip at science.ru.nl > *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 > *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain > *>* > Arjen, > *>* > Thanks for answering all my previous questions. I was successfully > *>* > able to incorporate head movements to my erf data. As I understand I > *>* > have to do this separately for the time frequency data after keeping > *>* > individual trials. I am interested in both beta and gamma bands > *>* > [15:1:70]. my time frequency looks like this using wavelets, > *>* > timefreq = > *>* > label: {204x1 cell} > *>* > dimord: 'rpt_chan_freq_time' > *>* > freq: [1x56 double] > *>* > time: [1x1500 double] > *>* > powspctrm: [4-D double] > *>* > cumtapcnt: [55x56 double] > *>* > grad: [1x1 struct] > *>* > elec: [1x1 struct] > *>* > cfg: [1x1 struct] > *>* > trialinfo: [55x1 double] > *>* > After regressconfound > *>* > hpicomptimefreq = > *>* > label: {204x1 cell} > *>* > dimord: 'rpt_chan_freq_time' > *>* > freq: [1x56 double] > *>* > time: [1x1500 double] > *>* > powspctrm: [4-D double] > *>* > cumtapcnt: [55x56 double] > *>* > cfg: [1x1 struct] > *>* > trialinfo: [55x1 double] > *>* > beta: [4-D double] > *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix > *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It > *>* > will take an enoumous amount of time to process the data through > *>* > regressconfound. Is there a workaround to make the processing faster > *>* > or am I missing something. Any help would be of great help. > *>* > Thanks, > *>* > Raghavan* > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > > _______________________________________________ > 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 jm.horschig at donders.ru.nl Fri Feb 21 11:57:38 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Fri, 21 Feb 2014 11:57:38 +0100 Subject: [FieldTrip] timeseries analysis In-Reply-To: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> References: <8ea8d3c3ceaf4650852692047b6bd628@CO1PR02MB174.namprd02.prod.outlook.com> Message-ID: <53073122.7070305@donders.ru.nl> Hi Tim, interesting approach to use FieldTrip for fMRI data, keep us updated on your progress, please! Your error is rather straightforward. You need to specify a time-axis for each trial rather than a common time-axis. And pay attention to the dimensions. data.trial has to be cell-array where each trial is defined as nChans x nSamples. data.time needs to be cell-array and it's elements need to be 1 x nSamples. Lastly, data.label needs to be a cell-array with dimensions nChans x 1. for more information, see here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat Regarding your questions: > 1. Am I on the right track? yes, but maybe better define time in seconds than in samples, otherwise you're good. > 2. Is there a better function to be using? probably no, you need to hack it yourself together > 3. Am I using the proper data format as an import? if FT cannot read your data it by ft_read_data, then yes, this is the best (and only) way > 4. The code is 'assuming that the trials are consecutive segments of a > continuous recording', which is not the case for me, so what > can/should I do about that? you can define data.sampleinfo which specifies at what sample your trial started and ended relative to the actual recording. But, this information might not be necessary for now, so maybe just ignore the warning until you run into other problems. > 5. Does anyone have a template matlab script and demo dataset (for > timeseries analysis) that runs without errors, that I could look at? > It would help me to just step through the analysis to see what's > happening, and an example of input data/parameters. please see the link above for examples. Best, Jörn On 2/18/2014 8:44 PM, Timothy J Wanger wrote: > Hi, > > My name is Tim Wanger, I am a graduate student working with Dean > Sabatinelli at the University of Georgia. This is my first attempt at > using Field Trip. In order to familiarize myself with the software and > learn how it can analyze data collected at our lab, I put together a > small dataset containing fMRI timeseries from two different > experimental conditions(arousing/not-arousing). After looking through > the documentation on the Field Trip website, I came to the conclusion > that 'ft_timelockanalysis' could be used to analyse timeseries data. > After setting up a cfg variable, and importing my data(does not need > preprocessing), I tried running ft_timelockanalysis, but there were > some errors that I am not sure how to fix. I was wondering if anyone > could help me sort this out. > > data.label=region'; % region info > data.fsample=4; % 250ms sampling rate (4Hz) > data.trial=timeseriesdata; % our data, <158x50 cell> matrix. trials > have already been excised from raw data > data.time=num2cell(1:length(timeseriesdata)); % represent time in samples > data.trialinfo=arousalrating'; % experimental condition information > > cfg.channel='all'; > cfg.trials= 'all'; > cfg.covariance='no'; > cfg.covariancewindow='all'; > cfg.keeptrials='no'; > cfg.removemean='yes'; > cfg.vartrllength=2; % some trials are missing the 50th sample > > > Here is the error I am currently receiving, with some relevant Matlab > command window output. > > the input is raw data with 1 channels and 158 trials > Warning: removing inconsistent sampleinfo > > In ft_datatype_raw at 109 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > Warning: the data does not contain a trial definition > > In utilities/private/warning_once at 116 > In utilities/private/fixsampleinfo at 66 > In ft_datatype_raw at 158 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > Warning: reconstructing sampleinfo by assuming that the trials are > consecutive segments of a continuous > recording > > In utilities/private/warning_once at 116 > In utilities/private/fixsampleinfo at 79 > In ft_datatype_raw at 158 > In ft_checkdata at 213 > In ft_timelockanalysis at 105 > In testing_fieldtrip at 49 > > ??? Index exceeds matrix dimensions. > Error in ==> fixsampleinfo at 95 > offset(i) = time2offset(data.time{i}, data.fsample); > Error in ==> ft_datatype_raw at 158 > data = fixsampleinfo(data); > Error in ==> ft_checkdata at 213 > data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); > Error in ==> ft_timelockanalysis at 105 > data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', > 'yes', 'hassampleinfo', 'yes'); > Error in ==> testing_fieldtrip at 49 > [timelock] = ft_timelockanalysis(cfg, data); > > > So, my questions are: > 1. Am I on the right track? > 2. Is there a better function to be using? > 3. Am I using the proper data format as an import? > 4. The code is 'assuming that the trials are consecutive segments of a > continuous recording', which is not the case for me, so what > can/should I do about that? > 5. Does anyone have a template matlab script and demo dataset (for > timeseries analysis) that runs without errors, that I could look at? > It would help me to just step through the analysis to see what's > happening, and an example of input data/parameters. > > Thanks in advance! > -Tim Wanger​ > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From gopalar.ccf at gmail.com Fri Feb 21 12:41:26 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Fri, 21 Feb 2014 06:41:26 -0500 Subject: [FieldTrip] sending mails to fieldtrip community Message-ID: Thanks Arjen Please respond to my trivial question. Thanks Raghavan ---------- Forwarded message ---------- From: *Stolk, A. (Arjen)* Date: Friday, February 21, 2014 Subject: mails to fieldtrip community To: Raghavan Gopalakrishnan Hi Raghavan, Ok, but let's keep it 'online' as other people might benefit from your questions as well. Yours, Arjen ------------------------------ *Van: *"Raghavan Gopalakrishnan" > *Aan: *"a stolk" > *Verzonden: *Donderdag 20 februari 2014 23:42:54 *Onderwerp: *mails to fieldtrip community Arjen, Whenever I try to post a message on Fieldtrip, it seems to appear as a separate message instead of creating a chain to the existing chain of mail exchanges. You could see that on the archives, I have three different chain with the same title - '[FieldTrip] regressconfound and frequency domain', though they all have the same subject. I thought it might be better for other users if they all form a chain instead of being separate. Thanks, Raghavan -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Fri Feb 21 15:53:35 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Fri, 21 Feb 2014 15:53:35 +0100 (CET) Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: Message-ID: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Dear Alik, If I am correct, you're asking how to create subject-level t-descriptives, mentioned in the previous post? A quick answer would be to perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using ft_timelockstatistics (although you're not really 'testing' here, but only interested in that t-descriptive), in which trials are the unit of observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, ntrls_conditionB)]; ). Note that since an indepedent t-test tests for differences of the means of two conditions, it won't fail on unequal number of observations across the conditions (unlike a dependent/paired t-test). Hope this gets you kickstarted for the moment. I found a previous mail-conversation that goes more into detail, providing more overview of the steps involved: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html More useful documentation: http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level Yours, Arjen ----- Oorspronkelijk bericht ----- > Van: "Alik Widge" > Aan: "FieldTrip discussion list" > Verzonden: Vrijdag 21 februari 2014 11:38:10 > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > Arjen, what you just described is more or less what I struggled to do > last week and ultimately gave up as I was unable to figure out how to > get FT to do it despite much meditation over tutorials and source > files. Can you elaborate a bit more on what you are saying below -- > not the ft_regressconfound bit, but the bit about how to get > ft_statistics_montecarlo and its wrappers to do a trials-level > analysis and permutation at the whole-group level? Especially, what > does one put in cfg.design and how does one call the function? > Everything I could find in the tutorials described the case of doing > means at the subject level and then permutation of means at the group > level, which as you point out is underpowered for subtle effects. > My particular situation was timelock-analyzed trials (with > keeptrials='yes'), but I could not find a way to set up cfg.design > that did not throw error messages. The thing that really seemed to > bother it was that there were different numbers of trials in the 2-3 > conditions of interest, since some had to be removed for excessive > artifact. > Thanks for any help, > Alik > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > wrote: > > Dear Raghavan, > > To compute a t-descriptive on subject level freq data, you'll need > > to > > use ft_freqstatistics. Have a look here for instance: > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > At the subject level, you do not need (non-parametric) cluster > > permutation testing (Maris & Oostenveld), as you're taking each > > subject's t-descriptives to the group level. At the group level, you > > can then test the hypothesis that there's a difference between > > tasks/conditions (H1) vs. no difference (H0). In order to do so, > > you'll need to create a dummy variable at the group level, that has > > the same number of 'subjects', but with zeros in all fields (in your > > case this will be a .stat field). At the group level, you thus call > > ft_freqstatistics again. This approach has the advantage that you're > > more sensitive (as compared to taking each subject's mean to the > > group > > level) to effects that are small but consistent over trials in each > > subject. > > Arjen > > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > > Aan: fieldtrip at science.ru.nl > > > Verzonden: Donderdag 20 februari 2014 23:33:18 > > > Onderwerp: Re: [FieldTrip] regressconfound and frequency domain > > > Thanks Arjen, > > > Should I use ft_freqdescriptives to compute t descriptives for > > > individual subjects, and then take that to group level instead of > > > mean? If not, what are the other alternatives? > > > Thanks, > > > Raghavan > > > Hi Raghavan, ft_regressconfound run on timelock data seems to > > > return > > > output with avg field. However, ft_regressconfound run on > > > frequency > > > data, does not return average. I see the avg field being removed. > > > Is > > > there a reason? >> Not intentionally, but not an issue either. You > > > could still use ft_freqdescriptives to compute the average for > > > you, > > > but see my comment below. Question - Since ft_regressconfound > > > outputs > > > power spectrum of individual trials - 4D matrix (instead of > > > average), > > > can I simply re-average the power spectrum over trials to see the > > > average power for that subject. Also, I need to run grand average > > > (over subjects) before running statistics. I hope these steps does > > > not > > > distort the data. Please advise. >> Remember that the mean over > > > trials > > > is not affected by your clean-up of trial-by-trial variance due to > > > head movement. Taking each subject's mean (unaffected) to the > > > group > > > level is an approach that will not benefit from your clean-up. In > > > order to benefit from reduced trial-by-trial variance, you'll need > > > a > > > measure that depends on it, e.g. t-descriptive, neural > > > activity-behavior correlation (for taking to the group level). > > > Hope > > > this helps, Arjen ----- Oorspronkelijk bericht ----- > > > > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > > > > > > Aan: > > > > fieldtrip at science.ru.nl > Verzonden: Donderdag 20 februari > > > > 2014 > > > > 22:12:28 > Onderwerp: Re: [FieldTrip] regressconfound and > > > > frequency > > > > domain > Arjen, > Thanks, I reduced down the time resolution so > > > > computation can go > faster. Now, m y matrix looks like this > > > > > hpicomptimefreq = > label: {204x1 cell} > dimord: > > > > 'rpt_chan_freq_time' > freq: [1x56 double] > time: [1x375 > > > > double] > > > > > > > > > powspctrm: [4-D double] > cumtapcnt: [59x56 double] > cfg: [1x1 > > > > struct] > trialinfo: [59x1 double] > beta: [4-D double] > > > > > ft_regressconfound run on timelock data seems to return output > > > > with > > > > > avg field. However, ft_regressconfound run on frequency data, > > > > > does > > > > not > return average. I see the avg field being removed. Is > > > > there > > > > a > > > > reason? > Question - Since ft_regressconfound outputs power > > > > spectrum > > > > of > individual trials - 4D matrix (instead of average), can I > > > > simply > re-average the power spectrum over trials to see the > > > > average power for > that subject. Also, I need to run grand > > > > average > > > > (over subjects) before > running statistics. I hope these steps > > > > does > > > > not distort the data. > Please advise. > Thanks, > Raghavan > > > > > Date: > > > > Wed, 19 Feb 2014 22:58:38 +0100 (CET) > From: "Stolk, A. > > > > (Arjen)" > > > > < > > > > a.stolk at fcdonders.ru.nl > > To: FieldTrip discussion list < > > > > fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] > > > > regressconfound and frequency domain > Message-ID: > < > > > > 2108167665.5423215.1392847118322.JavaMail.root at > > > > sculptor.zimbra.ru.nl > > > Content-Type: text/plain; > > > > charset="utf-8" > Dear Raghavan, Good to hear it's working out > > > > for > > > > you. A short answer > would be 'no'. Reducing the size of your > > > > data > > > > matrix is likely going > to speed up computations. Your time > > > > resolution seems pretty high (1500 > frequency estimations per > > > > single trial); do you need that many? Yours, > Arjen ----- > > > > Oorspronkelijk bericht ----- > > Van: "Raghavan Gopalakrishnan" > > > > < > > > > gopalar.ccf at gmail.com > > > Aan: fieldtrip at science.ru.nl > > > > > > > > > > Verzonden: Woensdag 19 februari 2014 22:01:00 > > Onderwerp: > > > > [FieldTrip] regressconfound and frequency domain > > Arjen, > > > > > > Thanks for answering all my previous questions. I was > > > > successfully > > > > > > > > > > able to incorporate head movements to my erf data. As I > > > > > understand > > > > I > > have to do this separately for the time frequency data > > > > after > > > > keeping > > individual trials. I am interested in both beta and > > > > gamma bands > > [15:1:70]. my time frequency looks like this > > > > using > > > > wavelets, > > timefreq = > > label: {204x1 cell} > > dimord: > > > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 > > > > double] > > > > > > > > > > grad: [1x1 struct] > > elec: [1x1 struct] > > cfg: [1x1 > > > > > struct] > > > > > > > > > > > trialinfo: [55x1 double] > > After regressconfound > > > > > > hpicomptimefreq = > > label: {204x1 cell} > > dimord: > > > > 'rpt_chan_freq_time' > > freq: [1x56 double] > > time: [1x1500 > > > > double] > > powspctrm: [4-D double] > > cumtapcnt: [55x56 > > > > double] > > > > > > > > > > cfg: [1x1 struct] > > trialinfo: [55x1 double] > > beta: [4-D > > > > double] > > Regressconfound took about 1 hr and 30 mins, since > > > > its > > > > a > > > > huge matrix > > [55x204x56x1500]. I have 25 such blocks of data > > > > for > > > > 20 subjects. It > > will take an enoumous amount of time to > > > > process > > > > the data through > > regressconfound. Is there a workaround to > > > > make > > > > the processing faster > > or am I missing something. Any help > > > > would > > > > be of great help. > > Thanks, > > Raghavan > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > > Phone: +31(0)243 68294 > > Web: www.arjenstolk.nl > > _______________________________________________ > > 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 -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Feb 21 16:14:04 2014 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 21 Feb 2014 10:14:04 -0500 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> References: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: I don't *think* I'm asking about how to do second-order analysis, unless I have missed something important. I did read the link/FAQ when I was working on this last week, and that seems different than the question I am asking. What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? Alik Alik Widge alik.widge at gmail.com (206) 866-5435 On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) wrote: > Dear Alik, > > If I am correct, you're asking how to create subject-level t-descriptives, > mentioned in the previous post? A quick answer would be to perform an > indepedent t-test ( cfg.statistic = indepsamplesT; ) using > ft_timelockstatistics (although you're not really 'testing' here, but only > interested in that t-descriptive), in which trials are the unit of > observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, > ntrls_conditionB)]; ). Note that since an indepedent t-test tests for > differences of the means of two conditions, it won't fail on unequal number > of observations across the conditions (unlike a dependent/paired t-test). > > Hope this gets you kickstarted for the moment. I found a previous > mail-conversation that goes more into detail, providing more overview of > the steps involved: > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html > More useful documentation: > > http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level > > Yours, > Arjen > > ------------------------------ > > *Van: *"Alik Widge" > *Aan: *"FieldTrip discussion list" > *Verzonden: *Vrijdag 21 februari 2014 11:38:10 > > *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain > > Arjen, what you just described is more or less what I struggled to do last > week and ultimately gave up as I was unable to figure out how to get FT to > do it despite much meditation over tutorials and source files. Can you > elaborate a bit more on what you are saying below -- not the > ft_regressconfound bit, but the bit about how to get > ft_statistics_montecarlo and its wrappers to do a trials-level analysis and > permutation at the whole-group level? Especially, what does one put in > cfg.design and how does one call the function? Everything I could find in > the tutorials described the case of doing means at the subject level and > then permutation of means at the group level, which as you point out is > underpowered for subtle effects. > > My particular situation was timelock-analyzed trials (with > keeptrials='yes'), but I could not find a way to set up cfg.design that > did not throw error messages. The thing that really seemed to bother it was > that there were different numbers of trials in the 2-3 conditions of > interest, since some had to be removed for excessive artifact. > > Thanks for any help, > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Raghavan, >> >> To compute a t-descriptive on subject level freq data, you'll need to use >> ft_freqstatistics. Have a look here for instance: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> >> At the subject level, you do not need (non-parametric) cluster >> permutation testing (Maris & Oostenveld), as you're taking each subject's >> t-descriptives to the group level. At the group level, you can then test >> the hypothesis that there's a difference between tasks/conditions (H1) vs. >> no difference (H0). In order to do so, you'll need to create a dummy >> variable at the group level, that has the same number of 'subjects', but >> with zeros in all fields (in your case this will be a .stat field). At the >> group level, you thus call ft_freqstatistics again. This approach has the >> advantage that you're more sensitive (as compared to taking each subject's >> mean to the group level) to effects that are small but consistent over >> trials in each subject. >> >> Arjen >> >> >> ------------------------------ >> >> *Van: *"Raghavan Gopalakrishnan" >> *Aan: *fieldtrip at science.ru.nl >> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Thanks Arjen, >> Should I use ft_freqdescriptives to compute t descriptives for individual >> subjects, and then take that to group level instead of mean? If not, what >> are the other alternatives? >> Thanks, >> Raghavan >> >> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >> >* Van: "Raghavan Gopalakrishnan" > >> *>* Aan: fieldtrip at science.ru.nl >> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >> *>* Arjen, >> *>* Thanks, I reduced down the time resolution so computation can go >> *>* faster. Now, m y matrix looks like this >> *>* hpicomptimefreq = >> *>* label: {204x1 cell} >> *>* dimord: 'rpt_chan_freq_time' >> *>* freq: [1x56 double] >> *>* time: [1x375 double] >> *>* powspctrm: [4-D double] >> *>* cumtapcnt: [59x56 double] >> *>* cfg: [1x1 struct] >> *>* trialinfo: [59x1 double] >> *>* beta: [4-D double] >> *>* ft_regressconfound run on timelock data seems to return output with >> *>* avg field. However, ft_regressconfound run on frequency data, does not >> *>* return average. I see the avg field being removed. Is there a reason? >> *>* Question - Since ft_regressconfound outputs power spectrum of >> *>* individual trials - 4D matrix (instead of average), can I simply >> *>* re-average the power spectrum over trials to see the average power for >> *>* that subject. Also, I need to run grand average (over subjects) before >> *>* running statistics. I hope these steps does not distort the data. >> *>* Please advise. >> *>* Thanks, >> *>* Raghavan >> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >> *>* Message-ID: >> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >> *>* > >> *>* Content-Type: text/plain; charset="utf-8" >> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >> *>* would be 'no'. Reducing the size of your data matrix is likely going >> *>* to speed up computations. Your time resolution seems pretty high (1500 >> *>* frequency estimations per single trial); do you need that many? Yours, >> *>* Arjen ----- Oorspronkelijk bericht ----- >> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >> *>* > Aan: fieldtrip at science.ru.nl >> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >> *>* > Arjen, >> *>* > Thanks for answering all my previous questions. I was successfully >> *>* > able to incorporate head movements to my erf data. As I understand I >> *>* > have to do this separately for the time frequency data after keeping >> *>* > individual trials. I am interested in both beta and gamma bands >> *>* > [15:1:70]. my time frequency looks like this using wavelets, >> *>* > timefreq = >> *>* > label: {204x1 cell} >> *>* > dimord: 'rpt_chan_freq_time' >> *>* > freq: [1x56 double] >> *>* > time: [1x1500 double] >> *>* > powspctrm: [4-D double] >> *>* > cumtapcnt: [55x56 double] >> *>* > grad: [1x1 struct] >> *>* > elec: [1x1 struct] >> *>* > cfg: [1x1 struct] >> *>* > trialinfo: [55x1 double] >> *>* > After regressconfound >> *>* > hpicomptimefreq = >> *>* > label: {204x1 cell} >> *>* > dimord: 'rpt_chan_freq_time' >> *>* > freq: [1x56 double] >> *>* > time: [1x1500 double] >> *>* > powspctrm: [4-D double] >> *>* > cumtapcnt: [55x56 double] >> *>* > cfg: [1x1 struct] >> *>* > trialinfo: [55x1 double] >> *>* > beta: [4-D double] >> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >> *>* > will take an enoumous amount of time to process the data through >> *>* > regressconfound. Is there a workaround to make the processing faster >> *>* > or am I missing something. Any help would be of great help. >> *>* > Thanks, >> *>* > Raghavan* >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> >> _______________________________________________ >> 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 > > > > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > > _______________________________________________ > 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 a.stolk8 at gmail.com Fri Feb 21 16:26:27 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Fri, 21 Feb 2014 16:26:27 +0100 Subject: [FieldTrip] regressconfound and frequency domain In-Reply-To: References: <1566596675.5460122.1392994415546.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> >> _______________________________________________ >> 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 russgport at gmail.com Sat Feb 22 00:27:54 2014 From: russgport at gmail.com (Russell G Port) Date: Fri, 21 Feb 2014 18:27:54 -0500 Subject: [FieldTrip] sliding window for ICA Message-ID: Hi All, I have come across a problem and was hoping that someone had experience/knew things that could be useful.I have some MEG data, and the effort currently is to remove noise and artifact. I have the line noise reduction working fine, the question that faces me is the following. When I first read in my data I have the option of one of two methods. I can read it in as 1 second epoch for the whole length of the experiment (contiguous time bins, with no regard to events), or create 1 second epochs centered around a certain trigger (the data contains 4 different triggers). Initially I wanted to read in 1 second epochs (that spanned the entire dataset), clean it of artifacts (jumps, muscle, EOG,ECG, anything else), which would remove bad trials and components. I had then hoped to redefined the epoch, so that I could create 4 separate subsets of data, each centered around a separate trigger. It appears that I cannot do this (fieldtrip actually refuses this specifically). Is this because of issues with phase/jitter when putting the samples back together in different time sets? Second, it has been suggested that we perform ICA analysis to detect EOG and ECG artifacts on the data parsed just by timing (i.e. 1second bins contiguous for the entire length of the data but no relation to triggers), and have the component rejection scan my trials that are actually binned the based on triggers to remove the components; even though this is not the exact epochs used to classify the components. Is this possible? While I think it would be better to do the artifact correction on the whole dataset (all time/triggers included), would it actually be better to first define trials by triggers and then repeat everything (artifact rejection-wise)? This is very easy to do (and I have), the only issue comes when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as in http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg). I have the issue that when I used ft_artifact_ecg to detect peaks in the ECG channel (via z scores), zeros and NaNs are returned, and it fails to graph; since often the ECG timing occurs with such timing that the full pre/post time extends past what is actually in the trial. Is it proper just to remove all ECG events that cross the boundaries of the trigger based trials from the trial definitions used in next step. Here the sections of data contaminated with ECG are parsed and then tested to see coherence to the ICA components? I would fear that this would produce erroneous results, since the data for the ica would include the partial ECG event that I threw out. Best Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsauvigny at gmail.com Sat Feb 22 14:32:02 2014 From: tsauvigny at gmail.com (Thomas Sauvigny) Date: Sat, 22 Feb 2014 14:32:02 +0100 Subject: [FieldTrip] problem with EEG source reconstruction Message-ID: Dear fellow fiedtrippers, I would like to do a source reconstruction of EEG data using The FielTrip example MRI dataset via minimum-norm estimate. I stick close to the MNE tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and use a few steps from the EEG headmodel tutorial as well (http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I am struggling to combine the information from both tutorials in some crucial step prior to ft_sourceanalysis. My first approach has been to basically run through the MNE tutorial using the Fieltrip MRI dataset. As I could not save both the original anatomy and the masked anatomy in a freesurfer compatible format while using cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri = ft_volumesegment(cfg, mri); I instead proceeded as mentioned below and aligned the electrodes to the scalp in a second step (according to the headmodel tutorial). But when I want to combine the headmodel (vol) and the electrodes (elec_aligned2) into the leadfield, that does not work: using headmodel specified in the configuration using electrodes specified in the configuration Error using ft_prepare_vol_sens (line 534) unsupported volume conductor model for EEG Error in prepare_headmodel (line 94) [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); Error in ft_prepare_leadfield (line 124) [vol, sens, cfg] = prepare_headmodel(cfg, data); When I instead use the volume conduction model built in the headmodel tutorial (vol2) and the sourcespace from the MNE tutorial I get: Error using * Inner matrix dimensions must agree. Error in minimumnormestimate (line 179) A = P*A; % prewhitened leadfields Error in ft_sourceanalysis (line 869) dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, 'noisecov', squeeze(Cy(i,:,:))); In older posts in the mailing list there appeared to be problems with the scaling of the different components and I adapted the units, but that did not solve the problems. I would be very thankful for any help. cheers Thomas My script: clear all; mri = ft_read_mri('Subject01.mri'); save mri mri; disp(mri) cfg = []; cfg.resolution = 1; cfg.dim = [256 256 256]; mrirs = ft_volumereslice(cfg, mri); save mrirs mrirs; % segmentation of the mri % load mrirs; cfg = []; cfg.coordsys = 'ctf'; cfg.output = {'skullstrip' 'brain'}; seg = ft_volumesegment(cfg, mrirs); save seg seg; disp(seg(1)) %%% Thus, you need to identify the anterior commissure, the posterior commissure, and an interhemispheric point (which defines the XZ-plane). You can navigate across the slices with the arrows. %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel %%% coordinates of these landmarks are stored: % load mrirs; cfg = []; cfg.method = 'interactive'; mri_tal = ft_volumerealign(cfg, mrirs); save mri_tal mri_tal clear all; load mri_tal; load seg; % ensure that the skull-stripped anatomy is expressed in the same coordinate system as the anatomy seg.transform = mri_tal.transform; % save both the original anatomy, and the masked anatomy in a freesurfer compatible format cfg = []; cfg.filename = 'Subject01'; cfg.filetype = 'mgz'; cfg.parameter = 'anatomy'; ft_volumewrite(cfg, mri_tal); cfg.filename = 'Subject01masked'; ft_volumewrite(cfg, seg); %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% tcsh chsh -s /bin/tcsh setenv FREESURFER_HOME /Applications/freesurfer source $FREESURFER_HOME/SetUpFreeSurfer.csh setenv SUBJECTS_DIR /Applications/freesurfer/subjects setenv SUBJECT /Subject01 %%% .mgz files to mri folder cd $SUBJECTS_DIR/Subject01/mri/ mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz recon-all -talairach -subjid Subject01 recon-all -nuintensitycor -subjid Subject01 recon-all -normalization -subjid Subject01 cp T1.mgz brainmask.mgz recon-all -gcareg -subjid Subject01 recon-all -canorm -subjid Subject01 recon-all -careg -subjid Subject01 recon-all -calabel -subjid Subject01 recon-all -normalization2 -subjid Subject01 recon-all -segmentation -subjid Subject01 recon-all -fill -subjid Subject01 %%% This ends the part of the Freesurfer pipeline concerned with volumetric processing. At this stage you should have a file filled.mgz containing the segmentation of the cortical white matter (cerebellum is not included!). %%% You can check how this looks using FieldTrip, by doing the following: % % go to the Subject01/mri directory mri = ft_read_mri('filled.mgz'); cfg = []; cfg.interactive = 'yes'; figure;ft_sourceplot(cfg, mri); %%% back in Terminal: cd $SUBJECTS_DIR/Subject01/mri/ recon-all -tessellate -subjid Subject01 recon-all -smooth1 -subjid Subject01 recon-all -inflate1 -subjid Subject01 recon-all -qsphere -subjid Subject01 recon-all -fix -subjid Subject01 cp brain.mgz brain.finalsurfs.mgz recon-all -finalsurfs -subjid Subject01 recon-all -smooth2 -subjid Subject01 recon-all -inflate2 -subjid Subject01 recon-all -sphere -subjid Subject01 recon-all -surfreg -subjid Subject01 %%% MNE download and installation %%%%%%%%%%%%%% setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app source $MNE_ROOT/bin/mne_setup % http://martinos.org/mne/stable/manual/list.html cd $MNE_ROOT/bin ./mne_setup_sh setenv SUBJECTS_DIR /Applications/freesurfer/subjects setenv SUBJECT /Subject01 ./mne_setup_source_space --ico -6 --overwrite %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); figure;ft_plot_mesh(bnd); %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/mri mri_nom = ft_read_mri('orig-nomask.mgz'); cfg = []; cfg.method = 'interactive'; mri_nom_ctf = ft_volumerealign(cfg, mri_nom); %%% fiducials chosen, fiducials l,r,n mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/bem bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); sourcespace = ft_convert_units(bnd, 'cm'); sourcespace = ft_transform_geometry(T, sourcespace); save sourcespace sourcespace; save T T; %we will need the transformation matrix in the next step %%% Current Folder auf: /Applications/freesurfer/subjects/Subject01/Subject01/mri mri_nom = ft_read_mri('orig-nomask.mgz'); cfg = []; cfg.coordsys = 'spm'; cfg.output = {'brain'}; seg = ft_volumesegment(cfg, mri_nom); seg = ft_convert_units(seg,'cm'); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg,seg); vol.bnd = ft_transform_geometry(T, vol.bnd); save vol vol; % load vol % volume conduction model figure;hold on; ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight %%% so far, so good. >>> then I create the elec file: clear all; mri2 = ft_read_mri('Subject01.mri'); disp(mri2) save mri2 mri2; cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri2 = ft_volumesegment(cfg, mri2); save segmentedmri2 segmentedmri2 disp(segmentedmri2) cfg=[]; cfg.tissue={'brain','skull','scalp'}; cfg.numvertices = [3000 2000 1000]; bnd2=ft_prepare_mesh(cfg,segmentedmri2); save bnd2 bnd2 disp(bnd2(1)) cfg = []; cfg.method ='dipoli'; vol2 = ft_prepare_headmodel(cfg, segmentedmri2); save vol2 vol2 disp(vol2) vol2 = ft_convert_units(vol2, 'cm'); figure; ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp figure; ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull figure; ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); elec2 = ft_read_sens('standard_1020.elc'); % may you need to define the path to the file disp(elec2) elec2 = ft_convert_units(elec2, 'cm'); % load volume conduction model load vol2; figure; % head surface (scalp) ft_plot_mesh(vol2.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % electrodes ft_plot_sens(elec2,'style', 'sk'); mri2 = ft_convert_units(mri2, 'cm'); nas=mri2.hdr.fiducial.mri.nas; lpa=mri2.hdr.fiducial.mri.lpa; rpa=mri2.hdr.fiducial.mri.rpa; transm=mri2.transform; nas=warp_apply(transm,nas, 'homogenous'); lpa=warp_apply(transm,lpa, 'homogenous'); rpa=warp_apply(transm,rpa, 'homogenous'); fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials fid.label = {'Nz','LPA','RPA'}; % same labels as in elec fid.unit = 'cm'; % same units as mri % alignment cfg = []; cfg.method = 'fiducial'; cfg.template = fid; % see above cfg.elec = elec2; cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec elec_aligned2 = ft_electroderealign(cfg); save elec_aligned2 elec_aligned2; % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); figure; ft_plot_sens(elec_aligned2,'style','sk'); hold on; ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', 'facecolor', [0.65 0.65 0.65]); %scalp cfg = []; cfg.method = 'interactive'; cfg.elec = elec_aligned2; cfg.headshape = vol2.bnd(1); elec_aligned2 = ft_electroderealign(cfg); %%%%% and here I am struggling: I can not get any of the above files to %%%%% work together: vol or vol2, elec_aligned2, sourcespace etc. vol = ft_convert_units(vol, 'cm'); elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); cfg = []; cfg.elec = elec_aligned2; % sensor positions cfg.channel = 'all'; % the used channels cfg.grid.pos = sourcespace.pnt; % source points cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are inside of the brain cfg.vol = vol; cfg.normalize = 'yes';% volume conduction model leadfield = ft_prepare_leadfield(cfg); save leadfield leadfield; clear all; load('GA1.mat') load('GA2.mat') load leadfield; load vol2; load elec_aligned2; cfg = []; cfg.method = 'mne'; cfg.elec = elec_aligned2; cfg.grid = leadfield; cfg.vol = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; cfg.mne.normalize = 'yes'; sourceCERT0 = ft_sourceanalysis(cfg, GA1); sourceCERT3 = ft_sourceanalysis(cfg, GA2); -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Sat Feb 22 15:38:25 2014 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Sat, 22 Feb 2014 15:38:25 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: References: Message-ID: Hi Thomas, When I was working with actual data, once I got this error. At that time, it was the problem of having different number of electrodes for the forward solution (lead-field) i have created and for each subject recording electrodes. Each subject has different set of recording electrodes which gave this problem. I think we have to check the difference in electrodes or number of sensors. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > Dear fellow fiedtrippers, > > I would like to do a source reconstruction of EEG data using The FielTrip > example MRI dataset via minimum-norm estimate. I stick close to the MNE > tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and > use a few steps from the EEG headmodel tutorial as well ( > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I > am struggling to combine the information from both tutorials in some > crucial step prior to ft_sourceanalysis. > My first approach has been to basically run through the MNE tutorial using > the Fieltrip MRI dataset. As I could not save both the original anatomy and > the masked anatomy in a freesurfer compatible format while using > > *cfg = [];* > *cfg.output = {'brain','skull','scalp'};* > *segmentedmri = ft_volumesegment(cfg, mri);* > > I instead proceeded as mentioned below and aligned the electrodes to the > scalp in a second step (according to the headmodel tutorial). But when I > want to combine the headmodel (vol) and the electrodes (elec_aligned2) into > the leadfield, that does not work: > > *using headmodel specified in the configuration* > *using electrodes specified in the configuration* > *Error using ft_prepare_vol_sens (line 534)* > *unsupported volume conductor model for EEG* > > *Error in prepare_headmodel (line 94)* > *[vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, > 'order',* > *cfg.order);* > > *Error in ft_prepare_leadfield (line 124)* > *[vol, sens, cfg] = prepare_headmodel(cfg, data);* > > > When I instead use the volume conduction model built in the headmodel > tutorial (vol2) and the sourcespace from the MNE tutorial I get: > > > > > > > > > > *Error using * Inner matrix dimensions must agree.Error in > minimumnormestimate (line 179) A = P*A; % prewhitened > leadfieldsError in ft_sourceanalysis (line 869) dip(i) = > minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, > 'noisecov', squeeze(Cy(i,:,:)));* > > In older posts in the mailing list there appeared to be problems with the > scaling of the different components and I adapted the units, but that did > not solve the problems. > I would be very thankful for any help. > > > > cheers > Thomas > > > > > > > > > My script: > > clear all; > mri = ft_read_mri('Subject01.mri'); > save mri mri; > disp(mri) > > cfg = []; > cfg.resolution = 1; > cfg.dim = [256 256 256]; > mrirs = ft_volumereslice(cfg, mri); > save mrirs mrirs; > > % segmentation of the mri > % load mrirs; > cfg = []; > cfg.coordsys = 'ctf'; > cfg.output = {'skullstrip' 'brain'}; > seg = ft_volumesegment(cfg, mrirs); > save seg seg; > > disp(seg(1)) > > %%% Thus, you need to identify the anterior commissure, the posterior > commissure, and an interhemispheric point (which defines the XZ-plane). You > can navigate across the slices with the arrows. > %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel > %%% coordinates of these landmarks are stored: > % load mrirs; > cfg = []; > cfg.method = 'interactive'; > mri_tal = ft_volumerealign(cfg, mrirs); > save mri_tal mri_tal > > clear all; > load mri_tal; > load seg; > % ensure that the skull-stripped anatomy is expressed in the same > coordinate system as the anatomy > seg.transform = mri_tal.transform; > % save both the original anatomy, and the masked anatomy in a freesurfer > compatible format > cfg = []; > cfg.filename = 'Subject01'; > cfg.filetype = 'mgz'; > cfg.parameter = 'anatomy'; > ft_volumewrite(cfg, mri_tal); > cfg.filename = 'Subject01masked'; > ft_volumewrite(cfg, seg); > > %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% > tcsh > chsh -s /bin/tcsh > setenv FREESURFER_HOME /Applications/freesurfer > source $FREESURFER_HOME/SetUpFreeSurfer.csh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > %%% .mgz files to mri folder > cd $SUBJECTS_DIR/Subject01/mri/ > mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz > mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz > > recon-all -talairach -subjid Subject01 > recon-all -nuintensitycor -subjid Subject01 > recon-all -normalization -subjid Subject01 > cp T1.mgz brainmask.mgz > recon-all -gcareg -subjid Subject01 > recon-all -canorm -subjid Subject01 > recon-all -careg -subjid Subject01 > recon-all -calabel -subjid Subject01 > recon-all -normalization2 -subjid Subject01 > recon-all -segmentation -subjid Subject01 > recon-all -fill -subjid Subject01 > > > %%% This ends the part of the Freesurfer pipeline concerned with > volumetric processing. At this stage you should have a file filled.mgz > containing the segmentation of the cortical white matter (cerebellum is not > included!). > %%% You can check how this looks using FieldTrip, by doing the following: > % % go to the Subject01/mri directory > mri = ft_read_mri('filled.mgz'); > cfg = []; > cfg.interactive = 'yes'; > figure;ft_sourceplot(cfg, mri); > > %%% back in Terminal: > cd $SUBJECTS_DIR/Subject01/mri/ > recon-all -tessellate -subjid Subject01 > recon-all -smooth1 -subjid Subject01 > recon-all -inflate1 -subjid Subject01 > recon-all -qsphere -subjid Subject01 > recon-all -fix -subjid Subject01 > cp brain.mgz brain.finalsurfs.mgz > recon-all -finalsurfs -subjid Subject01 > recon-all -smooth2 -subjid Subject01 > recon-all -inflate2 -subjid Subject01 > recon-all -sphere -subjid Subject01 > recon-all -surfreg -subjid Subject01 > > %%% MNE download and installation %%%%%%%%%%%%%% > setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 > setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app > source $MNE_ROOT/bin/mne_setup > > % http://martinos.org/mne/stable/manual/list.html > cd $MNE_ROOT/bin > ./mne_setup_sh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > > ./mne_setup_source_space --ico -6 --overwrite > > %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > figure;ft_plot_mesh(bnd); > > %%% Current Folder : > /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > %%% fiducials chosen, fiducials l,r,n > > mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > %%% Current Folder : > /Applications/freesurfer/subjects/Subject01/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', > 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > %%% Current Folder auf: > /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.coordsys = 'spm'; > cfg.output = {'brain'}; > seg = ft_volumesegment(cfg, mri_nom); > seg = ft_convert_units(seg,'cm'); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg,seg); > vol.bnd = ft_transform_geometry(T, vol.bnd); > save vol vol; > > % load vol % volume conduction model > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > > > > %%% so far, so good. >>> then I create the elec file: > clear all; > mri2 = ft_read_mri('Subject01.mri'); > disp(mri2) > save mri2 mri2; > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri2 = ft_volumesegment(cfg, mri2); > save segmentedmri2 segmentedmri2 > disp(segmentedmri2) > > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd2=ft_prepare_mesh(cfg,segmentedmri2); > > save bnd2 bnd2 > > disp(bnd2(1)) > > cfg = []; > cfg.method ='dipoli'; > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > save vol2 vol2 > > disp(vol2) > > vol2 = ft_convert_units(vol2, 'cm'); > > > figure; > ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp > figure; > ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull > figure; > ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain > > ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, > 'edgecolor', [1 1 1], 'edgealpha', 0.05); > hold on; > ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); > hold on; > ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); > > elec2 = ft_read_sens('standard_1020.elc'); % may you need to > define the path to the file > > disp(elec2) > > elec2 = ft_convert_units(elec2, 'cm'); > > % load volume conduction model > load vol2; > figure; > % head surface (scalp) > ft_plot_mesh(vol2.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % electrodes > ft_plot_sens(elec2,'style', 'sk'); > > > mri2 = ft_convert_units(mri2, 'cm'); > > nas=mri2.hdr.fiducial.mri.nas; > lpa=mri2.hdr.fiducial.mri.lpa; > rpa=mri2.hdr.fiducial.mri.rpa; > > transm=mri2.transform; > > nas=warp_apply(transm,nas, 'homogenous'); > lpa=warp_apply(transm,lpa, 'homogenous'); > rpa=warp_apply(transm,rpa, 'homogenous'); > > fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials > fid.label = {'Nz','LPA','RPA'}; % same labels as in elec > fid.unit = 'cm'; % same units as mri > > % alignment > cfg = []; > cfg.method = 'fiducial'; > cfg.template = fid; % see above > cfg.elec = elec2; > cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid > and in elec > elec_aligned2 = ft_electroderealign(cfg); > > save elec_aligned2 elec_aligned2; > % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > figure; > ft_plot_sens(elec_aligned2,'style','sk'); > hold on; > ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', > 'facecolor', [0.65 0.65 0.65]); %scalp > > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec_aligned2; > cfg.headshape = vol2.bnd(1); > elec_aligned2 = ft_electroderealign(cfg); > > > *%%%%% and here I am struggling: I can not get any of the above files to* > *%%%%% work together: vol or vol2, elec_aligned2, sourcespace etc.* > > vol = ft_convert_units(vol, 'cm'); > elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > cfg = []; > cfg.elec = elec_aligned2; % sensor positions > cfg.channel = 'all'; % the used channels > cfg.grid.pos = sourcespace.pnt; % source points > cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are > inside of the brain > cfg.vol = vol; > cfg.normalize = 'yes';% volume conduction model > leadfield = ft_prepare_leadfield(cfg); > > save leadfield leadfield; > > clear all; > load('GA1.mat') > load('GA2.mat') > load leadfield; > load vol2; > load elec_aligned2; > > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned2; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > cfg.mne.normalize = 'yes'; > sourceCERT0 = ft_sourceanalysis(cfg, GA1); > sourceCERT3 = ft_sourceanalysis(cfg, GA2); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From aaron.schurger at gmail.com Sat Feb 22 16:37:27 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Sat, 22 Feb 2014 16:37:27 +0100 Subject: [FieldTrip] sliding window for ICA In-Reply-To: References: Message-ID: See below... On Sat, Feb 22, 2014 at 12:27 AM, Russell G Port wrote: > Hi All, > > I have come across a problem and was hoping that someone had experience/knew > things that could be useful.I have some MEG data, and the effort currently > is to remove noise and artifact. I have the line noise reduction working > fine, the question that faces me is the following. When I first read in my > data I have the option of one of two methods. I can read it in as 1 second > epoch for the whole length of the experiment (contiguous time bins, with no > regard to events), or create 1 second epochs centered around a certain > trigger (the data contains 4 different triggers). Initially I wanted to read > in 1 second epochs (that spanned the entire dataset), clean it of artifacts > (jumps, muscle, EOG,ECG, anything else), which would remove bad trials and > components. I had then hoped to redefined the epoch, so that I could create > 4 separate subsets of data, each centered around a separate trigger. It > appears that I cannot do this (fieldtrip actually refuses this > specifically). Is this because of issues with phase/jitter when putting the > samples back together in different time sets? Second, it has been suggested > that we perform ICA analysis to detect EOG and ECG artifacts on the data > parsed just by timing (i.e. 1second bins contiguous for the entire length of > the data but no relation to triggers), and have the component rejection scan > my trials that are actually binned the based on triggers to remove the > components; even though this is not the exact epochs used to classify the > components. Is this possible? This is the preferred way to do it. Read in all of your data in 1- or 2-second epochs at arbitrary points (just one right after another). Run ICA on these epochs and save the components that you get (call this 'comp'). Then make a note of the components that you want to remove (usually blink, eye movement, and heart). Now read in your data time-locked to your triggers and use the previously-defined components to clean up the data (use the cfg to specify which components you want to remove). [data] = ft_rejectcomponent(cfg, comp, data); > > While I think it would be better to do the artifact correction on the whole > dataset (all time/triggers included), would it actually be better to first > define trials by triggers and then repeat everything (artifact > rejection-wise)? This is very easy to do (and I have), the only issue comes > when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as in > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg). > I have the issue that when I used ft_artifact_ecg to detect peaks in the ECG > channel (via z scores), zeros and NaNs are returned, and it fails to graph; > since often the ECG timing occurs with such timing that the full pre/post > time extends past what is actually in the trial. Is it proper just to remove > all ECG events that cross the boundaries of the trigger based trials from > the trial definitions used in next step. Here the sections of data > contaminated with ECG are parsed and then tested to see coherence to the ICA > components? I would fear that this would produce erroneous results, since > the data for the ica would include the partial ECG event that I threw out. > > Best > Russ Port > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From russgport at gmail.com Sat Feb 22 19:49:17 2014 From: russgport at gmail.com (Russell G Port) Date: Sat, 22 Feb 2014 13:49:17 -0500 Subject: [FieldTrip] sliding window for ICA In-Reply-To: References: Message-ID: Thank you Dr Schurger, this is awesome On Sat, Feb 22, 2014 at 10:37 AM, Aaron Schurger wrote: > See below... > > > On Sat, Feb 22, 2014 at 12:27 AM, Russell G Port > wrote: > > Hi All, > > > > I have come across a problem and was hoping that someone had > experience/knew > > things that could be useful.I have some MEG data, and the effort > currently > > is to remove noise and artifact. I have the line noise reduction working > > fine, the question that faces me is the following. When I first read in > my > > data I have the option of one of two methods. I can read it in as 1 > second > > epoch for the whole length of the experiment (contiguous time bins, with > no > > regard to events), or create 1 second epochs centered around a certain > > trigger (the data contains 4 different triggers). Initially I wanted to > read > > in 1 second epochs (that spanned the entire dataset), clean it of > artifacts > > (jumps, muscle, EOG,ECG, anything else), which would remove bad trials > and > > components. I had then hoped to redefined the epoch, so that I could > create > > 4 separate subsets of data, each centered around a separate trigger. It > > appears that I cannot do this (fieldtrip actually refuses this > > specifically). Is this because of issues with phase/jitter when putting > the > > samples back together in different time sets? Second, it has been > suggested > > that we perform ICA analysis to detect EOG and ECG artifacts on the data > > parsed just by timing (i.e. 1second bins contiguous for the entire > length of > > the data but no relation to triggers), and have the component rejection > scan > > my trials that are actually binned the based on triggers to remove the > > components; even though this is not the exact epochs used to classify the > > components. Is this possible? > > This is the preferred way to do it. Read in all of your data in 1- or > 2-second epochs at arbitrary points (just one right after another). > Run ICA on these epochs and save the components that you get (call > this 'comp'). Then make a note of the components that you want to > remove (usually blink, eye movement, and heart). Now read in your data > time-locked to your triggers and use the previously-defined components > to clean up the data (use the cfg to specify which components you want > to remove). > [data] = ft_rejectcomponent(cfg, comp, data); > > > > > While I think it would be better to do the artifact correction on the > whole > > dataset (all time/triggers included), would it actually be better to > first > > define trials by triggers and then repeat everything (artifact > > rejection-wise)? This is very easy to do (and I have), the only issue > comes > > when trying to compare the using ft_timelockanalysis/ft_freqanalysis (as > in > > > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts?s[]=ecg > ). > > I have the issue that when I used ft_artifact_ecg to detect peaks in the > ECG > > channel (via z scores), zeros and NaNs are returned, and it fails to > graph; > > since often the ECG timing occurs with such timing that the full pre/post > > time extends past what is actually in the trial. Is it proper just to > remove > > all ECG events that cross the boundaries of the trigger based trials from > > the trial definitions used in next step. Here the sections of data > > contaminated with ECG are parsed and then tested to see coherence to the > ICA > > components? I would fear that this would produce erroneous results, since > > the data for the ica would include the partial ECG event that I threw > out. > > > > Best > > Russ Port > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > École Polytechnique Fédérale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > _______________________________________________ > 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 zizlsperger at gmail.com Sun Feb 23 13:14:37 2014 From: zizlsperger at gmail.com (Zizlsperger Leopold) Date: Sun, 23 Feb 2014 13:14:37 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: References: Message-ID: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> Hello in view of your code: first check if elec2 = ft_read_sens('standard_1020.elc’); corresponds to the channel structure of your functional data (averages). Best to Hamburg Leo — Dr. med. Leopold Zizlsperger Klinik für Neurologie Uniklinik RWTH Aachen Pauwelsstrasse 30 52074 Aachen Tel: +49 241 80 35465 lzizlsperger at ukaachen.de Leopold Zizlsperger, MD Department of Neurology RWTH Aachen University Pauwelsstrasse 30 52074 Aachen, Germany Tel: +49 241 80 35465 lzizlsperger at ukaachen.de On 22 Feb 2014, at 15:38, Chaitanya Srinivas wrote: > Hi Thomas, > > When I was working with actual data, once I got this error. At that time, it was the problem of having different number of electrodes for the forward solution (lead-field) i have created and for each subject recording electrodes. Each subject has different set of recording electrodes which gave this problem. I think we have to check the difference in electrodes or number of sensors. > > > > =============================================== > > > > Best Regards > Chaitanya Srinivas Lanka > > Wiss. Mitarbeiter PhD Student > Functional and Restorative Neurosurgery Neural Information Processing > Neurosurgical University Hospital Graduate Training Center for Neuroscience > Eberhard Karls University Eberhard Karls University > Otfried-Mueller-Str.45 Österbergstr. 3 > D-72076 Tuebingen D-72074 Tuebingen > Mobile Phone Number : +49-176-79035731 > =============================================== > > > On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > Dear fellow fiedtrippers, > > I would like to do a source reconstruction of EEG data using The FielTrip example MRI dataset via minimum-norm estimate. I stick close to the MNE tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) and use a few steps from the EEG headmodel tutorial as well (http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I am struggling to combine the information from both tutorials in some crucial step prior to ft_sourceanalysis. > My first approach has been to basically run through the MNE tutorial using the Fieltrip MRI dataset. As I could not save both the original anatomy and the masked anatomy in a freesurfer compatible format while using > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri); > > I instead proceeded as mentioned below and aligned the electrodes to the scalp in a second step (according to the headmodel tutorial). But when I want to combine the headmodel (vol) and the electrodes (elec_aligned2) into the leadfield, that does not work: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Error using ft_prepare_vol_sens (line 534) > unsupported volume conductor model for EEG > > Error in prepare_headmodel (line 94) > [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', > cfg.order); > > Error in ft_prepare_leadfield (line 124) > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > > When I instead use the volume conduction model built in the headmodel tutorial (vol2) and the sourcespace from the MNE tutorial I get: > > Error using * > Inner matrix dimensions must agree. > > Error in minimumnormestimate (line 179) > A = P*A; % prewhitened leadfields > > Error in ft_sourceanalysis (line 869) > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, > 'noisecov', squeeze(Cy(i,:,:))); > > In older posts in the mailing list there appeared to be problems with the scaling of the different components and I adapted the units, but that did not solve the problems. > I would be very thankful for any help. > > > > cheers > Thomas > > > > > > > > > My script: > > clear all; > mri = ft_read_mri('Subject01.mri'); > save mri mri; > disp(mri) > > cfg = []; > cfg.resolution = 1; > cfg.dim = [256 256 256]; > mrirs = ft_volumereslice(cfg, mri); > save mrirs mrirs; > > % segmentation of the mri > % load mrirs; > cfg = []; > cfg.coordsys = 'ctf'; > cfg.output = {'skullstrip' 'brain'}; > seg = ft_volumesegment(cfg, mrirs); > save seg seg; > > disp(seg(1)) > > %%% Thus, you need to identify the anterior commissure, the posterior commissure, and an interhemispheric point (which defines the XZ-plane). You can navigate across the slices with the arrows. > %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel > %%% coordinates of these landmarks are stored: > % load mrirs; > cfg = []; > cfg.method = 'interactive'; > mri_tal = ft_volumerealign(cfg, mrirs); > save mri_tal mri_tal > > clear all; > load mri_tal; > load seg; > % ensure that the skull-stripped anatomy is expressed in the same coordinate system as the anatomy > seg.transform = mri_tal.transform; > % save both the original anatomy, and the masked anatomy in a freesurfer compatible format > cfg = []; > cfg.filename = 'Subject01'; > cfg.filetype = 'mgz'; > cfg.parameter = 'anatomy'; > ft_volumewrite(cfg, mri_tal); > cfg.filename = 'Subject01masked'; > ft_volumewrite(cfg, seg); > > %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% > tcsh > chsh -s /bin/tcsh > setenv FREESURFER_HOME /Applications/freesurfer > source $FREESURFER_HOME/SetUpFreeSurfer.csh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > %%% .mgz files to mri folder > cd $SUBJECTS_DIR/Subject01/mri/ > mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz > mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz > > recon-all -talairach -subjid Subject01 > recon-all -nuintensitycor -subjid Subject01 > recon-all -normalization -subjid Subject01 > cp T1.mgz brainmask.mgz > recon-all -gcareg -subjid Subject01 > recon-all -canorm -subjid Subject01 > recon-all -careg -subjid Subject01 > recon-all -calabel -subjid Subject01 > recon-all -normalization2 -subjid Subject01 > recon-all -segmentation -subjid Subject01 > recon-all -fill -subjid Subject01 > > > %%% This ends the part of the Freesurfer pipeline concerned with volumetric processing. At this stage you should have a file filled.mgz containing the segmentation of the cortical white matter (cerebellum is not included!). > %%% You can check how this looks using FieldTrip, by doing the following: > % % go to the Subject01/mri directory > mri = ft_read_mri('filled.mgz'); > cfg = []; > cfg.interactive = 'yes'; > figure;ft_sourceplot(cfg, mri); > > %%% back in Terminal: > cd $SUBJECTS_DIR/Subject01/mri/ > recon-all -tessellate -subjid Subject01 > recon-all -smooth1 -subjid Subject01 > recon-all -inflate1 -subjid Subject01 > recon-all -qsphere -subjid Subject01 > recon-all -fix -subjid Subject01 > cp brain.mgz brain.finalsurfs.mgz > recon-all -finalsurfs -subjid Subject01 > recon-all -smooth2 -subjid Subject01 > recon-all -inflate2 -subjid Subject01 > recon-all -sphere -subjid Subject01 > recon-all -surfreg -subjid Subject01 > > %%% MNE download and installation %%%%%%%%%%%%%% > setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 > setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app > source $MNE_ROOT/bin/mne_setup > > % http://martinos.org/mne/stable/manual/list.html > cd $MNE_ROOT/bin > ./mne_setup_sh > > setenv SUBJECTS_DIR /Applications/freesurfer/subjects > setenv SUBJECT /Subject01 > > ./mne_setup_source_space --ico -6 --overwrite > > %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > figure;ft_plot_mesh(bnd); > > %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.method = 'interactive'; > mri_nom_ctf = ft_volumerealign(cfg, mri_nom); > > %%% fiducials chosen, fiducials l,r,n > > mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); > T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); > %%% Current Folder : /Applications/freesurfer/subjects/Subject01/Subject01/bem > bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', 'mne_source'); > sourcespace = ft_convert_units(bnd, 'cm'); > sourcespace = ft_transform_geometry(T, sourcespace); > save sourcespace sourcespace; > save T T; %we will need the transformation matrix in the next step > > %%% Current Folder auf: /Applications/freesurfer/subjects/Subject01/Subject01/mri > mri_nom = ft_read_mri('orig-nomask.mgz'); > > cfg = []; > cfg.coordsys = 'spm'; > cfg.output = {'brain'}; > seg = ft_volumesegment(cfg, mri_nom); > seg = ft_convert_units(seg,'cm'); > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg,seg); > vol.bnd = ft_transform_geometry(T, vol.bnd); > save vol vol; > > % load vol % volume conduction model > figure;hold on; > ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; > ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight > > > > %%% so far, so good. >>> then I create the elec file: > clear all; > mri2 = ft_read_mri('Subject01.mri'); > disp(mri2) > save mri2 mri2; > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri2 = ft_volumesegment(cfg, mri2); > save segmentedmri2 segmentedmri2 > disp(segmentedmri2) > > cfg=[]; > cfg.tissue={'brain','skull','scalp'}; > cfg.numvertices = [3000 2000 1000]; > bnd2=ft_prepare_mesh(cfg,segmentedmri2); > > save bnd2 bnd2 > > disp(bnd2(1)) > > cfg = []; > cfg.method ='dipoli'; > vol2 = ft_prepare_headmodel(cfg, segmentedmri2); > > save vol2 vol2 > > disp(vol2) > > vol2 = ft_convert_units(vol2, 'cm'); > > > figure; > ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp > figure; > ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull > figure; > ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain > > ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); > hold on; > ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); > hold on; > ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); > > elec2 = ft_read_sens('standard_1020.elc'); % may you need to define the path to the file > > disp(elec2) > > elec2 = ft_convert_units(elec2, 'cm'); > > % load volume conduction model > load vol2; > figure; > % head surface (scalp) > ft_plot_mesh(vol2.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % electrodes > ft_plot_sens(elec2,'style', 'sk'); > > > mri2 = ft_convert_units(mri2, 'cm'); > > nas=mri2.hdr.fiducial.mri.nas; > lpa=mri2.hdr.fiducial.mri.lpa; > rpa=mri2.hdr.fiducial.mri.rpa; > > transm=mri2.transform; > > nas=warp_apply(transm,nas, 'homogenous'); > lpa=warp_apply(transm,lpa, 'homogenous'); > rpa=warp_apply(transm,rpa, 'homogenous'); > > fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials > fid.label = {'Nz','LPA','RPA'}; % same labels as in elec > fid.unit = 'cm'; % same units as mri > > % alignment > cfg = []; > cfg.method = 'fiducial'; > cfg.template = fid; % see above > cfg.elec = elec2; > cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec > elec_aligned2 = ft_electroderealign(cfg); > > save elec_aligned2 elec_aligned2; > % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > figure; > ft_plot_sens(elec_aligned2,'style','sk'); > hold on; > ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', 'facecolor', [0.65 0.65 0.65]); %scalp > > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec_aligned2; > cfg.headshape = vol2.bnd(1); > elec_aligned2 = ft_electroderealign(cfg); > > > %%%%% and here I am struggling: I can not get any of the above files to > %%%%% work together: vol or vol2, elec_aligned2, sourcespace etc. > > vol = ft_convert_units(vol, 'cm'); > elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); > cfg = []; > cfg.elec = elec_aligned2; % sensor positions > cfg.channel = 'all'; % the used channels > cfg.grid.pos = sourcespace.pnt; % source points > cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are inside of the brain > cfg.vol = vol; > cfg.normalize = 'yes';% volume conduction model > leadfield = ft_prepare_leadfield(cfg); > > save leadfield leadfield; > > clear all; > load('GA1.mat') > load('GA2.mat') > load leadfield; > load vol2; > load elec_aligned2; > > > cfg = []; > cfg.method = 'mne'; > cfg.elec = elec_aligned2; > cfg.grid = leadfield; > cfg.vol = vol; > cfg.mne.prewhiten = 'yes'; > cfg.mne.lambda = 3; > cfg.mne.scalesourcecov = 'yes'; > cfg.mne.normalize = 'yes'; > sourceCERT0 = ft_sourceanalysis(cfg, GA1); > sourceCERT3 = ft_sourceanalysis(cfg, GA2); > > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_Signatur.png Type: image/png Size: 3435 bytes Desc: not available URL: From tsauvigny at gmail.com Sun Feb 23 18:51:22 2014 From: tsauvigny at gmail.com (Thomas Sauvigny) Date: Sun, 23 Feb 2014 18:51:22 +0100 Subject: [FieldTrip] problem with EEG source reconstruction In-Reply-To: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> References: <921B93BF-44A6-4C27-BD6C-400C5411FC9B@gmail.com> Message-ID: Awesome, Thank you Chaitanya and Leo! Am 23.02.2014 13:27 schrieb "Zizlsperger Leopold" : > Hello > in view of your code: first check if > elec2 = ft_read_sens('standard_1020.elc'); > corresponds to the channel structure of your functional data (averages). > Best to Hamburg > Leo > > -- > > > Dr. med. Leopold Zizlsperger > Klinik für Neurologie > Uniklinik RWTH Aachen > Pauwelsstrasse 30 > 52074 Aachen > Tel: +49 241 80 35465 > lzizlsperger at ukaachen.de > > > > > > Leopold Zizlsperger, MD > Department of Neurology > RWTH Aachen University > Pauwelsstrasse 30 > 52074 Aachen, Germany > Tel: +49 241 80 35465 > lzizlsperger at ukaachen.de > > > On 22 Feb 2014, at 15:38, Chaitanya Srinivas > wrote: > > Hi Thomas, > > When I was working with actual data, once I got this error. At that time, > it was the problem of having different number of electrodes for the forward > solution (lead-field) i have created and for each subject recording > electrodes. Each subject has different set of recording electrodes which > gave this problem. I think we have to check the difference in electrodes or > number of sensors. > > > > *=============================================== * > > > ***Best Regards* > > > *Chaitanya Srinivas Lanka Wiss. Mitarbeiter > * > > *PhD Student Functional and Restorative Neurosurgery Neural Information > ProcessingNeurosurgical University Hospital* > > * Graduate Training Center for Neuroscience Eberhard Karls > University Eberhard Karls University **Otfried-Mueller-Str.45 > Österbergstr. 3* > * D-72076 Tuebingen **D-72074 > Tuebingen* > > *Mobile Phone Number : +49-176-79035731* > *===============================================* > > > On Sat, Feb 22, 2014 at 2:32 PM, Thomas Sauvigny wrote: > >> Dear fellow fiedtrippers, >> >> I would like to do a source reconstruction of EEG data using The FielTrip >> example MRI dataset via minimum-norm estimate. I stick close to the MNE >> tutorial (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) >> and use a few steps from the EEG headmodel tutorial as well ( >> http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg). Unfortunately, I >> am struggling to combine the information from both tutorials in some >> crucial step prior to ft_sourceanalysis. >> My first approach has been to basically run through the MNE tutorial >> using the Fieltrip MRI dataset. As I could not save both the original >> anatomy and the masked anatomy in a freesurfer compatible format while >> using >> >> *cfg = [];* >> *cfg.output = {'brain','skull','scalp'};* >> *segmentedmri = ft_volumesegment(cfg, mri);* >> >> I instead proceeded as mentioned below and aligned the electrodes to the >> scalp in a second step (according to the headmodel tutorial). But when I >> want to combine the headmodel (vol) and the electrodes (elec_aligned2) into >> the leadfield, that does not work: >> >> *using headmodel specified in the configuration* >> *using electrodes specified in the configuration* >> *Error using ft_prepare_vol_sens (line 534)* >> *unsupported volume conductor model for EEG* >> >> *Error in prepare_headmodel (line 94)* >> *[vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, >> 'order',* >> *cfg.order);* >> >> *Error in ft_prepare_leadfield (line 124)* >> *[vol, sens, cfg] = prepare_headmodel(cfg, data);* >> >> >> When I instead use the volume conduction model built in the headmodel >> tutorial (vol2) and the sourcespace from the MNE tutorial I get: >> >> >> >> >> >> >> >> >> >> *Error using * Inner matrix dimensions must agree.Error in >> minimumnormestimate (line 179) A = P*A; % prewhitened >> leadfieldsError in ft_sourceanalysis (line 869) dip(i) = >> minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}, >> 'noisecov', squeeze(Cy(i,:,:)));* >> >> In older posts in the mailing list there appeared to be problems with the >> scaling of the different components and I adapted the units, but that did >> not solve the problems. >> I would be very thankful for any help. >> >> >> >> cheers >> Thomas >> >> >> >> >> >> >> >> >> My script: >> >> clear all; >> mri = ft_read_mri('Subject01.mri'); >> save mri mri; >> disp(mri) >> >> cfg = []; >> cfg.resolution = 1; >> cfg.dim = [256 256 256]; >> mrirs = ft_volumereslice(cfg, mri); >> save mrirs mrirs; >> >> % segmentation of the mri >> % load mrirs; >> cfg = []; >> cfg.coordsys = 'ctf'; >> cfg.output = {'skullstrip' 'brain'}; >> seg = ft_volumesegment(cfg, mrirs); >> save seg seg; >> >> disp(seg(1)) >> >> %%% Thus, you need to identify the anterior commissure, the posterior >> commissure, and an interhemispheric point (which defines the XZ-plane). You >> can navigate across the slices with the arrows. >> %%% By pressing the 'a', 'p', and 'z' at the right locations, the voxel >> %%% coordinates of these landmarks are stored: >> % load mrirs; >> cfg = []; >> cfg.method = 'interactive'; >> mri_tal = ft_volumerealign(cfg, mrirs); >> save mri_tal mri_tal >> >> clear all; >> load mri_tal; >> load seg; >> % ensure that the skull-stripped anatomy is expressed in the same >> coordinate system as the anatomy >> seg.transform = mri_tal.transform; >> % save both the original anatomy, and the masked anatomy in a freesurfer >> compatible format >> cfg = []; >> cfg.filename = 'Subject01'; >> cfg.filetype = 'mgz'; >> cfg.parameter = 'anatomy'; >> ft_volumewrite(cfg, mri_tal); >> cfg.filename = 'Subject01masked'; >> ft_volumewrite(cfg, seg); >> >> %%%%% MAC Terminal Input %%%%%%%%%%%%%%%% >> tcsh >> chsh -s /bin/tcsh >> setenv FREESURFER_HOME /Applications/freesurfer >> source $FREESURFER_HOME/SetUpFreeSurfer.csh >> >> setenv SUBJECTS_DIR /Applications/freesurfer/subjects >> setenv SUBJECT /Subject01 >> %%% .mgz files to mri folder >> cd $SUBJECTS_DIR/Subject01/mri/ >> mri_convert -c -oc 0 0 0 Subject01masked.mgz orig.mgz >> mri_convert -c -oc 0 0 0 Subject01.mgz orig-nomask.mgz >> >> recon-all -talairach -subjid Subject01 >> recon-all -nuintensitycor -subjid Subject01 >> recon-all -normalization -subjid Subject01 >> cp T1.mgz brainmask.mgz >> recon-all -gcareg -subjid Subject01 >> recon-all -canorm -subjid Subject01 >> recon-all -careg -subjid Subject01 >> recon-all -calabel -subjid Subject01 >> recon-all -normalization2 -subjid Subject01 >> recon-all -segmentation -subjid Subject01 >> recon-all -fill -subjid Subject01 >> >> >> %%% This ends the part of the Freesurfer pipeline concerned with >> volumetric processing. At this stage you should have a file filled.mgz >> containing the segmentation of the cortical white matter (cerebellum is not >> included!). >> %%% You can check how this looks using FieldTrip, by doing the following: >> % % go to the Subject01/mri directory >> mri = ft_read_mri('filled.mgz'); >> cfg = []; >> cfg.interactive = 'yes'; >> figure;ft_sourceplot(cfg, mri); >> >> %%% back in Terminal: >> cd $SUBJECTS_DIR/Subject01/mri/ >> recon-all -tessellate -subjid Subject01 >> recon-all -smooth1 -subjid Subject01 >> recon-all -inflate1 -subjid Subject01 >> recon-all -qsphere -subjid Subject01 >> recon-all -fix -subjid Subject01 >> cp brain.mgz brain.finalsurfs.mgz >> recon-all -finalsurfs -subjid Subject01 >> recon-all -smooth2 -subjid Subject01 >> recon-all -inflate2 -subjid Subject01 >> recon-all -sphere -subjid Subject01 >> recon-all -surfreg -subjid Subject01 >> >> %%% MNE download and installation %%%%%%%%%%%%%% >> setenv MNE_ROOT /Applications/MNE-2.7.4-3378-MacOSX-x86_64 >> setenv MATLAB_ROOT /Applications/MATLAB_R2013b.app >> source $MNE_ROOT/bin/mne_setup >> >> % http://martinos.org/mne/stable/manual/list.html >> cd $MNE_ROOT/bin >> ./mne_setup_sh >> >> setenv SUBJECTS_DIR /Applications/freesurfer/subjects >> setenv SUBJECT /Subject01 >> >> ./mne_setup_source_space --ico -6 --overwrite >> >> %%%% back in Matlab: /Applications/freesurfer/subjects/Subject01/bem >> bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', >> 'mne_source'); >> figure;ft_plot_mesh(bnd); >> >> %%% Current Folder : >> /Applications/freesurfer/subjects/Subject01/Subject01/mri >> mri_nom = ft_read_mri('orig-nomask.mgz'); >> >> cfg = []; >> cfg.method = 'interactive'; >> mri_nom_ctf = ft_volumerealign(cfg, mri_nom); >> >> %%% fiducials chosen, fiducials l,r,n >> >> mri_nom_ctf = ft_convert_units(mri_nom_ctf, 'cm'); >> T = mri_nom_ctf.transform*inv(mri_nom_ctf.transformorig); >> %%% Current Folder : >> /Applications/freesurfer/subjects/Subject01/Subject01/bem >> bnd = ft_read_headshape('Subject01-oct-6-src.fif', 'format', >> 'mne_source'); >> sourcespace = ft_convert_units(bnd, 'cm'); >> sourcespace = ft_transform_geometry(T, sourcespace); >> save sourcespace sourcespace; >> save T T; %we will need the transformation matrix in the next step >> >> %%% Current Folder auf: >> /Applications/freesurfer/subjects/Subject01/Subject01/mri >> mri_nom = ft_read_mri('orig-nomask.mgz'); >> >> cfg = []; >> cfg.coordsys = 'spm'; >> cfg.output = {'brain'}; >> seg = ft_volumesegment(cfg, mri_nom); >> seg = ft_convert_units(seg,'cm'); >> >> cfg = []; >> cfg.method = 'singleshell'; >> vol = ft_prepare_headmodel(cfg,seg); >> vol.bnd = ft_transform_geometry(T, vol.bnd); >> save vol vol; >> >> % load vol % volume conduction model >> figure;hold on; >> ft_plot_vol(vol, 'facecolor', 'none');alpha 0.5; >> ft_plot_mesh(sourcespace, 'edgecolor', 'none'); camlight >> >> >> >> %%% so far, so good. >>> then I create the elec file: >> clear all; >> mri2 = ft_read_mri('Subject01.mri'); >> disp(mri2) >> save mri2 mri2; >> >> cfg = []; >> cfg.output = {'brain','skull','scalp'}; >> segmentedmri2 = ft_volumesegment(cfg, mri2); >> save segmentedmri2 segmentedmri2 >> disp(segmentedmri2) >> >> cfg=[]; >> cfg.tissue={'brain','skull','scalp'}; >> cfg.numvertices = [3000 2000 1000]; >> bnd2=ft_prepare_mesh(cfg,segmentedmri2); >> >> save bnd2 bnd2 >> >> disp(bnd2(1)) >> >> cfg = []; >> cfg.method ='dipoli'; >> vol2 = ft_prepare_headmodel(cfg, segmentedmri2); >> >> save vol2 vol2 >> >> disp(vol2) >> >> vol2 = ft_convert_units(vol2, 'cm'); >> >> >> figure; >> ft_plot_mesh(vol2.bnd(1),'facecolor','none'); %scalp >> figure; >> ft_plot_mesh(vol2.bnd(2),'facecolor','none'); %skull >> figure; >> ft_plot_mesh(vol2.bnd(3),'facecolor','none'); %brain >> >> ft_plot_mesh(vol2.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, >> 'edgecolor', [1 1 1], 'edgealpha', 0.05); >> hold on; >> ft_plot_mesh(vol2.bnd(2),'edgecolor','none','facealpha',0.4); >> hold on; >> ft_plot_mesh(vol2.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); >> >> elec2 = ft_read_sens('standard_1020.elc'); % may you need to >> define the path to the file >> >> disp(elec2) >> >> elec2 = ft_convert_units(elec2, 'cm'); >> >> % load volume conduction model >> load vol2; >> figure; >> % head surface (scalp) >> ft_plot_mesh(vol2.bnd(1), >> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); >> hold on; >> % electrodes >> ft_plot_sens(elec2,'style', 'sk'); >> >> >> mri2 = ft_convert_units(mri2, 'cm'); >> >> nas=mri2.hdr.fiducial.mri.nas; >> lpa=mri2.hdr.fiducial.mri.lpa; >> rpa=mri2.hdr.fiducial.mri.rpa; >> >> transm=mri2.transform; >> >> nas=warp_apply(transm,nas, 'homogenous'); >> lpa=warp_apply(transm,lpa, 'homogenous'); >> rpa=warp_apply(transm,rpa, 'homogenous'); >> >> fid.chanpos = [nas; lpa; rpa]; % ctf-coordinates of fiducials >> fid.label = {'Nz','LPA','RPA'}; % same labels as in elec >> fid.unit = 'cm'; % same units as mri >> >> % alignment >> cfg = []; >> cfg.method = 'fiducial'; >> cfg.template = fid; % see above >> cfg.elec = elec2; >> cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid >> and in elec >> elec_aligned2 = ft_electroderealign(cfg); >> >> save elec_aligned2 elec_aligned2; >> % elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); >> figure; >> ft_plot_sens(elec_aligned2,'style','sk'); >> hold on; >> ft_plot_mesh(vol2.bnd(1),'facealpha', 0.85, 'edgecolor', 'none', >> 'facecolor', [0.65 0.65 0.65]); %scalp >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec_aligned2; >> cfg.headshape = vol2.bnd(1); >> elec_aligned2 = ft_electroderealign(cfg); >> >> >> *%%%%% and here I am struggling: I can not get any of the above files to* >> *%%%%% work together: vol or vol2, elec_aligned2, sourcespace etc.* >> >> vol = ft_convert_units(vol, 'cm'); >> elec_aligned2 = ft_convert_units(elec_aligned2, 'cm'); >> cfg = []; >> cfg.elec = elec_aligned2; % sensor positions >> cfg.channel = 'all'; % the used channels >> cfg.grid.pos = sourcespace.pnt; % source points >> cfg.grid.inside = 1:size(sourcespace.pnt,1); % all source points are >> inside of the brain >> cfg.vol = vol; >> cfg.normalize = 'yes';% volume conduction model >> leadfield = ft_prepare_leadfield(cfg); >> >> save leadfield leadfield; >> >> clear all; >> load('GA1.mat') >> load('GA2.mat') >> load leadfield; >> load vol2; >> load elec_aligned2; >> >> >> cfg = []; >> cfg.method = 'mne'; >> cfg.elec = elec_aligned2; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> cfg.mne.normalize = 'yes'; >> sourceCERT0 = ft_sourceanalysis(cfg, GA1); >> sourceCERT3 = ft_sourceanalysis(cfg, GA2); >> >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: logo_Signatur.png Type: image/png Size: 3435 bytes Desc: not available URL: From pgoodin at swin.edu.au Mon Feb 24 10:46:52 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 24 Feb 2014 09:46:52 +0000 Subject: [FieldTrip] Plotting group SD / CI over multiplottER data? Message-ID: Hi Fieldtrippers, As the subject says, is it possible to plot standard deviations / confidence intervals for group timelock data using multiplotter? After grandaveraging the data the var variable is removed, so is there a work around to either getting the timelockgrandaverage function to include a measure of group variance or adding one in? Thanks for any advice / assistance, Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Feb 24 23:01:26 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 24 Feb 2014 17:01:26 -0500 Subject: [FieldTrip] regressconfound and frequency domain Message-ID: <8C6ABCDE-8D0A-4769-94A8-87BC7071251F@gmail.com> Hi Arjen, Alik Thanks for stimulating this discussion about second level statistics. I tried as suggested, but it would be great if one of you can detail the steps involved so I can make sure what am doing is indeed correct. It would be great if some more detail is provided on the field trip web page about this. Thanks, Raghavan What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Feb 25 10:32:39 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 25 Feb 2014 10:32:39 +0100 Subject: [FieldTrip] Referencing Message-ID: Dear all, I have 4 electrodes, and I would like to reference my data by subtracting from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. I was wondering if there is an easier way in fieldtrip to perform this calculation, and then to change the data structure with these new channel labels. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.andolina at ucl.ac.uk Tue Feb 25 11:25:02 2014 From: i.andolina at ucl.ac.uk (Ian M. Andolina) Date: Tue, 25 Feb 2014 10:25:02 +0000 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? Message-ID: <530C6F7E.2000702@ucl.ac.uk> Hi, I wanted to use Fieldtrip to recreate the methodology used in a paper by Leopold et al., 2003 — the relevant methods section is the following: /“The LFP signals were resampled to 1 kHz, and then band-pass filtered into seven frequency ranges using a second order, bi-directional, zero-phase Chebyshev type-1 filter. The frequency ranges, as well as their rough mapping onto classically defined electroencephalographic conventions, were the following: δ (1–4 Hz), θ (5–8 Hz), α (9–14 Hz), β (15–30 Hz), γL (30–50 Hz), γH (50–100 Hz), and γVH (100–150 Hz). The resulting band-limited signals were full-wave rectified by taking their absolute value. They were then resampled to 20 Hz after low-pass filtering with an eighth order Chebyshev type-1 filter (cutoff = 8 Hz).”/ My LFP data is sampled at 1kHz, and I manually pad with data either side of the event triggered region of interest. Fieldtrip doesn’t have a |chebyshev type-1| filter, but would a second order two-pass (aka zero phase?) butterworth be good enough considering the frequency bands used? I’m using the following cfg passed to |ft_preprocessing| for the initial bandpass filtering and rectification: |freq ={[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 150]}; for j =1:length(freq) cfg =[]; cfg.padding =0; cfg.bpfilter ='yes'; cfg.bpfilttype ='but'; cfg.bpfreq = freq{j}; cfg.bpfiltdir ='twopass'; cfg.bpfiltord =2; cfg.bpinstabilityfix ='reduce'; cfg.rectify ='yes'; bp{j} = ft_preprocessing(cfg,ft); end | As far as I can see in |ft_preprocessing| rectification occurs after filtering, so this is as specified by Leopold /et al.,/ Then for downsampling/resampling: |cfg =[]; cfg.padding =0; cfg.lpfilter ='yes'; cfg.lpfreq =8; cfg.lpfilttype ='but'; cfg.lpfiltdir ='twopass'; cfg.lpfiltord =8; cfg.lpinstabilityfix ='reduce'; bp{j} = ft_preprocessing(cfg,bp{j}); cfg =[]; cfg.resample ='yes'; cfg.resamplefs =20; cfg.detrend ='no'; bp{j} = ft_resampledata(cfg,bp{j}); | Does this seem a correct translation of this method in Fieldtrip? Are there any caveats other than the filter differences? Thanks, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanya.pro at gmail.com Tue Feb 25 12:50:57 2014 From: chaitanya.pro at gmail.com (Chaitanya Srinivas) Date: Tue, 25 Feb 2014 12:50:57 +0100 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: <530C6F7E.2000702@ucl.ac.uk> References: <530C6F7E.2000702@ucl.ac.uk> Message-ID: Hi Ian, If you want to approximate a chebyshev filter with butterworth, you obviously need a higher order than the actual chebyshev uses. Some simple calculations are involved on your data which basically suggests even to get a 3dB of stopband attenuation for the delta range, you would be needing an order of 3 for a chebyshev-1 type filter. Similarly you will be needing a 4th order butterworth filter. By default, even the filedtrip uses 4th order for butterworth filter. So I would suggest you to use a 4th order butterworth filter to approximate the chebyshev filter you mentioned here. *===============================================* *[image: Inline image 1]* *Best Regards* *Chaitanya Srinivas Lanka Wiss. Mitarbeiter * *PhD StudentFunctional and Restorative Neurosurgery Neural Information ProcessingNeurosurgical University Hospital* * Graduate Training Center for Neuroscience Eberhard Karls University Eberhard Karls University **Otfried-Mueller-Str.45 Österbergstr. 3* * D-72076 Tuebingen **D-72074 Tuebingen* *Mobile Phone Number : +49-176-79035731* *===============================================* On Tue, Feb 25, 2014 at 11:25 AM, Ian M. Andolina wrote: > Hi, I wanted to use Fieldtrip to recreate the methodology used in a > paper by Leopold et al., 2003 — the relevant methods section is the following: > > *“The LFP signals were resampled to 1 kHz, and then band-pass filtered > into seven frequency ranges using a second order, bi-directional, > zero-phase Chebyshev type-1 filter. The frequency ranges, as well as their > rough mapping onto classically defined electroencephalographic conventions, > were the following: δ (1–4 Hz), θ (5–8 Hz), α (9–14 Hz), β (15–30 Hz), γL > (30–50 Hz), γH (50–100 Hz), and γVH (100–150 Hz). The resulting > band-limited signals were full-wave rectified by taking their absolute > value. They were then resampled to 20 Hz after low-pass filtering with an > eighth order Chebyshev type-1 filter (cutoff = 8 Hz).”* > > My LFP data is sampled at 1kHz, and I manually pad with data either side > of the event triggered region of interest. Fieldtrip doesn’t have a chebyshev > type-1 filter, but would a second order two-pass (aka zero phase?) > butterworth be good enough considering the frequency bands used? I’m using > the following cfg passed to ft_preprocessing for the initial bandpass > filtering and rectification: > > freq = {[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 150]};for j = 1:length(freq) > cfg = []; > cfg.padding = 0; > cfg.bpfilter = 'yes'; > cfg.bpfilttype = 'but'; > cfg.bpfreq = freq{j}; > cfg.bpfiltdir = 'twopass'; > cfg.bpfiltord = 2; > cfg.bpinstabilityfix = 'reduce'; > cfg.rectify = 'yes'; > bp{j} = ft_preprocessing(cfg,ft);end > > As far as I can see in ft_preprocessing rectification occurs after > filtering, so this is as specified by Leopold *et al.,* > > Then for downsampling/resampling: > > cfg = [];cfg.padding = 0;cfg.lpfilter = 'yes';cfg.lpfreq = 8;cfg.lpfilttype = 'but';cfg.lpfiltdir = 'twopass';cfg.lpfiltord = 8;cfg.lpinstabilityfix = 'reduce'; > bp{j} = ft_preprocessing(cfg,bp{j}); > cfg = [];cfg.resample = 'yes';cfg.resamplefs = 20;cfg.detrend = 'no'; > bp{j} = ft_resampledata(cfg,bp{j}); > > Does this seem a correct translation of this method in Fieldtrip? Are > there any caveats other than the filter differences? > > Thanks, Ian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23195 bytes Desc: not available URL: From conrado.bosman at gmail.com Tue Feb 25 13:47:24 2014 From: conrado.bosman at gmail.com (Conrado Bosman) Date: Tue, 25 Feb 2014 13:47:24 +0100 Subject: [FieldTrip] Referencing In-Reply-To: References: Message-ID: <4B4052A2-BD50-4CE6-BBB5-D2846C86BD77@gmail.com> Dear Hweeling, There is indeed an easy way to re-referencing electrodes using local derivation in Fieldtrip. You need to create an structure call montage, that in your case should be: montage = [] montage.labelorg = {'E1' 'E2' 'E3' 'E4'} montage.labelnew = {'E2-E1' E3-E2' 'E4-E3'} montage.tra = [1 -1 0 0;0 -1 1 0;0 0 -1 1]; then... cfg = []; cfg.reref = 'yes' cfg.montage = montage; dat = ft_preprocessing(cfg,dat) % dat is your original data structure containing your original channels Hope it works! Best, Conrado On 25 Feb 2014, at 10:32, Hwee Ling Lee wrote: > Dear all, > > I have 4 electrodes, and I would like to reference my data by subtracting from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. > > I was wondering if there is an easier way in fieldtrip to perform this calculation, and then to change the data structure with these new channel labels. > > Thanks. > > Cheers, > Hweeling > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From pierre.megevand at gmail.com Tue Feb 25 17:14:42 2014 From: pierre.megevand at gmail.com (=?ISO-8859-1?Q?Pierre_M=E9gevand?=) Date: Tue, 25 Feb 2014 11:14:42 -0500 Subject: [FieldTrip] Referencing (Hwee Ling Lee) Message-ID: Dear Hweeling, ft_apply_montage is the function that you are looking for. http://fieldtrip.fcdonders.nl/reference/ft_apply_montage The documentation for that function shows exactly what you want to do. Pierre -- Pierre Mégevand, MD, PhD Post-doctoral research fellow Laboratory for Multimodal Human Brain Mapping Feinstein Institute for Medical Research Manhasset, NY, USA On Tue, Feb 25, 2014 at 6:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Referencing (Hwee Ling Lee) > 2. Band Limited Power Analysis in Fieldtrip? (Ian M. Andolina) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 25 Feb 2014 10:32:39 +0100 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Referencing > Message-ID: > BkryfFvXKuLR2SNpdTxsjWN_rQcAKEA at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I have 4 electrodes, and I would like to reference my data by subtracting > from the neighbouring electrode. In other words, E2-E1, E3-E2, E4-E3. > > I was wondering if there is an easier way in fieldtrip to perform this > calculation, and then to change the data structure with these new channel > labels. > > Thanks. > > Cheers, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140225/78be03db/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Tue, 25 Feb 2014 10:25:02 +0000 > From: "Ian M. Andolina" > To: > Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? > Message-ID: <530C6F7E.2000702 at ucl.ac.uk> > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi, I wanted to use Fieldtrip to recreate the methodology used in a > paper by Leopold et al., 2003 > ? the relevant methods > section is the following: > > /?The LFP signals were resampled to 1 kHz, and then band-pass filtered > into seven frequency ranges using a second order, bi-directional, > zero-phase Chebyshev type-1 filter. The frequency ranges, as well as > their rough mapping onto classically defined electroencephalographic > conventions, were the following: ? (1?4 Hz), ? (5?8 Hz), ? (9?14 Hz), ? > (15?30 Hz), ?L (30?50 Hz), ?H (50?100 Hz), and ?VH (100?150 Hz). The > resulting band-limited signals were full-wave rectified by taking their > absolute value. They were then resampled to 20 Hz after low-pass > filtering with an eighth order Chebyshev type-1 filter (cutoff = 8 Hz).?/ > > My LFP data is sampled at 1kHz, and I manually pad with data either side > of the event triggered region of interest. Fieldtrip doesn?t have a > |chebyshev type-1| filter, but would a second order two-pass (aka zero > phase?) butterworth be good enough considering the frequency bands used? > I?m using the following cfg passed to |ft_preprocessing| for the initial > bandpass filtering and rectification: > > |freq ={[1 4], [5 8], [9 14], [15 30], [30 50], [50 100], [100 > 150]}; > for j =1:length(freq) > cfg =[]; > cfg.padding =0; > cfg.bpfilter ='yes'; > cfg.bpfilttype ='but'; > cfg.bpfreq = freq{j}; > cfg.bpfiltdir ='twopass'; > cfg.bpfiltord =2; > cfg.bpinstabilityfix ='reduce'; > cfg.rectify ='yes'; > bp{j} = ft_preprocessing(cfg,ft); > end > | > > As far as I can see in |ft_preprocessing| rectification occurs after > filtering, so this is as specified by Leopold /et al.,/ > > Then for downsampling/resampling: > > |cfg =[]; > cfg.padding =0; > cfg.lpfilter ='yes'; > cfg.lpfreq =8; > cfg.lpfilttype ='but'; > cfg.lpfiltdir ='twopass'; > cfg.lpfiltord =8; > cfg.lpinstabilityfix ='reduce'; > bp{j} = ft_preprocessing(cfg,bp{j}); > cfg =[]; > cfg.resample ='yes'; > cfg.resamplefs =20; > cfg.detrend ='no'; > bp{j} = ft_resampledata(cfg,bp{j}); > | > > Does this seem a correct translation of this method in Fieldtrip? Are > there any caveats other than the filter differences? > > Thanks, Ian > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140225/a73da687/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 39, Issue 44 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michielb at tcd.ie Tue Feb 25 17:55:16 2014 From: michielb at tcd.ie (Bart Michiels) Date: Tue, 25 Feb 2014 16:55:16 +0000 Subject: [FieldTrip] non parametric statistics on connectivity data Message-ID: Hi all, I have two resting state coherence dataset (patient and control) both with the dimensions frequency x chan x chan and would like to do some non-parametric stats. Knowing that channel level analysis isn't the best idea to assess connectivity, which fieldtrip sub-function could I use to make some statistical inference about connectivity difference between patients and controls? I know that all statistical tools can be used for data dimensions: frequency x chan, but not the freq x chan x chan I was thinking of ft_statfun_indepsamplesZcoh but am not sure this is the right one. Thank you ! Best, Bart -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Feb 25 18:10:02 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 25 Feb 2014 18:10:02 +0100 Subject: [FieldTrip] non parametric statistics on connectivity data In-Reply-To: References: Message-ID: Dear Bart, one way to plug freq x chan x chan data into the statistics functions requiring freq x chan is to restructure your data to channel combinations, in a way that you end up with chan times chan elements in a freq x chan matrix. Of course you'll have to create new labels for your new channels. Hope this helps, if you need more specific advise, let me know. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 25.02.2014 um 17:55 schrieb Bart Michiels: > Hi all, > > I have two resting state coherence dataset (patient and control) both with the dimensions frequency x chan x chan and would like to do some non-parametric stats. > Knowing that channel level analysis isn't the best idea to assess connectivity, which fieldtrip sub-function could I use to make some statistical inference about connectivity difference between patients and controls? > > I know that all statistical tools can be used for data dimensions: frequency x chan, but not the freq x chan x chan > I was thinking of ft_statfun_indepsamplesZcoh but am not sure this is the right one. > > Thank you ! > Best, Bart > _______________________________________________ > 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 gopalar.ccf at gmail.com Tue Feb 25 23:01:17 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 25 Feb 2014 17:01:17 -0500 Subject: [FieldTrip] regressconfound and statistics Message-ID: <3F209DE8-FE47-49BE-9FA7-9AEE1477E37B@gmail.com> Arjen et al, I have the following output data from regressconfound pertaining to one block of data. hpicompfiltdata = avg: [306x1500 double] var: [306x1500 double] time: [1x1500 double] dof: [306x1500 double] label: {306x1 cell} trial: [59x306x1500 double] dimord: 'rpt_chan_time' trialinfo: [59x1 double] cfg: [1x1 struct] beta: [37x306x1500 double] Since I have 4 blocks for each subject, I appended them using ft_appenddata, and using ft_timelockanalysis (mentioning appropriate cfg.trial and cfg.keeptrials=‘yes’;) I split the data into 2 conditions timelock_cond1 (shown below) and timelock_cond2, retaining only 204 gradiometers ( i suppose I am not supposed to use ft_combineplanar at this level since it would distort the results). timelock_cond1 = avg: [204x1500 double] var: [204x1500 double] time: [1x1500 double] dof: [204x1500 double] label: {204x1 cell} trial: [143x204x1500 double] dimord: 'rpt_chan_time' trialinfo: [143x1 double] cfg: [1x1 struct] Then these are the steps I did, per your suggestion. 1. I gathered all the time lock (from above step) for all subjects in a cell matrix, timelock_cond1{:} and timelock_cond2{:} 3. Then I ran first level stats for each subject, with cfg.statistic= indepsamplesT and cfg.method=‘analytic’; cfg.design as you suggested, and rest of cfg. for sj = 1: size(subj,2) stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); end 4. Then, I did timelockgrandaverage cfg.keepindividual = 'yes'; cfg.parameter = 'stat'; stat2=ft_timelockgrandaverage(cfg,stat1{:}); 5. Created a dummy variable just like stat2 in the above step and replaced the field ‘individual’ with zeros dummy2=stat2; dummy2.individual=zeros(size(stat2.individual)); 6. Finally, ran the second level stats, with cfg. statistic = ‘depsamplesT’; cfg.method=‘montecarlo’; and rest of cfg. stat = ft_timelockstatistics(cfg, stat2, dummy2); However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn’t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong. Thanks, Raghavan What you described in your reply to me just now, calling ft_timelockstatistics at the subject level to calculate descriptives, still effectively reduces each subject to one "datapoint" -- the difference between conditions of the selected t-descriptive for that subject. I believe I understand how to do that, and how to then do nonparametric shuffle testing at the between-subjects level for the signfiicance of that within-subjects descriptive/difference. >> Ok. That's indeed the procedure I tried to outline. In your earlier reply to Raghavan, it sounded like you were suggesting pooling the trials themselves between subjects (that is, all subjects' trials go into one big "bucket"), with the trial-to-trial variance having been removed via ft_regressconfound, *then* calling the ft_statistics functions on this single large "bucket" of trials. Have I misunderstood your suggestion? >> I might have not been clear there then. I was meant to say that one could use ft_regressconfound on trials of two (or more) conditions combined of a single subject, prior to calculating the single subject t-descriptive (using ft_xxxstatistics). This allows one to compute a 'cleaner' t-score, or at least provide a good case that head movement did not differentially influence activity levels in the separate conditions. It was not related to pooling trials between subjects. 2014-02-21 16:14 GMT+01:00 Alik Widge : > I don't *think* I'm asking about how to do second-order analysis, unless I > have missed something important. I did read the link/FAQ when I was working > on this last week, and that seems different than the question I am asking. > > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of that > within-subjects descriptive/difference. > > In your earlier reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I misunderstood > your suggestion? > > Alik > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to create subject-level >> t-descriptives, mentioned in the previous post? A quick answer would be to >> perform an indepedent t-test ( cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics (although you're not really 'testing' here, but only >> interested in that t-descriptive), in which trials are the unit of >> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> ntrls_conditionB)]; ). Note that since an indepedent t-test tests for >> differences of the means of two conditions, it won't fail on unequal number >> of observations across the conditions (unlike a dependent/paired t-test). >> >> Hope this gets you kickstarted for the moment. I found a previous >> mail-conversation that goes more into detail, providing more overview of >> the steps involved: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >> More useful documentation: >> >> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >> >> Yours, >> Arjen >> >> ------------------------------ >> >> *Van: *"Alik Widge" >> *Aan: *"FieldTrip discussion list" >> *Verzonden: *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >> >> Arjen, what you just described is more or less what I struggled to do >> last week and ultimately gave up as I was unable to figure out how to get >> FT to do it despite much meditation over tutorials and source files. Can >> you elaborate a bit more on what you are saying below -- not the >> ft_regressconfound bit, but the bit about how to get >> ft_statistics_montecarlo and its wrappers to do a trials-level analysis and >> permutation at the whole-group level? Especially, what does one put in >> cfg.design and how does one call the function? Everything I could find in >> the tutorials described the case of doing means at the subject level and >> then permutation of means at the group level, which as you point out is >> underpowered for subtle effects. >> >> My particular situation was timelock-analyzed trials (with >> keeptrials='yes'), but I could not find a way to set up cfg.design that >> did not throw error messages. The thing that really seemed to bother it was >> that there were different numbers of trials in the 2-3 conditions of >> interest, since some had to be removed for excessive artifact. >> >> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl> wrote: >> >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject level freq data, you'll need to >>> use ft_freqstatistics. Have a look here for instance: >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>> At the subject level, you do not need (non-parametric) cluster >>> permutation testing (Maris & Oostenveld), as you're taking each subject's >>> t-descriptives to the group level. At the group level, you can then test >>> the hypothesis that there's a difference between tasks/conditions (H1) vs. >>> no difference (H0). In order to do so, you'll need to create a dummy >>> variable at the group level, that has the same number of 'subjects', but >>> with zeros in all fields (in your case this will be a .stat field). At the >>> group level, you thus call ft_freqstatistics again. This approach has the >>> advantage that you're more sensitive (as compared to taking each subject's >>> mean to the group level) to effects that are small but consistent over >>> trials in each subject. >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: *"Raghavan Gopalakrishnan" >>> *Aan: *fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound and frequency domain >>> >>> Thanks Arjen, >>> Should I use ft_freqdescriptives to compute t descriptives for >>> individual subjects, and then take that to group level instead of mean? If >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>> Hi Raghavan, ft_regressconfound run on timelock data seems to return output with avg field. However, ft_regressconfound run on frequency data, does not return average. I see the avg field being removed. Is there a reason? >> Not intentionally, but not an issue either. You could still use ft_freqdescriptives to compute the average for you, but see my comment below. Question - Since ft_regressconfound outputs power spectrum of individual trials - 4D matrix (instead of average), can I simply re-average the power spectrum over trials to see the average power for that subject. Also, I need to run grand average (over subjects) before running statistics. I hope these steps does not distort the data. Please advise. >> Remember that the mean over trials is not affected by your clean-up of trial-by-trial variance due to head movement. Taking each subject's mean (unaffected) to the group level is an approach that will not benefit from your clean-up. In order to benefit from reduced trial-by-trial variance, you'll need a measure that depends on it, e.g. t-descriptive, neural activity-behavior correlation (for taking to the group level). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan Gopalakrishnan" > >>> *>* Aan: fieldtrip at science.ru.nl >>> *>* Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>> *>* Thanks, I reduced down the time resolution so computation can go >>> *>* faster. Now, m y matrix looks like this >>> *>* hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on timelock data seems to return output with >>> *>* avg field. However, ft_regressconfound run on frequency data, does not >>> *>* return average. I see the avg field being removed. Is there a reason? >>> *>* Question - Since ft_regressconfound outputs power spectrum of >>> *>* individual trials - 4D matrix (instead of average), can I simply >>> *>* re-average the power spectrum over trials to see the average power for >>> *>* that subject. Also, I need to run grand average (over subjects) before >>> *>* running statistics. I hope these steps does not distort the data. >>> *>* Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < a.stolk at fcdonders.ru.nl > >>> *>* To: FieldTrip discussion list < fieldtrip at science.ru.nl > >>> *>* Subject: Re: [FieldTrip] regressconfound and frequency domain >>> *>* Message-ID: >>> *>* < 2108167665.5423215.1392847118322.JavaMail.root at sculptor.zimbra.ru.nl >>> *>* > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear Raghavan, Good to hear it's working out for you. A short answer >>> *>* would be 'no'. Reducing the size of your data matrix is likely going >>> *>* to speed up computations. Your time resolution seems pretty high (1500 >>> *>* frequency estimations per single trial); do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *>* > Aan: fieldtrip at science.ru.nl >>> *>* > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>> *>* > Thanks for answering all my previous questions. I was successfully >>> *>* > able to incorporate head movements to my erf data. As I understand I >>> *>* > have to do this separately for the time frequency data after keeping >>> *>* > individual trials. I am interested in both beta and gamma bands >>> *>* > [15:1:70]. my time frequency looks like this using wavelets, >>> *>* > timefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks of data for 20 subjects. It >>> *>* > will take an enoumous amount of time to process the data through >>> *>* > regressconfound. Is there a workaround to make the processing faster >>> *>* > or am I missing something. Any help would be of great help. >>> *>* > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Feb 26 09:20:05 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 26 Feb 2014 09:20:05 +0100 (CET) Subject: [FieldTrip] regressconfound and statistics In-Reply-To: <3F209DE8-FE47-49BE-9FA7-9AEE1477E37B@gmail.com> Message-ID: <1312202281.5535647.1393402805973.JavaMail.root@sculptor.zimbra.ru.nl> Hi Raghavan, Could you provide some more details on what statistical comparisons you are trying to make? It seems you have 4 blocks of recordings, each encompassing 2 task conditions, which you want to compare in terms of evoked/induced activity. If this is correct, you could 1) append data of the 4 blocks (subject-level) 2) regress out contributions from head movement using ft_regressconfound (subject-level) 3) split the trials into the 2 task conditions (subject-level) 4) compute t-scores using an independent samples t-test (subject-level) 5) non-parametric testing of effects using a dummy variable with zeros (group-level) From your descriptions, I got the impression you might have reversed the order of step 1 and 2. "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn’t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong." It's hard to tell from this information what might have caused this difference. For instance, the incorrect order of the steps above, or differences in neural processes you may be capturing through using a mean vs. a t-score, or maybe even head positions that are positively correlated with your effects, possibly because they're driving them (e.g. differential distances to the MEG sensors between the task conditions may cause the amplitude of the same ERP be more pronounced in one condition than another). I'd recommend looking into the (average) head positions of the different blocks/conditions, and see what is going on there (e.g. http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis? ). Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: fieldtrip at science.ru.nl > Verzonden: Dinsdag 25 februari 2014 23:01:17 > Onderwerp: Re: [FieldTrip] regressconfound and statistics > Arjen et al, > I have the following output data from regressconfound pertaining to > one block of data. > hpicompfiltdata = > avg: [306x1500 double] > var: [306x1500 double] > time: [1x1500 double] > dof: [306x1500 double] > label: {306x1 cell} > trial: [59x306x1500 double] > dimord: 'rpt_chan_time' > trialinfo: [59x1 double] > cfg: [1x1 struct] > beta: [37x306x1500 double] > Since I have 4 blocks for each subject, I appended them using > ft_appenddata, and using ft_timelockanalysis (mentioning appropriate > cfg.trial and cfg.keeptrials=‘yes’; ) I split the data into 2 > conditions timelock_cond1 (shown below) and timelock_cond2, retaining > only 204 gradiometers ( i suppose I am not supposed to use > ft_combineplanar at this level since it would distort the results). > timelock_cond1 = > avg: [204x1500 double] > var: [204x1500 double] > time: [1x1500 double] > dof: [204x1500 double] > label: {204x1 cell} > trial: [143x204x1500 double] > dimord: 'rpt_chan_time' > trialinfo: [143x1 double] > cfg: [1x1 struct] > Then these are the steps I did, per your suggestion. > 1. I gathered all the time lock (from above step) for all subjects in > a cell matrix, timelock_cond1{:} and timelock_cond2{:} > 3. Then I ran first level stats for each subject, with cfg.statistic= > indepsamplesT and cfg.method=‘analytic’; cfg.design as you suggested, > and rest of cfg. > for sj = 1: size(subj,2) > stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); > end > 4. Then, I did timelockgrandaverage > cfg.keepindividual = 'yes'; > cfg.parameter = 'stat'; > stat2=ft_timelockgrandaverage(cfg,stat1{:}); > 5. Created a dummy variable just like stat2 in the above step and > replaced the field ‘individual’ with zeros > dummy2=stat2; > dummy2.individual=zeros(size(stat2.individual)); > 6. Finally, ran the second level stats, with cfg. statistic = > ‘depsamplesT’; cfg.method=‘montecarlo’; and rest of cfg. > stat = ft_timelockstatistics(cfg, stat2, dummy2); > However, the problem is, whatever significance I found earlier (i.e. > by comparing means rather than t-statistic) doesn’t test significant > now. I thought it might get better by doing this, but seems to get > worse. Please correct me if I am doing anything wrong. > Thanks, > Raghavan > What you described in your reply to me just now, calling > ft_timelockstatistics at the subject level to calculate descriptives, > still > effectively reduces each subject to one "datapoint" -- the difference > between conditions of the selected t-descriptive for that subject. I > believe I understand how to do that, and how to then do nonparametric > shuffle testing at the between-subjects level for the signfiicance of > that > within-subjects descriptive/difference. > >> Ok. That's indeed the procedure I tried to outline. In your earlier > >> reply to Raghavan, it sounded like you were suggesting > pooling the trials themselves between subjects (that is, all subjects' > trials go into one big "bucket"), with the trial-to-trial variance > having > been removed via ft_regressconfound, *then* calling the ft_statistics > functions on this single large "bucket" of trials. Have I > misunderstood > your suggestion? > >> I might have not been clear there then. I was meant to say that one > >> could use ft_regressconfound on trials of two (or more) conditions > >> combined > of a single subject, prior to calculating the single subject > t-descriptive > (using ft_xxxstatistics). This allows one to compute a 'cleaner' > t-score, > or at least provide a good case that head movement did not > differentially > influence activity levels in the separate conditions. It was not > related to > pooling trials between subjects. > 2014-02-21 16:14 GMT+01:00 Alik Widge < alik.widge at gmail.com >: > > I don't *think* I'm asking about how to do second-order analysis, > > unless I > have missed something important. I did read the link/FAQ > > when I was working > on this last week, and that seems different > > than the question I am asking. > > What you described in your reply > > to me just now, calling > ft_timelockstatistics at the subject level > > to calculate descriptives, still > effectively reduces each subject > > to one "datapoint" -- the difference > between conditions of the > > selected t-descriptive for that subject. I > believe I understand > > how to do that, and how to then do nonparametric > shuffle testing > > at the between-subjects level for the signfiicance of that > > > within-subjects descriptive/difference. > > In your earlier reply to > > Raghavan, it sounded like you were suggesting > pooling the trials > > themselves between subjects (that is, all subjects' > trials go into > > one big "bucket"), with the trial-to-trial variance having > been > > removed via ft_regressconfound, *then* calling the ft_statistics > > > functions on this single large "bucket" of trials. Have I > > misunderstood > your suggestion? > > Alik > > Alik Widge > > > alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, > > 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > > > wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to > > create subject-level >> t-descriptives, mentioned in the previous > > post? A quick answer would be to >> perform an indepedent t-test ( > > cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics > > (although you're not really 'testing' here, but only >> interested > > in that t-descriptive), in which trials are the unit of >> > > observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> > > ntrls_conditionB)]; ). Note that since an indepedent t-test tests > > for >> differences of the means of two conditions, it won't fail on > > unequal number >> of observations across the conditions (unlike a > > dependent/paired t-test). >> >> Hope this gets you kickstarted for > > the moment. I found a previous >> mail-conversation that goes more > > into detail, providing more overview of >> the steps involved: >> > > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html > > >> More useful documentation: >> >> > > http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level > > >> >> Yours, >> Arjen >> >> ------------------------------ >> >> > > *Van: *"Alik Widge" < alik.widge at gmail.com > >> *Aan: *"FieldTrip > > discussion list" < fieldtrip at science.ru.nl > >> *Verzonden: > > *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: > > [FieldTrip] regressconfound and frequency domain >> >> Arjen, what > > you just described is more or less what I struggled to do >> last > > week and ultimately gave up as I was unable to figure out how to get > > >> FT to do it despite much meditation over tutorials and source > > files. Can >> you elaborate a bit more on what you are saying below > > -- not the >> ft_regressconfound bit, but the bit about how to get > > >> ft_statistics_montecarlo and its wrappers to do a trials-level > > analysis and >> permutation at the whole-group level? Especially, > > what does one put in >> cfg.design and how does one call the > > function? Everything I could find in >> the tutorials described the > > case of doing means at the subject level and >> then permutation of > > means at the group level, which as you point out is >> underpowered > > for subtle effects. >> >> My particular situation was > > timelock-analyzed trials (with >> keeptrials='yes'), but I could not > > find a way to set up cfg.design that >> did not throw error > > messages. The thing that really seemed to bother it was >> that > > there were different numbers of trials in the 2-3 conditions of >> > > interest, since some had to be removed for excessive artifact. >> >> > > Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at > > gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 > > AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl > wrote: >> > > >>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject > > level freq data, you'll need to >>> use ft_freqstatistics. Have a > > look here for instance: >>> > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> > > >>> At the subject level, you do not need (non-parametric) cluster > > >>> permutation testing (Maris & Oostenveld), as you're taking each > > subject's >>> t-descriptives to the group level. At the group level, > > you can then test >>> the hypothesis that there's a difference > > between tasks/conditions (H1) vs. >>> no difference (H0). In order > > to do so, you'll need to create a dummy >>> variable at the group > > level, that has the same number of 'subjects', but >>> with zeros in > > all fields (in your case this will be a .stat field). At the >>> > > group level, you thus call ft_freqstatistics again. This approach > > has the >>> advantage that you're more sensitive (as compared to > > taking each subject's >>> mean to the group level) to effects that > > are small but consistent over >>> trials in each subject. >>> >>> > > Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: > > *"Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *Aan: * > > fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari > > 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound > > and frequency domain >>> >>> Thanks Arjen, >>> Should I use > > ft_freqdescriptives to compute t descriptives for >>> individual > > subjects, and then take that to group level instead of mean? If >>> > > not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> > > >>> Hi Raghavan, ft_regressconfound run on timelock data seems to > > return output with avg field. However, ft_regressconfound run on > > frequency data, does not return average. I see the avg field being > > removed. Is there a reason? >> Not intentionally, but not an issue > > either. You could still use ft_freqdescriptives to compute the > > average for you, but see my comment below. Question - Since > > ft_regressconfound outputs power spectrum of individual trials - 4D > > matrix (instead of average), can I simply re-average the power > > spectrum over trials to see the average power for that subject. > > Also, I need to run grand average (over subjects) before running > > statistics. I hope these steps does not distort the data. Please > > advise. >> Remember that the mean over trials is not affected by > > your clean-up of trial-by-trial variance due to head movement. > > Taking each subject's mean (unaffected) to the group level is an > > approach that will not benefit from your clean-up. In order to > > benefit from reduced trial-by-trial variance, you'll need a measure > > that depends on it, e.g. t-descriptive, neural activity-behavior > > correlation (for taking to the group level). Hope this helps, Arjen > > ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan > > Gopalakrishnan" > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> *>* > > Aan: fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: > > Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, > > >>> *>* Thanks, I reduced down the time resolution so computation > > can go >>> *>* faster. Now, m y matrix looks like this >>> *>* > > hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: > > 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: > > [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: > > [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 > > double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on > > timelock data seems to return output with >>> *>* avg field. > > However, ft_regressconfound run on frequency data, does not >>> *>* > > return average. I see the avg field being removed. Is there a > > reason? >>> *>* Question - Since ft_regressconfound outputs power > > spectrum of >>> *>* individual trials - 4D matrix (instead of > > average), can I simply >>> *>* re-average the power spectrum over > > trials to see the average power for >>> *>* that subject. Also, I > > need to run grand average (over subjects) before >>> *>* running > > statistics. I hope these steps does not distort the data. >>> *>* > > Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, > > 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < > > a.stolk at fcdonders.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > To: FieldTrip discussion list < fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > Subject: Re: [FieldTrip] regressconfound and frequency domain >>> > > *>* Message-ID: >>> *>* < > > 2108167665.5423215.1392847118322.JavaMail.root at > > sculptor.zimbra.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > > >>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear > > Raghavan, Good to hear it's working out for you. A short answer >>> > > *>* would be 'no'. Reducing the size of your data matrix is likely > > going >>> *>* to speed up computations. Your time resolution seems > > pretty high (1500 >>> *>* frequency estimations per single trial); > > do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk > > bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf > > at gmail.com < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* > > > Aan: fieldtrip at science.ru.nl < > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > > > Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: > > [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, > > >>> *>* > Thanks for answering all my previous questions. I was > > successfully >>> *>* > able to incorporate head movements to my erf > > data. As I understand I >>> *>* > have to do this separately for the > > time frequency data after keeping >>> *>* > individual trials. I am > > interested in both beta and gamma bands >>> *>* > [15:1:70]. my time > > frequency looks like this using wavelets, >>> *>* > timefreq = >>> > > *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> > > *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > > > powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > > > grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: > > [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After > > regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 > > cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 > > double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D > > double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 > > struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D > > double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since > > its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks > > of data for 20 subjects. It >>> *>* > will take an enoumous amount > > of time to process the data through >>> *>* > regressconfound. Is > > there a workaround to make the processing faster >>> *>* > or am I > > missing something. Any help would be of great help. >>> *>* > > > Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> > > _______________________________________________ >>> fieldtrip > > mailing list >>> fieldtrip at donders.ru.nl >>> > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> > > >>> >>> -- >>> Donders Institute for Brain, Cognition and Behaviour > > >>> Centre for Cognitive Neuroimaging >>> Radboud University > > Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: > > +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> > > _______________________________________________ >>> 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 >> >> >> >> > > >> -- >> Donders Institute for Brain, Cognition and Behaviour >> > > Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> > > >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: > > www.arjenstolk.nl >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.andolina at ucl.ac.uk Wed Feb 26 14:43:15 2014 From: i.andolina at ucl.ac.uk (Ian M. Andolina) Date: Wed, 26 Feb 2014 13:43:15 +0000 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: References: Message-ID: <530DEF73.3030605@ucl.ac.uk> On 25/02/2014 11:51, fieldtrip-request at science.ru.nl wrote: > Re: [FieldTrip] Band Limited Power Analysis in Fieldtrip? Thanks Chaitanya, I get instability for the 1-4Hz band using a 4th order butterworth, but it seems to work for the higher bands (using cfg.bpinstabilityfix = 'reduce' to fix it only for the bands that need it). Does anyone know if integrating a chebyshev type-1 filter into fieldtrip preprocessing has been attempted, it is present in the signal processing toolbox and I could do this manually but I'd rather use existing code if possible... Thanks again, Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Wed Feb 26 17:38:23 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Wed, 26 Feb 2014 11:38:23 -0500 Subject: [FieldTrip] regressconfound and statistics In-Reply-To: References: Message-ID: Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.” I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Another question, is it ok to apply combineplanar to regressconfounded data? Thanks for your support. Raghavan > > > Date: Wed, 26 Feb 2014 09:20:05 +0100 (CET) > From: "Stolk, A. (Arjen)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] regressconfound and statistics > Message-ID: > <1312202281.5535647.1393402805973.JavaMail.root at sculptor.zimbra.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Hi Raghavan, Could you provide some more details on what statistical comparisons you are trying to make? It seems you have 4 blocks of recordings, each encompassing 2 task conditions, which you want to compare in terms of evoked/induced activity. If this is correct, you could 1) append data of the 4 blocks (subject-level) 2) regress out contributions from head movement using ft_regressconfound (subject-level) 3) split the trials into the 2 task conditions (subject-level) 4) compute t-scores using an independent samples t-test (subject-level) 5) non-parametric testing of effects using a dummy variable with zeros (group-level) From your descriptions, I got the impression you might have reversed the order of step 1 and 2. "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now. I thought it might get better by doing this, but seems to get worse. Please correct me if I am doing anything wrong." It's hard to tell from this information what might have caused this difference. For instance, the incorrect order of the steps above, or differences in neural processes you may be capturing through using a mean vs. a t-score, or maybe even head positions that are positively correlated with your effects, possibly because they're driving them (e.g. differential distances to the MEG sensors between the task conditions may cause the amplitude of the same ERP be more pronounced in one condition than another). I'd recommend looking into the (average) head positions of the different blocks/conditions, and see what is going on there (e.g. http://fieldtrip.fcdonders.nl/example/how_to_incorporate_head_movements_in_meg_analysis? ). Arjen ----- Oorspronkelijk bericht ----- >> Van: "Raghavan Gopalakrishnan" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Dinsdag 25 februari 2014 23:01:17 >> Onderwerp: Re: [FieldTrip] regressconfound and statistics >> Arjen et al, >> I have the following output data from regressconfound pertaining to >> one block of data. >> hpicompfiltdata = >> avg: [306x1500 double] >> var: [306x1500 double] >> time: [1x1500 double] >> dof: [306x1500 double] >> label: {306x1 cell} >> trial: [59x306x1500 double] >> dimord: 'rpt_chan_time' >> trialinfo: [59x1 double] >> cfg: [1x1 struct] >> beta: [37x306x1500 double] >> Since I have 4 blocks for each subject, I appended them using >> ft_appenddata, and using ft_timelockanalysis (mentioning appropriate >> cfg.trial and cfg.keeptrials=?yes?; ) I split the data into 2 >> conditions timelock_cond1 (shown below) and timelock_cond2, retaining >> only 204 gradiometers ( i suppose I am not supposed to use >> ft_combineplanar at this level since it would distort the results). >> timelock_cond1 = >> avg: [204x1500 double] >> var: [204x1500 double] >> time: [1x1500 double] >> dof: [204x1500 double] >> label: {204x1 cell} >> trial: [143x204x1500 double] >> dimord: 'rpt_chan_time' >> trialinfo: [143x1 double] >> cfg: [1x1 struct] >> Then these are the steps I did, per your suggestion. >> 1. I gathered all the time lock (from above step) for all subjects in >> a cell matrix, timelock_cond1{:} and timelock_cond2{:} >> 3. Then I ran first level stats for each subject, with cfg.statistic= >> indepsamplesT and cfg.method=?analytic?; cfg.design as you suggested, >> and rest of cfg. >> for sj = 1: size(subj,2) >> stat1{sj}=first_level_stats(timelock_cond1{sj},timelock_cond2{:}); >> end >> 4. Then, I did timelockgrandaverage >> cfg.keepindividual = 'yes'; >> cfg.parameter = 'stat'; >> stat2=ft_timelockgrandaverage(cfg,stat1{:}); >> 5. Created a dummy variable just like stat2 in the above step and >> replaced the field ?individual? with zeros >> dummy2=stat2; >> dummy2.individual=zeros(size(stat2.individual)); >> 6. Finally, ran the second level stats, with cfg. statistic = >> ?depsamplesT?; cfg.method=?montecarlo?; and rest of cfg. >> stat = ft_timelockstatistics(cfg, stat2, dummy2); >> However, the problem is, whatever significance I found earlier (i.e. >> by comparing means rather than t-statistic) doesn?t test significant >> now. I thought it might get better by doing this, but seems to get >> worse. Please correct me if I am doing anything wrong. >> Thanks, >> Raghavan >> What you described in your reply to me just now, calling >> ft_timelockstatistics at the subject level to calculate descriptives, >> still >> effectively reduces each subject to one "datapoint" -- the difference >> between conditions of the selected t-descriptive for that subject. I >> believe I understand how to do that, and how to then do nonparametric >> shuffle testing at the between-subjects level for the signfiicance of >> that >> within-subjects descriptive/difference. >>>> Ok. That's indeed the procedure I tried to outline. In your earlier >>>> reply to Raghavan, it sounded like you were suggesting >> pooling the trials themselves between subjects (that is, all subjects' >> trials go into one big "bucket"), with the trial-to-trial variance >> having >> been removed via ft_regressconfound, *then* calling the ft_statistics >> functions on this single large "bucket" of trials. Have I >> misunderstood >> your suggestion? >>>> I might have not been clear there then. I was meant to say that one >>>> could use ft_regressconfound on trials of two (or more) conditions >>>> combined >> of a single subject, prior to calculating the single subject >> t-descriptive >> (using ft_xxxstatistics). This allows one to compute a 'cleaner' >> t-score, >> or at least provide a good case that head movement did not >> differentially >> influence activity levels in the separate conditions. It was not >> related to >> pooling trials between subjects. >> 2014-02-21 16:14 GMT+01:00 Alik Widge < alik.widge at gmail.com >: >>> I don't *think* I'm asking about how to do second-order analysis, >>> unless I > have missed something important. I did read the link/FAQ >>> when I was working > on this last week, and that seems different >>> than the question I am asking. > > What you described in your reply >>> to me just now, calling > ft_timelockstatistics at the subject level >>> to calculate descriptives, still > effectively reduces each subject >>> to one "datapoint" -- the difference > between conditions of the >>> selected t-descriptive for that subject. I > believe I understand >>> how to do that, and how to then do nonparametric > shuffle testing >>> at the between-subjects level for the signfiicance of that > >>> within-subjects descriptive/difference. > > In your earlier reply to >>> Raghavan, it sounded like you were suggesting > pooling the trials >>> themselves between subjects (that is, all subjects' > trials go into >>> one big "bucket"), with the trial-to-trial variance having > been >>> removed via ft_regressconfound, *then* calling the ft_statistics > >>> functions on this single large "bucket" of trials. Have I >>> misunderstood > your suggestion? > > Alik > > Alik Widge > >>> alik.widge at gmail.com > (206) 866-5435 > > > > On Fri, Feb 21, >>> 2014 at 9:53 AM, Stolk, A. (Arjen) < > a.stolk at fcdonders.ru.nl > >>> wrote: > >> Dear Alik, >> >> If I am correct, you're asking how to >>> create subject-level >> t-descriptives, mentioned in the previous >>> post? A quick answer would be to >> perform an indepedent t-test ( >>> cfg.statistic = indepsamplesT; ) using >> ft_timelockstatistics >>> (although you're not really 'testing' here, but only >> interested >>> in that t-descriptive), in which trials are the unit of >> >>> observations ( cfg.design = [ones(1, ntrls_conditionA) 2*ones(1, >> >>> ntrls_conditionB)]; ). Note that since an indepedent t-test tests >>> for >> differences of the means of two conditions, it won't fail on >>> unequal number >> of observations across the conditions (unlike a >>> dependent/paired t-test). >> >> Hope this gets you kickstarted for >>> the moment. I found a previous >> mail-conversation that goes more >>> into detail, providing more overview of >> the steps involved: >> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2011-November/004539.html >>>>> More useful documentation: >> >> >>> http://fieldtrip.fcdonders.nl/faq/what_is_the_idea_behind_statistical_inference_at_the_second-level >>>>>>> Yours, >> Arjen >> >> ------------------------------ >> >> >>> *Van: *"Alik Widge" < alik.widge at gmail.com > >> *Aan: *"FieldTrip >>> discussion list" < fieldtrip at science.ru.nl > >> *Verzonden: >>> *Vrijdag 21 februari 2014 11:38:10 >> >> *Onderwerp: *Re: >>> [FieldTrip] regressconfound and frequency domain >> >> Arjen, what >>> you just described is more or less what I struggled to do >> last >>> week and ultimately gave up as I was unable to figure out how to get >>>>> FT to do it despite much meditation over tutorials and source >>> files. Can >> you elaborate a bit more on what you are saying below >>> -- not the >> ft_regressconfound bit, but the bit about how to get >>>>> ft_statistics_montecarlo and its wrappers to do a trials-level >>> analysis and >> permutation at the whole-group level? Especially, >>> what does one put in >> cfg.design and how does one call the >>> function? Everything I could find in >> the tutorials described the >>> case of doing means at the subject level and >> then permutation of >>> means at the group level, which as you point out is >> underpowered >>> for subtle effects. >> >> My particular situation was >>> timelock-analyzed trials (with >> keeptrials='yes'), but I could not >>> find a way to set up cfg.design that >> did not throw error >>> messages. The thing that really seemed to bother it was >> that >>> there were different numbers of trials in the 2-3 conditions of >> >>> interest, since some had to be removed for excessive artifact. >> >> >>> Thanks for any help, >> Alik >> >> Alik Widge >> alik.widge at >>> gmail.com >> (206) 866-5435 >> >> >> >> On Fri, Feb 21, 2014 at 3:23 >>> AM, Stolk, A. (Arjen) < >> a.stolk at fcdonders.ru.nl > wrote: >> >>>>>> Dear Raghavan, >>> >>> To compute a t-descriptive on subject >>> level freq data, you'll need to >>> use ft_freqstatistics. Have a >>> look here for instance: >>> >>> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >>> >>>>>> At the subject level, you do not need (non-parametric) cluster >>>>>> permutation testing (Maris & Oostenveld), as you're taking each >>> subject's >>> t-descriptives to the group level. At the group level, >>> you can then test >>> the hypothesis that there's a difference >>> between tasks/conditions (H1) vs. >>> no difference (H0). In order >>> to do so, you'll need to create a dummy >>> variable at the group >>> level, that has the same number of 'subjects', but >>> with zeros in >>> all fields (in your case this will be a .stat field). At the >>> >>> group level, you thus call ft_freqstatistics again. This approach >>> has the >>> advantage that you're more sensitive (as compared to >>> taking each subject's >>> mean to the group level) to effects that >>> are small but consistent over >>> trials in each subject. >>> >>> >>> Arjen >>> >>> >>> ------------------------------ >>> >>> *Van: >>> *"Raghavan Gopalakrishnan" < gopalar.ccf at gmail.com > >>> *Aan: * >>> fieldtrip at science.ru.nl >>> *Verzonden: *Donderdag 20 februari >>> 2014 23:33:18 >>> >>> *Onderwerp: *Re: [FieldTrip] regressconfound >>> and frequency domain >>> >>> Thanks Arjen, >>> Should I use >>> ft_freqdescriptives to compute t descriptives for >>> individual >>> subjects, and then take that to group level instead of mean? If >>> >>> not, what are the other alternatives? >>> Thanks, >>> Raghavan >>> >>>>>> Hi Raghavan, ft_regressconfound run on timelock data seems to >>> return output with avg field. However, ft_regressconfound run on >>> frequency data, does not return average. I see the avg field being >>> removed. Is there a reason? >> Not intentionally, but not an issue >>> either. You could still use ft_freqdescriptives to compute the >>> average for you, but see my comment below. Question - Since >>> ft_regressconfound outputs power spectrum of individual trials - 4D >>> matrix (instead of average), can I simply re-average the power >>> spectrum over trials to see the average power for that subject. >>> Also, I need to run grand average (over subjects) before running >>> statistics. I hope these steps does not distort the data. Please >>> advise. >> Remember that the mean over trials is not affected by >>> your clean-up of trial-by-trial variance due to head movement. >>> Taking each subject's mean (unaffected) to the group level is an >>> approach that will not benefit from your clean-up. In order to >>> benefit from reduced trial-by-trial variance, you'll need a measure >>> that depends on it, e.g. t-descriptive, neural activity-behavior >>> correlation (for taking to the group level). Hope this helps, Arjen >>> ----- Oorspronkelijk bericht ----- >>> >* Van: "Raghavan >>> Gopalakrishnan" >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> *>* >>> Aan: fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* >>> Verzonden: Donderdag 20 februari 2014 22:12:28 >>> *>* Onderwerp: >>> Re: [FieldTrip] regressconfound and frequency domain >>> *>* Arjen, >>>>>> *>* Thanks, I reduced down the time resolution so computation >>> can go >>> *>* faster. Now, m y matrix looks like this >>> *>* >>> hpicomptimefreq = >>> *>* label: {204x1 cell} >>> *>* dimord: >>> 'rpt_chan_freq_time' >>> *>* freq: [1x56 double] >>> *>* time: >>> [1x375 double] >>> *>* powspctrm: [4-D double] >>> *>* cumtapcnt: >>> [59x56 double] >>> *>* cfg: [1x1 struct] >>> *>* trialinfo: [59x1 >>> double] >>> *>* beta: [4-D double] >>> *>* ft_regressconfound run on >>> timelock data seems to return output with >>> *>* avg field. >>> However, ft_regressconfound run on frequency data, does not >>> *>* >>> return average. I see the avg field being removed. Is there a >>> reason? >>> *>* Question - Since ft_regressconfound outputs power >>> spectrum of >>> *>* individual trials - 4D matrix (instead of >>> average), can I simply >>> *>* re-average the power spectrum over >>> trials to see the average power for >>> *>* that subject. Also, I >>> need to run grand average (over subjects) before >>> *>* running >>> statistics. I hope these steps does not distort the data. >>> *>* >>> Please advise. >>> *>* Thanks, >>> *>* Raghavan >>> *>* Date: Wed, >>> 19 Feb 2014 22:58:38 +0100 (CET) >>> *>* From: "Stolk, A. (Arjen)" < >>> a.stolk at fcdonders.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>> To: FieldTrip discussion list < fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>> Subject: Re: [FieldTrip] regressconfound and frequency domain >>> >>> *>* Message-ID: >>> *>* < >>> 2108167665.5423215.1392847118322.JavaMail.root at >>> sculptor.zimbra.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > >>>>>> *>* Content-Type: text/plain; charset="utf-8" >>> *>* Dear >>> Raghavan, Good to hear it's working out for you. A short answer >>> >>> *>* would be 'no'. Reducing the size of your data matrix is likely >>> going >>> *>* to speed up computations. Your time resolution seems >>> pretty high (1500 >>> *>* frequency estimations per single trial); >>> do you need that many? Yours, >>> *>* Arjen ----- Oorspronkelijk >>> bericht ----- >>> *>* > Van: "Raghavan Gopalakrishnan" < gopalar.ccf >>> at gmail.com < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >>> *>* >>>> Aan: fieldtrip at science.ru.nl < >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> *>* > >>> Verzonden: Woensdag 19 februari 2014 22:01:00 >>> *>* > Onderwerp: >>> [FieldTrip] regressconfound and frequency domain >>> *>* > Arjen, >>>>>> *>* > Thanks for answering all my previous questions. I was >>> successfully >>> *>* > able to incorporate head movements to my erf >>> data. As I understand I >>> *>* > have to do this separately for the >>> time frequency data after keeping >>> *>* > individual trials. I am >>> interested in both beta and gamma bands >>> *>* > [15:1:70]. my time >>> frequency looks like this using wavelets, >>> *>* > timefreq = >>> >>> *>* > label: {204x1 cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> >>> *>* > freq: [1x56 double] >>> *>* > time: [1x1500 double] >>> *>* > >>> powspctrm: [4-D double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* >>>> grad: [1x1 struct] >>> *>* > elec: [1x1 struct] >>> *>* > cfg: >>> [1x1 struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > After >>> regressconfound >>> *>* > hpicomptimefreq = >>> *>* > label: {204x1 >>> cell} >>> *>* > dimord: 'rpt_chan_freq_time' >>> *>* > freq: [1x56 >>> double] >>> *>* > time: [1x1500 double] >>> *>* > powspctrm: [4-D >>> double] >>> *>* > cumtapcnt: [55x56 double] >>> *>* > cfg: [1x1 >>> struct] >>> *>* > trialinfo: [55x1 double] >>> *>* > beta: [4-D >>> double] >>> *>* > Regressconfound took about 1 hr and 30 mins, since >>> its a huge matrix >>> *>* > [55x204x56x1500]. I have 25 such blocks >>> of data for 20 subjects. It >>> *>* > will take an enoumous amount >>> of time to process the data through >>> *>* > regressconfound. Is >>> there a workaround to make the processing faster >>> *>* > or am I >>> missing something. Any help would be of great help. >>> *>* > >>> Thanks, >>> *>* > Raghavan* >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip >>> mailing list >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>>>>>>>> -- >>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>> Radboud University >>> Nijmegen >>> >>> Email: a.stolk at donders.ru.nl >>> Phone: >>> +31(0)243 68294 >>> Web: www.arjenstolk.nl >>> >>> >>> _______________________________________________ >>> 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 >> >> >> >> >>>>> -- >> Donders Institute for Brain, Cognition and Behaviour >> >>> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >>>>> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: >>> www.arjenstolk.nl >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 39, Issue 48 > ***************************************** From v.piai.research at gmail.com Wed Feb 26 19:03:55 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 26 Feb 2014 19:03:55 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' Message-ID: <530E2C8B.6070004@gmail.com> Hi all, Does anyone have some tips for getting a nice sourceplot using the 'ortho' method? I'm using functional data masked by the stats results. I see a lot of cerebellum activity as well as deeper sources, so a surface plot is very likely to be fooling me. I'm getting a very ugly figure, though, because of all the squares (activity and masks) bleeding outside of the skull outline. Anyone with experience on what works well to make that look nicer (eg., in Illustrator)? Thanks, Vitoria From a.stolk at fcdonders.ru.nl Wed Feb 26 22:43:59 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 26 Feb 2014 22:43:59 +0100 (CET) Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <530E2C8B.6070004@gmail.com> Message-ID: <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Hi Vitoria, I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, Arjen ----- Oorspronkelijk bericht ----- > Van: "Vitoria Piai" > Aan: fieldtrip at donders.ru.nl > Verzonden: Woensdag 26 februari 2014 19:03:55 > Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' > Hi all, > > Does anyone have some tips for getting a nice sourceplot using the > 'ortho' method? > I'm using functional data masked by the stats results. I see a lot of > cerebellum activity as well as deeper sources, so a surface plot is > very > likely to be fooling me. I'm getting a very ugly figure, though, > because > of all the squares (activity and masks) bleeding outside of the skull > outline. > Anyone with experience on what works well to make that look nicer > (eg., > in Illustrator)? > > Thanks, Vitoria > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl From notthemindprobe at yahoo.com Thu Feb 27 01:11:59 2014 From: notthemindprobe at yahoo.com (Eric Pohlmeyer) Date: Wed, 26 Feb 2014 16:11:59 -0800 (PST) Subject: [FieldTrip] Recording Biosemi GSR data in GDF files In-Reply-To: Message-ID: <1393459919.4744.YahooMailBasic@web140204.mail.bf1.yahoo.com> Robert: Thanks for your suggestions, after doing some digging in the Actiview Labview code and some Biosemi forums posting I found there is some interesting variations in the Biosemi GSR sensors that affect how they are interpreted by the biosemi2ft code and then stored in the GDF files. Most significantly, for Biosemi there are two channels of analog data the correspond to 1 channel of GSR data. In other words, to use biosemi2ft to get EEG channels 1:32 you would specify channels 1, 2, .... 32 in the biosemi2ft config file. This corresponds to biosemi/BDF channels 1:32. Similarly, if you want the 8 Biosemi external analog channels [biosemi channels 257 to 264] you would specify channels 257 to 264 in the config file for biosemi2ft. However, if you specify that you want channels 265 and 266 in the biosemi2ft config this witll *not* give you the Biosemi GSR1 and Biosemi GSR2 channels. Instead you will get two voltage measurements that are both used by Actiview to calculate GSR1. Therefore you need to set up the biosemi2ft config file to recorded channels 265->268 [4 channels] in order the get the raw data that is used by Biosemi to calculate the contents of its channels 265(GSR1) and 266 (GSR2). Actiview does something along the following with the pairs of channels to calculate GSR (the following would be for GSR1, GSR2 would use channels 268&267) GSR1 = CH266-CH265 low pass filter GSR GSR1 = 13.3*GSR Max and minimum substraction in a sliding window (128 data points for a complete 16Hz excitation wave cycle when data is at 2048Hz, there is 50% window overlap) GSR1 = GSR1/8192 GSR1 = 1/GSR1 GSR1 = 1E+9 * GSR1 There can be some variation to account for different speed modes/sampling rates (I've been running at 2048Hz). There is also additional operations for verifying data integrity, and converting data types. Anyway, one of the big things to be aware of is that when you go beyond channel 264 there is no longer a 1:1 relationship in the Biosemi data channeling numbering and the way that the biosemi2ft is accessing the (raw) data. I haven't used any of the other Biosemi sensor data, but some of the messages in their forums suggest that the ERGO, RESP and TEMP sensors as well under go additional processing in Actiview. So I don't know if there are multiple channels of 'raw' data that correspond to each of those. Best, Eric ---------------------------------------------------------------------- Message: 1 Date: Tue, 18 Feb 2014 16:55:55 +0100 From: Robert Oostenveld To: FieldTrip discussion list Subject: Re: [FieldTrip] Recording Biosemi GSR data in GDF files Message-ID: <4A14FD77-D413-418C-B788-F45F0CD675AD at donders.ru.nl> Content-Type: text/plain; charset="us-ascii" Hi Eric, Although I don't have any real expertise in this matter, let me share my 2 cents: Your description suggests that the GSR is estimated using a 16Hz alternating current  of constant (but presumably unknown) amplitude, and that GSR is estimated by solving Ohms law (V=I*R). Rather than doing an instantaneous estimate (which is noisy, especially if the current passes the zero-crossing)  there will be a rectification and temporal smoothing of the voltage prior to the estimation. Or perhaps even better: a sliding window estimation: for a given time t   take the signal from t-1/16s in the past up to t-0 (i.e. now)   estimate the 16Hz amplitude using a DFT, this is a single positive number (either RMS, Vpeak, or Vpeak-to-peak)   estimate R = V/I (this requires that you know the current I) You could determine I by connecting a known resistor of appropriate size to the electrodes. Or perhaps you don't even have to; if you are not interested in the absolute value but only in changes, you would just take R as proportional to V. Something like this (for the offline case) would do it time    = (1:(fsample/16))/fsample; % just enough time for one oscillation model_c = cos(16*2*pi*time); model_s = sin(16*2*pi*time); model   = model_c + i*model_s;      % i is the complex number model   = model./norm(model); signal    = randn(1,10*fsample);    % the raw signal amplitude = nan(size(signal));      % the estimated amplitude for t=1:length(signal)   begsample = t - fsample/16 + 1;   % note the +1, the segment should be 64 samples long   endsample = t - 0;   if begsample>=1 && endsample<=length(signal)     segment = signal(begsample:endsample);     amplitude(t) = segment*model'; % discrete fourier transform   end end plot(abs(amplitude)) This can be translated to the online case by inserting it into one of the examples at http://fieldtrip.fcdonders.nl/development/realtime best regards, Robert On 18 Feb 2014, at 0:00, Eric Pohlmeyer wrote: > Fieldtrip users: > > Hi, my basic question is: Does anyone know how to record Biosemi GSR (skin conductance) data in a GDF file?  This is a different operation than just specifying additional non-EEG channels, as you do for the 8 external inputs on the Biosemi amp. > > Some more details: > > Currently we have been doing real-time transmission of EEG and the 8 external Biosemi channels using the Fieldtrip buffer and biosemi2ft, and all the data has been recorded fine.  We recently wanted to add GSR data to this.  However, it appears that the GSR data is treated differently by Biosemi than its other analog channels, thus when we add channel 265 (the GSR channel) to the biosemi2ft config file, we get another channel of data, but it is just the 16Hz excitation wave that Biosemi uses to deduce the GSR data, rather than the GSR data itself.  When we record the GSR data using Activew in a BDF file, the data is recorded fine. > > Apparently Biosemi does some extra manipulations to GSR data in Actiview prior its storage in the BDF files, this extra manipulation occurs after it arrives from the USB driver, and is likely why we just see the excitation sine wave in the GDF file.  This is in contrasts to the 8 external channels which do not undergo such additional manipulations. > > So, before I dove in and tried to work out a solution, I was just wondering if anyone had already come up with a workaround for saving the Biosemi GSR data into the GDF? > > Thanks! > > Eric > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From barbara.schorr at uni-ulm.de Thu Feb 27 09:08:24 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Thu, 27 Feb 2014 09:08:24 +0100 Subject: [FieldTrip] Plotting ERP data: From topoplot to 3D brain surface plot Message-ID: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> Dear Fieldtripers, I have ERP data from a normal oddball task (low pitch tones vs. high pitch tones) resulting in a P300. I know how to plot them with the normal ft_topoplot command. For just visualization, this is fine, but for a publication I would like to plot my data on a 3D brain surface. I know how to do that with the ft_sourceplot command. I tried it with my data, but the result is not even close to what I see when I plot it with the ft_topoplot command (I don's see the nice big blob of activity in the parietal cortex). I guess the problem is that I do more analizyng steps in order to get the data structure which is needed for sourceplotting. What I really just want to do is putting my topoplot on a brainsurface. Is that possible in fieldtrip or do I need to use another software? Thank you very much for your help!! Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From eelke.spaak at donders.ru.nl Thu Feb 27 09:19:55 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 27 Feb 2014 09:19:55 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Vitória, When you are calling ft_sourceinterpolate, you can call it with different interpolation methods. I think the default is 'nearest', which results in interpolated blocky figures. You can also specify cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both of which result in smoother interpolations. Furthermore you can play around with the mask variable for plotting. I guess you are now using the binary mask resulting from the output of ft_sourcestatistics. You can also create a real-value mask based e.g. on the statistical or relative values (which results in opacity being ramped up according to effect size), and then apply the statistical map to that. This would be something like the following: tmp = int_stat.stat; oldmask = int_stat.mask; int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % set the new mask to range between 0 and 1 int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels where int_stat is the result of ft_sourceinterpolate. Note that because I used 'sphere_avg' interpolation in this case, the interpolated mask will not be strictly binary anymore, hence the test < 0.9, rather than == 1. (Also note that you should specify cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting with a mask like the above.) Does this do something like you want? Best, Eelke On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: > Hi Vitoria, > > I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, > > Arjen > > > ----- Oorspronkelijk bericht ----- >> Van: "Vitoria Piai" >> Aan: fieldtrip at donders.ru.nl >> Verzonden: Woensdag 26 februari 2014 19:03:55 >> Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' >> Hi all, >> >> Does anyone have some tips for getting a nice sourceplot using the >> 'ortho' method? >> I'm using functional data masked by the stats results. I see a lot of >> cerebellum activity as well as deeper sources, so a surface plot is >> very >> likely to be fooling me. I'm getting a very ugly figure, though, >> because >> of all the squares (activity and masks) bleeding outside of the skull >> outline. >> Anyone with experience on what works well to make that look nicer >> (eg., >> in Illustrator)? >> >> Thanks, Vitoria >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From v.piai.research at gmail.com Thu Feb 27 16:44:46 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Feb 2014 16:44:46 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: <530F5D6E.4030804@gmail.com> Hi Elke and Arjen, Thanks a lot, it almost solved the problem (see figure). It looks better than before anyways, so I guess I could just do the finishing in Illustrator. (Or can you tell from this figure that something is going wrong with the interpolation/projection?) Vitoria On 27-2-2014 9:19, Eelke Spaak wrote: > Hi Vitória, > > When you are calling ft_sourceinterpolate, you can call it with > different interpolation methods. I think the default is 'nearest', > which results in interpolated blocky figures. You can also specify > cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both > of which result in smoother interpolations. > > Furthermore you can play around with the mask variable for plotting. I > guess you are now using the binary mask resulting from the output of > ft_sourcestatistics. You can also create a real-value mask based e.g. > on the statistical or relative values (which results in opacity being > ramped up according to effect size), and then apply the statistical > map to that. This would be something like the following: > > tmp = int_stat.stat; > oldmask = int_stat.mask; > int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % > set the new mask to range between 0 and 1 > int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels > > where int_stat is the result of ft_sourceinterpolate. Note that > because I used 'sphere_avg' interpolation in this case, the > interpolated mask will not be strictly binary anymore, hence the test > < 0.9, rather than == 1. (Also note that you should specify > cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting > with a mask like the above.) > > Does this do something like you want? > > Best, > Eelke > > On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: >> Hi Vitoria, >> >> I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, >> >> Arjen >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "Vitoria Piai" >>> Aan: fieldtrip at donders.ru.nl >>> Verzonden: Woensdag 26 februari 2014 19:03:55 >>> Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' >>> Hi all, >>> >>> Does anyone have some tips for getting a nice sourceplot using the >>> 'ortho' method? >>> I'm using functional data masked by the stats results. I see a lot of >>> cerebellum activity as well as deeper sources, so a surface plot is >>> very >>> likely to be fooling me. I'm getting a very ugly figure, though, >>> because >>> of all the squares (activity and masks) bleeding outside of the skull >>> outline. >>> Anyone with experience on what works well to make that look nicer >>> (eg., >>> in Illustrator)? >>> >>> Thanks, Vitoria >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Email: a.stolk at donders.ru.nl >> Phone: +31(0)243 68294 >> Web: www.arjenstolk.nl >> _______________________________________________ >> 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 -- Vitória Piai PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition, Radboud University Nijmegen Montessorilaan 3, B.02.30 6525 HR Nijmegen The Netherlands Email : V.piai at donders.ru.nl Phone : +31 24 3612635 www.vitoriapiai.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dedabghb.png Type: image/png Size: 178693 bytes Desc: not available URL: From ayobimpe2004 at hotmail.com Thu Feb 27 22:37:50 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Thu, 27 Feb 2014 22:37:50 +0100 Subject: [FieldTrip] correlated sources with DICS Message-ID: Hello, I want to compute source coherence with DICS. I am not getting what I want with cfg.refdip option.Please how can I include two bilateral reference positions in leadfield computation or generally compute source coherence from one source location to other sources? Azeez A. Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Feb 28 08:50:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 28 Feb 2014 08:50:34 +0100 Subject: [FieldTrip] tips for nice sourceplot using 'ortho' In-Reply-To: <530F5D6E.4030804@gmail.com> References: <530E2C8B.6070004@gmail.com> <785888725.5569124.1393451039461.JavaMail.root@sculptor.zimbra.ru.nl> <530F5D6E.4030804@gmail.com> Message-ID: Hi Vitoria, I forgot to add: the default in ft_sourceinterpolate is to *always* use 'nearest' interpolation if the data field is logical (as is the case for the mask; hence still the blocky masking). This is a reasonable setting I guess, but I don't see a reason why you shouldn't be able to use 'smudge' or 'sphere_avg' for a mask as well. You can circumvent this by doing stat.mask = double(stat.mask); before the interpolation step. Best, Eelke On 27 February 2014 16:44, Vitoria Piai wrote: > Hi Elke and Arjen, > > Thanks a lot, it almost solved the problem (see figure). It looks better > than before anyways, so I guess I could just do the finishing in > Illustrator. > (Or can you tell from this figure that something is going wrong with the > interpolation/projection?) > > Vitoria > > > > On 27-2-2014 9:19, Eelke Spaak wrote: > > Hi Vitória, > > When you are calling ft_sourceinterpolate, you can call it with > different interpolation methods. I think the default is 'nearest', > which results in interpolated blocky figures. You can also specify > cfg.interpmethod = 'sphere_avg' or cfg.interpmethod = 'smudge', both > of which result in smoother interpolations. > > Furthermore you can play around with the mask variable for plotting. I > guess you are now using the binary mask resulting from the output of > ft_sourcestatistics. You can also create a real-value mask based e.g. > on the statistical or relative values (which results in opacity being > ramped up according to effect size), and then apply the statistical > map to that. This would be something like the following: > > tmp = int_stat.stat; > oldmask = int_stat.mask; > int_stat.mask = (tmp - min(tmp(:))) ./ (max(tmp(:)) - min(tmp(:))); % > set the new mask to range between 0 and 1 > int_stat.mask(oldmask < 0.9) = 0; % mask out non-significant voxels > > where int_stat is the result of ft_sourceinterpolate. Note that > because I used 'sphere_avg' interpolation in this case, the > interpolated mask will not be strictly binary anymore, hence the test > < 0.9, rather than == 1. (Also note that you should specify > cfg.opacitylim = [0 1] and cfg.opacitymap = 'rampup' when plotting > with a mask like the above.) > > Does this do something like you want? > > Best, > Eelke > > On 26 February 2014 22:43, Stolk, A. (Arjen) wrote: > > Hi Vitoria, > > I don't know whether you have done so already, but you could try and interpolate your source reconstructed activity on a high spatial resolution version of a brain (e.g. try the /template/anatomy/single_subj_T1_1mm.nii). Hope this helps, > > Arjen > > > ----- Oorspronkelijk bericht ----- > > Van: "Vitoria Piai" > Aan: fieldtrip at donders.ru.nl > Verzonden: Woensdag 26 februari 2014 19:03:55 > Onderwerp: [FieldTrip] tips for nice sourceplot using 'ortho' > Hi all, > > Does anyone have some tips for getting a nice sourceplot using the > 'ortho' method? > I'm using functional data masked by the stats results. I see a lot of > cerebellum activity as well as deeper sources, so a surface plot is > very > likely to be fooling me. I'm getting a very ugly figure, though, > because > of all the squares (activity and masks) bleeding outside of the skull > outline. > Anyone with experience on what works well to make that look nicer > (eg., > in Illustrator)? > > Thanks, Vitoria > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Email: a.stolk at donders.ru.nl > Phone: +31(0)243 68294 > Web: www.arjenstolk.nl > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Vitória Piai > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition, Radboud University Nijmegen > Montessorilaan 3, B.02.30 > 6525 HR Nijmegen > The Netherlands > > Email : V.piai at donders.ru.nl > Phone : +31 24 3612635www.vitoriapiai.com > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dedabghb.png Type: image/png Size: 178693 bytes Desc: not available URL: From sauer.mpih at googlemail.com Fri Feb 28 12:08:41 2014 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Fri, 28 Feb 2014 12:08:41 +0100 Subject: [FieldTrip] Warning in topoplot function - 4D data Message-ID: Dear all, when plotting topoplots of 4D data using the 4D248 layout, Matlab gives me the warning "Some points fall outside the outline, please consider using another layout.". Indeed, two frontal sensors are placed outside the head. I am wondering why this message shows up and whether this influences results, i.e. a misplaced peak sensor. I tried with different fieldtrip versions, current ones and old ones. I get the warning all the time. Any help is appreciated! Thanks a lot and best regards, Andreas -- Andreas Sauer Max Planck Institute for Brain Research Deutschordenstraße 46 60528 Frankfurt am Main Germany T: +49 69 96769 278 F: +49 69 96769 327 Email: andreas.sauer at brain.mpg.de www.brain.mpg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-02-28 11:57:24.png Type: image/png Size: 15484 bytes Desc: not available URL: From albenin at mail.ru Fri Feb 28 15:28:40 2014 From: albenin at mail.ru (=?UTF-8?B?0JDQu9C10LrRgdC10Lkg0JHQtdC90LjQvQ==?=) Date: Fri, 28 Feb 2014 18:28:40 +0400 Subject: [FieldTrip] =?utf-8?q?Statistics_on_freq_data?= In-Reply-To: <1391612267.921368498@f293.i.mail.ru> References: <1391612267.921368498@f293.i.mail.ru> Message-ID: <1393597720.682131540@f250.i.mail.ru> Hi all! Does anyone have ideas? :) > > >Dear Fieldtripers, > >First of all big thanks for a wonderful tool and support! > >I have some questions about cluster based permutation test on TF data. >I perform a between-trials experiment and want to search differences say >on frequencies 10-30Hz and latencies 200-1200 ms from onset. >So I need to explore these ranges for possible differencies in powerspectrum. >When I use for example > >cfg.latency          = [0.2 1.2]; >cfg.frequency        = [10 30]; > >I find no significant clusters, and lowest p_value is very high, say 0,8. >But when I try to look at smaller time/frequency areas, like > >cfg.latency          = [0.2 0.3]; >cfg.frequency        = [15 16]; > >There can be one or two significant clusters with p_values<0.01. >So my question is: does the algorithm look for the whole specified TF window like >0.2-1.2s   10-30Hz and tries to find significant difference based on the whole length >of interval? This could explain why there are no significant clusters on bigger windows. >Such clusters appear when we shorten the toi and foi - it's much more probable to find differences >at smaller scales. >So the next question is: what should I do to explore the whole number of frequencies and latencies? >Shall I run a loop with parameters like this: > >Iteration 1 >cfg.latency          = [0.2 0.3]; >cfg.frequency        = [15 16]; > >Iteration 2 >cfg.latency          = [0.3 0.4]; >cfg.frequency        = [15 16]; > >... and so on? > >Or maybe I do not understand something in basis of method? >BTW, I've read all tutorials and appropriate papers like >Nonparametric statistical testing of EEG, but could not find the answer. > > >Thanks in advance, > >Alex > > > >_______________________________________________ >fieldtrip mailing list >fieldtrip at donders.ru.nl >http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Неизвестно Неизвестно -------------- next part -------------- An HTML attachment was scrubbed... URL: