From tim.curran at Colorado.EDU Fri Aug 1 21:00:44 2014 From: tim.curran at Colorado.EDU (Tim Curran) Date: Fri, 1 Aug 2014 13:00:44 -0600 Subject: [FieldTrip] Postdoc Position, Colorado Message-ID: <5AE917E0-2DC4-4DFD-A5DF-12E2CD19FC01@colorado.edu> Postdoctoral Research Associate Position Curran Lab, University of Colorado Boulder Postdoctoral research position available in the lab of Tim Curran at the Department of Psychology & Neuroscience, University of Colorado Boulder to work on an ONR-funded grant focusing on top-down influences on visual object recognition. Curran’s lab will focus on human EEG studies in collaboration with Randy O’Reilly (UC Boulder, computational modeling), David Sheinberg (Brown, primate electrophysiology), and Tor Wager (UC Boulder, fMRI). PhD in psychology, neuroscience, or related fields required. Desirable qualifications include human EEG research experience, especially involving advanced analyses approaches including machine learning. fMRI experience is also valuable, but not necessary. The position is available immediately, but the start date is flexible. The University of Colorado is an Equal Opportunity Employer committed to building a diverse workforce. We encourage applications from women, racial and ethnic minorities, individuals with disabilities and veterans. Alternative formats of this ad can be provided upon request for individuals with disabilities by contacting the ADA Coordinator at hr-ada at colorado.edu. The University of Colorado Boulder conducts background checks on all final applicants being considered for employment. For further information contact, tim.curran at colorado.edu. Applicants must submit a CV, a statement of research experience/interests, a cover letter including email addresses for at least three referees, and one recommendation letter. The other referees will be contacted for letters if needed. Applications will be accepted electronically at https://www.jobsatcu.com/postings/85712 . The job posting # is RF01616. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dragos.n.stanciu at gmail.com Sat Aug 2 03:32:54 2014 From: dragos.n.stanciu at gmail.com (Dragos Stanciu) Date: Sat, 2 Aug 2014 02:32:54 +0100 Subject: [FieldTrip] Connectivity analysis after applying Welch's method In-Reply-To: <53DA41D1.7080604@donders.ru.nl> References: <53DA41D1.7080604@donders.ru.nl> Message-ID: Hello Jörn, Thank you for the suggestion. I managed to get connectivity plots with that function. Coming back to the question in my previous email, would it be OK to take the absolute value of the debiased wpli values to be used in graph analysis as edge weights? For example, HERMES, another connectivity toolbox returns only values between 0 and 1 for this measure. Also, Vinck et al. paper says that the value should be positive, I guess by taking the absolute value in the case of a lagging phase. Sorry if this is a basic question, but I would appreciate if someone can shed some light on this. Kind regards, Dragos Stanciu On Jul 31, 2014 2:18 PM, Jörn M. Horschig wrote: > Hi Dragos, > > have yoi checked ft_topoplotCC? > > Best, > Jörn > > On 7/31/2014 12:06 AM, Dragos Stanciu wrote: > >> Hello Jörn, >> >> Thank you so much for responding. The suggested changes were spot on and >> ft_connectivityanalysis executed successfully. >> In the end, I went with the approach of redefining the 10s epoch in 2s >> minitrials and performing ft_freqanalysis on these minitrials with >> /cfg.output='fourier'/ and /keeptrial='yes'. /I then did >> ft_connectivityanalysis on the frequency structures resulted from >> processing the segmented data. This would give me connectivity matrices for >> each 10s epoch, which I then average to get one connectivity matrix for the >> subject (technically, I have a connectivity matrix for each frequency bin, >> but I can again average across the frequency spectrum). >> >> I have a question on the debiased weighted phase lag index measure. The >> values in the matrix vary between -1 and 1 (depending if the relative phase >> lags or leads). When I construct the adjacency matrices, is it just a >> matter of taking the absolute value of these values? >> >> I would also like some advice on plotting connectivity matrices. I was >> able to plot one matrix with ft_plot_matrix, but it would be really nice if >> I could plot a connectivity graph where the thickness of the edges >> correspond to the strength of the connectivity measure. I tried >> ft_topoplotER with 4D148.lay as the layout file and 'gui' as refchannel, >> but I didn't get anything interesting. As my data is MEG, it doesn't make >> sense to me to choose a reference channel... >> Ideally, I would like to combine the layout (4D148.lay) with the >> connectivity matrix for plotting the graph. Do you have any ideas for this? >> Also, do you have any other suggestions on what other plotting functions >> can be used with these connectivity matrices? I've looked through the >> tutorial, but the functions don't seem very relevant to my type of data. >> >> Thank you for your help. >> >> Regards, >> Dragos Stanciu >> >> Message: 9 >> Date: Wed, 30 Jul 2014 10:28:50 +0200 >> From: "J?rn M. Horschig" > > >> To: FieldTrip discussion list > > >> Subject: Re: [FieldTrip] Connectivity analysis after applying Welch's >> method >> >> Hi Dragos, >> >> while quickly browisng through your mail, it appears to me that you >> simply need to set single_epoch_freq.dimord = 'rpt_chan_freq'. >> FieldTrip >> is using the dimord field to infer the order of the dimensions >> (*dim*ension *ord*er). The actual dimensions of powspctrm and >> crsspctrm >> are now inconsistent with the dimord specifications. >> >> Best, >> J?rn >> >> >> On 7/30/2014 1:18 AM, Dragos Stanciu wrote: >> > Dear FieldTrippers, >> > >> > I'm Dragos Stanciu and I'm working on my MSc in Neuroinformatics >> > dissertation at the University of Edinburgh. My project involves >> > analysis of resting-state functional connectivity using graph theory >> > in Alzheimer's disease based on MEG data. >> > >> > Each of my subjects has a number of 10s epochs (trials) associated >> > with him/her. I was able to compute the coherence and weighted phase >> > lag index measures (with /ft_freqanalysis /and >> > /ft_connectivityanalysis) /by treating my 10s epochs as trials, but >> > now I would like to reduce the amount of noise in the estimation of >> > the frequency spectrum by employing Welch's method. >> > >> > For this, I split each 10s epoch in 2s segments (minitrials) >> with 50% >> > overlap: >> > >> > [sep_epoch_data] = ft_redefinetrial(cfg_cut, >> single_epoch_data)/. / >> > >> > >> > I then apply /ft_preprocessing /on the minitrials: >> > >> > [processed_single_epoch] = ft_preprocessing(cfg, >> sep_epoch_data); >> > >> > I then do frequency analysis on the preprocessed segmented data: >> > >> > [single_epoch_freq] = ft_freqanalysis(cfg_freq, >> > processed_single_epoch); >> > >> > where >> > >> > display(cfg_freq) >> > method: 'mtmfft' >> > taper: 'hanning' >> > foilim: [0.5000 4] >> > output: 'powandcsd' >> > channel: {148x1 cell} % 148 channels labelled from >> A1 to >> > A148 >> > keeptrial: 'no' % don't keep the minitrials, as we want >> > to average them >> > keeptapers: 'no' >> > >> > Please note that I average the minitrials (/keeptrial = 'no'/) as I >> > want to get an average of the frequencies. >> > >> > The resulting /single_epoch_freq/ structure looks like: >> > >> > display(single_epoch_freq) >> > label: {148x1 cell} >> > dimord: 'chan_freq' >> > freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008 >> > 4.0009] >> > powspctrm: [148x8 double] >> > labelcmb: {10878x2 cell} % channel combinations >> (148*147/2) >> > crsspctrm: [10878x8 double] >> > cfg: [1x1 struct] >> > >> > >> > The last step is to append the averaged frequency structures of each >> > 10s epoch together and perform connectivity analysis on the main 10s >> > epochs. I do the concatenation like so: >> > freq_avgs_powspctrm = [freq_avgs_powspctrm; >> > permute(single_epoch_freq.powspctrm, [3,1,2])]; >> > >> > freq_avgs_crsspctrm = [freq_avgs_crsspctrm; >> > permute(single_epoch_freq.crsspctrm, [3,1,2])]; >> > >> > The idea behind /permute(..., [3, 1, 2])/ is that I want the first >> > dimension to represent trials, the second dimension channel >> > combinations and the third dimension frequencies, as this is needed >> > for the input of /ft_connectivity_wpli /(Repetitions x >> > Channelcombination (x Frequency)). >> > >> > I then call stat_conn = ft_connectivityanalysis(cfg_conn, >> freq_avgs); >> > where: >> > >> > display(cfg_conn) >> > method: 'wpli_debiased' >> > channel: {148x1 cell} >> > >> > and >> > >> > display(freq_avgs) >> > powspctrm: [4x148x8 double] % as I have 4 ten >> second epochs >> > crsspctrm: [4x10878x8 double] % as I have 4 ten >> second epochs >> > label: {148x1 cell} >> > dimord: 'chan_freq' >> > freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008 >> > 4.0009] >> > labelcmb: {10878x2 cell} >> > cfg: [1x1 struct] >> > >> > >> > The error that I get when running /ft_connectivityanalysis/ is: >> > >> > Error using cat >> > CAT arguments dimensions are not consistent. >> > Error in ft_checkdata>fixcsd (line 1170) >> > data.crsspctrm = cat(catdim, data.powspctrm, >> data.crsspctrm); >> > >> > >> > When debugging, /catdim/ is equal to 1. The error occurs because the >> > 2nd dimension of data.powspctrm and data.crsspctrm are not equal >> > (former is 148, latter is 10878). Do you have any suggestions on >> > getting around this problem? Should I construct /freq_avgs /(data >> > input to ft_connectivityanalysis) differently? I'm also open to >> > different approaches to working out Welch's method in FieldTrip. >> > >> > Please download this archive that contains my test script and 4 >> > example 10s epochs of a subject: >> > https://www.dropbox.com/s/js7pztai02f5p27/Welch_fieldtrip.zip >> The code >> > should make things clearer (or the opposite). >> > Observations: I thought about using /ft_freqanalysis_mtmwelch/, but >> > apparently it's deprecated. >> > >> > Thank you all in advance for your feedback. >> > >> > Kind regards, >> > Dragos Stanciu >> > >> >> >> -- >> J?rn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> >> >> >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniele.marinazzo at ugent.be Sun Aug 3 20:05:16 2014 From: daniele.marinazzo at ugent.be (Daniele Marinazzo) Date: Sun, 3 Aug 2014 20:05:16 +0200 Subject: [FieldTrip] Controversies in EEG source imaging - workshop, data and special issue in Brain Topography Message-ID: Dear Colleague The Key Laboratory of Neuroinformation of the Ministery of Education of China in Chengdu (NIL), in collaboration with the Cuban Neuroscience Center (CNEURO), and the University of Ghent (UG) are organizing a workshop on “Controversies in EEG source imaging (ESI)” Which will be held in Chengdu, China from the 20th to the 22nd of August. All the info on the workshop and related activities are on the website http://www.neuro.uestc.edu.cn/ceegsi/ Confirmed speakers include: Anna Custo Jorge Bosch-Bayard Claude Bédard Fabrizio de Vico Fallani Daqing Guo Stefan Haufe Xu Lei Daniele Marinazzo Cu Peng Dimitris Pinotsis Jorge Riera Andreas Spiegler Pedro Valdes Sosa Dezhong Yao Rather than having traditional presentations we shall be discussing questions such as: --Are there monopoles in the brain, and if so what impact to the have on ESI? --Is there is a best EEG reference and does it matter for ESI? --What is the best way to measure brain connectivity in ESI? --What if any, will the impact of Neural Field theory on ESI be? with short presentations followed by discussions. We hope you can come and join us there. In any case, the workshop is structured in such a way that interested researchers can contribute even remotely. This can happen in several ways: -on the website several types of data (scalp and intracranial recordings from human, rat and monkey) have been uploaded. You can play with these data and share results and discussions. -you can contribute to the discussion participating to the forum on the website, uploading papers, preliminary results, etc. -ultimately, these discussions will result in a special issue of Brain Topography, to which we invite you to contribute. The papers should ideally reflect the discussions during the workshop as well as before and after on the forum, and/or analyze the simulations and at least one experimental data set. Kind regards Dezhong Yao, Daqing Gu, Xu Peng, Daniele Marinazzo and Pedro Valdes Sosa -- Daniele Marinazzo -- Department of Data Analysis Faculty of Psychology and Pedagogical Sciences, Gent University Henri Dunantlaan 1, B-9000 Gent, Belgium +32 (0) 9 264 6375 http://users.ugent.be/~dmarinaz/ http://helpdesk.ugent.be/e-maildisclaimer.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Aug 5 13:53:42 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 5 Aug 2014 13:53:42 +0200 Subject: [FieldTrip] repairing bad channels Message-ID: Dear all, I'm trying to repair the bad channels by using the ft_channelrepair function for 64 channels EEG data. I've set up the structure like this: load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); cfg_neighb.method = 'distance'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, data4); cfg = []; if strcmp('S004', dir_analysis{sub}) == 1 cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; end cfg.trials = 'all'; cfg.method = 'average'; cfg.neighbours = neighbours; cfg.elec = lay.pos; data5 = ft_channelrepair(cfg, data4); However, I get an error message: ttempt to reference field of non-structure array. Error in ft_datatype_sens (line 136) nchan = length(sens.label); Error in ft_checkconfig (line 246) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_preamble_trackconfig (line 38) cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); Error in ft_preamble (line 54) evalin('caller', ['ft_preamble_' cmd]); Error in ft_channelrepair (line 76) ft_preamble trackconfig Can someone please help me? Thank you very much! Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From edueeg at gmail.com Tue Aug 5 14:09:25 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Tue, 5 Aug 2014 13:09:25 +0100 Subject: [FieldTrip] fieldtrip workshop Message-ID: Hello, I would please like to know more about the course scheduled for September 17-19 in Birmingham UK, as announced at http://fieldtrip.fcdonders.nl/workshop/birmingham Specifically, I would like to know if the course is confirmed and how to apply Thank you very much eduardo schenberg -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Aug 5 14:10:59 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Aug 2014 14:10:59 +0200 Subject: [FieldTrip] repairing bad channels In-Reply-To: References: Message-ID: <53E0C9D3.9080508@donders.ru.nl> Hi Hweeling, reading the help of the function might help ;) > The EEG or MEG sensor positions can be present in the data or can be specified as > cfg.elec = structure with electrode positions, seeFT_DATATYPE_SENS > cfg.grad = structure with gradiometer definition, seeFT_DATATYPE_SENS > cfg.elecfile = name of file containing the electrode positions, seeFT_READ_SENS > cfg.gradfile = name of file containing the gradiometer definition, seeFT_READ_SENS The cross-reference to ft_datatype_sens should help you to resolve your issue (and check out the FieldTrip/template directory) Best, Jörn On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > Dear all, > > I'm trying to repair the bad channels by using the ft_channelrepair > function for 64 channels EEG data. > > I've set up the structure like this: > > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'distance'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data4); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.neighbours = neighbours; > cfg.elec = lay.pos; > data5 = ft_channelrepair(cfg, data4); > > However, I get an error message: > > ttempt to reference field of non-structure array. > Error in ft_datatype_sens (line 136) > nchan = length(sens.label); > Error in ft_checkconfig (line 246) > cfg.elec = ft_datatype_sens(cfg.elec); > Error in ft_preamble_trackconfig (line 38) > cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); > Error in ft_preamble (line 54) > evalin('caller', ['ft_preamble_' cmd]); > Error in ft_channelrepair (line 76) > ft_preamble trackconfig > > Can someone please help me? > > Thank you very much! > > Best regards, > Hweeling > > > > _______________________________________________ > 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 agreene24 at gmail.com Wed Aug 6 07:12:06 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 14:12:06 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? Message-ID: Hello, I'm somewhat new to ft, so forgive me if this is a seemingly trivial question. I ran runica on ft preprocessed MEG data, but I also want to see the frequency power spectrum of the components. I've tried using freqanalysis on the components in the following manner: comp.cfg.previous.tapsmofrq=4; comp.cfg.previous.foi=[0:2:30]; comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; comp.cfg.previous.toi=[-0.5:0.05:1.5]; comp.cfg.previous.channel='all'; [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) // but the errors I receive are as follows: Warning: Input arguments must be scalar. > In specest/private/ft_preproc_polyremoval at 57 In ft_specest_mtmfft at 66 In ft_freqanalysis at 526 ??? For colon operator with char operands, first and last operands must be char. Error in ==> ft_preproc_polyremoval at 58 for i = 0:order Error in ==> ft_specest_mtmfft at 66 dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); Error in ==> ft_freqanalysis at 526 [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', cfg.taper, options{:}, 'feedback', fbopt); // Is using freqanalysis on the components possible? If so, what needs to be modified in order to employ it? If not, is there another method to outputting the frequency power spectrum of ica components? Thanks, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Aug 6 09:07:38 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 6 Aug 2014 10:07:38 +0300 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Dear Ashly, I'm trying to recreate the error you got, but I couldn't. Did you specify the method? Try using comp.cfg.previous.method = 'mtmfft'; When I run ft_freqanalysis using the mtmfft method on the comp structure I get from the ICA tutorial, everything seems to work fine. Did you try running the same function on a tutorial structure? Best. Roey On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene wrote: > Hello, > > I'm somewhat new to ft, so forgive me if this is a seemingly trivial > question. > I ran runica on ft preprocessed MEG data, but I also want to see the > frequency power spectrum of the components. I've tried using freqanalysis > on the components in the following manner: > > > comp.cfg.previous.tapsmofrq=4; > comp.cfg.previous.foi=[0:2:30]; > comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; > comp.cfg.previous.toi=[-0.5:0.05:1.5]; > comp.cfg.previous.channel='all'; > > [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) > > > // but the errors I receive are as follows: > > > Warning: Input arguments must be scalar. > > In specest/private/ft_preproc_polyremoval at 57 > In ft_specest_mtmfft at 66 > In ft_freqanalysis at 526 > ??? For colon operator with char operands, first and last operands must be > char. > > Error in ==> ft_preproc_polyremoval at 58 > for i = 0:order > > Error in ==> ft_specest_mtmfft at 66 > dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); > > Error in ==> ft_freqanalysis at 526 > [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', > cfg.taper, options{:}, 'feedback', fbopt); > > // Is using freqanalysis on the components possible? If so, what needs to > be modified in order to employ it? If not, is there another method to > outputting the frequency power spectrum of ica components? > > Thanks, > > Ashley > > > > _______________________________________________ > 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 Aug 6 09:32:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 6 Aug 2014 09:32:34 +0200 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Hi Ashley, In addition to Roey's remark, in general I would say it is not a good idea to explicitly modify the xxx.cfg.previous structure. Just create a new cfg from scratch for each FT function call: cfg = []; cfg.method = 'mtmfft'; cfg.foi = .... etc. compfreq = ft_freqanalysis(cfg, comp); Best, Eelke On 6 August 2014 09:07, Roey Schurr wrote: > Dear Ashly, > > I'm trying to recreate the error you got, but I couldn't. > Did you specify the method? Try using > comp.cfg.previous.method = 'mtmfft'; > > When I run ft_freqanalysis using the mtmfft method on the comp structure I > get from the ICA tutorial, everything seems to work fine. Did you try > running the same function on a tutorial structure? > > Best. > Roey > > > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene wrote: >> >> Hello, >> >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial >> question. >> I ran runica on ft preprocessed MEG data, but I also want to see the >> frequency power spectrum of the components. I've tried using freqanalysis on >> the components in the following manner: >> >> >> comp.cfg.previous.tapsmofrq=4; >> comp.cfg.previous.foi=[0:2:30]; >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; >> comp.cfg.previous.channel='all'; >> >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) >> >> >> // but the errors I receive are as follows: >> >> >> Warning: Input arguments must be scalar. >> > In specest/private/ft_preproc_polyremoval at 57 >> In ft_specest_mtmfft at 66 >> In ft_freqanalysis at 526 >> ??? For colon operator with char operands, first and last operands must be >> char. >> >> Error in ==> ft_preproc_polyremoval at 58 >> for i = 0:order >> >> Error in ==> ft_specest_mtmfft at 66 >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); >> >> Error in ==> ft_freqanalysis at 526 >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', >> cfg.taper, options{:}, 'feedback', fbopt); >> >> // Is using freqanalysis on the components possible? If so, what needs to >> be modified in order to employ it? If not, is there another method to >> outputting the frequency power spectrum of ica components? >> >> Thanks, >> >> Ashley >> >> >> >> _______________________________________________ >> 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 agreene24 at gmail.com Wed Aug 6 10:11:10 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 17:11:10 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Hi Eelke, It worked fine once I just created a new cfg. It's always the small, overlooked things... Thanks!! Ashley On Wed, Aug 6, 2014 at 4:32 PM, Eelke Spaak wrote: > Hi Ashley, > > In addition to Roey's remark, in general I would say it is not a good > idea to explicitly modify the xxx.cfg.previous structure. Just create > a new cfg from scratch for each FT function call: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.foi = .... > etc. > > compfreq = ft_freqanalysis(cfg, comp); > > Best, > Eelke > > On 6 August 2014 09:07, Roey Schurr wrote: > > Dear Ashly, > > > > I'm trying to recreate the error you got, but I couldn't. > > Did you specify the method? Try using > > comp.cfg.previous.method = 'mtmfft'; > > > > When I run ft_freqanalysis using the mtmfft method on the comp structure > I > > get from the ICA tutorial, everything seems to work fine. Did you try > > running the same function on a tutorial structure? > > > > Best. > > Roey > > > > > > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene > wrote: > >> > >> Hello, > >> > >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial > >> question. > >> I ran runica on ft preprocessed MEG data, but I also want to see the > >> frequency power spectrum of the components. I've tried using > freqanalysis on > >> the components in the following manner: > >> > >> > >> comp.cfg.previous.tapsmofrq=4; > >> comp.cfg.previous.foi=[0:2:30]; > >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; > >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; > >> comp.cfg.previous.channel='all'; > >> > >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) > >> > >> > >> // but the errors I receive are as follows: > >> > >> > >> Warning: Input arguments must be scalar. > >> > In specest/private/ft_preproc_polyremoval at 57 > >> In ft_specest_mtmfft at 66 > >> In ft_freqanalysis at 526 > >> ??? For colon operator with char operands, first and last operands must > be > >> char. > >> > >> Error in ==> ft_preproc_polyremoval at 58 > >> for i = 0:order > >> > >> Error in ==> ft_specest_mtmfft at 66 > >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); > >> > >> Error in ==> ft_freqanalysis at 526 > >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', > >> cfg.taper, options{:}, 'feedback', fbopt); > >> > >> // Is using freqanalysis on the components possible? If so, what needs > to > >> be modified in order to employ it? If not, is there another method to > >> outputting the frequency power spectrum of ica components? > >> > >> Thanks, > >> > >> Ashley > >> > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agreene24 at gmail.com Wed Aug 6 10:12:06 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 17:12:06 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: And, also of course Roey, thank you as well Ashley On Wed, Aug 6, 2014 at 5:11 PM, Ashley Greene wrote: > Hi Eelke, > > It worked fine once I just created a new cfg. It's always the small, > overlooked things... > > Thanks!! > > Ashley > > > On Wed, Aug 6, 2014 at 4:32 PM, Eelke Spaak > wrote: > >> Hi Ashley, >> >> In addition to Roey's remark, in general I would say it is not a good >> idea to explicitly modify the xxx.cfg.previous structure. Just create >> a new cfg from scratch for each FT function call: >> >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.foi = .... >> etc. >> >> compfreq = ft_freqanalysis(cfg, comp); >> >> Best, >> Eelke >> >> On 6 August 2014 09:07, Roey Schurr wrote: >> > Dear Ashly, >> > >> > I'm trying to recreate the error you got, but I couldn't. >> > Did you specify the method? Try using >> > comp.cfg.previous.method = 'mtmfft'; >> > >> > When I run ft_freqanalysis using the mtmfft method on the comp >> structure I >> > get from the ICA tutorial, everything seems to work fine. Did you try >> > running the same function on a tutorial structure? >> > >> > Best. >> > Roey >> > >> > >> > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene >> wrote: >> >> >> >> Hello, >> >> >> >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial >> >> question. >> >> I ran runica on ft preprocessed MEG data, but I also want to see the >> >> frequency power spectrum of the components. I've tried using >> freqanalysis on >> >> the components in the following manner: >> >> >> >> >> >> comp.cfg.previous.tapsmofrq=4; >> >> comp.cfg.previous.foi=[0:2:30]; >> >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; >> >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; >> >> comp.cfg.previous.channel='all'; >> >> >> >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) >> >> >> >> >> >> // but the errors I receive are as follows: >> >> >> >> >> >> Warning: Input arguments must be scalar. >> >> > In specest/private/ft_preproc_polyremoval at 57 >> >> In ft_specest_mtmfft at 66 >> >> In ft_freqanalysis at 526 >> >> ??? For colon operator with char operands, first and last operands >> must be >> >> char. >> >> >> >> Error in ==> ft_preproc_polyremoval at 58 >> >> for i = 0:order >> >> >> >> Error in ==> ft_specest_mtmfft at 66 >> >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); >> >> >> >> Error in ==> ft_freqanalysis at 526 >> >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', >> >> cfg.taper, options{:}, 'feedback', fbopt); >> >> >> >> // Is using freqanalysis on the components possible? If so, what needs >> to >> >> be modified in order to employ it? If not, is there another method to >> >> outputting the frequency power spectrum of ica components? >> >> >> >> Thanks, >> >> >> >> Ashley >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Aug 6 14:12:28 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 6 Aug 2014 14:12:28 +0200 Subject: [FieldTrip] repairing bad channels In-Reply-To: <53E0C9D3.9080508@donders.ru.nl> References: <53E0C9D3.9080508@donders.ru.nl> Message-ID: Dear Jörn, Pardon my ignorance, however, I'm not exactly sure what you mean as I'm not an expert in matlab programming. I've checked the functions, but I still don't understand how I could resolve my issue. In addition, I checked on Easycap website, and find that the Montage 11 (or what the template directory called 'easycapM11.mat') is the closest fit to the cap that I used for the EEG recordings (At least that's what I gathered from their website). Could you please alternatively show me how you would do for repairing bad channels for the EEG data (an example)? Thank you. Cheers, Hweeling On 5 August 2014 14:10, "Jörn M. Horschig" wrote: > Hi Hweeling, > > reading the help of the function might help ;) > > The EEG or MEG sensor positions can be present in the data or can be >> specified as >> cfg.elec = structure with electrode positions, >> seeFT_DATATYPE_SENS > nl/reference/ft_datatype_sens> >> cfg.grad = structure with gradiometer definition, >> seeFT_DATATYPE_SENS > nl/reference/ft_datatype_sens> >> cfg.elecfile = name of file containing the electrode positions, >> seeFT_READ_SENS >> cfg.gradfile = name of file containing the gradiometer >> definition, seeFT_READ_SENS > nl/reference/ft_read_sens> >> > > The cross-reference to ft_datatype_sens should help you to resolve your > issue (and check out the FieldTrip/template directory) > > Best, > Jörn > > > > On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > >> Dear all, >> >> I'm trying to repair the bad channels by using the ft_channelrepair >> function for 64 channels EEG data. >> >> I've set up the structure like this: >> >> >> load('/home/leeh/Programs/fieldtrip-20140803/template/ >> layout/easycapM11.mat'); >> >> cfg_neighb.method = 'distance'; >> cfg_neighb.layout = lay; >> neighbours = ft_prepare_neighbours(cfg_neighb, data4); >> >> cfg = []; >> if strcmp('S004', dir_analysis{sub}) == 1 >> cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; >> end >> cfg.trials = 'all'; >> cfg.method = 'average'; >> cfg.neighbours = neighbours; >> cfg.elec = lay.pos; >> data5 = ft_channelrepair(cfg, data4); >> >> However, I get an error message: >> >> ttempt to reference field of non-structure array. >> Error in ft_datatype_sens (line 136) >> nchan = length(sens.label); >> Error in ft_checkconfig (line 246) >> cfg.elec = ft_datatype_sens(cfg.elec); >> Error in ft_preamble_trackconfig (line 38) >> cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); >> Error in ft_preamble (line 54) >> evalin('caller', ['ft_preamble_' cmd]); >> Error in ft_channelrepair (line 76) >> ft_preamble trackconfig >> >> Can someone please help me? >> >> Thank you very much! >> >> Best regards, >> Hweeling >> >> >> >> _______________________________________________ >> 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 > > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Aug 6 16:40:49 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Wed, 06 Aug 2014 16:40:49 +0200 Subject: [FieldTrip] Fwd: Re: repairing bad channels In-Reply-To: <53E22351.6080300@donders.ru.nl> References: <53E22351.6080300@donders.ru.nl> Message-ID: <53E23E71.1070005@donders.ru.nl> I forgot to include the mailing list in my response to Hweeling, my apologies for leaving you out ;) -------- Original Message -------- Subject: Re: [FieldTrip] repairing bad channels Date: Wed, 06 Aug 2014 14:45:05 +0200 From: "Jörn M. Horschig" Organization: Donders Institute for Brain, Cognition and Behaviour, Radboud University Nijmegen To: hweeling.lee at gmail.com Dear Hweeling, in FieldTrip/template there are different directories, one of the is 'elec'. The help that I copied in my last mail mentions that you can (should) define cfg.elec, which is a particular type of sensor-description (sens, thus ft_datatype_sens). The layout templates in the template/layout directory are layouts, not electrode positions, i.e. they are 2D projections of the electrodes optimized for visual inspections, topoplots, etc. There are three ways for you to go: 1) choose a template file from the 'elec' directory and specify cfg.elec or cfg.elecfile accordingly. The M11 cap is basically a 10-10 electrode cap, so you could use electrode positions from any 10-10 system as a template. 2) instead of specifying cfg.elec, you can specify cfg.layout and point to the layout file that you want to use (just like when calling a plotting function). FieldTrip will then extract the 2D positions and infer neighbours from that. 3) You can set cfg.method to 'template', which will load alreay pre-defined neighbours for your particular data, see http://fieldtrip.fcdonders.nl/template/neighbours Hope this helps and clarifies things :) Best, Jörn On 8/6/2014 2:12 PM, Hwee Ling Lee wrote: > Dear Jörn, > > Pardon my ignorance, however, I'm not exactly sure what you mean as > I'm not an expert in matlab programming. I've checked the functions, > but I still don't understand how I could resolve my issue. > > In addition, I checked on Easycap website, and find that the Montage > 11 (or what the template directory called 'easycapM11.mat') is the > closest fit to the cap that I used for the EEG recordings (At least > that's what I gathered from their website). > > Could you please alternatively show me how you would do for repairing > bad channels for the EEG data (an example)? > > Thank you. > > Cheers, > Hweeling > > > > On 5 August 2014 14:10, "Jörn M. Horschig" > wrote: > > Hi Hweeling, > > reading the help of the function might help ;) > > The EEG or MEG sensor positions can be present in the data > or can be specified as > cfg.elec = structure with electrode positions, > seeFT_DATATYPE_SENS > > cfg.grad = structure with gradiometer > definition, seeFT_DATATYPE_SENS > > cfg.elecfile = name of file containing the electrode > positions, seeFT_READ_SENS > > cfg.gradfile = name of file containing the > gradiometer definition, seeFT_READ_SENS > > > > The cross-reference to ft_datatype_sens should help you to resolve > your issue (and check out the FieldTrip/template directory) > > Best, > Jörn > > > > On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > > Dear all, > > I'm trying to repair the bad channels by using the > ft_channelrepair function for 64 channels EEG data. > > I've set up the structure like this: > > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'distance'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data4); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.neighbours = neighbours; > cfg.elec = lay.pos; > data5 = ft_channelrepair(cfg, data4); > > However, I get an error message: > > ttempt to reference field of non-structure array. > Error in ft_datatype_sens (line 136) > nchan = length(sens.label); > Error in ft_checkconfig (line 246) > cfg.elec = ft_datatype_sens(cfg.elec); > Error in ft_preamble_trackconfig (line 38) > cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); > Error in ft_preamble (line 54) > evalin('caller', ['ft_preamble_' cmd]); > Error in ft_channelrepair (line 76) > ft_preamble trackconfig > > Can someone please help me? > > Thank you very much! > > Best regards, > Hweeling > > > > _______________________________________________ > 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 > > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= -- 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 Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 6 22:46:05 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 6 Aug 2014 20:46:05 +0000 Subject: [FieldTrip] Crossing Segmentations Message-ID: Hello All, Thank you for the help. I looked at my surface images in free view and they are crossing. The crossing seems to be taking place between the the brain and inner skull crossing over outer skull and outer skin. I believe that this is because the data that we have only goes down so far in the original mr images (Below). And when the individual surfaces are created they cross towards the posterior part of the head (Next Image). I attached the surfaces just in case to allow you to see. Would it be possible to extend outer skull and skin when using freesurfer, or get around this some other way. And lastly we are getting a very bumpy skin (Last Photo). Will this be a problem when creating the head model, finding the lead field matrix, etc. with MNE because the crossing sections prevent me from proceeding? Isaiah [cid:25735CD5-80A7-45EE-A539-AE0A4415EF42 at host.ucla.edu][cid:F69DE3BB-8642-475B-A56C-693438F83929 at host.ucla.edu][cid:BBA7098A-DBA4-4161-AA9D-1F3B08646948 at host.ucla.edu] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.13.20 PM.png Type: image/png Size: 62870 bytes Desc: Screen Shot 2014-08-06 at 1.13.20 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.25.14 PM.png Type: image/png Size: 154778 bytes Desc: Screen Shot 2014-08-06 at 1.25.14 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.28.46 PM.png Type: image/png Size: 124960 bytes Desc: Screen Shot 2014-08-06 at 1.28.46 PM.png URL: From pierre.megevand at gmail.com Thu Aug 7 23:16:51 2014 From: pierre.megevand at gmail.com (=?UTF-8?Q?Pierre_M=C3=A9gevand?=) Date: Thu, 7 Aug 2014 17:16:51 -0400 Subject: [FieldTrip] Post-doctoral position in cognitive neurophysiology/epilepsy Message-ID: The Laboratory for Multimodal Human Brain Mapping, at New York’s Feinstein Institute for Medical Research, has an immediate opening for a postdoctoral fellow with interests in epilepsy, cognitive neuroscience, and functional connectivity. The lab uses human intracranial EEG, direct electrical stimulation of the brain, and functional MRI to study: (1) neural mechanisms of cognitive abilities such as attention, visual processing, and language; (2) extent and dynamics of macroscale functional networks in the human brain; (3) how to improve the identification of functional and pathological brain regions in individuals suffering from epilepsy. The fellow will be involved in all aspects of experimental design, data collection and analysis, and publication of research. In addition, they will have extensive opportunities for work with colleagues in collaborating groups, including researchers at Columbia University, Albert Einstein College of Medicine, Child Mind Institute, and Nathan Kline Institute (all in New York), and the Weizmann Institute of Science in Israel. Candidates should have a background in at least one of the major techniques used in the lab: neurophysiology (EEG/MEG), neuroimaging (structural and functional MRI), or brain stimulation (direct electrical stimulation, TMS, tDCS/ACS). Additional experience in another of these techniques would be a plus. Strong programming skills (especially in the MATLAB environment) are required. Candidates with Ph.D. and/or M.D. degrees are welcome to apply. For more information about the lab, please visit: http://www.feinsteininstitute.org/faculty/ashesh-mehta-md-phd/ Interested candidates should submit CV and brief statement of interest to Dr. Ashesh Mehta at amehta at nshs.edu. From e.caspar at ucl.ac.uk Sat Aug 9 09:31:05 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sat, 9 Aug 2014 07:31:05 +0000 Subject: [FieldTrip] High-pass filter - 0.1 Message-ID: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sun Aug 10 10:01:00 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 10 Aug 2014 10:01:00 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser Message-ID: Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? Best Katrin Hi Alik, Using cfg.plotlabels = 'some', only plots several of the channel labels. Leaving it empty, or setting it to 'yes', will show all labels, is that what you intended? Additionally, right now we cannot guarantee compatibility with matlab R2012b onwards due to low level changes in several MathWorks functions. Please use a version older dan R2013a. Cheers, Roemer On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: >* I have pounded on this one from a few different angles and even gone and *>* looked at the source, and still can't quite figure out what I'm doing wrong. *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying *>* to do is load it up and inspect the data a bit to get a sense of how badly *>* artifacted it is. So: *>>* %%%%%% *>>* cfg = []; *>* cfg.blocksize = 30; % num of seconds to display at once *>* cfg.continuous = 'yes'; % not yet cut into trials *>* cfg.plotlabels = 'some'; *>* cfg.viewmode = 'vertical'; *>* cfg.colorgroups = 'chantype'; *>>* cfg.dataset = [DataDir filesep EEGFile]; *>* cfg.channel = {'EEG'}; *>>* ft_databrowser(cfg) *>>>* %%%%%% *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no *>* triggers or EOG), 30 second segments at a time. What it does *not* do is *>* label the channels along the y-axis so that I can readily tell which one is *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is *>* supposed to do, and yet, it does not. I've also tried doing this as *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label *>* contains the correct channel names, and that *still* doesn't work. *>>* I'm aware that this was marked as a bug before, but bugzilla shows it *>* closed long ago, before r7276 that I'm using I believe. *>>* MATLAB r2013a on OS X, if it matters. *>>* Am I simply misunderstanding what this cfg argument does or how to use it? *>>>* Alik Widge, MD, PhD *>* alik.widge at gmail.com *>* (206) 866-5435 *>>>* _______________________________________________ *>* fieldtrip mailing list *>* fieldtrip at donders.ru.nl *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip *> -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Sun Aug 10 15:18:42 2014 From: alik.widge at gmail.com (Alik Widge) Date: Sun, 10 Aug 2014 09:18:42 -0400 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: References: Message-ID: Not that I've heard, and it's still driving me a little bit nuts. Guys, I know that this is because I don't use old MATLAB, but it is going towards the end of 2014. 2012b and older are really not available for a lot of us, especially since our university licenses often force us onto newer versions. Any chance of a fix? Alik On Sunday, August 10, 2014, KatrinH Heimann wrote: > Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? > > Best > > Katrin > > > Hi Alik, > > Using cfg.plotlabels = 'some', only plots several of the channel labels. > Leaving it empty, or setting it to 'yes', will show all labels, is that > what you intended? > > Additionally, right now we cannot guarantee compatibility with matlab > R2012b onwards due to low level changes in several MathWorks functions. > Please use a version older dan R2013a. > > Cheers, > Roemer > > > On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: > > >* I have pounded on this one from a few different angles and even gone and > *>* looked at the source, and still can't quite figure out what I'm doing wrong. > *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying > *>* to do is load it up and inspect the data a bit to get a sense of how badly > *>* artifacted it is. So: > *>>* %%%%%% > *>>* cfg = []; > *>* cfg.blocksize = 30; % num of seconds to display at once > *>* cfg.continuous = 'yes'; % not yet cut into trials > *>* cfg.plotlabels = 'some'; > *>* cfg.viewmode = 'vertical'; > *>* cfg.colorgroups = 'chantype'; > *>>* cfg.dataset = [DataDir filesep EEGFile]; > *>* cfg.channel = {'EEG'}; > *>>* ft_databrowser(cfg) > *>>>* %%%%%% > *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no > *>* triggers or EOG), 30 second segments at a time. What it does *not* do is > *>* label the channels along the y-axis so that I can readily tell which one is > *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is > *>* supposed to do, and yet, it does not. I've also tried doing this as > *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label > *>* contains the correct channel names, and that *still* doesn't work. > *>>* I'm aware that this was marked as a bug before, but bugzilla shows it > *>* closed long ago, before r7276 that I'm using I believe. > *>>* MATLAB r2013a on OS X, if it matters. > *>>* Am I simply misunderstanding what this cfg argument does or how to use it? > *>>>* Alik Widge, MD, PhD > *>* alik.widge at gmail.com > *>* (206) 866-5435 > *>>>* _______________________________________________ > *>* fieldtrip mailing list > *>* fieldtrip at donders.ru.nl > *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > *> > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail: r.vandermeij at donders.ru.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > -- Sent from Gmail Mobile; apologies for the brevity -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Aug 11 12:43:27 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 11 Aug 2014 12:43:27 +0200 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Message-ID: Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie wrote: > Dear Fieldtrip members, > > I would like to apply to my data a bandpass filter from 0.016 (or at least > 0.1) to 30 Hz > > bpfilterRange = [.1 30]; > > However, it seems that Fieltrip doesn't accept small high-pass filter > values. I have the following mistake : > > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, > which is quite high. > > I wonder if the problem comes from my data (but I had no problems on others > programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? > > Thank in advance, > > Emilie > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Spachtholz at psy.lmu.de Tue Aug 12 10:46:35 2014 From: Spachtholz at psy.lmu.de (Philipp Spachtholz) Date: Tue, 12 Aug 2014 10:46:35 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: References: Message-ID: <53E9D46B.7060200@psy.lmu.de> Dear Katrin, I had the same problem. This is what worked for me: Apparently, at least in my case, the channel labels not showing up in the databrowser resulted from are wrong specification of the fontsize in ft_databrowser. You have to locate the line that corresponds to your viewmode ('component' in my case, around line 1715) and replace the 'FontSize', 18 to a relative value, e.g 0.02, so that the call to plotting the text looks like this: ft_plot_text(labelx(laysel), labely(laysel), opt.hdr.label(chanindx(i)), 'tag', 'chanlabel', 'HorizontalAlignment', 'right','interpreter','none','FontUnits','normalized','FontSize',0.02,'FontName', 'Arial'); I am very unsure about wether this works for other MATLAB versions but you can give it a try. Just make sure to make a backup of the ft_databrowser before you make any changes there. Best Philipp Am 8/10/2014 3:18 PM, schrieb Alik Widge: > Not that I've heard, and it's still driving me a little bit nuts. > Guys, I know that this is because I don't use old MATLAB, but it is > going towards the end of 2014. 2012b and older are really not > available for a lot of us, especially since our university licenses > often force us onto newer versions. Any chance of a fix? > > Alik > > On Sunday, August 10, 2014, KatrinH Heimann > wrote: > > Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? > > Best > > Katrin > > Hi Alik, > > Using cfg.plotlabels = 'some', only plots several of the channel labels. > Leaving it empty, or setting it to 'yes', will show all labels, is that > what you intended? > > Additionally, right now we cannot guarantee compatibility with matlab > R2012b onwards due to low level changes in several MathWorks functions. > Please use a version older dan R2013a. > > Cheers, > Roemer > > > On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: > > >/ I have pounded on this one from a few different angles and even gone and > />/ looked at the source, and still can't quite figure out what I'm doing wrong. > />/ > />/ I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying > />/ to do is load it up and inspect the data a bit to get a sense of how badly > />/ artifacted it is. So: > />/ > />/ %%%%%% > />/ > />/ cfg = []; > />/ cfg.blocksize = 30; % num of seconds to display at once > />/ cfg.continuous = 'yes'; % not yet cut into trials > />/ cfg.plotlabels = 'some'; > />/ cfg.viewmode = 'vertical'; > />/ cfg.colorgroups = 'chantype'; > />/ > />/ cfg.dataset = [DataDir filesep EEGFile]; > />/ cfg.channel = {'EEG'}; > />/ > />/ ft_databrowser(cfg) > />/ > />/ > />/ %%%%%% > />/ > />/ This does 90% of what it ought to do -- it shows me the EEG channels (no > />/ triggers or EOG), 30 second segments at a time. What it does *not* do is > />/ label the channels along the y-axis so that I can readily tell which one is > />/ Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is > />/ supposed to do, and yet, it does not. I've also tried doing this as > />/ ft_databrowser(cfg,data), where I explicitly make sure that data.label > />/ contains the correct channel names, and that *still* doesn't work. > />/ > />/ I'm aware that this was marked as a bug before, but bugzilla shows it > />/ closed long ago, before r7276 that I'm using I believe. > />/ > />/ MATLAB r2013a on OS X, if it matters. > />/ > />/ Am I simply misunderstanding what this cfg argument does or how to use it? > />/ > />/ > />/ Alik Widge, MD, PhD > />/ alik.widge at gmail.com > />/ (206) 866-5435 > />/ > />/ > />/ _______________________________________________ > />/ fieldtrip mailing list > />/ fieldtrip at donders.ru.nl > />/ http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > />/ > / > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail:r.vandermeij at donders.ru.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > > > -- > Sent from Gmail Mobile; apologies for the brevity > > > _______________________________________________ > 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 Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 13 00:47:30 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Tue, 12 Aug 2014 22:47:30 +0000 Subject: [FieldTrip] Volume Conduction Models Message-ID: Hello, I am having a problem with my conduction models. [cid:72261DB6-9B5F-4784-B6EB-6D0E2E491F33 at host.ucla.edu] [cid:9595825F-C607-4946-9F35-A012A9A990B6 at host.ucla.edu][cid:8A2A417B-F1DB-4369-A690-FC5B059B6B42 at host.ucla.edu] I have tried to change the parameters at various times. Does anyone have an idea on how to fix this problem. The MRIs have nothing below the nose, as well as nothing above the head. Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.30 PM.png Type: image/png Size: 134746 bytes Desc: Screen Shot 2014-08-12 at 3.42.30 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.40 PM.png Type: image/png Size: 133318 bytes Desc: Screen Shot 2014-08-12 at 3.42.40 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.58 PM.png Type: image/png Size: 132607 bytes Desc: Screen Shot 2014-08-12 at 3.42.58 PM.png URL: From hweeling.lee at gmail.com Wed Aug 13 10:43:22 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 13 Aug 2014 10:43:22 +0200 Subject: [FieldTrip] Question regarding coherence statistics Message-ID: Dear all, I refer to a previous post regarding 'question about coherenece statistics for group analysis related to J. Neuroscience 2011 and Science 2005 (both papers by Jan-Mathijs Schoffelen). I tried to follow the suggestions regarding the comparison of coherence for two conditions. This is what I set up for my case: cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; (there are 60 EEG channels in this case). cfg.channelcmb = {cfg.channel, cfg.channel}; freq1 = ft_connectivityanalysis(cfg, cond1); %this is done for 5 subjects separately freq2 = ft_connectivityanalysis(cfg, cond2); %this is done for 5 subjects separately freq1 = atanh(freq1.cohspctrm) - atanh(freq2.cohspctrm); %this is done for 5 subjects separately freq2.cohspctrm(:) = 0; %this is done for 5 subjects separately cfg = []; cfg.layout = 'EEG1010.lay'; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.alpha = 0.05; cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; cfg.avgoverfreq = 'yes'; cfg.frequency = [2 4]; % this will be performed for different frequency bands [prec200_delta_stat] = ft_freqstatistics(cfg, sub01_freq1, sub02_freq1, sub03_freq1, sub04_freq1, sub05_freq1, sub01_freq2, sub02_freq2, sub03_freq2, sub04_freq2, sub05_freq2); However, when I tried to run this script, I get an error message: Reference to non-existent field 'label'. Error in ft_freqstatistics (line 131) haschan(i) = ~isempty(strfind(varargin{i}.dimord, 'chan')) ... Can someone please help? Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Wed Aug 13 17:16:57 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 17:16:57 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: <53E9D46B.7060200@psy.lmu.de> References: <53E9D46B.7060200@psy.lmu.de> Message-ID: Philipp! You made my day! This works perfectly!!! Thanks a million! k 2014-08-12 10:46 GMT+02:00 Philipp Spachtholz : > Dear Katrin, > > I had the same problem. This is what worked for me: > > Apparently, at least in my case, the channel labels not showing up in the > databrowser resulted > from are wrong specification of the fontsize in ft_databrowser. > > You have to locate the line that corresponds to your viewmode ('component' > in my case, around line 1715) > and replace the > > 'FontSize', 18 to a relative value, e.g 0.02, so that the call to plotting > the text looks like this: > > ft_plot_text(labelx(laysel), labely(laysel), opt.hdr.label(chanindx(i)), > 'tag', 'chanlabel', 'HorizontalAlignment', > 'right','interpreter','none','FontUnits','normalized','FontSize',0.02,'FontName', > 'Arial'); > > I am very unsure about wether this works for other MATLAB versions but you > can give it a try. > Just make sure to make a backup of the ft_databrowser before you make any > changes there. > > Best > > Philipp > > > > Am 8/10/2014 3:18 PM, schrieb Alik Widge: > > Not that I've heard, and it's still driving me a little bit nuts. > Guys, I know that this is because I don't use old MATLAB, but it is going > towards the end of 2014. 2012b and older are really not available for a lot > of us, especially since our university licenses often force us onto newer > versions. Any chance of a fix? > > Alik > > On Sunday, August 10, 2014, KatrinH Heimann > wrote: > >> Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? >> >> Best >> >> Katrin >> >> Hi Alik, >> >> Using cfg.plotlabels = 'some', only plots several of the channel labels. >> Leaving it empty, or setting it to 'yes', will show all labels, is that >> what you intended? >> >> Additionally, right now we cannot guarantee compatibility with matlab >> R2012b onwards due to low level changes in several MathWorks functions. >> Please use a version older dan R2013a. >> >> Cheers, >> Roemer >> >> >> On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: >> >> >* I have pounded on this one from a few different angles and even gone and >> *>* looked at the source, and still can't quite figure out what I'm doing wrong. >> *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying >> *>* to do is load it up and inspect the data a bit to get a sense of how badly >> *>* artifacted it is. So: >> *>>* %%%%%% >> *>>* cfg = []; >> *>* cfg.blocksize = 30; % num of seconds to display at once >> *>* cfg.continuous = 'yes'; % not yet cut into trials >> *>* cfg.plotlabels = 'some'; >> *>* cfg.viewmode = 'vertical'; >> *>* cfg.colorgroups = 'chantype'; >> *>>* cfg.dataset = [DataDir filesep EEGFile]; >> *>* cfg.channel = {'EEG'}; >> *>>* ft_databrowser(cfg) >> *>>>* %%%%%% >> *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no >> *>* triggers or EOG), 30 second segments at a time. What it does *not* do is >> *>* label the channels along the y-axis so that I can readily tell which one is >> *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is >> *>* supposed to do, and yet, it does not. I've also tried doing this as >> *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label >> *>* contains the correct channel names, and that *still* doesn't work. >> *>>* I'm aware that this was marked as a bug before, but bugzilla shows it >> *>* closed long ago, before r7276 that I'm using I believe. >> *>>* MATLAB r2013a on OS X, if it matters. >> *>>* Am I simply misunderstanding what this cfg argument does or how to use it? >> *>>>* Alik Widge, MD, PhD >> *>* alik.widge at gmail.com >> *>* (206) 866-5435 <%28206%29%20866-5435> >> *>>>* _______________________________________________ >> *>* fieldtrip mailing list >> *>* fieldtrip at donders.ru.nl >> *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> *> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> > > -- > Sent from Gmail Mobile; apologies for the brevity > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 katrinheimann at gmail.com Wed Aug 13 19:22:41 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 19:22:41 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all Message-ID: Dear all. I am trying to replace bad channels. This is my code (very basic I think):%% Preparing neighbours for channel repair cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {}; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) I do not get any error but fieldtrip even tells me that the interpolation worked. However I do not see ANY trace of it in my data when inspecting it afterwards. I also tried to change the method (to average) - no change. Anybody who can help me with that? Thanks a million Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 13 21:55:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 13 Aug 2014 21:55:30 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Katrin, Have you tried putting the labels of the channels you want interpolated into the cfg.badchannel array? Best, Eelke Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : > Dear all. I am trying to replace bad channels. > This is my code (very basic I think):%% Preparing neighbours for channel > repair > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > I do not get any error but fieldtrip even tells me that the interpolation > worked. However I do not see ANY trace of it in my data when inspecting it > afterwards. I also tried to change the method (to average) - no change. > Anybody who can help me with that? > Thanks a million > Katrin > > > > _______________________________________________ > 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 katrinheimann at gmail.com Wed Aug 13 22:12:44 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 22:12:44 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Eelke, yes, sure, sorry, I did that. No effect. 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > Dear Katrin, > > Have you tried putting the labels of the channels you want interpolated > into the cfg.badchannel array? > > Best, > Eelke > Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : > >> Dear all. I am trying to replace bad channels. >> This is my code (very basic I think):%% Preparing neighbours for channel >> repair >> >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> % Interpolate and put into new data structure >> >> cfg = []; >> >> cfg.badchannel = {}; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.method = 'nearest'; >> >> cfg.neighbours = neighbours; >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> I do not get any error but fieldtrip even tells me that the interpolation >> worked. However I do not see ANY trace of it in my data when inspecting it >> afterwards. I also tried to change the method (to average) - no change. >> Anybody who can help me with that? >> Thanks a million >> Katrin >> >> >> >> _______________________________________________ >> 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 katrinheimann at gmail.com Thu Aug 14 08:25:09 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 14 Aug 2014 08:25:09 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis Message-ID: Dear all, I am sorry I have another silly problem. I try to create the cell array for a within-analysis. I am using the following code to load the single subject structs and put them in an array calles all90. load ('ERP_AnnaLisa13obs90_ERP.mat') all90(1,:) = obs90_data_ERP load ('ERP_Benedetta23obs90_ERP.mat') all90(2,:) = obs90_data_ERP Unfortunately the result is a struct array. I can convert it to a cell by struct2cell but then fieldtrip does not recognise it as ERP data anymore as the labels inside of the struct disappear. Anybody who can help? k -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 14 08:54:41 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Aug 2014 08:54:41 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Hi Katrin, Try using curly braces {} to index your cell arrays when you want to access or change their content. The parentheses index the elements of the cell array (which are themselves cells, just like elements of double arrays are doubles). Curly braces index the *contents* of these cells. The following blog post might be helpful for you: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . Best, Eelke On 14 August 2014 08:25, KatrinH Heimann wrote: > Dear all, > I am sorry I have another silly problem. I try to create the cell array for > a within-analysis. > > I am using the following code to load the single subject structs and put > them in an array calles all90. > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90(1,:) = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90(2,:) = obs90_data_ERP > > > Unfortunately the result is a struct array. I can convert it to a cell by > struct2cell but then fieldtrip does not recognise it as ERP data anymore as > the labels inside of the struct disappear. Anybody who can help? > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nick.peatfield at gmail.com Thu Aug 14 08:56:13 2014 From: nick.peatfield at gmail.com (Nicholas A. Peatfield) Date: Thu, 14 Aug 2014 08:56:13 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Dear Katrin, The problem I can see here is that you are not indexing the data like you should with a cell. For that you have to use the curly brackets, for example: load ('ERP_AnnaLisa13obs90_ERP.mat') all90{1} = obs90_data_ERP load ('ERP_Benedetta23obs90_ERP.mat') all90{2} = obs90_data_ERP Cheers, Nick On 14 August 2014 08:25, KatrinH Heimann wrote: > Dear all, > I am sorry I have another silly problem. I try to create the cell array > for a within-analysis. > > I am using the following code to load the single subject structs and put > them in an array calles all90. > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90(1,:) = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90(2,:) = obs90_data_ERP > > Unfortunately the result is a struct array. I can convert it to a cell by > struct2cell but then fieldtrip does not recognise it as ERP data anymore as > the labels inside of the struct disappear. Anybody who can help? > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Nicholas Peatfield, PhD Centro Interdipartimentale Mente/Cervello- CIMEC Assegnista di ricerca - Research Fellow Via delle Regole, 101 - 38060 Mattarello +39 0461 283086 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 14 08:57:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Aug 2014 08:57:38 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: OK just checking :) In that case, could you post a small snippet of data and the actual cfg you used (including which channels to repair) on e.g. dropbox or so? Then I can have a look. Best, Eelke On 13 August 2014 22:12, KatrinH Heimann wrote: > Dear Eelke, yes, sure, sorry, I did that. No effect. > > > 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> Dear Katrin, >> >> Have you tried putting the labels of the channels you want interpolated >> into the cfg.badchannel array? >> >> Best, >> Eelke >> >> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : >>> >>> Dear all. I am trying to replace bad channels. >>> This is my code (very basic I think):%% Preparing neighbours for channel >>> repair >>> >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> % Interpolate and put into new data structure >>> >>> cfg = []; >>> >>> cfg.badchannel = {}; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.method = 'nearest'; >>> >>> cfg.neighbours = neighbours; >>> >>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >>> >>> I do not get any error but fieldtrip even tells me that the interpolation >>> worked. However I do not see ANY trace of it in my data when inspecting it >>> afterwards. I also tried to change the method (to average) - no change. >>> Anybody who can help me with that? >>> Thanks a million >>> Katrin >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From k.kessler at aston.ac.uk Thu Aug 14 10:18:44 2014 From: k.kessler at aston.ac.uk (Kessler, Klaus) Date: Thu, 14 Aug 2014 08:18:44 +0000 Subject: [FieldTrip] PhD scholarship at the Aston Brain Centre (Birmingham, UK) Message-ID: Dear Fieldtrippers We would be grateful if you could disseminate this fully funded PhD opportunity (for UK and EU students) to potential candidates. It will mainly involve MEG recordings and analysis in attention paradigms where participants switch between "space and time". For the final year we have also planned an EEG study in a driving simulator. The PhD is funded in part by the Aston Brain Centre (within the School of Life and Health Sciences) and in part by the Rees Jeffreys Road Fund. If this sounds interesting to you, please follow the link below for applying and/or get in touch by email to learn more. http://www.findaphd.com/search/ProjectDetails.aspx?PJID=56302 Thanks Klaus __________________________ Professor Klaus Kessler Aston Brain Centre School of Life and Health Sciences Aston University Aston Triangle Birmingham, B4 7ET Phone: +44 (0)121 204 3187 Email: k.kessler at aston.ac.uk __________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Thu Aug 14 12:19:39 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 14 Aug 2014 12:19:39 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Thanks Eelke and Nick, that worked of course :) k 2014-08-14 8:56 GMT+02:00 Nicholas A. Peatfield : > Dear Katrin, > > The problem I can see here is that you are not indexing the data like you > should with a cell. For that you have to use the curly brackets, for > example: > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90{1} = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90{2} = obs90_data_ERP > > Cheers, > > Nick > > > On 14 August 2014 08:25, KatrinH Heimann wrote: > >> Dear all, >> I am sorry I have another silly problem. I try to create the cell array >> for a within-analysis. >> >> I am using the following code to load the single subject structs and put >> them in an array calles all90. >> >> load ('ERP_AnnaLisa13obs90_ERP.mat') >> >> all90(1,:) = obs90_data_ERP >> >> load ('ERP_Benedetta23obs90_ERP.mat') >> >> all90(2,:) = obs90_data_ERP >> >> Unfortunately the result is a struct array. I can convert it to a cell by >> struct2cell but then fieldtrip does not recognise it as ERP data anymore as >> the labels inside of the struct disappear. Anybody who can help? >> k >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Nicholas Peatfield, PhD > Centro Interdipartimentale Mente/Cervello- CIMEC > > Assegnista di ricerca - Research Fellow > Via delle Regole, 101 - 38060 Mattarello > +39 0461 283086 > > _______________________________________________ > 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 katrinheimann at gmail.com Sun Aug 17 11:23:20 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 17 Aug 2014 11:23:20 +0200 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? Message-ID: Dear all I still have problem with the channel interpolation (just not working at all, without error message, see my previous post). Now I am thinking if I just remove the bad channels for the single subjects and leave it like that. My question is though: Will this create problems for my Grand average over subjects later (as in each subject I remove different channels)? and which layout do I have to use to plot my Grand average data later? Every help is very welcome Cheers k -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Aug 18 08:58:15 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Aug 2014 08:58:15 +0200 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? In-Reply-To: References: Message-ID: Dear Kathrin, Re your previous post about repairing bad channels, I've also tried this on Fieldtrip and it works for me. I've not used the triangulation method, but maybe you could try again. I guess it depends on your template. For me, I was using Easycap 64 channels, but maybe it's different for you. Here's how I set up my repair channels options: % repairing bad channels with averaged of its neighbours load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, data2); cfg = []; if strcmp('S004', dir_analysis{sub}) == 1 cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; end cfg.trials = 'all'; cfg.method = 'average'; cfg.layout = lay; cfg.neighbours = neighbours; data3 = ft_channelrepair(cfg, data2); Re removing bad channels. Your question regarding if this will create problems for your grand average over subjects later. Well, it depends which channels you remove for individual subjects. As far as I'm aware, when you averaged your data across subjects, it will only pick the common channels across subjects for the statistical analyses. When you plot, you can always call for the template layout (e.g. 'EEG1020.lay'). This will plot the available channels across all subjects, and leave out the ones that are not in the data. I hope this helps. Cheers, Hweeling On 17 August 2014 11:23, KatrinH Heimann wrote: > Dear all > I still have problem with the channel interpolation (just not working at > all, without error message, see my previous post). Now I am thinking if I > just remove the bad channels for the single subjects and leave it like > that. My question is though: Will this create problems for my Grand average > over subjects later (as in each subject I remove different channels)? and > which layout do I have to use to plot my Grand average data later? > Every help is very welcome > Cheers > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Aug 18 10:18:46 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 18 Aug 2014 10:18:46 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Katrin, When I look at the data you've shown me, in fact I do see an effect of ft_channelrepair. I run your code: load ('ERP_Francesca17obs90_clean.mat') %% Preparing neighbours for channel repair cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {'E49', 'E68'}; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); followed by: dat1=obs90_data_clean2; dat2=obs90_data_channelrepaired; x=dat1.trial{1}(68,:); % 68 is channel index of E68 y=dat2.trial{1}(68,:); plot(x);hold on;plot(y,'r'); x=dat1.trial{1}(49,:); y=dat2.trial{1}(49,:); figure; plot(x);hold on;plot(y,'r') and the two figures that come up are shown in the attachments. The original (blue) and channel-repaired (red) traces are clearly different. These plots are for trial 1, but the same result holds when I plot a different trial. Does it work on your end too now? Best, Eelke On 14 August 2014 08:57, Eelke Spaak wrote: > OK just checking :) In that case, could you post a small snippet of > data and the actual cfg you used (including which channels to repair) > on e.g. dropbox or so? Then I can have a look. > > Best, > Eelke > > On 13 August 2014 22:12, KatrinH Heimann wrote: >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : >> >>> Dear Katrin, >>> >>> Have you tried putting the labels of the channels you want interpolated >>> into the cfg.badchannel array? >>> >>> Best, >>> Eelke >>> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : >>>> >>>> Dear all. I am trying to replace bad channels. >>>> This is my code (very basic I think):%% Preparing neighbours for channel >>>> repair >>>> >>>> >>>> >>>> cfg_neighb = []; >>>> >>>> cfg_neighb.feedback = 'yes'; >>>> >>>> cfg_neighb.method = 'triangulation'; >>>> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>> >>>> >>>> >>>> % Interpolate and put into new data structure >>>> >>>> cfg = []; >>>> >>>> cfg.badchannel = {}; >>>> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> cfg.method = 'nearest'; >>>> >>>> cfg.neighbours = neighbours; >>>> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>>> >>>> >>>> I do not get any error but fieldtrip even tells me that the interpolation >>>> worked. However I do not see ANY trace of it in my data when inspecting it >>>> afterwards. I also tried to change the method (to average) - no change. >>>> Anybody who can help me with that? >>>> Thanks a million >>>> Katrin >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 -------------- A non-text attachment was scrubbed... Name: E68.png Type: image/png Size: 10268 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: E49.png Type: image/png Size: 11130 bytes Desc: not available URL: From hweeling.lee at gmail.com Mon Aug 18 12:08:08 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Aug 2014 12:08:08 +0200 Subject: [FieldTrip] Question regarding coherence statistics and viewing of results Message-ID: Dear all, I've previously posted this question however, I did not get any replies. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' variable that would allow me to perform cluster-based statistical analyses. However, I was not sure how I could plot the results. I get an error message from Fieldtrip: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); Also, according to the paper by Maris et al., 2007 'Nonparametric statistical testing of coherence differences', the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, I would really appreciate if someone can help me how to make such a plot. Thank you very much. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Mon Aug 18 19:26:19 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 18 Aug 2014 13:26:19 -0400 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? In-Reply-To: References: Message-ID: Hi Kathrin, I like having my data saved before (I can apply a montage later) and after repairing channels. As Hweeling suggests, you will have difficulty grand averaging if the channel of interest is missing from one of your subjects. I no longer have your original post and apologize if I am repeating suggestions from others. Did you review and display your neighbors before repairing channels? Are you sure your channels had neighbors? I've used this function for years - when I switched EEG systems, I was unaware of the change in units, and ran into the same problem you are having. I think you are best off understanding why ft_channelrepair isn't working. I also found it helpful to have the ft_default settings provide me with feedback: ft_default.trackconfig = 'report'; ft_default.checkconfig = 'pendantic'; Hopefully my suggestions help you determine what's going on. If not, I could review your neighbors, and data structure. Best, Raquel On Mon, Aug 18, 2014 at 2:58 AM, Hwee Ling Lee wrote: > Dear Kathrin, > > Re your previous post about repairing bad channels, I've also tried this > on Fieldtrip and it works for me. I've not used the triangulation method, > but maybe you could try again. I guess it depends on your template. For me, > I was using Easycap 64 channels, but maybe it's different for you. Here's > how I set up my repair channels options: > > % repairing bad channels with averaged of its neighbours > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'template'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data2); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.layout = lay; > cfg.neighbours = neighbours; > data3 = ft_channelrepair(cfg, data2); > > Re removing bad channels. Your question regarding if this will create > problems for your grand average over subjects later. Well, it depends which > channels you remove for individual subjects. As far as I'm aware, when you > averaged your data across subjects, it will only pick the common channels > across subjects for the statistical analyses. When you plot, you can always > call for the template layout (e.g. 'EEG1020.lay'). This will plot the > available channels across all subjects, and leave out the ones that are not > in the data. > > I hope this helps. > > Cheers, > Hweeling > > > > On 17 August 2014 11:23, KatrinH Heimann wrote: > >> Dear all >> I still have problem with the channel interpolation (just not working at >> all, without error message, see my previous post). Now I am thinking if I >> just remove the bad channels for the single subjects and leave it like >> that. My question is though: Will this create problems for my Grand average >> over subjects later (as in each subject I remove different channels)? and >> which layout do I have to use to plot my Grand average data later? >> Every help is very welcome >> Cheers >> k >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > > _______________________________________________ > 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 jingfan.jf at gmail.com Mon Aug 18 21:05:02 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 18 Aug 2014 14:05:02 -0500 Subject: [FieldTrip] undefined function or variable 'abort' error when trying to run ft_definetrial(cfg) Message-ID: <010701cfbb17$51471a90$f3d54fb0$@gmail.com> Hi there, I am new to fieldtrip. I am trying the trigger-based trial selection tutorial. An error occurs when running cfg = ft_definetrial(cfg). In ft_preamble function, I couldn't find where abort is defined. I appreciate any help! Best, Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Mon Aug 18 23:52:38 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Mon, 18 Aug 2014 21:52:38 +0000 Subject: [FieldTrip] Aligning Electrodes Message-ID: Hello, I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. mri = ft_read_mri('Subject01.mri'); disp(mri.hdr.fiducial.mri) nas: [87 60 116] lpa: [29 145 155] rpa: [144 142 158] Reference to non-existent field 'hdr'. I cannot display. Am I missing a prior step? Best, Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Tue Aug 19 00:09:07 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Tue, 19 Aug 2014 00:09:07 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Eelke, ok, so i installed an older version of matlab (which also solved some other problems with fieldtrip) and now it works. However I am running into another problem with it. Maybe you can help too: If I try to run the ICA after the bad channel replacement it takes hours and wchange just does not get lower. In my naive thinking I thought that might be due to the fact that the replaced channels are recognized as interpolations of the others??? But what could I do otherwise?: I thought about doing the bcr later, but that means that my ica suffers from all the electrode jumps from my bad channels. or I just exclude them from the ica - but how to proceed then: apply the reject component function on the data without the channels and then replace them? sorry, I am just a bit lost. The weirdest thing is: if I replace the channels with the help of another software before even processing the data, the ica works perfectly later in fieldtrip. WHY???? Would be wonderful if you could give me another hand... Thanks so much in advance!!! Katrin 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > Dear Katrin, > > When I look at the data you've shown me, in fact I do see an effect of > ft_channelrepair. I run your code: > > load ('ERP_Francesca17obs90_clean.mat') > > %% Preparing neighbours for channel repair > > cfg_neighb = []; > cfg_neighb.feedback = 'yes'; > cfg_neighb.method = 'triangulation'; > cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); > > % Interpolate and put into new data structure > cfg = []; > cfg.badchannel = {'E49', 'E68'}; > cfg.layout = 'GSN-HydroCel-129.sfp'; > cfg.method = 'nearest'; > cfg.neighbours = neighbours; > obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); > > followed by: > > dat1=obs90_data_clean2; > dat2=obs90_data_channelrepaired; > > x=dat1.trial{1}(68,:); % 68 is channel index of E68 > y=dat2.trial{1}(68,:); > plot(x);hold on;plot(y,'r'); > > x=dat1.trial{1}(49,:); > y=dat2.trial{1}(49,:); > figure; > plot(x);hold on;plot(y,'r') > > and the two figures that come up are shown in the attachments. The > original (blue) and channel-repaired (red) traces are clearly > different. These plots are for trial 1, but the same result holds when > I plot a different trial. > > Does it work on your end too now? > > Best, > Eelke > > On 14 August 2014 08:57, Eelke Spaak wrote: > > OK just checking :) In that case, could you post a small snippet of > > data and the actual cfg you used (including which channels to repair) > > on e.g. dropbox or so? Then I can have a look. > > > > Best, > > Eelke > > > > On 13 August 2014 22:12, KatrinH Heimann > wrote: > >> Dear Eelke, yes, sure, sorry, I did that. No effect. > >> > >> > >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> > >>> Dear Katrin, > >>> > >>> Have you tried putting the labels of the channels you want interpolated > >>> into the cfg.badchannel array? > >>> > >>> Best, > >>> Eelke > >>> > >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" < > katrinheimann at gmail.com>: > >>>> > >>>> Dear all. I am trying to replace bad channels. > >>>> This is my code (very basic I think):%% Preparing neighbours for > channel > >>>> repair > >>>> > >>>> > >>>> > >>>> cfg_neighb = []; > >>>> > >>>> cfg_neighb.feedback = 'yes'; > >>>> > >>>> cfg_neighb.method = 'triangulation'; > >>>> > >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >>>> > >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>> > >>>> > >>>> > >>>> % Interpolate and put into new data structure > >>>> > >>>> cfg = []; > >>>> > >>>> cfg.badchannel = {}; > >>>> > >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>> > >>>> cfg.method = 'nearest'; > >>>> > >>>> cfg.neighbours = neighbours; > >>>> > >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >>>> > >>>> > >>>> I do not get any error but fieldtrip even tells me that the > interpolation > >>>> worked. However I do not see ANY trace of it in my data when > inspecting it > >>>> afterwards. I also tried to change the method (to average) - no > change. > >>>> Anybody who can help me with that? > >>>> Thanks a million > >>>> Katrin > >>>> > >>>> > >>>> > >>>> _______________________________________________ > >>>> fieldtrip mailing list > >>>> fieldtrip at donders.ru.nl > >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Aug 19 09:14:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 19 Aug 2014 09:14:44 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Hi Katrin, Hmm, the MATLAB version difference points to a potential bug in the code. Could you tell me which version it now works on, and which version it did not work on earlier? ICA not working on your repaired data makes sense, and the cause is in fact pretty much what you mentioned yourself. The data in the repaired channels are now linear combinations (i.e. weighted sums) of the data in other channels, so the rank of your data (number of orthogonal data vectors) is now smaller than the number of channels. In other words, your data is rank deficient. ICA does not work properly on rank-deficient data. There are a few solutions to this. I would not recommend including the bad channels in the ICA. Your second suggestion would be better: compute ICA on the data without the bad channels, then interpolate them after backprojecting to channel space. A third option would be to reduce the dimensionality of the ICA input data to its 'true' dimensionality. If you specify cfg.numcomponent = N when calling ft_componentanalysis, the data will first undergo PCA, keeping N dimensions. In your case you would need to set N to be maximally the number of recorded channels minus the number of interpolated ones. This third option is probably the easiest and best way to go. Lastly, the fact that ICA still works if you repair the channels in other software is possibly due to this other software applying some form of non-linear algorithm to repair the channels. In that case the rank of your data might not be altered. Best, Eelke On 19 August 2014 00:09, KatrinH Heimann wrote: > Dear Eelke, > > ok, so i installed an older version of matlab (which also solved some other > problems with fieldtrip) and now it works. However I am running into another > problem with it. Maybe you can help too: > If I try to run the ICA after the bad channel replacement it takes hours and > wchange just does not get lower. In my naive thinking I thought that might > be due to the fact that the replaced channels are recognized as > interpolations of the others??? But what could I do otherwise?: I thought > about doing the bcr later, but that means that my ica suffers from all the > electrode jumps from my bad channels. or I just exclude them from the ica - > but how to proceed then: apply the reject component function on the data > without the channels and then replace them? sorry, I am just a bit lost. The > weirdest thing is: if I replace the channels with the help of another > software before even processing the data, the ica works perfectly later in > fieldtrip. WHY???? > Would be wonderful if you could give me another hand... Thanks so much in > advance!!! > Katrin > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > >> Dear Katrin, >> >> When I look at the data you've shown me, in fact I do see an effect of >> ft_channelrepair. I run your code: >> >> load ('ERP_Francesca17obs90_clean.mat') >> >> %% Preparing neighbours for channel repair >> >> cfg_neighb = []; >> cfg_neighb.feedback = 'yes'; >> cfg_neighb.method = 'triangulation'; >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); >> >> % Interpolate and put into new data structure >> cfg = []; >> cfg.badchannel = {'E49', 'E68'}; >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> cfg.method = 'nearest'; >> cfg.neighbours = neighbours; >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); >> >> followed by: >> >> dat1=obs90_data_clean2; >> dat2=obs90_data_channelrepaired; >> >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 >> y=dat2.trial{1}(68,:); >> plot(x);hold on;plot(y,'r'); >> >> x=dat1.trial{1}(49,:); >> y=dat2.trial{1}(49,:); >> figure; >> plot(x);hold on;plot(y,'r') >> >> and the two figures that come up are shown in the attachments. The >> original (blue) and channel-repaired (red) traces are clearly >> different. These plots are for trial 1, but the same result holds when >> I plot a different trial. >> >> Does it work on your end too now? >> >> Best, >> Eelke >> >> On 14 August 2014 08:57, Eelke Spaak wrote: >> > OK just checking :) In that case, could you post a small snippet of >> > data and the actual cfg you used (including which channels to repair) >> > on e.g. dropbox or so? Then I can have a look. >> > >> > Best, >> > Eelke >> > >> > On 13 August 2014 22:12, KatrinH Heimann >> > wrote: >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : >> >> >> >>> Dear Katrin, >> >>> >> >>> Have you tried putting the labels of the channels you want >> >>> interpolated >> >>> into the cfg.badchannel array? >> >>> >> >>> Best, >> >>> Eelke >> >>> >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" >> >>> : >> >>>> >> >>>> Dear all. I am trying to replace bad channels. >> >>>> This is my code (very basic I think):%% Preparing neighbours for >> >>>> channel >> >>>> repair >> >>>> >> >>>> >> >>>> >> >>>> cfg_neighb = []; >> >>>> >> >>>> cfg_neighb.feedback = 'yes'; >> >>>> >> >>>> cfg_neighb.method = 'triangulation'; >> >>>> >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>> >> >>>> >> >>>> >> >>>> % Interpolate and put into new data structure >> >>>> >> >>>> cfg = []; >> >>>> >> >>>> cfg.badchannel = {}; >> >>>> >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> cfg.method = 'nearest'; >> >>>> >> >>>> cfg.neighbours = neighbours; >> >>>> >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >>>> >> >>>> >> >>>> I do not get any error but fieldtrip even tells me that the >> >>>> interpolation >> >>>> worked. However I do not see ANY trace of it in my data when >> >>>> inspecting it >> >>>> afterwards. I also tried to change the method (to average) - no >> >>>> change. >> >>>> Anybody who can help me with that? >> >>>> Thanks a million >> >>>> Katrin >> >>>> >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> fieldtrip mailing list >> >>>> fieldtrip at donders.ru.nl >> >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From katrinheimann at gmail.com Tue Aug 19 10:05:53 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Tue, 19 Aug 2014 10:05:53 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Eelke! I am sure your name translates in Angel actually! Now everthing works!!! And so easily! The version I reinstalled is Matlab R2012a. I had R 2014a for some weeks, but loads of things did not work with that... Thanks a million for your help, really! Katrin 2014-08-19 9:14 GMT+02:00 Eelke Spaak : > Hi Katrin, > > Hmm, the MATLAB version difference points to a potential bug in the > code. Could you tell me which version it now works on, and which > version it did not work on earlier? > > ICA not working on your repaired data makes sense, and the cause is in > fact pretty much what you mentioned yourself. The data in the repaired > channels are now linear combinations (i.e. weighted sums) of the data > in other channels, so the rank of your data (number of orthogonal data > vectors) is now smaller than the number of channels. In other words, > your data is rank deficient. ICA does not work properly on > rank-deficient data. There are a few solutions to this. > > I would not recommend including the bad channels in the ICA. Your > second suggestion would be better: compute ICA on the data without the > bad channels, then interpolate them after backprojecting to channel > space. A third option would be to reduce the dimensionality of the ICA > input data to its 'true' dimensionality. If you specify > cfg.numcomponent = N when calling ft_componentanalysis, the data will > first undergo PCA, keeping N dimensions. In your case you would need > to set N to be maximally the number of recorded channels minus the > number of interpolated ones. This third option is probably the easiest > and best way to go. > > Lastly, the fact that ICA still works if you repair the channels in > other software is possibly due to this other software applying some > form of non-linear algorithm to repair the channels. In that case the > rank of your data might not be altered. > > Best, > Eelke > > On 19 August 2014 00:09, KatrinH Heimann wrote: > > Dear Eelke, > > > > ok, so i installed an older version of matlab (which also solved some > other > > problems with fieldtrip) and now it works. However I am running into > another > > problem with it. Maybe you can help too: > > If I try to run the ICA after the bad channel replacement it takes hours > and > > wchange just does not get lower. In my naive thinking I thought that > might > > be due to the fact that the replaced channels are recognized as > > interpolations of the others??? But what could I do otherwise?: I thought > > about doing the bcr later, but that means that my ica suffers from all > the > > electrode jumps from my bad channels. or I just exclude them from the > ica - > > but how to proceed then: apply the reject component function on the data > > without the channels and then replace them? sorry, I am just a bit lost. > The > > weirdest thing is: if I replace the channels with the help of another > > software before even processing the data, the ica works perfectly later > in > > fieldtrip. WHY???? > > Would be wonderful if you could give me another hand... Thanks so much in > > advance!!! > > Katrin > > > > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > > > >> Dear Katrin, > >> > >> When I look at the data you've shown me, in fact I do see an effect of > >> ft_channelrepair. I run your code: > >> > >> load ('ERP_Francesca17obs90_clean.mat') > >> > >> %% Preparing neighbours for channel repair > >> > >> cfg_neighb = []; > >> cfg_neighb.feedback = 'yes'; > >> cfg_neighb.method = 'triangulation'; > >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); > >> > >> % Interpolate and put into new data structure > >> cfg = []; > >> cfg.badchannel = {'E49', 'E68'}; > >> cfg.layout = 'GSN-HydroCel-129.sfp'; > >> cfg.method = 'nearest'; > >> cfg.neighbours = neighbours; > >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); > >> > >> followed by: > >> > >> dat1=obs90_data_clean2; > >> dat2=obs90_data_channelrepaired; > >> > >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 > >> y=dat2.trial{1}(68,:); > >> plot(x);hold on;plot(y,'r'); > >> > >> x=dat1.trial{1}(49,:); > >> y=dat2.trial{1}(49,:); > >> figure; > >> plot(x);hold on;plot(y,'r') > >> > >> and the two figures that come up are shown in the attachments. The > >> original (blue) and channel-repaired (red) traces are clearly > >> different. These plots are for trial 1, but the same result holds when > >> I plot a different trial. > >> > >> Does it work on your end too now? > >> > >> Best, > >> Eelke > >> > >> On 14 August 2014 08:57, Eelke Spaak wrote: > >> > OK just checking :) In that case, could you post a small snippet of > >> > data and the actual cfg you used (including which channels to repair) > >> > on e.g. dropbox or so? Then I can have a look. > >> > > >> > Best, > >> > Eelke > >> > > >> > On 13 August 2014 22:12, KatrinH Heimann > >> > wrote: > >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. > >> >> > >> >> > >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> >> > >> >>> Dear Katrin, > >> >>> > >> >>> Have you tried putting the labels of the channels you want > >> >>> interpolated > >> >>> into the cfg.badchannel array? > >> >>> > >> >>> Best, > >> >>> Eelke > >> >>> > >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" > >> >>> : > >> >>>> > >> >>>> Dear all. I am trying to replace bad channels. > >> >>>> This is my code (very basic I think):%% Preparing neighbours for > >> >>>> channel > >> >>>> repair > >> >>>> > >> >>>> > >> >>>> > >> >>>> cfg_neighb = []; > >> >>>> > >> >>>> cfg_neighb.feedback = 'yes'; > >> >>>> > >> >>>> cfg_neighb.method = 'triangulation'; > >> >>>> > >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >> >>>> > >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> >>>> > >> >>>> > >> >>>> > >> >>>> % Interpolate and put into new data structure > >> >>>> > >> >>>> cfg = []; > >> >>>> > >> >>>> cfg.badchannel = {}; > >> >>>> > >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >> >>>> > >> >>>> cfg.method = 'nearest'; > >> >>>> > >> >>>> cfg.neighbours = neighbours; > >> >>>> > >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> >>>> > >> >>>> > >> >>>> I do not get any error but fieldtrip even tells me that the > >> >>>> interpolation > >> >>>> worked. However I do not see ANY trace of it in my data when > >> >>>> inspecting it > >> >>>> afterwards. I also tried to change the method (to average) - no > >> >>>> change. > >> >>>> Anybody who can help me with that? > >> >>>> Thanks a million > >> >>>> Katrin > >> >>>> > >> >>>> > >> >>>> > >> >>>> _______________________________________________ > >> >>>> 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 > _______________________________________________ > 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 Tue Aug 19 10:26:58 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 19 Aug 2014 10:26:58 +0200 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hi Isaiah, could you check which FT-Version & Matlab-Version you are using? I just checked it and it seems to work fine (on Matlab 2011b). Also, could you post the output from calling "mri" and "mri.hdr"? 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: > Hello, > > I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. > > mri = ft_read_mri('Subject01.mri'); > > disp(mri.hdr.fiducial.mri) > nas: [87 60 116] > lpa: [29 145 155] > rpa: [144 142 158] > Reference to non-existent field 'hdr'. > > I cannot display. Am I missing a prior step? > > Best, > Isaiah Smith > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Aug 19 10:54:52 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 19 Aug 2014 08:54:52 +0000 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: , Message-ID: I'm just going to chime in and say that Matlab 2014a has been causing issues for me in other toolboxes too, do you definitely are not alone! Eelke is awesome :) Sent from my iPhone On 19 Aug 2014, at 5:39 pm, "KatrinH Heimann" > wrote: Eelke! I am sure your name translates in Angel actually! Now everthing works!!! And so easily! The version I reinstalled is Matlab R2012a. I had R 2014a for some weeks, but loads of things did not work with that... Thanks a million for your help, really! Katrin 2014-08-19 9:14 GMT+02:00 Eelke Spaak >: Hi Katrin, Hmm, the MATLAB version difference points to a potential bug in the code. Could you tell me which version it now works on, and which version it did not work on earlier? ICA not working on your repaired data makes sense, and the cause is in fact pretty much what you mentioned yourself. The data in the repaired channels are now linear combinations (i.e. weighted sums) of the data in other channels, so the rank of your data (number of orthogonal data vectors) is now smaller than the number of channels. In other words, your data is rank deficient. ICA does not work properly on rank-deficient data. There are a few solutions to this. I would not recommend including the bad channels in the ICA. Your second suggestion would be better: compute ICA on the data without the bad channels, then interpolate them after backprojecting to channel space. A third option would be to reduce the dimensionality of the ICA input data to its 'true' dimensionality. If you specify cfg.numcomponent = N when calling ft_componentanalysis, the data will first undergo PCA, keeping N dimensions. In your case you would need to set N to be maximally the number of recorded channels minus the number of interpolated ones. This third option is probably the easiest and best way to go. Lastly, the fact that ICA still works if you repair the channels in other software is possibly due to this other software applying some form of non-linear algorithm to repair the channels. In that case the rank of your data might not be altered. Best, Eelke On 19 August 2014 00:09, KatrinH Heimann > wrote: > Dear Eelke, > > ok, so i installed an older version of matlab (which also solved some other > problems with fieldtrip) and now it works. However I am running into another > problem with it. Maybe you can help too: > If I try to run the ICA after the bad channel replacement it takes hours and > wchange just does not get lower. In my naive thinking I thought that might > be due to the fact that the replaced channels are recognized as > interpolations of the others??? But what could I do otherwise?: I thought > about doing the bcr later, but that means that my ica suffers from all the > electrode jumps from my bad channels. or I just exclude them from the ica - > but how to proceed then: apply the reject component function on the data > without the channels and then replace them? sorry, I am just a bit lost. The > weirdest thing is: if I replace the channels with the help of another > software before even processing the data, the ica works perfectly later in > fieldtrip. WHY???? > Would be wonderful if you could give me another hand... Thanks so much in > advance!!! > Katrin > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak >: > >> Dear Katrin, >> >> When I look at the data you've shown me, in fact I do see an effect of >> ft_channelrepair. I run your code: >> >> load ('ERP_Francesca17obs90_clean.mat') >> >> %% Preparing neighbours for channel repair >> >> cfg_neighb = []; >> cfg_neighb.feedback = 'yes'; >> cfg_neighb.method = 'triangulation'; >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); >> >> % Interpolate and put into new data structure >> cfg = []; >> cfg.badchannel = {'E49', 'E68'}; >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> cfg.method = 'nearest'; >> cfg.neighbours = neighbours; >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); >> >> followed by: >> >> dat1=obs90_data_clean2; >> dat2=obs90_data_channelrepaired; >> >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 >> y=dat2.trial{1}(68,:); >> plot(x);hold on;plot(y,'r'); >> >> x=dat1.trial{1}(49,:); >> y=dat2.trial{1}(49,:); >> figure; >> plot(x);hold on;plot(y,'r') >> >> and the two figures that come up are shown in the attachments. The >> original (blue) and channel-repaired (red) traces are clearly >> different. These plots are for trial 1, but the same result holds when >> I plot a different trial. >> >> Does it work on your end too now? >> >> Best, >> Eelke >> >> On 14 August 2014 08:57, Eelke Spaak > wrote: >> > OK just checking :) In that case, could you post a small snippet of >> > data and the actual cfg you used (including which channels to repair) >> > on e.g. dropbox or so? Then I can have a look. >> > >> > Best, >> > Eelke >> > >> > On 13 August 2014 22:12, KatrinH Heimann > >> > wrote: >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak >: >> >> >> >>> Dear Katrin, >> >>> >> >>> Have you tried putting the labels of the channels you want >> >>> interpolated >> >>> into the cfg.badchannel array? >> >>> >> >>> Best, >> >>> Eelke >> >>> >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" >> >>> >: >> >>>> >> >>>> Dear all. I am trying to replace bad channels. >> >>>> This is my code (very basic I think):%% Preparing neighbours for >> >>>> channel >> >>>> repair >> >>>> >> >>>> >> >>>> >> >>>> cfg_neighb = []; >> >>>> >> >>>> cfg_neighb.feedback = 'yes'; >> >>>> >> >>>> cfg_neighb.method = 'triangulation'; >> >>>> >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>> >> >>>> >> >>>> >> >>>> % Interpolate and put into new data structure >> >>>> >> >>>> cfg = []; >> >>>> >> >>>> cfg.badchannel = {}; >> >>>> >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> cfg.method = 'nearest'; >> >>>> >> >>>> cfg.neighbours = neighbours; >> >>>> >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >>>> >> >>>> >> >>>> I do not get any error but fieldtrip even tells me that the >> >>>> interpolation >> >>>> worked. However I do not see ANY trace of it in my data when >> >>>> inspecting it >> >>>> afterwards. I also tried to change the method (to average) - no >> >>>> change. >> >>>> Anybody who can help me with that? >> >>>> Thanks a million >> >>>> Katrin >> >>>> >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> 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 _______________________________________________ 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 tyler.grummett at flinders.edu.au Wed Aug 20 04:47:14 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Wed, 20 Aug 2014 02:47:14 +0000 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) Message-ID: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> Hello fieldtrip experts, I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. I have tried multiplying the source.avg.mom by the source.leadfield. I wont clutter the email with code, however I can once requested. I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. Any help would be greatly appreciated. Tyler Sent from my iPad From eelke.spaak at donders.ru.nl Wed Aug 20 14:29:00 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Aug 2014 14:29:00 +0200 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) In-Reply-To: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> References: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> Message-ID: Hi Tyler, Beamforming is a scanning method, which means that the power/current density at each grid point is estimated independently from all other grid points. In general one would not expect sum_i(leadfield_ix * pow_i), where i indexes grid points, to faithfully reproduce the potential measured at sensor x. This as opposed to something like e.g. minimum-norm estimate, where the estimation is done in one regression-like step, rather than by scanning grid points. Best, Eelke On 20 August 2014 04:47, Tyler Grummett wrote: > Hello fieldtrip experts, > > I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. > > I have tried multiplying the source.avg.mom by the source.leadfield. > I wont clutter the email with code, however I can once requested. > > I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. > > Any help would be greatly appreciated. > > Tyler > > Sent from my iPad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Wed Aug 20 14:54:47 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Wed, 20 Aug 2014 12:54:47 +0000 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) In-Reply-To: References: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au>, Message-ID: <3E2D3E20-2A83-4ABC-BADC-FB53DD7651C4@flinders.edu.au> Thank you clearing that up eelke :) Tyler Sent from my iPhone > On 20 Aug 2014, at 10:03 pm, "Eelke Spaak" wrote: > > Hi Tyler, > > Beamforming is a scanning method, which means that the power/current > density at each grid point is estimated independently from all other > grid points. In general one would not expect sum_i(leadfield_ix * > pow_i), where i indexes grid points, to faithfully reproduce the > potential measured at sensor x. This as opposed to something like e.g. > minimum-norm estimate, where the estimation is done in one > regression-like step, rather than by scanning grid points. > > Best, > Eelke > >> On 20 August 2014 04:47, Tyler Grummett wrote: >> Hello fieldtrip experts, >> >> I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. >> >> I have tried multiplying the source.avg.mom by the source.leadfield. >> I wont clutter the email with code, however I can once requested. >> >> I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. >> >> Any help would be greatly appreciated. >> >> Tyler >> >> Sent from my iPad >> _______________________________________________ >> 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 jingfan.jf at gmail.com Wed Aug 20 16:03:51 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Wed, 20 Aug 2014 09:03:51 -0500 Subject: [FieldTrip] undefined function or variable 'abort' error when trying to run ft_definetrial(cfg) Message-ID: <002101cfbc7f$92d84830$b888d890$@gmail.com> Hi there, I am new to fieldtrip. I am trying the trigger-based trial selection tutorial. An error occurs when running cfg = ft_definetrial(cfg). In ft_preamble function, I couldn't find where abort is defined. I appreciate any help! Best, Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Aug 20 16:23:46 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 20 Aug 2014 17:23:46 +0300 Subject: [FieldTrip] MNE Source Reconstruction Sanity Check In-Reply-To: <53D1FD3B.7040600@donders.ru.nl> References: <346147900.8004488.1406126123454.JavaMail.root@sculptor.zimbra.ru.nl> <790E6AB9-6372-4F70-9B98-2DE6E084F552@donders.ru.nl> <53D1FD3B.7040600@donders.ru.nl> Message-ID: Dear fieldtrippers, dear Jörn, I am currently trying to use the standard BEM head model provided in the fieldtrip toolbox (on a 19 electrodes EEG recording, segmented into 10-seconds trials, not time-locked), but I have encountered a problem I could not resolve: Error using svd Input to SVD must not contain NaN or Inf. Error in pinv (line 29) [U,S,V] = svd(A,0); Error in pinv (line 27) X = pinv(A',varargin{:})'; Error in minimumnormestimate (line 151) w = pinv(lf); Error in ft_sourceanalysis (line 876) dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Following some old posts in the mailing list I made sure the electrodes data structure of the data is the same as that given in the cfg of ft_sourceanalysis. However, it is still possible that using a 19 electrodes recording is not possible using the source model I am using? I am also afraid computing the source reconstruction on such continuous data, that is not time-locked, could be a problem. For example, having to calculate the “avg” field artificially seems a little fishy. I also tried running the code on the EEG data of the continuous data preprocessing tutorial (after choosing only 19 of its electrodes, though possibly not the right ones). Any advice would be greatly appreciated! Thank you all, Roey THE CODE --------------- % Load head model, “vol” hdmfile = fullfile(which('standard_bem.mat')); load(hdmfile); % Create grid gridcfg = []; gridcfg.grid.xgrid = -20:1:20; gridcfg.grid.ygrid = -20:1:20; gridcfg.grid.zgrid = -20:1:20; gridcfg.grid.unit = 'cm'; gridcfg.grid.tight = 'yes'; gridcfg.inwardshift = -1.5; gridcfg.vol = vol; gridVar = ft_prepare_sourcemodel(gridcfg); % Restrict source reconstruction to outside of the cerrebellum gridVar = getRidOfCerrebellum([], gridVar); % Source reconstruction slcfg = struct; slcfg.method = ‘mne’; slcfg.elec = data.elec; slcfg.grid = gridVar; slcfg.vol = vol; slcfg.rawtrial = 'yes'; slcfg.hdmfile = hdmfile; slcfg.mne.lambda = '5%'; slcfg.keepfilter = 'yes'; slcfg.rawtrial = 'no'; % this is because we are now just computing the spatial filter slcfg.singletrial = 'no'; slcfg.keeptrials = 'yes'; % calculate the avg of each trial, for use in ft_sourceanalysis for trialI = 1:length(data.trial) data.avg(:,trialI) = mean(data.trial{trialI}')'; end source_for_filter = ft_sourceanalysis(slcfg, data); %this source structure is used to compute the filter to be used later On Fri, Jul 25, 2014 at 9:46 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Dear Roey, > > I agreet that this is a bad idea - independently of what result you will > get, the error is just too big to draw any reliable conclusions. Imho, you > can better try using ICA to decompose your data into components. > > Concerning the headmodel, there is a standard BEM headmodel template > available in FieldTrip. > > Best, > Jörn > > > On 7/24/2014 8:50 PM, Roey Schurr wrote: > >> Dear Jim, >> Thank you for drawing my attention to this problem. I have actually tried >> building a realistic head model using OPENMEG but encountered some >> compitability problems since our lab does not use Linux. This is indeed one >> of the most important (short) future tasks - being able to use such >> realistic head models. >> Best, >> roey >> >> >> On Thu, Jul 24, 2014 at 6:34 PM, E688205 > > wrote: >> >> Dear Roey, >> >> To add to Diego's comments, since you are dealing with EEG data a >> single sphere headmodel is not a good idea because it does not >> take into account the differences in conductivity between the >> skull, scalp, and brain. This is not a problem for MEG but is >> important for EEG. Therefore it is better to use, for example, a >> BEM head model. >> >> Best, >> >> Jim >> >> On 23 jul. 2014, at 16:38, "Lozano Soldevilla, D. (Diego)" >> > > wrote: >> >> Dear Roey, >>> >>> In my opinion it's definitely not a good idea to compute MNE >>> using 19 sensors. There are studies that have found a drastic >>> localization precision from 31 to 63 electrodes and further >>> improvements till 123: >>> >>> http://www.ncbi.nlm.nih.gov/pubmed/15351361 (see figure 1) >>> http://www.ncbi.nlm.nih.gov/pubmed/12495765 >>> >>> Although it's very difficult to know the "minimum" number of >>> electrodes needed to accurately localize a given source (it >>> depends on the strength of the source you want to localize, >>> source reconstruction algorithm, data noise...), 19 electrodes >>> are too low to trust the results you can get. >>> >>> best, >>> >>> Diego >>> >>> >>> ------------------------------------------------------------ >>> ------------ >>> From roeysc atgmail.com Mon Jul 21 11:21:32 >>> 2014 >>> From: roeysc atgmail.com (Roey Schurr) >>> >>> Date: Mon, 21 Jul 2014 12:21:32 +0300 >>> Subject: [FieldTrip] MNE Source Reconstruction Sanity Check >>> Message-ID: >> mail.gmail.com >> AQ_W43cHF_8J2b+rNyzd55x4aRviw at mail.gmail.com>> >>> >>> >>> Dear fieldtrippers, >>> >>> >>> >>> I want to do a sanity check on mne source reconstruction. >>> >>> I'm working on continuous EEG recordings (19 electrodes), estimating >>> the >>> source reconstruction activity using the *mne* (minimum norm >>> estimate) >>> method, a *template MRI* (Colin27) and a *singlesphere* headmodel. >>> As a >>> sanity check for the source reconstruction itself, I wanted to >>> compare >>> conditions in which I could estimate the loci of significant >>> changes, e.g.: >>> rest vs movement of the hand, moving the right hand vs the left >>> hand, etc. >>> I have about 60 seconds of recording for each condition. >>> >>> >>> >>> What I did was: >>> >>> 1) Segment the recording of each condition into many "trials" of 2 >>> seconds >>> each. >>> >>> 2) For each trial, average the activity in each of the 90 ROIs of >>> the aal >>> atlas (I excluded the cerebellum from the source reconstruction). >>> >>> >>> >>> I was wondering what comparison would be best in this case. Since >>> this is >>> not Evoked Responses data, I find it hard to find relevant ideas, >>> and would >>> like to hear your thoughts. >>> >>> >>> >>> 1) I did a frequency analysis (mtmfft) in conventional bands of >>> interest >>> and ran ft_freqstatistics on the resulting structures (using ttest2 >>> and the >>> bonferoni correction for the multiple comparison problem). This gave >>> some >>> results, however for most conditions they are not very encouraging >>> (the >>> ROIs that showed significant differences were not close to those >>> that I >>> have assumed). >>> >>> >>> >>> *QUESTION 1*: do you think this is a proper method? Note that I did >>> not use >>> a frequency based source reconstruction in the first place, because >>> I'm >>> ultimately interested in the time course in the source space. >>> >>> >>> >>> 2) I was wondering if a cluster based permutation test is impossible >>> to use >>> here, since this is a continuous recording, so clustering according >>> to time >>> adjacency seems irrelevant. >>> >>> >>> >>> *QUESTION 2*: is it possible to use a cluster based statistical test >>> here? >>> If so, it could be better than a-priori averaging the source >>> activity in >>> the atlas ROIs, which could mask some of the effects, if they are >>> located >>> in a small area. >>> >>> >>> >>> 3) Another possibility is looking at the data itself. Unfortunately I >>> encountered some problems using ft_sourcemovie, though this is a >>> subject >>> for a different thread. >>> >>> >>> >>> Any thoughts and advice are highly appreciated! >>> >>> Thank you for taking the time, >>> >>> roey >>> _______________________________________________ >>> >>> 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 >> > > > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 20 21:55:37 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 20 Aug 2014 19:55:37 +0000 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hello Julian, Thanks for the help. I am using MATLAB 2014a, and I am using my own mri, and locations. FieldTrip is up to date as well. The result is below.[cid:889764B9-93C3-4878-B240-9029C6836FAA at host.ucla.edu] I am trying to move the electrodes slightly. When I follow the steps on the website. >> disp(mri.hdr.fiducial.mri) Reference to non-existent field 'HDR'. Isaiah On Aug 19, 2014, at 1:26 AM, Julian Keil > wrote: Hi Isaiah, could you check which FT-Version & Matlab-Version you are using? I just checked it and it seems to work fine (on Matlab 2011b). Also, could you post the output from calling "mri" and "mri.hdr"? 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: Hello, I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. mri = ft_read_mri('Subject01.mri'); disp(mri.hdr.fiducial.mri) nas: [87 60 116] lpa: [29 145 155] rpa: [144 142 158] Reference to non-existent field 'hdr'. I cannot display. Am I missing a prior step? Best, Isaiah Smith _______________________________________________ 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: Screen Shot 2014-08-20 at 12.48.14 PM.png Type: image/png Size: 40529 bytes Desc: Screen Shot 2014-08-20 at 12.48.14 PM.png URL: From julian.keil at gmail.com Thu Aug 21 09:15:39 2014 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 21 Aug 2014 09:15:39 +0200 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hi Isaiah, so you are having trouble using your own MRI, right? Have you tried the example-MRI that comes with the tutorial or the standard mri found in the templates-folder? Depending on your MRI-machine you might not actually get any header info (which is stored in .hdr). For example, with the Simens Verio which I use here, I get DICOM files which contain a .hdr when read into field trip, however the .hdr field does not contain any information on the fiducials. So, in order to realign your EEG-Electrodes and the MRI without the fiducials, you need to use the ft_electroderealign-function with cfg.method = interactive. You also need to take some steps before that, i.e. you need to realign your MRI (ft_volumerealign), segment the MRI (ft_volumesegment) and create a head model (ft_prepare_headmodel). From your plot I guess that you already have the head model and EEG-Electrodes, so you can use the code from the example script (http://fieldtrip.fcdonders.nl/example/align_eeg_electrode_positions_to_bem_headmodel): % align interactive to surface of headmodel stored in vol.bnd cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1); elec_new = ft_electroderealign(cfg); Good luck, in case you're still having trouble I can also send you a copy of my personal script I use to create head models. Julian Am 20.08.2014 um 21:55 schrieb Isaiah C. Smith: > Hello Julian, > > Thanks for the help. I am using MATLAB 2014a, and I am using my own mri, and locations. FieldTrip is up to date as well. The result is below. > I am trying to move the electrodes slightly. > > When I follow the steps on the website. > >> disp(mri.hdr.fiducial.mri) > Reference to non-existent field 'HDR'. > > Isaiah > On Aug 19, 2014, at 1:26 AM, Julian Keil wrote: > >> Hi Isaiah, >> >> could you check which FT-Version & Matlab-Version you are using? >> I just checked it and it seems to work fine (on Matlab 2011b). >> Also, could you post the output from calling "mri" and "mri.hdr"? >> >> 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: >> >>> Hello, >>> >>> I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. >>> >>> mri = ft_read_mri('Subject01.mri'); >>> >>> disp(mri.hdr.fiducial.mri) >>> nas: [87 60 116] >>> lpa: [29 145 155] >>> rpa: [144 142 158] >>> Reference to non-existent field 'hdr'. >>> >>> I cannot display. Am I missing a prior step? >>> >>> Best, >>> Isaiah Smith >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Fri Aug 22 11:01:14 2014 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Fri, 22 Aug 2014 11:01:14 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR Message-ID: Hi All, I want to have a TFR plot that has the same portion for : - alpha (7-15 Hz) - beta (15-30 Hz) - low gamma (30-60 Hz) - high gamma (60-120 Hz) Since those bands have exponential frequency steps, I could only see very small part of alpha and (too) many high gamma band. Is there a way to make the cfg.foi in fieldtrip to have non linear steps? I tried to insert a exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); But fieldtrip seems only detect first and last number and make linear steps out of it. Thank you in advance for any help and share! Sandhy -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Fri Aug 22 11:13:22 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Fri, 22 Aug 2014 11:13:22 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: References: Message-ID: Hey Sandhy, Try, cfg.foi = [7:30, 30:5:60, 60:10:120]; Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. Is this what you need? -- Regards, Kousik Sarathy, S On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < prasandhya.a.yusuf at gmail.com> wrote: > Hi All, > > I want to have a TFR plot that has the same portion for : > - alpha (7-15 Hz) > - beta (15-30 Hz) > - low gamma (30-60 Hz) > - high gamma (60-120 Hz) > > Since those bands have exponential frequency steps, I could only see very > small part of alpha and (too) many high gamma band. Is there a way to make > the cfg.foi in fieldtrip to have non linear steps? I tried to insert a > exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); > But fieldtrip seems only detect first and last number and make linear > steps out of it. > > Thank you in advance for any help and share! > > Sandhy > > _______________________________________________ > 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 d.lozanosoldevilla at fcdonders.ru.nl Fri Aug 22 13:08:34 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Fri, 22 Aug 2014 13:08:34 +0200 (CEST) Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: Message-ID: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> Hi Sandhy , Could you please tell us a bit more info about how do you compute your TFR ? Your problem sounds to me as your data length does not match the frequency you're asking: http :// fieldtrip . fcdonders . nl / faq /why_does_my_output.freq_not_match_my_ cfg . foi _when_using_wavelet_formerly_ wltconvol _in_ft_ freqanalyis http :// fieldtrip . fcdonders . nl / faq /why_does_my_output.freq_not_match_my_ cfg . foi _when_using_ mtmconvol _in_ft_ freqanalyis If you want to space frequency logarithmically, I'd recommend you to change the y-axes scale to log-scale after the TFR . Alternatively, other people approach the frequency resolution modifying the wavelets. You can make a modified wavelets with different number of cycles per frequency although this approach it's more vulnerable to spectral leakage. This is because the wavelet at particular frequency wont fit an interger number of cycles : cfg = []; cfg .output = 'pow' ; cfg .channel = 'MEG' ; cfg .method = 'mtmconvol' ; cfg .taper = 'hanning' ; cfg . foi = 2:1:50; cfg .t_ ftimwin = linspace (3,37.5,size( cfg . foi ,2))./ cfg . foi ; cfg . toi = -0.5:0.05:1.5; freq = ft_ freqanalysis ( cfg , data); I hope it helps, Diego ----- Original Message ----- > From: " kousik sarathy " < sarathykousik @ gmail .com> > To: " FieldTrip discussion list" < fieldtrip @science. ru . nl > > Sent: Friday, 22 August, 2014 11:13:22 AM > Subject: Re: [ FieldTrip ] Non linear frequency steps in TFR > Hey Sandhy , > Try, > cfg . foi = [7:30, 30:5:60, 60:10:120]; > Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. > Is this what you need? > -- > Regards, > Kousik Sarathy , S > On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < > prasandhya .a. yusuf @ gmail .com > wrote: > > Hi All, > > I want to have a TFR plot that has the same portion for : > > - alpha (7-15 Hz) > > - beta (15-30 Hz) > > - low gamma (30-60 Hz) > > - high gamma (60-120 Hz) > > Since those bands have exponential frequency steps, I could only see > > very small part of alpha and (too) many high gamma band. Is there a > > way to make the cfg . foi in fieldtrip to have non linear steps? I > > tried to insert a exponential function: cfg . foi = > > 0.5*exp(0.6931*(3.8:0.02:7.9)); > > But fieldtrip seems only detect first and last number and make > > linear > > steps out of it. > > Thank you in advance for any help and share! > > Sandhy > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip @ donders . ru . nl > > http ://mailman.science. ru . nl /mailman/ listinfo / fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip @ donders . ru . nl > http ://mailman.science. ru . nl /mailman/ listinfo / fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http :// www . ru . nl /people/ donders /lozano-soldevilla-d/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Aug 22 16:56:57 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 22 Aug 2014 16:56:57 +0200 Subject: [FieldTrip] normalization of already baselinecorrected EEG data Message-ID: Dear all, I have again a rather conceptual question: I just did all the steps until timelock with a set of 20 subjects. Now i realized (far too late) that the baseline I chose in the preprocessing was not ideal (it is before stimulusonset but actually not before the point 0 of my ERP analysis as that is within the stimulus). Is there anything I can do about that without repeating all steps for all subjects? could I baseline correct again? Or do a z score of the single trials(would make sense as I have a strong intersubject variability too) Every advice is appreciated! Best Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.grova at mcgill.ca Fri Aug 22 21:04:15 2014 From: christophe.grova at mcgill.ca (Christophe Grova) Date: Fri, 22 Aug 2014 19:04:15 +0000 Subject: [FieldTrip] Postdoctoral and/or MSc/PhD positions available in the Multimodal Functional Imaging Lab in Montreal Message-ID: <9E1647EDA3EBB44AADA162CEC4C4222E3CAF7741@exmbx2010-9.campus.MCGILL.CA> Postdoctoral and/or MSc/PhD positions available at Concordia University in the Multimodal Functional Imaging Lab I am pleased to announce that I am currently looking for a Postdoctoral fellow and/or M.Sc./PhD students to join my lab, the Multimodal Functional Imaging lab. The candidates will join a multidisciplinary team composed of neurologists and methodologists within the Multimodal Functional Imaging Laboratory. This laboratory directed by Pr. Grova is based on two sites: (i) Physics Dpt at Concordia University and PERFORM center, (ii) Biomedical Engineering Dpt and part of the epilepsy group of the Montreal Neurological Institute, McGill University. Both environments offer unique platforms with access to several modalities (simultaneous high-density EEG/fMRI, MEG, simultaneous EEG/NIRS, TMS, SPECT/CT, PET/CT). The candidates will notably have access to the brand new multimodal imaging platform of PERFORM center, dedicated to neuroscience studies over large cohort of subjects (effect of age, exercising, ...), whereas clinical applications during the presurgical investigation of patients with epilepsy will be primarly based at the Montreal Neurological Institute. The main expertise of the team is the development and the validation of source localization methods dedicated for EEG, MEG and NIRS as well as multimodal characterization of brain activity and especially resting state functional connectivity. Project 1: Multimodal characterization of resting state functional connectivity The main originality of this project is to consider frequency-based source localization of EEG and MEG data, using notably wavelet-based Maximum on the Mean (Lina et al IEEE TBME 2012) in order to investigate resting state functional connectivity from simultaneous EEG/MEG data and simultaneous high-density EEG/fMRI data. These multimodal data will be considered in order to investigate the dynamic of resting state functional connectivity patterns in healthy controls and patients with epilepsy. Project 2: Multimodal assessement of the integrity of the neuromuscular coupling The main originality of this project is a complete multimodal investigation of neurovascular coupling processes involving EEG/MEG, EEG/fMRI and EEG/NIRS data. Neurovascular coupling during excitation and inhibition will be analyzed either in healthy conditions during well-controlled paradigms (e.g. finger tapping, electrical median nerve stimulation, TMS stimulations) or in resting state conditions and notably at the time of transient epileptic activity. One of the main objective will consist in assessing the integrity of the neurovascular coupling processes in these conditions. Developpments will involve statistical analysis of NIRS signal, 3D tomographic reconstruction of EEG and NIRS data, evaluation of neurovascular coupling models. Supervisor: Christophe Grova Ph.D. Assistant Professor, Physics Dpt and PERFORM, Concordia University, Montreal, Canada Adjunct Professor, Biomedical Engineering and Neurology & Neurosurgery dpts, McGill University, Montreal, Canada Director of the Multimodal Functional Imaging Laboratory Email: christophe.grova at concordia.ca christophe.grova at mcgill.ca Requirements: The candidate should have expertise in image and signal processing, involving notably one or few of the modalities mentioned. Computational skills including neuroimaging softwares and Matlab are important additional qualifications. Experience in the field of epilepsy will be appreciated Please send your CV and motivation letter before Sept. 20th 2014 to christophe.grova at concordia.ca Cordially Christophe Grova *************************** Christophe Grova, PhD Assistant Professor, Physics Dpt, Concordia University PERFORM centre, Concordia University Adjunct Prof in Biomedical Engineering, and Neurology and Neurosurgery Dpt, McGill University Multimodal Functional Imaging Lab (Multi FunkIm) Montreal Neurological Institute - epilepsy group Centre de Recherches en Mathématiques Biomedical Engineering Department - Room 304 McGill University 3775 University Street, Montreal, Quebec, Canada, H3A 2B4 email : christophe.grova at concordia.ca , christophe.grova at mcgill.ca tel : (514) 398 2516 fax : (514) 398 7461 web: Physics, Concordia University: http://physics.concordia.ca/facultyandresearch/bios/grova.php McGill University: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/PeopleChristophe MultiFunkIm Lab: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/HomePage *************************** [X] -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Aug 22 22:33:18 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 22 Aug 2014 22:33:18 +0200 Subject: [FieldTrip] example for nonparametric permutation anova using ft_statfun_depsamplesF? Message-ID: Dear all, I would like to replicate the results of a study using exactly what they used. I need to do a nonparametric permutation anova (repeated measures) of ERP data with 2 levels of Hemisphere, 4 levels of ROI and 3 levels of Time (windows). Could somebody post an example of such an analysis? I can't figure out how to determine the different levels by the cfg structure etc. Thanks a million Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.barcelo at uib.es Sat Aug 23 00:33:59 2014 From: f.barcelo at uib.es (Francisco Barcelo) Date: Sat, 23 Aug 2014 00:33:59 +0200 Subject: [FieldTrip] PhD and Postdoctoral positions in Majorca, Spain Message-ID: One PhD and one Postdoctoral research positions are available at the Department of Psychology (University of Balearic Islands, Spain) to join an ongoing project on the Cognitive neuroscience of executive control aimed to assess functional and effective connectivity (e.g., Dynamic Causal Modeling) in M/EEG data sets from healthy controls and brain injured patients. The project aims to develop state-of-the-art neuropsychological tools for a more valid and cost-effective evaluation of dysexecutive symptoms in elderly adults and patients with frontal lobe lesions (cf., Barceló & Knight, Cereb. Cortex, 2007; Nyhus & Barceló, Brain & Cognition, 2009). Successful pre/postdoctoral candidates will hold a MSc/PhD in Psychology, Biology, Cognitive Neuroscience, Physics, or related fields, and will play a key role in designing, conducting, analyzing and reporting M/EEG studies, with a focus on event-related potentials, oscillatory neural activity and synchrony. Candidates will be fluent in English (knowledge of Spanish is not required), and will prove good interpersonal and communication skills, including writing to a high standard. Both positions are funded by the Spanish Government (MINECO’s grant PSI2013-44760-R), as well as other local research agencies. Requirements for the PhD student position: 1) EU citizenship; 2) a Master degree and excellent academic marks; 3) Programming skills (eg., Matlab will be a plus); and 4) Demonstrated ability and high motivation to conduct high-quality research publishable in quality international peer-reviewed journals. Requirements for the Postdoc position: 1) Strong background publishing EEG and/or MEG studies; 2) Advanced programming skills (eg., Matlab, C, Python); 3) Excellent command of EEG/MEG data analysis software (EEGLAB, SPM8, Brainstorm, etc); and 4) demonstrate creative and independent work. Applicants must submit an updated CV in pdf format, a letter of motivation, and the names and emails of two referees to the grant holder: Francisco Barceló (f.barcelo at uib.es). The PhD studentship is for 3 years, and the postdoc position is for one year, with the possibility of renewal. Starting date October 1st 2014, or until the positions are filled. Informal inquires are welcomed. For more information visit: www.mcst.es, or www.neuropsicologiaclinica.es. ><><><><><><><><><><><><><>< Francisco Barceló, PhD Full Professor of Neuropsychology University of Illes Balears (UIB) Ctra. Valldemossa, km 7.5 E-07122 Palma de Mallorca - Spain Personal: www.mcst.es Lab: www.neuropsicologiaclinica.es Phone: 971 172750 Fax: 971 172309 ><><><><><><><><><><><><><>< -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sat Aug 23 18:08:26 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sat, 23 Aug 2014 18:08:26 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! Message-ID: Dear all, my problems seem neverending. This time however i really need help. I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: computing average of avg over 19 subjects Warning: discarding electrode information because it cannot be averaged > In ft_timelockgrandaverage at 249 the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB computing average of avg over 2 subjects Warning: discarding electrode information because it cannot be averaged > In ft_timelockgrandaverage at 249 the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) I guess that there is a problem with the layout I use. Here the code that I use %For generating the layout (also in the single subjects): cfg = []; cfg.channel = obs_data.label; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.feedback = 'yes'; lay = ft_prepare_layout(cfg); cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); %For computing the grand average cfg = []; cfg.channel = 'all'; cfg.latency = 'all'; cfg.parameter = 'avg'; cfg.keepindividual = 'no' GA_90 = ft_timelockgrandaverage(cfg,all90{:}); GA_180 = ft_timelockgrandaverage(cfg,all180{:}); % "{:}" means to use data from all elements of the variable For plotting the significant clusters cfg = []; cfg.style = 'blank'; cfg.layout = lay; cfg.channellabels = 'yes'; cfg.highlight = 'labels'; cfg.highlightchannel = find(stat.mask); cfg.comment = 'no'; figure; ft_topoplotER(cfg, GA_90) title('Nonparametric: significant with cluster multiple comparison correction') Do you have ANY idea to this? I am really completely helpless.... thanks and best Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sun Aug 24 05:40:34 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sun, 24 Aug 2014 15:40:34 +1200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Try this one I use On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: > Dear all, my problems seem neverending. This time however i really need > help. > I implemented a pipeline for ERPs. All works now, trialdefinition, > preprocessing, channelreplacement, ica, componentrejection, final > artifactdetection, timelock of the single subject data. However, when I > wanna compute the grandaverage of the single subjects I get the following > error message: > > computing average of avg over 19 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the > additional allocation of an estimated 3 MB > computing average of avg over 2 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the > additional allocation of an estimated 0 MB > the call to "ft_prepare_layout" took 0 seconds and required the additional > allocation of an estimated 0 MB > the call to "ft_topoplotER" took 0 seconds and required the additional > allocation of an estimated 0 MB > > Furthermore in the plot of the significant clusters, the channelnames are > mixed up (do not correspond to my net) > > > I guess that there is a problem with the layout I use. > Here the code that I use > > %For generating the layout (also in the single subjects): > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = lay; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > > > %For computing the grand average > > cfg = []; > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > cfg.parameter = 'avg'; > > cfg.keepindividual = 'no' > > GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > > GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > > % "{:}" means to use data from all elements of the variable > > > > For plotting the significant clusters > > cfg = []; > > cfg.style = 'blank'; > > cfg.layout = lay; > > cfg.channellabels = 'yes'; > > cfg.highlight = 'labels'; > > cfg.highlightchannel = find(stat.mask); > > cfg.comment = 'no'; > > figure; ft_topoplotER(cfg, GA_90) > > title('Nonparametric: significant with cluster multiple comparison > correction') > > > Do you have ANY idea to this? I am really completely helpless.... > > thanks and best > > Katrin > > _______________________________________________ > 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 e.caspar at ucl.ac.uk Sun Aug 24 12:49:24 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sun, 24 Aug 2014 10:49:24 +0000 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Message-ID: <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Thank you for your answer. The complete error message I have is this one, but I'm not able to decrypt it. Error using filter_with_correction (line 44) Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter. Error in filter_with_correction (line 44) error('Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter.'); Error in ft_preproc_bandpassfilter (line 148) filt = filter_with_correction(B,A,dat,dir); Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); It only occurs when I ask for a bpfilterrange from .1 to 30, or any values lower than .9. Thanks! Emilie Le 11 août 2014 à 12:43, Eelke Spaak > a écrit : Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie > wrote: Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie _______________________________________________ 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 roeysc at gmail.com Sun Aug 24 13:47:55 2014 From: roeysc at gmail.com (Roey Schurr) Date: Sun, 24 Aug 2014 14:47:55 +0300 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Message-ID: Dear Emilie, Try reading this thread and see if it helps: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005360.html The bottom line is, if you want a low highpass filer, you need to change the order of the filter you're using. In the example in the thread above, using a filter of order 5 helped Philipp applying a 0.1 Hz highpass filter. So you could try using something like: cfg.hpfiltord = 5; Hope this helps! Roey On Sun, Aug 24, 2014 at 1:49 PM, Caspar, Emilie wrote: > Thank you for your answer. The complete error message I have is this one, > but I'm not able to decrypt it. > > Error using filter_with_correction (line 44) > Calculated filter coefficients have poles on or outside the unit circle > and will not be stable. Try a higher cutoff > frequency or a different type/order of filter. > > Error in filter_with_correction (line 44) > error('Calculated filter coefficients have poles on or outside the unit > circle and will not be stable. Try a > higher cutoff frequency or a different type/order of filter.'); > > Error in ft_preproc_bandpassfilter (line 148) > filt = filter_with_correction(B,A,dat,dir); > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > It only occurs when I ask for a bpfilterrange from .1 to 30, or any > values lower than .9. > > Thanks! > > Emilie > > > > Le 11 août 2014 à 12:43, Eelke Spaak a écrit > : > > Dear Emilie, > > The error message you include only specifies *where* in the code the > error happened, not *what* the actual error was. Could you include the > actual error as well? Perhaps someone can then help you fix it. (In > general there is no fixed lower limit on filter low-/highpass > frequency, although a practical limit could depend on your data.) > > Best, > Eelke > > On 9 August 2014 09:31, Caspar, Emilie wrote: > > Dear Fieldtrip members, > > I would like to apply to my data a bandpass filter from 0.016 (or at least > 0.1) to 30 Hz > > bpfilterRange = [.1 30]; > > However, it seems that Fieltrip doesn't accept small high-pass filter > values. I have the following mistake : > > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, > which is quite high. > > I wonder if the problem comes from my data (but I had no problems on others > programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? > > Thank in advance, > > Emilie > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Sun Aug 24 14:15:48 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Sun, 24 Aug 2014 14:15:48 +0200 Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences Message-ID: Dear all and Prof Maris, I'm re-posting this question again, as I didn't get any replies previously. I’m interested to investigate if there are any differences in phase synchronization in resting state data at timepoint 2 versus timepoint 1. The EEG data was collected using 64 EEG channels, resting state, eyes opened and eyes closed. I’ve arbitrarily segmented the resting state data into epochs of 2s each, and the epochs with artifacts are excluded completely from further analyses. I then performed mtmfft to get the fourier representation of the data, extracted the coherence, and compared the coherence difference of timepoint 2 versus timepoint 1 of all channels paired with all other channels. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to perform cluster-based statistical analyses. I get an output with ‘chan_chan’ dimord variable. However, I was not 100% sure that this is correct, hence, I’ve inserted my code (see below). It’ll be great if you could tell me if what I’m doing makes any sense at all. Also, I don’t know how I can plot the results to see if it make any sense at all. Also, I checked the values obtained from when I specified "cfg.channelcmb" and when I did not specify "cfg.channelcmb", I noticed that the values were somehow different. I would assume that the values to be similar, although I'm not sure why they would have differences in the values obtained from specifying "cfg.channelcmb". This is my code that I've used thus far: for sub = 1:5 cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; cfg.foilim = [0 100]; cfg.taper = 'dpss'; % find the index for the c200 condition pre_c200_idx = find(data5.trialinfo == 201); cfg.trials = pre_c200_idx; HLF_pre_c200 = ft_freqanalysis(cfg, data5); post_c200_idx = find(data5.trialinfo == 200); cfg.trials = post_c200_idx; HLF_post_c200 = ft_freqanalysis(cfg, data5); cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'coh'; HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_post_c200); end load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; cfg_neighb.channel = 'all'; neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); cfg = []; cfg.layout = lay; cfg.neighbours = neighbours; cfg.channel = 'all'; cfg.channelcmb = {cfg.channel, cfg.channel}; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.tail = 0; % cfg.clustertail = 0; cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency bands. cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; % for theta band cfg.avgoverfreq = 'yes'; cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), and gamma (40-100). [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, sub_HLF_pre_c200coh{:}); When I tried to plot the results, I used this code: cfg = []; cfg.channel = 'all'; cfg.layout = 'lay'; cfg.zlim = [-1 1]; cfg.alpha = 0.05; cfg.refchannel = 'all'; ft_clusterplot(cfg, diffc200_theta_stat); However, I was not sure how I could plot the results. I get an error message from Fieldtrip when using ft_clusterplot: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); According to your paper in 2007, the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, and I would really appreciate if you can show me how to make such a plot. Thank you very much. Kind regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sun Aug 24 21:52:32 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 24 Aug 2014 21:52:32 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Dear Ana, dear all, the layout you used does not correspond to our nets. I tried the GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? Cheers Katrin 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > Try this one > I use > > > On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > wrote: > >> Dear all, my problems seem neverending. This time however i really need >> help. >> I implemented a pipeline for ERPs. All works now, trialdefinition, >> preprocessing, channelreplacement, ica, componentrejection, final >> artifactdetection, timelock of the single subject data. However, when I >> wanna compute the grandaverage of the single subjects I get the following >> error message: >> >> computing average of avg over 19 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the >> additional allocation of an estimated 3 MB >> computing average of avg over 2 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> the call to "ft_prepare_layout" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> the call to "ft_topoplotER" took 0 seconds and required the additional >> allocation of an estimated 0 MB >> >> Furthermore in the plot of the significant clusters, the channelnames are >> mixed up (do not correspond to my net) >> >> >> I guess that there is a problem with the layout I use. >> Here the code that I use >> >> %For generating the layout (also in the single subjects): >> >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = lay; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >> >> %For computing the grand average >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.latency = 'all'; >> >> cfg.parameter = 'avg'; >> >> cfg.keepindividual = 'no' >> >> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >> % "{:}" means to use data from all elements of the variable >> >> >> >> For plotting the significant clusters >> >> cfg = []; >> >> cfg.style = 'blank'; >> >> cfg.layout = lay; >> >> cfg.channellabels = 'yes'; >> >> cfg.highlight = 'labels'; >> >> cfg.highlightchannel = find(stat.mask); >> >> cfg.comment = 'no'; >> >> figure; ft_topoplotER(cfg, GA_90) >> >> title('Nonparametric: significant with cluster multiple comparison >> correction') >> >> >> Do you have ANY idea to this? I am really completely helpless.... >> >> thanks and best >> >> Katrin >> >> _______________________________________________ >> 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 prasandhya.a.yusuf at gmail.com Mon Aug 25 15:00:09 2014 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Mon, 25 Aug 2014 15:00:09 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> References: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Kousik Sarathy and Diego, thank you for your repply and suggestions! Thanks a lot for the Field Trip links Diego, it helps me to understand how Field Trip compute with wavelet. I thought field trip compute the wavelet the same way as cwt function in Matlab (using scales instead of frequencies). Yes, I think I need to consider the frequencies "available" from my computation and should be more aware of the spectral interpolation with vulnerable spectral leakage. I am still trying to play around with the parameters so I can get what I want. Cheers :) Sandhy On Fri, Aug 22, 2014 at 1:08 PM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Sandhy, > > Could you please tell us a bit more info about how do you compute your > TFR? Your problem sounds to me as your data length does not match the > frequency you're asking: > > > http://fieldtrip.fcdonders.nl/faq/why_does_my_output.freq_not_match_my_cfg.foi_when_using_wavelet_formerly_wltconvol_in_ft_freqanalyis > > http://fieldtrip.fcdonders.nl/faq/why_does_my_output.freq_not_match_my_cfg.foi_when_using_mtmconvol_in_ft_freqanalyis > > If you want to space frequency logarithmically, I'd recommend you to > change the y-axes scale to log-scale after the TFR. Alternatively, other > people approach the frequency resolution modifying the wavelets. You can > make a modified wavelets with different number of cycles per frequency > although this approach it's more vulnerable to spectral leakage. This is > because the wavelet at particular frequency wont fit an interger number of > cycles : > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:50; > cfg.t_ftimwin = linspace(3,37.5,size(cfg.foi,2))./cfg.foi; > cfg.toi = -0.5:0.05:1.5; > freq = ft_freqanalysis(cfg, data); > > I hope it helps, > > Diego > > ------------------------------ > > *From: *"kousik sarathy" > *To: *"FieldTrip discussion list" > *Sent: *Friday, 22 August, 2014 11:13:22 AM > *Subject: *Re: [FieldTrip] Non linear frequency steps in TFR > > > Hey Sandhy, > > Try, > cfg.foi = [7:30, 30:5:60, 60:10:120]; > > Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. > > Is this what you need? > > > -- > Regards, > Kousik Sarathy, S > > > > On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < > prasandhya.a.yusuf at gmail.com> wrote: > >> Hi All, >> >> I want to have a TFR plot that has the same portion for : >> - alpha (7-15 Hz) >> - beta (15-30 Hz) >> - low gamma (30-60 Hz) >> - high gamma (60-120 Hz) >> >> Since those bands have exponential frequency steps, I could only see very >> small part of alpha and (too) many high gamma band. Is there a way to make >> the cfg.foi in fieldtrip to have non linear steps? I tried to insert a >> exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); >> But fieldtrip seems only detect first and last number and make linear >> steps out of it. >> >> Thank you in advance for any help and share! >> >> Sandhy >> >> _______________________________________________ >> 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 > > > > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > 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 e.caspar at ucl.ac.uk Mon Aug 25 15:11:59 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 25 Aug 2014 13:11:59 +0000 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Message-ID: <86F3C645-6F78-449F-8576-2E3584CABA25@live.ucl.ac.uk> Thank you for your answer. I have found a solution with an order of 3 Thank you for the help :) Emilie Le 24 août 2014 à 13:47, Roey Schurr > a écrit : Dear Emilie, Try reading this thread and see if it helps: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005360.html The bottom line is, if you want a low highpass filer, you need to change the order of the filter you're using. In the example in the thread above, using a filter of order 5 helped Philipp applying a 0.1 Hz highpass filter. So you could try using something like: cfg.hpfiltord = 5; Hope this helps! Roey On Sun, Aug 24, 2014 at 1:49 PM, Caspar, Emilie > wrote: Thank you for your answer. The complete error message I have is this one, but I'm not able to decrypt it. Error using filter_with_correction (line 44) Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter. Error in filter_with_correction (line 44) error('Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter.'); Error in ft_preproc_bandpassfilter (line 148) filt = filter_with_correction(B,A,dat,dir); Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); It only occurs when I ask for a bpfilterrange from .1 to 30, or any values lower than .9. Thanks! Emilie Le 11 août 2014 à 12:43, Eelke Spaak > a écrit : Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie > wrote: Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.marshall at fcdonders.ru.nl Mon Aug 25 17:15:23 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Mon, 25 Aug 2014 17:15:23 +0200 Subject: [FieldTrip] example for nonparametric permutation anova using ft_statfun_depsamplesF? In-Reply-To: References: Message-ID: <53FB530B.5080904@fcdonders.ru.nl> Hi Katrin, It sounds like what you want is a factorial ANOVA with 3 factors. Fortunately the feasibility, sense and implemenation of a permutation factorial ANOVA has been discussed a great deal on this mailing list. For some examples, see: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004280.html http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-September/003113.html http://mailman.science.ru.nl/pipermail/fieldtrip/2011-December/004578.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-November/003285.html http://mailman.science.ru.nl/pipermail/fieldtrip/2009-November/002485.html http://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005466.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-January/006029.html Hopefully something there should allow you to get started. Best of luck! Tom On 8/22/2014 10:33 PM, KatrinH Heimann wrote: > Dear all, > I would like to replicate the results of a study using exactly what > they used. I need to do a nonparametric permutation anova (repeated > measures) of ERP data with 2 levels of Hemisphere, 4 levels of ROI and > 3 levels of Time (windows). Could somebody post an example of such an > analysis? I can't figure out how to determine the different levels by > the cfg structure etc. > Thanks a million > Katrin > > > _______________________________________________ > 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 ktyler at swin.edu.au Tue Aug 26 02:57:27 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 26 Aug 2014 00:57:27 +0000 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer Message-ID: Hi all, I am raking through my script trying to sort out potential faults in my analysis. One issue I have come across is whether ft_timelock analysis should be performed once, or twice when using lcmv method of beamformer. The tutorial on lcmv beamfomer found here http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow seems to indicate that time-locking is only performed once only in the analysis pipeline. However, elsewhere on the FT site, I found the following advice: "In order for the beamformer to work, we need the covariance between sensor pairs. This should be the covariance of (a particular latency window) of the averaged single trials. This is essentially different from the average covariance of the single trials. Therefore, we have to call timelockanalysis more than once: the first time we obtain the evoked field, and the second time we obtain the covariance matrix/ces at interesting latency/ies" Which is correct? I have been time locking twice: using data sets which were already time-locked using ft_timelockanalysis, and then time locking again, prior to using ft_sourceanalysis........... Wrong? The phrase 'sanity check' comes up quite often on this list, and I absolutely understand! As always, any help is very much appreciated!! Kaelasha -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Tue Aug 26 06:53:11 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Tue, 26 Aug 2014 16:53:11 +1200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: > Dear Ana, dear all, > the layout you used does not correspond to our nets. I tried the > GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. > Please can anybody help? > Cheers > Katrin > > > 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > > Try this one >> I use >> >> >> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > > wrote: >> >>> Dear all, my problems seem neverending. This time however i really need >>> help. >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> preprocessing, channelreplacement, ica, componentrejection, final >>> artifactdetection, timelock of the single subject data. However, when I >>> wanna compute the grandaverage of the single subjects I get the following >>> error message: >>> >>> computing average of avg over 19 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>> additional allocation of an estimated 3 MB >>> computing average of avg over 2 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_topoplotER" took 0 seconds and required the additional >>> allocation of an estimated 0 MB >>> >>> Furthermore in the plot of the significant clusters, the channelnames >>> are mixed up (do not correspond to my net) >>> >>> >>> I guess that there is a problem with the layout I use. >>> Here the code that I use >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> cfg.channel = obs_data.label; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.feedback = 'yes'; >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = lay; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> %For computing the grand average >>> >>> cfg = []; >>> >>> cfg.channel = 'all'; >>> >>> cfg.latency = 'all'; >>> >>> cfg.parameter = 'avg'; >>> >>> cfg.keepindividual = 'no' >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> For plotting the significant clusters >>> >>> cfg = []; >>> >>> cfg.style = 'blank'; >>> >>> cfg.layout = lay; >>> >>> cfg.channellabels = 'yes'; >>> >>> cfg.highlight = 'labels'; >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> cfg.comment = 'no'; >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> correction') >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> thanks and best >>> >>> Katrin >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.marshall at fcdonders.ru.nl Tue Aug 26 17:49:17 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Tue, 26 Aug 2014 17:49:17 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions Message-ID: <53FCAC7D.4040402@fcdonders.ru.nl> Hi Trippers, I have performed dipole fitting on some data and I would like to identify the anatomical regions in which various dipoles are located - ie, to make statements of the sort, 'dipole X was (best) localised to the right superior parietal cortex'. Specifically - I have the output from ft_dipolefitting which gives positions in the head space of the individual subjects, and I would like to anatomically label the dipoles according to the AAL atlas, which is based on the MNI template brain. I *think* what I will need to do is apply some warping of the subject MRI to the MNI template, and then apply the same warping to the dipole co-ordinate. However it is not clear to me how to warp a single point, rather than an entire volume. Is there some fieldtrip function that could be used for this? I do not think the approach detailed in // will be much use here, since (if I understand correctly) the MNI-aligned grid created here would only be used as a starting point for ft_dipolefitting. In the end a given dipole might not correspond to any grid point. Can anybody advise me on how to set about this? Thanks a lot. Best, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Aug 26 18:03:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 26 Aug 2014 18:03:44 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: <53FCAC7D.4040402@fcdonders.ru.nl> References: <53FCAC7D.4040402@fcdonders.ru.nl> Message-ID: Hi Tom, ft_volumenormalise will allow you to normalise an anatomical volume to MNI space. The output of ft_volumenormalise will have a .params and .initial field. These you need, you can discard the actual normalised volumetric data. The fields contain the linear (.initial) and nonlinear (.params) warps needed to go from subject-specific to MNI space, and vice versa. Using these you can do something like: normalised = ft_volumenormalise([], mri); mnipos = ft_warp_apply(normalised.params, ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); where subjectpos is an Nx3 array of subject-specific coordinates, and mnipos will of course be Nx3 in MNI space. In case of questions we can discuss tomorrow in person :) Best, Eelke On 26 August 2014 17:49, Tom Marshall wrote: > Hi Trippers, > > I have performed dipole fitting on some data and I would like to identify > the anatomical regions in which various dipoles are located - ie, to make > statements of the sort, 'dipole X was (best) localised to the right superior > parietal cortex'. Specifically - I have the output from ft_dipolefitting > which gives positions in the head space of the individual subjects, and I > would like to anatomically label the dipoles according to the AAL atlas, > which is based on the MNI template brain. > > I *think* what I will need to do is apply some warping of the subject MRI to > the MNI template, and then apply the same warping to the dipole co-ordinate. > However it is not clear to me how to warp a single point, rather than an > entire volume. Is there some fieldtrip function that could be used for this? > > I do not think the approach detailed in > > will be much use here, since (if I understand correctly) the MNI-aligned > grid created here would only be used as a starting point for > ft_dipolefitting. In the end a given dipole might not correspond to any grid > point. > > Can anybody advise me on how to set about this? > > Thanks a lot. > > Best, > Tom > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From t.marshall at fcdonders.ru.nl Tue Aug 26 18:38:23 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Tue, 26 Aug 2014 18:38:23 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: References: <53FCAC7D.4040402@fcdonders.ru.nl> Message-ID: <53FCB7FF.80907@fcdonders.ru.nl> Hi Eelke, Fantastic! I'm now almost where I want to be... Now I have the MNI co-ordinate, and plotting: cfg=[]; cfg.location=mnipos; cfg.locationcoordinates='head'; cfg.atlas='/home/common/matlab/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; cfg.funparameter='anatomy'; ft_sourceplot(cfg,normalised); Gives me the plot with the dipole position where I expect it (based on where it was pre-warping) and an anatomical label from the AAL atlas. So far so good. I'd like to go one better though, and directly look up the label from the atlas. ft_volumelookup returns an anatomical label if you give it a binary mask, so I could try to create a volume-sized mask full of zeroes with a single 1 at 'mnipos'. However, mnipos is an MNI co-ordinate, and I would need to specify the 1 in voxel co-ordinates (ie, as an index in the matrix rather than a co-ordinate which could be -ve). How to convert the co-ordinate? Best, Tom On 8/26/2014 6:03 PM, Eelke Spaak wrote: > Hi Tom, > > ft_volumenormalise will allow you to normalise an anatomical volume to > MNI space. The output of ft_volumenormalise will have a .params and > .initial field. These you need, you can discard the actual normalised > volumetric data. The fields contain the linear (.initial) and > nonlinear (.params) warps needed to go from subject-specific to MNI > space, and vice versa. Using these you can do something like: > > normalised = ft_volumenormalise([], mri); > mnipos = ft_warp_apply(normalised.params, > ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); > > where subjectpos is an Nx3 array of subject-specific coordinates, and > mnipos will of course be Nx3 in MNI space. > > In case of questions we can discuss tomorrow in person :) > > Best, > Eelke > > On 26 August 2014 17:49, Tom Marshall wrote: >> Hi Trippers, >> >> I have performed dipole fitting on some data and I would like to identify >> the anatomical regions in which various dipoles are located - ie, to make >> statements of the sort, 'dipole X was (best) localised to the right superior >> parietal cortex'. Specifically - I have the output from ft_dipolefitting >> which gives positions in the head space of the individual subjects, and I >> would like to anatomically label the dipoles according to the AAL atlas, >> which is based on the MNI template brain. >> >> I *think* what I will need to do is apply some warping of the subject MRI to >> the MNI template, and then apply the same warping to the dipole co-ordinate. >> However it is not clear to me how to warp a single point, rather than an >> entire volume. Is there some fieldtrip function that could be used for this? >> >> I do not think the approach detailed in >> >> will be much use here, since (if I understand correctly) the MNI-aligned >> grid created here would only be used as a starting point for >> ft_dipolefitting. In the end a given dipole might not correspond to any grid >> point. >> >> Can anybody advise me on how to set about this? >> >> Thanks a lot. >> >> Best, >> Tom >> >> _______________________________________________ >> 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 prarobinson at gmail.com Tue Aug 26 19:37:42 2014 From: prarobinson at gmail.com (Paul Robinson) Date: Tue, 26 Aug 2014 10:37:42 -0700 Subject: [FieldTrip] rda2ft.exe pthread error In-Reply-To: References: Message-ID: Greetings, All. I hope to run rda2ft as a stand-alone executable under Windows XP (that's the OS I'm stuck with for now), but I get an error to the effect that pthreadGC2.dll can't be found. Does anyone have a version of this executable available that will work? Alternatively, I may be able to re-compile under Ubuntu with MinGW, but I expect that's what created the versions of rda2ft.exe I'm finding on line to begin with... Any help would be most appreciated! Best, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 27 10:04:18 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 10:04:18 +0200 Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences In-Reply-To: References: Message-ID: Dear Hweeling, I'm not sure if I understand all your questions correctly, but I can give two pointers that might be of help. First, the error message you get when trying to plot ("no reference channel is specified") tells you what you should do: specify a reference channel :) Connectivity is between channels, so if you want to plot a spatial topography, you are plotting connectivity of all channels versus *one* channel, which is called the reference channel. You can do this with cfg.refchannel = 'chan'. You might want to take a look at this part of our tutorials: http://fieldtrip.fcdonders.nl/tutorial/sensor_analysis#cortico-muscular_coherence where plotting connectivity data is explained. Second, I see that you are using cfg.alpha = 0.05/8, implementing Bonferroni correction for multiple comparisons. Cluster statistics is already a way of dealing with multiple comparisons (i.e. the cluster test is a single test), so there is no need for this. (Unless you are iteratively doing cluster statistics across some dimension, but your code suggests to me that is not the case.) Hope that helps. Best, Eelke On 24 August 2014 14:15, Hwee Ling Lee wrote: > Dear all and Prof Maris, > > I'm re-posting this question again, as I didn't get any replies previously. > > I’m interested to investigate if there are any differences in phase > synchronization in resting state data at timepoint 2 versus timepoint 1. The > EEG data was collected using 64 EEG channels, resting state, eyes opened and > eyes closed. I’ve arbitrarily segmented the resting state data into epochs > of 2s each, and the epochs with artifacts are excluded completely from > further analyses. I then performed mtmfft to get the fourier representation > of the data, extracted the coherence, and compared the coherence difference > of timepoint 2 versus timepoint 1 of all channels paired with all other > channels. > > I figured that if I extract the connectivity analyses without specifying the > channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to > perform cluster-based statistical analyses. I get an output with ‘chan_chan’ > dimord variable. However, I was not 100% sure that this is correct, hence, > I’ve inserted my code (see below). It’ll be great if you could tell me if > what I’m doing makes any sense at all. Also, I don’t know how I can plot the > results to see if it make any sense at all. > > Also, I checked the values obtained from when I specified "cfg.channelcmb" > and when I did not specify "cfg.channelcmb", I noticed that the values were > somehow different. I would assume that the values to be similar, although > I'm not sure why they would have differences in the values obtained from > specifying "cfg.channelcmb". > > This is my code that I've used thus far: > > for sub = 1:5 > > cfg = []; > > cfg.output = 'fourier'; > > cfg.channel = {'all'}; > > cfg.method = 'mtmfft'; > > cfg.keeptrials = 'yes'; > > cfg.tapsmofrq = 5; > > cfg.foilim = [0 100]; > > cfg.taper = 'dpss'; > > % find the index for the c200 condition > > pre_c200_idx = find(data5.trialinfo == 201); > > cfg.trials = pre_c200_idx; > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > post_c200_idx = find(data5.trialinfo == 200); > > cfg.trials = post_c200_idx; > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > cfg = []; > > cfg.keeptrials = 'no'; > > cfg.channel = {'all'}; > > cfg.removemean = 'yes'; > > cfg.method = 'coh'; > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > HLF_post_c200); > > end > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > cfg_neighb.method = 'template'; > > cfg_neighb.layout = lay; > > cfg_neighb.channel = 'all'; > > neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); > > > > cfg = []; > > cfg.layout = lay; > > cfg.neighbours = neighbours; > > cfg.channel = 'all'; > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > cfg.latency = 'all'; > > cfg.avgovertime = 'no'; > > cfg.avgoverchan = 'no'; > > cfg.parameter = 'cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'depsamplesT'; > > cfg.correctm = 'cluster'; > > cfg.tail = 0; > > % cfg.clustertail = 0; > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency > bands. > > cfg.numrandomization = 10000; > > cfg.ivar = 2; > > cfg.uvar = 1; > > > > % design matrices > > clear design; > > design(1,:) = [1:5, 1:5]; > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > cfg.design = design; > > % for theta band > > cfg.avgoverfreq = 'yes'; > > cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), > and gamma (40-100). > > [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, > sub_HLF_pre_c200coh{:}); > > > When I tried to plot the results, I used this code: > > cfg = []; > > cfg.channel = 'all'; > > cfg.layout = 'lay'; > > cfg.zlim = [-1 1]; > > cfg.alpha = 0.05; > > cfg.refchannel = 'all'; > > ft_clusterplot(cfg, diffc200_theta_stat); > > However, I was not sure how I could plot the results. I get an error message > from Fieldtrip when using ft_clusterplot: > > Error using topoplot_common (line 366) > > no reference channel is specified > > Error in ft_topoplotTFR (line 192) > > [cfg] = topoplot_common(cfg, varargin{:}); > > Error in ft_clusterplot (line 372) > > ft_topoplotTFR(cfgtopo, stat); > > > > According to your paper in 2007, the topoplot of the results were masked by > the spatio-spectral pattern of the significant clusters. I don't know how to > do this, and I would really appreciate if you can show me how to make such a > plot. > > Thank you very much. > > Kind regards, > > Hweeling > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Wed Aug 27 10:52:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 10:52:38 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: <53FCB7FF.80907@fcdonders.ru.nl> References: <53FCAC7D.4040402@fcdonders.ru.nl> <53FCB7FF.80907@fcdonders.ru.nl> Message-ID: Hi Tom, Let me split your post into two questions: (1) how to compute voxel indices from known anatomical coordinates? (2) how to get an anatomical label for a known coordinate? (1) Any volumetric data should have a .transform matrix attached to it. This matrix describes the linear transformation needed to get *from* voxel indices *to* anatomical coordinates. (The type of coordinates the matrix projects to is described by the .coordsys field.). To go the other way, from anatomical coordinates to voxel indices, you just apply the inverse transformation (the round() is needed to get exact integers, otherwise matlab complains): voxinds = round(ft_warp_apply(pinv(mri.transform), mnipos)); (2) There is a function private/atlas_lookup.m that takes an atlas structure and a 1x3 position and returns the anatomical label. So there is no need to go through the creation of the mask etc. (and the answer to (1) becomes irrelevant in this instance, though still good to know :) ). This very straightforward functionality should actually be merged into ft_volumelookup and atlas_lookup needs to be deprecated, however for now the function is still very useful. Best, Eelke On 26 August 2014 18:38, Tom Marshall wrote: > Hi Eelke, > > Fantastic! I'm now almost where I want to be... > > Now I have the MNI co-ordinate, and plotting: > > cfg=[]; > cfg.location=mnipos; > cfg.locationcoordinates='head'; > cfg.atlas='/home/common/matlab/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; > cfg.funparameter='anatomy'; > ft_sourceplot(cfg,normalised); > > Gives me the plot with the dipole position where I expect it (based on where > it was pre-warping) and an anatomical label from the AAL atlas. So far so > good. > > I'd like to go one better though, and directly look up the label from the > atlas. ft_volumelookup returns an anatomical label if you give it a binary > mask, so I could try to create a volume-sized mask full of zeroes with a > single 1 at 'mnipos'. However, mnipos is an MNI co-ordinate, and I would > need to specify the 1 in voxel co-ordinates (ie, as an index in the matrix > rather than a co-ordinate which could be -ve). How to convert the > co-ordinate? > > Best, > Tom > > > On 8/26/2014 6:03 PM, Eelke Spaak wrote: >> >> Hi Tom, >> >> ft_volumenormalise will allow you to normalise an anatomical volume to >> MNI space. The output of ft_volumenormalise will have a .params and >> .initial field. These you need, you can discard the actual normalised >> volumetric data. The fields contain the linear (.initial) and >> nonlinear (.params) warps needed to go from subject-specific to MNI >> space, and vice versa. Using these you can do something like: >> >> normalised = ft_volumenormalise([], mri); >> mnipos = ft_warp_apply(normalised.params, >> ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); >> >> where subjectpos is an Nx3 array of subject-specific coordinates, and >> mnipos will of course be Nx3 in MNI space. >> >> In case of questions we can discuss tomorrow in person :) >> >> Best, >> Eelke >> >> On 26 August 2014 17:49, Tom Marshall wrote: >>> >>> Hi Trippers, >>> >>> I have performed dipole fitting on some data and I would like to identify >>> the anatomical regions in which various dipoles are located - ie, to make >>> statements of the sort, 'dipole X was (best) localised to the right >>> superior >>> parietal cortex'. Specifically - I have the output from ft_dipolefitting >>> which gives positions in the head space of the individual subjects, and I >>> would like to anatomically label the dipoles according to the AAL atlas, >>> which is based on the MNI template brain. >>> >>> I *think* what I will need to do is apply some warping of the subject MRI >>> to >>> the MNI template, and then apply the same warping to the dipole >>> co-ordinate. >>> However it is not clear to me how to warp a single point, rather than an >>> entire volume. Is there some fieldtrip function that could be used for >>> this? >>> >>> I do not think the approach detailed in >>> >>> >>> will be much use here, since (if I understand correctly) the MNI-aligned >>> grid created here would only be used as a starting point for >>> ft_dipolefitting. In the end a given dipole might not correspond to any >>> grid >>> point. >>> >>> Can anybody advise me on how to set about this? >>> >>> Thanks a lot. >>> >>> Best, >>> Tom >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From praajhen at gmail.com Wed Aug 27 13:00:17 2014 From: praajhen at gmail.com (Praghajieeth Raajhen) Date: Wed, 27 Aug 2014 13:00:17 +0200 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer Message-ID: Hello!!!! Please Help out. where am I going wrong? cfg = []; cfg.channel = 'EEG'; cfg.method = 'sam'; cfg.grid = grid; cfg.vol = vol1; cfg.projectnoise = 'yes'; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); workspace of grid,vol1,timelock (.mat) https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 1. Using fieldtrip 2013 version When i do EEG sourceanalysis using "SAM" method, following error occurs Attempted to access noise(0); index must be a positive integer or logical. Error in ==> beamformer_sam at 111 noise = noise(end); Error in ==> ft_sourceanalysis at 841 dip(i) = beamformer_sam(grid, sens, vol, squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); PS: same code for MEG source reconsturction works quite good. 2. Using fieldtrip 2014 version when i do the same I'm getting this kind of errors Undefined function or variable 'abort'. Error in ==> ft_sourceanalysis at 156 if abort PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It is showing same above error. advance thanks for your kind help. Praghajith R.S. praajhen at gmail.com Master Thesis @ UKSH Kiel, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 27 16:12:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 16:12:12 +0200 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer In-Reply-To: References: Message-ID: Dear Kaelasha, The tutorial is correct, it's best to use the averaged covariance, computed on the unaveraged data (so a single call to ft_timelockanalysis). We thought we had removed the example script you mentioned some time ago, but apparently somewhere on the wiki it still lingers. Could you let us know where you found this? Or better yet, just remove it? (It is a wiki, after all.) Best, Eelke On 26 August 2014 02:57, Kaelasha Tyler wrote: > Hi all, > > I am raking through my script trying to sort out potential faults in my > analysis. > One issue I have come across is whether ft_timelock analysis should be > performed once, or twice when using lcmv method of beamformer. > > The tutorial on lcmv beamfomer found here > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > seems to indicate that time-locking is only performed once only in the > analysis pipeline. > > However, elsewhere on the FT site, I found the following advice: > "In order for the beamformer to work, we need the covariance between sensor > pairs. This should be the covariance of (a particular latency window) of the > averaged single trials. This is essentially different from the average > covariance of the single trials. Therefore, we have to call timelockanalysis > more than once: the first time we obtain the evoked field, and the second > time we obtain the covariance matrix/ces at interesting latency/ies" > > Which is correct? > > I have been time locking twice: using data sets which were already > time-locked using ft_timelockanalysis, and then time locking again, prior to > using ft_sourceanalysis........... Wrong? > > The phrase 'sanity check' comes up quite often on this list, and I > absolutely understand! As always, any help is very much appreciated!! > > Kaelasha > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From sarita.tamang at mssm.edu Wed Aug 27 19:56:01 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Wed, 27 Aug 2014 17:56:01 +0000 Subject: [FieldTrip] Preprocessing data Message-ID: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> Hello Everybody, I'm just starting to use FieldTrip and I have some very basic questions. I'm trying to analyze LFP data along with the spikes which is in Plexon format. For the preprocessing part I tried to read it as continuous data so I did clear all close all cfg = []; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data data_org = ft_preprocessing(cfg); It gave me this error with 32 u int thing Error using timestamp_plexon (line 27) invalid input Error in ft_read_data (line 1064) ts = timestamp_plexon(tsl, tsh); % use helper function, this returns an uint64 array Error in ft_preprocessing (line 573) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in LFP (line 8) data_org = ft_preprocessing(cfg); I though this was probably due to reading it as continuous data or something I couldn't figure out so i tried using the example to see if the code runs clear all close all cfg = []; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'Strobed' cfg.trialdef.eventvalue = 35; % the value of the stimulus trigger for fully incongruent (FIC). cfg.trialdef.prestim = 0.5; % in seconds cfg.trialdef.poststim = 1; % in seconds cfg.channel = {'AD01' 'AD03'}; cfg.continuous = 'yes'; trl = []; for i=1:length(event) if strcmp(event(i).type, cfg.trialdef.eventtype) % it is a trigger, see whether it has the right value if ismember(event(i).value, cfg.trialdef.eventvalue) % add this to the trl definition begsample = event(i).sample - cfg.trialdef.prestim*hdr.Fs; endsample = event(i).sample + cfg.trialdef.poststim*hdr.Fs - 1; offset = -cfg.trialdef.prestim*hdr.Fs; trigger = event(i).value; % remember the trigger (=condition) for each trial trl(end+1, :) = [round([begsample endsample offset]) trigger]; end end end cfg = ft_definetrial(cfg); data_org = ft_preprocessing(cfg); And I just used the trl loop from the example give in the website because i kept getting error saying the trial is not defined. However even after putting the code I still get the same error. Error using ft_definetrial (line 184) no trials were defined, see FT_DEFINETRIAL for help I don't know what else should I try because I'm having trouble just doing the preprocessing. Your help will be very much appreciated. Thank you, Sarita -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Wed Aug 27 21:37:00 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 27 Aug 2014 12:37:00 -0700 Subject: [FieldTrip] Non-parametric connectivity analysis Message-ID: Hi, I'm currently trying to run a connectivity analysis. I am using 127 channel data, of which has been preprocessed using standard processing steps. I have then derived the CSD estimates using the CSD toolbox. When computing the non-parametric connectivity analysis I encounter the following warnings when computing the PDC (see below). I get similar warnings when computing granger causality, however, with the granger spectrum the solution is characterized by - Inf values In connectivity\private\sfactorization_wilson at 150 In ft_connectivity_csd2transfer at 181 In ft_connectivityanalysis at 390 Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 8.828770e-23. Can anyone shed some light on the situation? Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Thu Aug 28 01:37:34 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 27 Aug 2014 23:37:34 +0000 Subject: [FieldTrip] Preprocessing Message-ID: Hello, I am having some trouble. I need to process my data and gain access to the information below so that I can test a file converter. Can someone help me through that process? data : array of shape (n_channels, n_times) The channels’ evoked response. info : instance of Info Info dictionary. Consider using create_info to populate this structure. tmin : float Start time before event. comment : string Comment on dataset. Can be the condition. Defaults to ‘’. nave : int Number of averaged epochs. Defaults to 1. kind : str Type of data, either average or standard_error. Defaults to ‘average’. verbose : bool, str, int, or None If not None, override default verbose level (see mne.verbose). Defaults to raw.verbose. Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Thu Aug 28 08:45:32 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 06:45:32 +0000 Subject: [FieldTrip] Reject bad trials Message-ID: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlene.boenstrup at googlemail.com Thu Aug 28 09:05:55 2014 From: marlene.boenstrup at googlemail.com (=?UTF-8?Q?Marlene_B=C3=B6nstrup?=) Date: Thu, 28 Aug 2014 09:05:55 +0200 Subject: [FieldTrip] channelorder in leadfields, filter, ft_sourceanalysis Message-ID: Dear mailing-list, I am confused with the ordering of channels during leadfield computation and subsequent filter computation. Following the code in ft_prepare_leadfield, I am convinced that the channelorder of the leadfields is the same as in the input data to the function (second input to ft_prepare_leadfields). When I follow the leadfield order during ft_sourceanalysis it stays the same until the filter is computed based on that leadfield. The filter however is then applied to my data, which, during the course of ft_sourceanalysis, become reordered alphabetically during ft_checkdata in line 244 of ft_sourceanalysis (version 18.12.2013). So then the crssspectrum order and leadfield order would not match. Can you help me out with this paradox? I hope my question is not too confused, if so I will try to rephrase and exemplify, but maybe someone knows what I mean. Many thanks, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 09:07:36 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 07:07:36 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 28 09:18:35 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:18:35 +0200 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: Hi Emilie, It seems to me you are passing the non-cleaned data (epData) into ft_timelockanalysis, and not the cleaned data (data_clean). Best, Eelke On 28 August 2014 08:45, Caspar, Emilie wrote: > Hello, > > I'm preprocessing my EEG data. The script works correctly, but I think there > is something wrong, when I look at the output. > I reject bad trials with : > > cfg = []; > cfg.alim = 100; > cfg.keepchannel = 'yes'; > cfg.layout = 'biosemi64.lay'; > % cfg.method = 'summary'; > % cfg.method = 'trial'; > cfg.method = 'channel'; %% Or 'trial' > cfg.metric = 'var'; > [data_clean] = ft_rejectvisual(cfg, epData); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > > > And apparently, Fieldtrip correctly identifies what the trials to reject > are, Matlab indicates: > > 91 trials marked as GOOD, 9 trials marked as BAD > 66 channels marked as GOOD, 0 channels marked as BAD > the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 > the call to "ft_rejectvisual" took 27 seconds and required the additional > allocation of an estimated NaN MB > > So I save this file, before averaging with : > avgFC = ft_timelockanalysis(cfg, epData); > ft_singleplotER(cfg,avgFC); > > > What is strange, is that during the averaging, I can see that in my matlab > window that the averaging is on 100 trials (= the basic number of trials, > without rejection), as if Fieldtrip did not take into account the bad trials > in the averaging. > > averaging trials > averaging trial 100 of 100 > > > By reading, I though that maybe it was because of this function that was > missing into my script : > cleandata = ft_rejectartifact(cfg,'epData'); > > > However, I have the following mistake, and I don't understand it: > Error using ft_rejectartifact (line 234) > no trials were selected, cannot perform artifact detection/rejection > > Error in preprocessing_Libet (line 274) > cleandata = ft_rejectartifact(cfg,'epData'); > > > > Can someone help? > > > Thank you in advance, > > Emilie > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Thu Aug 28 09:19:27 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 07:19:27 +0000 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer In-Reply-To: References: Message-ID: Hey Praghajieeth, Firstly, I am by no means an expert of fieldtrip (I only started using it six or so months ago), so if I am wrong I apologise but you have been warned haha. Ill try and help, can you look up the following: Can you tell me what the dimensions of Cy is and whether there are any NaNs. What dimensions are data.chan.elec and data.label? Also its worth checking your vol1.mat for NaNs aswell. Good luck! Tyler Sent from my iPad On 27 Aug 2014, at 8:33 pm, "Praghajieeth Raajhen" > wrote: Hello!!!! Please Help out. where am I going wrong? cfg = []; cfg.channel = 'EEG'; cfg.method = 'sam'; cfg.grid = grid; cfg.vol = vol1; cfg.projectnoise = 'yes'; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); workspace of grid,vol1,timelock (.mat) https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 1. Using fieldtrip 2013 version When i do EEG sourceanalysis using "SAM" method, following error occurs Attempted to access noise(0); index must be a positive integer or logical. Error in ==> beamformer_sam at 111 noise = noise(end); Error in ==> ft_sourceanalysis at 841 dip(i) = beamformer_sam(grid, sens, vol, squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); PS: same code for MEG source reconsturction works quite good. 2. Using fieldtrip 2014 version when i do the same I'm getting this kind of errors Undefined function or variable 'abort'. Error in ==> ft_sourceanalysis at 156 if abort PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It is showing same above error. advance thanks for your kind help. Praghajith R.S. praajhen at gmail.com Master Thesis @ UKSH Kiel, Germany _______________________________________________ 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 Thu Aug 28 09:16:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:16:08 +0200 Subject: [FieldTrip] channelorder in leadfields, filter, ft_sourceanalysis In-Reply-To: References: Message-ID: Dear Marlene, Have a look at this bug: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2639 If you don't have an account on our bugzilla, it is easy to create one using just your e-mail address, then you can add yourself as CC to that bug. Best, Eelke On 28 August 2014 09:05, Marlene Bönstrup wrote: > Dear mailing-list, > > I am confused with the ordering of channels during leadfield computation and > subsequent filter computation. > Following the code in ft_prepare_leadfield, I am convinced that the > channelorder of the leadfields is the same as in the input data to the > function (second input to ft_prepare_leadfields). > When I follow the leadfield order during ft_sourceanalysis it stays the same > until the filter is computed based on that leadfield. The filter however is > then applied to my data, which, during the course of ft_sourceanalysis, > become reordered alphabetically during ft_checkdata in line 244 of > ft_sourceanalysis (version 18.12.2013). > So then the crssspectrum order and leadfield order would not match. > > Can you help me out with this paradox? > > I hope my question is not too confused, if so I will try to rephrase and > exemplify, but maybe someone knows what I mean. > > Many thanks, > > Marlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Thu Aug 28 09:23:41 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 07:23:41 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ 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 eelke.spaak at donders.ru.nl Thu Aug 28 09:24:39 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:24:39 +0200 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer In-Reply-To: References: Message-ID: Hi Praghajith, You should use the latest version of fieldtrip; it should work with the 2014 one you mentioned. The error concerning the 'abort' variable might be caused by fieldtrip not being on your path correctly. You should add *only* the root folder to the path yourself (i.e. not using addpath(genpath()) ), then fieldtrip takes care of the path itself. So do: restoredefaultpath addpath ft_defaults and then it should work. If it doesn't, let us know. Best, Eelke On 27 August 2014 13:00, Praghajieeth Raajhen wrote: > Hello!!!! > > Please Help out. where am I going wrong? > > cfg = []; > cfg.channel = 'EEG'; > cfg.method = 'sam'; > cfg.grid = grid; > cfg.vol = vol1; > cfg.projectnoise = 'yes'; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > workspace of grid,vol1,timelock (.mat) > https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 > > 1. Using fieldtrip 2013 version > When i do EEG sourceanalysis using "SAM" method, following error occurs > > Attempted to access noise(0); index must be a positive integer or logical. > > Error in ==> beamformer_sam at 111 > noise = noise(end); > > Error in ==> ft_sourceanalysis at 841 > dip(i) = beamformer_sam(grid, sens, vol, > squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); > > > PS: same code for MEG source reconsturction works quite good. > > 2. Using fieldtrip 2014 version > when i do the same I'm getting this kind of errors > > Undefined function or variable 'abort'. > > Error in ==> ft_sourceanalysis at 156 > if abort > > PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It > is showing same above error. > > > advance thanks for your kind help. > > Praghajith R.S. > praajhen at gmail.com > Master Thesis @ UKSH > Kiel, Germany > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Thu Aug 28 09:27:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:27:44 +0200 Subject: [FieldTrip] Preprocessing data In-Reply-To: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> References: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> Message-ID: Hello Sarita, It should not be a surprise that ft_definetrial does not find any trials for your data, since you are using trigger codes specified for the example dataset used in the tutorials. For reading continuous data, try adding cfg.continuous = 'yes' for your call to ft_preprocessing: cfg = []; cfg.continuous = 'yes'; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data data_org = ft_preprocessing(cfg); If that does not work, there is an error in some of the low-level functions for reading Plexon data, and I would not know how to help you on that. Hope this helps, best, Eelke On 27 August 2014 19:56, Tamang, Sarita wrote: > > Hello Everybody, > > I'm just starting to use FieldTrip and I have some very basic questions. > > I'm trying to analyze LFP data along with the spikes which is in Plexon > format. > > For the preprocessing part I tried to read it as continuous data so I did > clear all > close all > > cfg = []; > > cfg.dataset = 'fr041110a_nat1.plx'; %reading the data > data_org = ft_preprocessing(cfg); > > It gave me this error with 32 u int thing > > Error using timestamp_plexon (line 27) > invalid input > > Error in ft_read_data (line 1064) > ts = timestamp_plexon(tsl, tsh); % use helper function, this returns > an uint64 array > > Error in ft_preprocessing (line 573) > dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', > endsample, 'chanindx', rawindx, 'checkboundary', > strcmp(cfg.continuous, 'no'), > 'dataformat', cfg.dataformat); > > Error in LFP (line 8) > data_org = ft_preprocessing(cfg); > > > I though this was probably due to reading it as continuous data or > something I couldn't figure out so i tried using the example to see if the > code runs > > clear all > close all > > cfg = []; > > cfg.dataset = 'fr041110a_nat1.plx'; %reading the data > > hdr = ft_read_header(cfg.dataset); > event = ft_read_event(cfg.dataset); > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'Strobed' > cfg.trialdef.eventvalue = 35; % the value of the stimulus trigger for > fully incongruent (FIC). > cfg.trialdef.prestim = 0.5; % in seconds > cfg.trialdef.poststim = 1; % in seconds > cfg.channel = {'AD01' 'AD03'}; > cfg.continuous = 'yes'; > > trl = []; > > for i=1:length(event) > if strcmp(event(i).type, cfg.trialdef.eventtype) > % it is a trigger, see whether it has the right value > if ismember(event(i).value, cfg.trialdef.eventvalue) > % add this to the trl definition > begsample = event(i).sample - cfg.trialdef.prestim*hdr.Fs; > endsample = event(i).sample + cfg.trialdef.poststim*hdr.Fs - 1; > offset = -cfg.trialdef.prestim*hdr.Fs; > trigger = event(i).value; % remember the trigger (=condition) > for each trial > trl(end+1, :) = [round([begsample endsample offset]) trigger]; > end > end > end > > cfg = ft_definetrial(cfg); > data_org = ft_preprocessing(cfg); > > And I just used the trl loop from the example give in the website because i > kept getting error saying the trial is not defined. However even after > putting the code I still get the same error. > > Error using ft_definetrial (line 184) > no trials were defined, see FT_DEFINETRIAL for help > > I don't know what else should I try because I'm having trouble just doing > the preprocessing. Your help will be very much appreciated. > > Thank you, > Sarita > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Thu Aug 28 10:02:35 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 08:02:35 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> Message-ID: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 09:23, "Caspar, Emilie" > a écrit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 10:29:07 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 08:29:07 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk>, <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: Hey Emilie, It looks to me like you are creating clean_data twice. Could you change the first clean_data to a different name and then use that variable name when you call ft_rejectartifact? Tyler Sent from my iPad On 28 Aug 2014, at 5:35 pm, "Caspar, Emilie" > wrote: Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Universit? Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 ao?t 2014 ? 09:23, "Caspar, Emilie" > a ?crit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 ao?t 2014 ? 09:07, Tyler Grummett > a ?crit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 10:30:55 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 08:30:55 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk>, <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: <68CB9987-A228-4D54-AD12-93FD7DAD7D62@flinders.edu.au> Alternatively you could keep the same variable after you first make it. ie: cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,clean_data); ** avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); Tyler Sent from my iPad On 28 Aug 2014, at 5:35 pm, "Caspar, Emilie" > wrote: cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Thu Aug 28 10:41:07 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 08:41:07 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: <93F42BBB-7FC2-4CF6-9418-3B5A4C1D8982@live.ucl.ac.uk> Dear all, I found a solution, just by removing brackets here :[clean_data] = ft_rejectvisual(cfg, epData); Thank you again for your help! Emilie --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 10:02, "Caspar, Emilie" > a écrit : Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 09:23, "Caspar, Emilie" > a écrit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Aug 29 18:36:14 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Fri, 29 Aug 2014 18:36:14 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd Message-ID: Dear Fieldtrippers We have a 3x3 design and MEG data, say only mag channels (n102) to simplify. We want to perform a cluster-based permutation approach but timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', etc) cannot deal with interactions when you have more than three levels (true?) So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical Package- and feed 'clusterstat.m' with them We have done this with one channel over time with success. However, I am clueless now about how to solve the problem when dealing with the whole channel set. I wonder what is the nature of the cfg.dim that we need to feed 'clusterstat.m' with. Up to now, we use, (cioming out of -R-): size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) and the following presets: cfg=[]; cfg.clustercritval = Fcritmain; % We genereate this before hand cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here load('neuromag306mag_neighb.mat'); cfg.neighbours = neighbours; cfg.feedback = 'yes'; cfg.numrandomization = 1000; cfg.clusterstatistic = 'maxsum'; cfg.layout = 'neuromag306mag.lay'; for i = 1:length(cfg.neighbours) cfg.channel{i} = cfg.neighbours(i).label; end stat = clusterstat(cfg,statrnd, statobs) Which lead us to an error within findcluster Error using findcluster (line 59) invalid dimension of spatdimneighbstructmat Error in clusterstat (line 197) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); If anybody has got some insigth it would be greatly appreciated. Or any hints. Are the size of my statobs and starnd correct? I can share more information and firstly apologize if I was not able to describe the problem accurately, I am confused regarding that 'reshape' and the addition of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the problem arises first when findcluster.m tries to calculate the size of spatdimneighbstructmat First line of findcluster.m calcualtes 'spatdimlength' by : " spatdimlength = size(onoff, 1);" which in our case is "1", which is obviously wrong?. manythanks&peace2all -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Sat Aug 30 12:47:10 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Sat, 30 Aug 2014 10:47:10 +0000 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer In-Reply-To: References: , Message-ID: Hi Eelke, Thanks so much for this. As it happens I copied the script recommending to time lock twice some time ago, and wasn't able to see it when I looked through the FT site this time. So, problem solved all round. Cheers! Kaelasha ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Thursday, 28 August 2014 12:12 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer Dear Kaelasha, The tutorial is correct, it's best to use the averaged covariance, computed on the unaveraged data (so a single call to ft_timelockanalysis). We thought we had removed the example script you mentioned some time ago, but apparently somewhere on the wiki it still lingers. Could you let us know where you found this? Or better yet, just remove it? (It is a wiki, after all.) Best, Eelke On 26 August 2014 02:57, Kaelasha Tyler wrote: > Hi all, > > I am raking through my script trying to sort out potential faults in my > analysis. > One issue I have come across is whether ft_timelock analysis should be > performed once, or twice when using lcmv method of beamformer. > > The tutorial on lcmv beamfomer found here > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > seems to indicate that time-locking is only performed once only in the > analysis pipeline. > > However, elsewhere on the FT site, I found the following advice: > "In order for the beamformer to work, we need the covariance between sensor > pairs. This should be the covariance of (a particular latency window) of the > averaged single trials. This is essentially different from the average > covariance of the single trials. Therefore, we have to call timelockanalysis > more than once: the first time we obtain the evoked field, and the second > time we obtain the covariance matrix/ces at interesting latency/ies" > > Which is correct? > > I have been time locking twice: using data sets which were already > time-locked using ft_timelockanalysis, and then time locking again, prior to > using ft_sourceanalysis........... Wrong? > > The phrase 'sanity check' comes up quite often on this list, and I > absolutely understand! As always, any help is very much appreciated!! > > Kaelasha > > > > > > > > _______________________________________________ > 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 tim.curran at Colorado.EDU Fri Aug 1 21:00:44 2014 From: tim.curran at Colorado.EDU (Tim Curran) Date: Fri, 1 Aug 2014 13:00:44 -0600 Subject: [FieldTrip] Postdoc Position, Colorado Message-ID: <5AE917E0-2DC4-4DFD-A5DF-12E2CD19FC01@colorado.edu> Postdoctoral Research Associate Position Curran Lab, University of Colorado Boulder Postdoctoral research position available in the lab of Tim Curran at the Department of Psychology & Neuroscience, University of Colorado Boulder to work on an ONR-funded grant focusing on top-down influences on visual object recognition. Curran’s lab will focus on human EEG studies in collaboration with Randy O’Reilly (UC Boulder, computational modeling), David Sheinberg (Brown, primate electrophysiology), and Tor Wager (UC Boulder, fMRI). PhD in psychology, neuroscience, or related fields required. Desirable qualifications include human EEG research experience, especially involving advanced analyses approaches including machine learning. fMRI experience is also valuable, but not necessary. The position is available immediately, but the start date is flexible. The University of Colorado is an Equal Opportunity Employer committed to building a diverse workforce. We encourage applications from women, racial and ethnic minorities, individuals with disabilities and veterans. Alternative formats of this ad can be provided upon request for individuals with disabilities by contacting the ADA Coordinator at hr-ada at colorado.edu. The University of Colorado Boulder conducts background checks on all final applicants being considered for employment. For further information contact, tim.curran at colorado.edu. Applicants must submit a CV, a statement of research experience/interests, a cover letter including email addresses for at least three referees, and one recommendation letter. The other referees will be contacted for letters if needed. Applications will be accepted electronically at https://www.jobsatcu.com/postings/85712 . The job posting # is RF01616. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dragos.n.stanciu at gmail.com Sat Aug 2 03:32:54 2014 From: dragos.n.stanciu at gmail.com (Dragos Stanciu) Date: Sat, 2 Aug 2014 02:32:54 +0100 Subject: [FieldTrip] Connectivity analysis after applying Welch's method In-Reply-To: <53DA41D1.7080604@donders.ru.nl> References: <53DA41D1.7080604@donders.ru.nl> Message-ID: Hello Jörn, Thank you for the suggestion. I managed to get connectivity plots with that function. Coming back to the question in my previous email, would it be OK to take the absolute value of the debiased wpli values to be used in graph analysis as edge weights? For example, HERMES, another connectivity toolbox returns only values between 0 and 1 for this measure. Also, Vinck et al. paper says that the value should be positive, I guess by taking the absolute value in the case of a lagging phase. Sorry if this is a basic question, but I would appreciate if someone can shed some light on this. Kind regards, Dragos Stanciu On Jul 31, 2014 2:18 PM, Jörn M. Horschig wrote: > Hi Dragos, > > have yoi checked ft_topoplotCC? > > Best, > Jörn > > On 7/31/2014 12:06 AM, Dragos Stanciu wrote: > >> Hello Jörn, >> >> Thank you so much for responding. The suggested changes were spot on and >> ft_connectivityanalysis executed successfully. >> In the end, I went with the approach of redefining the 10s epoch in 2s >> minitrials and performing ft_freqanalysis on these minitrials with >> /cfg.output='fourier'/ and /keeptrial='yes'. /I then did >> ft_connectivityanalysis on the frequency structures resulted from >> processing the segmented data. This would give me connectivity matrices for >> each 10s epoch, which I then average to get one connectivity matrix for the >> subject (technically, I have a connectivity matrix for each frequency bin, >> but I can again average across the frequency spectrum). >> >> I have a question on the debiased weighted phase lag index measure. The >> values in the matrix vary between -1 and 1 (depending if the relative phase >> lags or leads). When I construct the adjacency matrices, is it just a >> matter of taking the absolute value of these values? >> >> I would also like some advice on plotting connectivity matrices. I was >> able to plot one matrix with ft_plot_matrix, but it would be really nice if >> I could plot a connectivity graph where the thickness of the edges >> correspond to the strength of the connectivity measure. I tried >> ft_topoplotER with 4D148.lay as the layout file and 'gui' as refchannel, >> but I didn't get anything interesting. As my data is MEG, it doesn't make >> sense to me to choose a reference channel... >> Ideally, I would like to combine the layout (4D148.lay) with the >> connectivity matrix for plotting the graph. Do you have any ideas for this? >> Also, do you have any other suggestions on what other plotting functions >> can be used with these connectivity matrices? I've looked through the >> tutorial, but the functions don't seem very relevant to my type of data. >> >> Thank you for your help. >> >> Regards, >> Dragos Stanciu >> >> Message: 9 >> Date: Wed, 30 Jul 2014 10:28:50 +0200 >> From: "J?rn M. Horschig" > > >> To: FieldTrip discussion list > > >> Subject: Re: [FieldTrip] Connectivity analysis after applying Welch's >> method >> >> Hi Dragos, >> >> while quickly browisng through your mail, it appears to me that you >> simply need to set single_epoch_freq.dimord = 'rpt_chan_freq'. >> FieldTrip >> is using the dimord field to infer the order of the dimensions >> (*dim*ension *ord*er). The actual dimensions of powspctrm and >> crsspctrm >> are now inconsistent with the dimord specifications. >> >> Best, >> J?rn >> >> >> On 7/30/2014 1:18 AM, Dragos Stanciu wrote: >> > Dear FieldTrippers, >> > >> > I'm Dragos Stanciu and I'm working on my MSc in Neuroinformatics >> > dissertation at the University of Edinburgh. My project involves >> > analysis of resting-state functional connectivity using graph theory >> > in Alzheimer's disease based on MEG data. >> > >> > Each of my subjects has a number of 10s epochs (trials) associated >> > with him/her. I was able to compute the coherence and weighted phase >> > lag index measures (with /ft_freqanalysis /and >> > /ft_connectivityanalysis) /by treating my 10s epochs as trials, but >> > now I would like to reduce the amount of noise in the estimation of >> > the frequency spectrum by employing Welch's method. >> > >> > For this, I split each 10s epoch in 2s segments (minitrials) >> with 50% >> > overlap: >> > >> > [sep_epoch_data] = ft_redefinetrial(cfg_cut, >> single_epoch_data)/. / >> > >> > >> > I then apply /ft_preprocessing /on the minitrials: >> > >> > [processed_single_epoch] = ft_preprocessing(cfg, >> sep_epoch_data); >> > >> > I then do frequency analysis on the preprocessed segmented data: >> > >> > [single_epoch_freq] = ft_freqanalysis(cfg_freq, >> > processed_single_epoch); >> > >> > where >> > >> > display(cfg_freq) >> > method: 'mtmfft' >> > taper: 'hanning' >> > foilim: [0.5000 4] >> > output: 'powandcsd' >> > channel: {148x1 cell} % 148 channels labelled from >> A1 to >> > A148 >> > keeptrial: 'no' % don't keep the minitrials, as we want >> > to average them >> > keeptapers: 'no' >> > >> > Please note that I average the minitrials (/keeptrial = 'no'/) as I >> > want to get an average of the frequencies. >> > >> > The resulting /single_epoch_freq/ structure looks like: >> > >> > display(single_epoch_freq) >> > label: {148x1 cell} >> > dimord: 'chan_freq' >> > freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008 >> > 4.0009] >> > powspctrm: [148x8 double] >> > labelcmb: {10878x2 cell} % channel combinations >> (148*147/2) >> > crsspctrm: [10878x8 double] >> > cfg: [1x1 struct] >> > >> > >> > The last step is to append the averaged frequency structures of each >> > 10s epoch together and perform connectivity analysis on the main 10s >> > epochs. I do the concatenation like so: >> > freq_avgs_powspctrm = [freq_avgs_powspctrm; >> > permute(single_epoch_freq.powspctrm, [3,1,2])]; >> > >> > freq_avgs_crsspctrm = [freq_avgs_crsspctrm; >> > permute(single_epoch_freq.crsspctrm, [3,1,2])]; >> > >> > The idea behind /permute(..., [3, 1, 2])/ is that I want the first >> > dimension to represent trials, the second dimension channel >> > combinations and the third dimension frequencies, as this is needed >> > for the input of /ft_connectivity_wpli /(Repetitions x >> > Channelcombination (x Frequency)). >> > >> > I then call stat_conn = ft_connectivityanalysis(cfg_conn, >> freq_avgs); >> > where: >> > >> > display(cfg_conn) >> > method: 'wpli_debiased' >> > channel: {148x1 cell} >> > >> > and >> > >> > display(freq_avgs) >> > powspctrm: [4x148x8 double] % as I have 4 ten >> second epochs >> > crsspctrm: [4x10878x8 double] % as I have 4 ten >> second epochs >> > label: {148x1 cell} >> > dimord: 'chan_freq' >> > freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008 >> > 4.0009] >> > labelcmb: {10878x2 cell} >> > cfg: [1x1 struct] >> > >> > >> > The error that I get when running /ft_connectivityanalysis/ is: >> > >> > Error using cat >> > CAT arguments dimensions are not consistent. >> > Error in ft_checkdata>fixcsd (line 1170) >> > data.crsspctrm = cat(catdim, data.powspctrm, >> data.crsspctrm); >> > >> > >> > When debugging, /catdim/ is equal to 1. The error occurs because the >> > 2nd dimension of data.powspctrm and data.crsspctrm are not equal >> > (former is 148, latter is 10878). Do you have any suggestions on >> > getting around this problem? Should I construct /freq_avgs /(data >> > input to ft_connectivityanalysis) differently? I'm also open to >> > different approaches to working out Welch's method in FieldTrip. >> > >> > Please download this archive that contains my test script and 4 >> > example 10s epochs of a subject: >> > https://www.dropbox.com/s/js7pztai02f5p27/Welch_fieldtrip.zip >> The code >> > should make things clearer (or the opposite). >> > Observations: I thought about using /ft_freqanalysis_mtmwelch/, but >> > apparently it's deprecated. >> > >> > Thank you all in advance for your feedback. >> > >> > Kind regards, >> > Dragos Stanciu >> > >> >> >> -- >> J?rn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> >> >> >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniele.marinazzo at ugent.be Sun Aug 3 20:05:16 2014 From: daniele.marinazzo at ugent.be (Daniele Marinazzo) Date: Sun, 3 Aug 2014 20:05:16 +0200 Subject: [FieldTrip] Controversies in EEG source imaging - workshop, data and special issue in Brain Topography Message-ID: Dear Colleague The Key Laboratory of Neuroinformation of the Ministery of Education of China in Chengdu (NIL), in collaboration with the Cuban Neuroscience Center (CNEURO), and the University of Ghent (UG) are organizing a workshop on “Controversies in EEG source imaging (ESI)” Which will be held in Chengdu, China from the 20th to the 22nd of August. All the info on the workshop and related activities are on the website http://www.neuro.uestc.edu.cn/ceegsi/ Confirmed speakers include: Anna Custo Jorge Bosch-Bayard Claude Bédard Fabrizio de Vico Fallani Daqing Guo Stefan Haufe Xu Lei Daniele Marinazzo Cu Peng Dimitris Pinotsis Jorge Riera Andreas Spiegler Pedro Valdes Sosa Dezhong Yao Rather than having traditional presentations we shall be discussing questions such as: --Are there monopoles in the brain, and if so what impact to the have on ESI? --Is there is a best EEG reference and does it matter for ESI? --What is the best way to measure brain connectivity in ESI? --What if any, will the impact of Neural Field theory on ESI be? with short presentations followed by discussions. We hope you can come and join us there. In any case, the workshop is structured in such a way that interested researchers can contribute even remotely. This can happen in several ways: -on the website several types of data (scalp and intracranial recordings from human, rat and monkey) have been uploaded. You can play with these data and share results and discussions. -you can contribute to the discussion participating to the forum on the website, uploading papers, preliminary results, etc. -ultimately, these discussions will result in a special issue of Brain Topography, to which we invite you to contribute. The papers should ideally reflect the discussions during the workshop as well as before and after on the forum, and/or analyze the simulations and at least one experimental data set. Kind regards Dezhong Yao, Daqing Gu, Xu Peng, Daniele Marinazzo and Pedro Valdes Sosa -- Daniele Marinazzo -- Department of Data Analysis Faculty of Psychology and Pedagogical Sciences, Gent University Henri Dunantlaan 1, B-9000 Gent, Belgium +32 (0) 9 264 6375 http://users.ugent.be/~dmarinaz/ http://helpdesk.ugent.be/e-maildisclaimer.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Aug 5 13:53:42 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 5 Aug 2014 13:53:42 +0200 Subject: [FieldTrip] repairing bad channels Message-ID: Dear all, I'm trying to repair the bad channels by using the ft_channelrepair function for 64 channels EEG data. I've set up the structure like this: load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); cfg_neighb.method = 'distance'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, data4); cfg = []; if strcmp('S004', dir_analysis{sub}) == 1 cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; end cfg.trials = 'all'; cfg.method = 'average'; cfg.neighbours = neighbours; cfg.elec = lay.pos; data5 = ft_channelrepair(cfg, data4); However, I get an error message: ttempt to reference field of non-structure array. Error in ft_datatype_sens (line 136) nchan = length(sens.label); Error in ft_checkconfig (line 246) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_preamble_trackconfig (line 38) cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); Error in ft_preamble (line 54) evalin('caller', ['ft_preamble_' cmd]); Error in ft_channelrepair (line 76) ft_preamble trackconfig Can someone please help me? Thank you very much! Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From edueeg at gmail.com Tue Aug 5 14:09:25 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Tue, 5 Aug 2014 13:09:25 +0100 Subject: [FieldTrip] fieldtrip workshop Message-ID: Hello, I would please like to know more about the course scheduled for September 17-19 in Birmingham UK, as announced at http://fieldtrip.fcdonders.nl/workshop/birmingham Specifically, I would like to know if the course is confirmed and how to apply Thank you very much eduardo schenberg -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Aug 5 14:10:59 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Aug 2014 14:10:59 +0200 Subject: [FieldTrip] repairing bad channels In-Reply-To: References: Message-ID: <53E0C9D3.9080508@donders.ru.nl> Hi Hweeling, reading the help of the function might help ;) > The EEG or MEG sensor positions can be present in the data or can be specified as > cfg.elec = structure with electrode positions, seeFT_DATATYPE_SENS > cfg.grad = structure with gradiometer definition, seeFT_DATATYPE_SENS > cfg.elecfile = name of file containing the electrode positions, seeFT_READ_SENS > cfg.gradfile = name of file containing the gradiometer definition, seeFT_READ_SENS The cross-reference to ft_datatype_sens should help you to resolve your issue (and check out the FieldTrip/template directory) Best, Jörn On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > Dear all, > > I'm trying to repair the bad channels by using the ft_channelrepair > function for 64 channels EEG data. > > I've set up the structure like this: > > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'distance'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data4); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.neighbours = neighbours; > cfg.elec = lay.pos; > data5 = ft_channelrepair(cfg, data4); > > However, I get an error message: > > ttempt to reference field of non-structure array. > Error in ft_datatype_sens (line 136) > nchan = length(sens.label); > Error in ft_checkconfig (line 246) > cfg.elec = ft_datatype_sens(cfg.elec); > Error in ft_preamble_trackconfig (line 38) > cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); > Error in ft_preamble (line 54) > evalin('caller', ['ft_preamble_' cmd]); > Error in ft_channelrepair (line 76) > ft_preamble trackconfig > > Can someone please help me? > > Thank you very much! > > Best regards, > Hweeling > > > > _______________________________________________ > 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 agreene24 at gmail.com Wed Aug 6 07:12:06 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 14:12:06 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? Message-ID: Hello, I'm somewhat new to ft, so forgive me if this is a seemingly trivial question. I ran runica on ft preprocessed MEG data, but I also want to see the frequency power spectrum of the components. I've tried using freqanalysis on the components in the following manner: comp.cfg.previous.tapsmofrq=4; comp.cfg.previous.foi=[0:2:30]; comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; comp.cfg.previous.toi=[-0.5:0.05:1.5]; comp.cfg.previous.channel='all'; [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) // but the errors I receive are as follows: Warning: Input arguments must be scalar. > In specest/private/ft_preproc_polyremoval at 57 In ft_specest_mtmfft at 66 In ft_freqanalysis at 526 ??? For colon operator with char operands, first and last operands must be char. Error in ==> ft_preproc_polyremoval at 58 for i = 0:order Error in ==> ft_specest_mtmfft at 66 dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); Error in ==> ft_freqanalysis at 526 [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', cfg.taper, options{:}, 'feedback', fbopt); // Is using freqanalysis on the components possible? If so, what needs to be modified in order to employ it? If not, is there another method to outputting the frequency power spectrum of ica components? Thanks, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Aug 6 09:07:38 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 6 Aug 2014 10:07:38 +0300 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Dear Ashly, I'm trying to recreate the error you got, but I couldn't. Did you specify the method? Try using comp.cfg.previous.method = 'mtmfft'; When I run ft_freqanalysis using the mtmfft method on the comp structure I get from the ICA tutorial, everything seems to work fine. Did you try running the same function on a tutorial structure? Best. Roey On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene wrote: > Hello, > > I'm somewhat new to ft, so forgive me if this is a seemingly trivial > question. > I ran runica on ft preprocessed MEG data, but I also want to see the > frequency power spectrum of the components. I've tried using freqanalysis > on the components in the following manner: > > > comp.cfg.previous.tapsmofrq=4; > comp.cfg.previous.foi=[0:2:30]; > comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; > comp.cfg.previous.toi=[-0.5:0.05:1.5]; > comp.cfg.previous.channel='all'; > > [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) > > > // but the errors I receive are as follows: > > > Warning: Input arguments must be scalar. > > In specest/private/ft_preproc_polyremoval at 57 > In ft_specest_mtmfft at 66 > In ft_freqanalysis at 526 > ??? For colon operator with char operands, first and last operands must be > char. > > Error in ==> ft_preproc_polyremoval at 58 > for i = 0:order > > Error in ==> ft_specest_mtmfft at 66 > dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); > > Error in ==> ft_freqanalysis at 526 > [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', > cfg.taper, options{:}, 'feedback', fbopt); > > // Is using freqanalysis on the components possible? If so, what needs to > be modified in order to employ it? If not, is there another method to > outputting the frequency power spectrum of ica components? > > Thanks, > > Ashley > > > > _______________________________________________ > 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 Aug 6 09:32:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 6 Aug 2014 09:32:34 +0200 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Hi Ashley, In addition to Roey's remark, in general I would say it is not a good idea to explicitly modify the xxx.cfg.previous structure. Just create a new cfg from scratch for each FT function call: cfg = []; cfg.method = 'mtmfft'; cfg.foi = .... etc. compfreq = ft_freqanalysis(cfg, comp); Best, Eelke On 6 August 2014 09:07, Roey Schurr wrote: > Dear Ashly, > > I'm trying to recreate the error you got, but I couldn't. > Did you specify the method? Try using > comp.cfg.previous.method = 'mtmfft'; > > When I run ft_freqanalysis using the mtmfft method on the comp structure I > get from the ICA tutorial, everything seems to work fine. Did you try > running the same function on a tutorial structure? > > Best. > Roey > > > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene wrote: >> >> Hello, >> >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial >> question. >> I ran runica on ft preprocessed MEG data, but I also want to see the >> frequency power spectrum of the components. I've tried using freqanalysis on >> the components in the following manner: >> >> >> comp.cfg.previous.tapsmofrq=4; >> comp.cfg.previous.foi=[0:2:30]; >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; >> comp.cfg.previous.channel='all'; >> >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) >> >> >> // but the errors I receive are as follows: >> >> >> Warning: Input arguments must be scalar. >> > In specest/private/ft_preproc_polyremoval at 57 >> In ft_specest_mtmfft at 66 >> In ft_freqanalysis at 526 >> ??? For colon operator with char operands, first and last operands must be >> char. >> >> Error in ==> ft_preproc_polyremoval at 58 >> for i = 0:order >> >> Error in ==> ft_specest_mtmfft at 66 >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); >> >> Error in ==> ft_freqanalysis at 526 >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', >> cfg.taper, options{:}, 'feedback', fbopt); >> >> // Is using freqanalysis on the components possible? If so, what needs to >> be modified in order to employ it? If not, is there another method to >> outputting the frequency power spectrum of ica components? >> >> Thanks, >> >> Ashley >> >> >> >> _______________________________________________ >> 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 agreene24 at gmail.com Wed Aug 6 10:11:10 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 17:11:10 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Hi Eelke, It worked fine once I just created a new cfg. It's always the small, overlooked things... Thanks!! Ashley On Wed, Aug 6, 2014 at 4:32 PM, Eelke Spaak wrote: > Hi Ashley, > > In addition to Roey's remark, in general I would say it is not a good > idea to explicitly modify the xxx.cfg.previous structure. Just create > a new cfg from scratch for each FT function call: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.foi = .... > etc. > > compfreq = ft_freqanalysis(cfg, comp); > > Best, > Eelke > > On 6 August 2014 09:07, Roey Schurr wrote: > > Dear Ashly, > > > > I'm trying to recreate the error you got, but I couldn't. > > Did you specify the method? Try using > > comp.cfg.previous.method = 'mtmfft'; > > > > When I run ft_freqanalysis using the mtmfft method on the comp structure > I > > get from the ICA tutorial, everything seems to work fine. Did you try > > running the same function on a tutorial structure? > > > > Best. > > Roey > > > > > > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene > wrote: > >> > >> Hello, > >> > >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial > >> question. > >> I ran runica on ft preprocessed MEG data, but I also want to see the > >> frequency power spectrum of the components. I've tried using > freqanalysis on > >> the components in the following manner: > >> > >> > >> comp.cfg.previous.tapsmofrq=4; > >> comp.cfg.previous.foi=[0:2:30]; > >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; > >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; > >> comp.cfg.previous.channel='all'; > >> > >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) > >> > >> > >> // but the errors I receive are as follows: > >> > >> > >> Warning: Input arguments must be scalar. > >> > In specest/private/ft_preproc_polyremoval at 57 > >> In ft_specest_mtmfft at 66 > >> In ft_freqanalysis at 526 > >> ??? For colon operator with char operands, first and last operands must > be > >> char. > >> > >> Error in ==> ft_preproc_polyremoval at 58 > >> for i = 0:order > >> > >> Error in ==> ft_specest_mtmfft at 66 > >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); > >> > >> Error in ==> ft_freqanalysis at 526 > >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', > >> cfg.taper, options{:}, 'feedback', fbopt); > >> > >> // Is using freqanalysis on the components possible? If so, what needs > to > >> be modified in order to employ it? If not, is there another method to > >> outputting the frequency power spectrum of ica components? > >> > >> Thanks, > >> > >> Ashley > >> > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agreene24 at gmail.com Wed Aug 6 10:12:06 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 17:12:06 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: And, also of course Roey, thank you as well Ashley On Wed, Aug 6, 2014 at 5:11 PM, Ashley Greene wrote: > Hi Eelke, > > It worked fine once I just created a new cfg. It's always the small, > overlooked things... > > Thanks!! > > Ashley > > > On Wed, Aug 6, 2014 at 4:32 PM, Eelke Spaak > wrote: > >> Hi Ashley, >> >> In addition to Roey's remark, in general I would say it is not a good >> idea to explicitly modify the xxx.cfg.previous structure. Just create >> a new cfg from scratch for each FT function call: >> >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.foi = .... >> etc. >> >> compfreq = ft_freqanalysis(cfg, comp); >> >> Best, >> Eelke >> >> On 6 August 2014 09:07, Roey Schurr wrote: >> > Dear Ashly, >> > >> > I'm trying to recreate the error you got, but I couldn't. >> > Did you specify the method? Try using >> > comp.cfg.previous.method = 'mtmfft'; >> > >> > When I run ft_freqanalysis using the mtmfft method on the comp >> structure I >> > get from the ICA tutorial, everything seems to work fine. Did you try >> > running the same function on a tutorial structure? >> > >> > Best. >> > Roey >> > >> > >> > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene >> wrote: >> >> >> >> Hello, >> >> >> >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial >> >> question. >> >> I ran runica on ft preprocessed MEG data, but I also want to see the >> >> frequency power spectrum of the components. I've tried using >> freqanalysis on >> >> the components in the following manner: >> >> >> >> >> >> comp.cfg.previous.tapsmofrq=4; >> >> comp.cfg.previous.foi=[0:2:30]; >> >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; >> >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; >> >> comp.cfg.previous.channel='all'; >> >> >> >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) >> >> >> >> >> >> // but the errors I receive are as follows: >> >> >> >> >> >> Warning: Input arguments must be scalar. >> >> > In specest/private/ft_preproc_polyremoval at 57 >> >> In ft_specest_mtmfft at 66 >> >> In ft_freqanalysis at 526 >> >> ??? For colon operator with char operands, first and last operands >> must be >> >> char. >> >> >> >> Error in ==> ft_preproc_polyremoval at 58 >> >> for i = 0:order >> >> >> >> Error in ==> ft_specest_mtmfft at 66 >> >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); >> >> >> >> Error in ==> ft_freqanalysis at 526 >> >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', >> >> cfg.taper, options{:}, 'feedback', fbopt); >> >> >> >> // Is using freqanalysis on the components possible? If so, what needs >> to >> >> be modified in order to employ it? If not, is there another method to >> >> outputting the frequency power spectrum of ica components? >> >> >> >> Thanks, >> >> >> >> Ashley >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Aug 6 14:12:28 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 6 Aug 2014 14:12:28 +0200 Subject: [FieldTrip] repairing bad channels In-Reply-To: <53E0C9D3.9080508@donders.ru.nl> References: <53E0C9D3.9080508@donders.ru.nl> Message-ID: Dear Jörn, Pardon my ignorance, however, I'm not exactly sure what you mean as I'm not an expert in matlab programming. I've checked the functions, but I still don't understand how I could resolve my issue. In addition, I checked on Easycap website, and find that the Montage 11 (or what the template directory called 'easycapM11.mat') is the closest fit to the cap that I used for the EEG recordings (At least that's what I gathered from their website). Could you please alternatively show me how you would do for repairing bad channels for the EEG data (an example)? Thank you. Cheers, Hweeling On 5 August 2014 14:10, "Jörn M. Horschig" wrote: > Hi Hweeling, > > reading the help of the function might help ;) > > The EEG or MEG sensor positions can be present in the data or can be >> specified as >> cfg.elec = structure with electrode positions, >> seeFT_DATATYPE_SENS > nl/reference/ft_datatype_sens> >> cfg.grad = structure with gradiometer definition, >> seeFT_DATATYPE_SENS > nl/reference/ft_datatype_sens> >> cfg.elecfile = name of file containing the electrode positions, >> seeFT_READ_SENS >> cfg.gradfile = name of file containing the gradiometer >> definition, seeFT_READ_SENS > nl/reference/ft_read_sens> >> > > The cross-reference to ft_datatype_sens should help you to resolve your > issue (and check out the FieldTrip/template directory) > > Best, > Jörn > > > > On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > >> Dear all, >> >> I'm trying to repair the bad channels by using the ft_channelrepair >> function for 64 channels EEG data. >> >> I've set up the structure like this: >> >> >> load('/home/leeh/Programs/fieldtrip-20140803/template/ >> layout/easycapM11.mat'); >> >> cfg_neighb.method = 'distance'; >> cfg_neighb.layout = lay; >> neighbours = ft_prepare_neighbours(cfg_neighb, data4); >> >> cfg = []; >> if strcmp('S004', dir_analysis{sub}) == 1 >> cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; >> end >> cfg.trials = 'all'; >> cfg.method = 'average'; >> cfg.neighbours = neighbours; >> cfg.elec = lay.pos; >> data5 = ft_channelrepair(cfg, data4); >> >> However, I get an error message: >> >> ttempt to reference field of non-structure array. >> Error in ft_datatype_sens (line 136) >> nchan = length(sens.label); >> Error in ft_checkconfig (line 246) >> cfg.elec = ft_datatype_sens(cfg.elec); >> Error in ft_preamble_trackconfig (line 38) >> cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); >> Error in ft_preamble (line 54) >> evalin('caller', ['ft_preamble_' cmd]); >> Error in ft_channelrepair (line 76) >> ft_preamble trackconfig >> >> Can someone please help me? >> >> Thank you very much! >> >> Best regards, >> Hweeling >> >> >> >> _______________________________________________ >> 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 > > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Aug 6 16:40:49 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Wed, 06 Aug 2014 16:40:49 +0200 Subject: [FieldTrip] Fwd: Re: repairing bad channels In-Reply-To: <53E22351.6080300@donders.ru.nl> References: <53E22351.6080300@donders.ru.nl> Message-ID: <53E23E71.1070005@donders.ru.nl> I forgot to include the mailing list in my response to Hweeling, my apologies for leaving you out ;) -------- Original Message -------- Subject: Re: [FieldTrip] repairing bad channels Date: Wed, 06 Aug 2014 14:45:05 +0200 From: "Jörn M. Horschig" Organization: Donders Institute for Brain, Cognition and Behaviour, Radboud University Nijmegen To: hweeling.lee at gmail.com Dear Hweeling, in FieldTrip/template there are different directories, one of the is 'elec'. The help that I copied in my last mail mentions that you can (should) define cfg.elec, which is a particular type of sensor-description (sens, thus ft_datatype_sens). The layout templates in the template/layout directory are layouts, not electrode positions, i.e. they are 2D projections of the electrodes optimized for visual inspections, topoplots, etc. There are three ways for you to go: 1) choose a template file from the 'elec' directory and specify cfg.elec or cfg.elecfile accordingly. The M11 cap is basically a 10-10 electrode cap, so you could use electrode positions from any 10-10 system as a template. 2) instead of specifying cfg.elec, you can specify cfg.layout and point to the layout file that you want to use (just like when calling a plotting function). FieldTrip will then extract the 2D positions and infer neighbours from that. 3) You can set cfg.method to 'template', which will load alreay pre-defined neighbours for your particular data, see http://fieldtrip.fcdonders.nl/template/neighbours Hope this helps and clarifies things :) Best, Jörn On 8/6/2014 2:12 PM, Hwee Ling Lee wrote: > Dear Jörn, > > Pardon my ignorance, however, I'm not exactly sure what you mean as > I'm not an expert in matlab programming. I've checked the functions, > but I still don't understand how I could resolve my issue. > > In addition, I checked on Easycap website, and find that the Montage > 11 (or what the template directory called 'easycapM11.mat') is the > closest fit to the cap that I used for the EEG recordings (At least > that's what I gathered from their website). > > Could you please alternatively show me how you would do for repairing > bad channels for the EEG data (an example)? > > Thank you. > > Cheers, > Hweeling > > > > On 5 August 2014 14:10, "Jörn M. Horschig" > wrote: > > Hi Hweeling, > > reading the help of the function might help ;) > > The EEG or MEG sensor positions can be present in the data > or can be specified as > cfg.elec = structure with electrode positions, > seeFT_DATATYPE_SENS > > cfg.grad = structure with gradiometer > definition, seeFT_DATATYPE_SENS > > cfg.elecfile = name of file containing the electrode > positions, seeFT_READ_SENS > > cfg.gradfile = name of file containing the > gradiometer definition, seeFT_READ_SENS > > > > The cross-reference to ft_datatype_sens should help you to resolve > your issue (and check out the FieldTrip/template directory) > > Best, > Jörn > > > > On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > > Dear all, > > I'm trying to repair the bad channels by using the > ft_channelrepair function for 64 channels EEG data. > > I've set up the structure like this: > > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'distance'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data4); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.neighbours = neighbours; > cfg.elec = lay.pos; > data5 = ft_channelrepair(cfg, data4); > > However, I get an error message: > > ttempt to reference field of non-structure array. > Error in ft_datatype_sens (line 136) > nchan = length(sens.label); > Error in ft_checkconfig (line 246) > cfg.elec = ft_datatype_sens(cfg.elec); > Error in ft_preamble_trackconfig (line 38) > cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); > Error in ft_preamble (line 54) > evalin('caller', ['ft_preamble_' cmd]); > Error in ft_channelrepair (line 76) > ft_preamble trackconfig > > Can someone please help me? > > Thank you very much! > > Best regards, > Hweeling > > > > _______________________________________________ > 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 > > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= -- 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 Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 6 22:46:05 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 6 Aug 2014 20:46:05 +0000 Subject: [FieldTrip] Crossing Segmentations Message-ID: Hello All, Thank you for the help. I looked at my surface images in free view and they are crossing. The crossing seems to be taking place between the the brain and inner skull crossing over outer skull and outer skin. I believe that this is because the data that we have only goes down so far in the original mr images (Below). And when the individual surfaces are created they cross towards the posterior part of the head (Next Image). I attached the surfaces just in case to allow you to see. Would it be possible to extend outer skull and skin when using freesurfer, or get around this some other way. And lastly we are getting a very bumpy skin (Last Photo). Will this be a problem when creating the head model, finding the lead field matrix, etc. with MNE because the crossing sections prevent me from proceeding? Isaiah [cid:25735CD5-80A7-45EE-A539-AE0A4415EF42 at host.ucla.edu][cid:F69DE3BB-8642-475B-A56C-693438F83929 at host.ucla.edu][cid:BBA7098A-DBA4-4161-AA9D-1F3B08646948 at host.ucla.edu] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.13.20 PM.png Type: image/png Size: 62870 bytes Desc: Screen Shot 2014-08-06 at 1.13.20 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.25.14 PM.png Type: image/png Size: 154778 bytes Desc: Screen Shot 2014-08-06 at 1.25.14 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.28.46 PM.png Type: image/png Size: 124960 bytes Desc: Screen Shot 2014-08-06 at 1.28.46 PM.png URL: From pierre.megevand at gmail.com Thu Aug 7 23:16:51 2014 From: pierre.megevand at gmail.com (=?UTF-8?Q?Pierre_M=C3=A9gevand?=) Date: Thu, 7 Aug 2014 17:16:51 -0400 Subject: [FieldTrip] Post-doctoral position in cognitive neurophysiology/epilepsy Message-ID: The Laboratory for Multimodal Human Brain Mapping, at New York’s Feinstein Institute for Medical Research, has an immediate opening for a postdoctoral fellow with interests in epilepsy, cognitive neuroscience, and functional connectivity. The lab uses human intracranial EEG, direct electrical stimulation of the brain, and functional MRI to study: (1) neural mechanisms of cognitive abilities such as attention, visual processing, and language; (2) extent and dynamics of macroscale functional networks in the human brain; (3) how to improve the identification of functional and pathological brain regions in individuals suffering from epilepsy. The fellow will be involved in all aspects of experimental design, data collection and analysis, and publication of research. In addition, they will have extensive opportunities for work with colleagues in collaborating groups, including researchers at Columbia University, Albert Einstein College of Medicine, Child Mind Institute, and Nathan Kline Institute (all in New York), and the Weizmann Institute of Science in Israel. Candidates should have a background in at least one of the major techniques used in the lab: neurophysiology (EEG/MEG), neuroimaging (structural and functional MRI), or brain stimulation (direct electrical stimulation, TMS, tDCS/ACS). Additional experience in another of these techniques would be a plus. Strong programming skills (especially in the MATLAB environment) are required. Candidates with Ph.D. and/or M.D. degrees are welcome to apply. For more information about the lab, please visit: http://www.feinsteininstitute.org/faculty/ashesh-mehta-md-phd/ Interested candidates should submit CV and brief statement of interest to Dr. Ashesh Mehta at amehta at nshs.edu. From e.caspar at ucl.ac.uk Sat Aug 9 09:31:05 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sat, 9 Aug 2014 07:31:05 +0000 Subject: [FieldTrip] High-pass filter - 0.1 Message-ID: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sun Aug 10 10:01:00 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 10 Aug 2014 10:01:00 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser Message-ID: Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? Best Katrin Hi Alik, Using cfg.plotlabels = 'some', only plots several of the channel labels. Leaving it empty, or setting it to 'yes', will show all labels, is that what you intended? Additionally, right now we cannot guarantee compatibility with matlab R2012b onwards due to low level changes in several MathWorks functions. Please use a version older dan R2013a. Cheers, Roemer On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: >* I have pounded on this one from a few different angles and even gone and *>* looked at the source, and still can't quite figure out what I'm doing wrong. *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying *>* to do is load it up and inspect the data a bit to get a sense of how badly *>* artifacted it is. So: *>>* %%%%%% *>>* cfg = []; *>* cfg.blocksize = 30; % num of seconds to display at once *>* cfg.continuous = 'yes'; % not yet cut into trials *>* cfg.plotlabels = 'some'; *>* cfg.viewmode = 'vertical'; *>* cfg.colorgroups = 'chantype'; *>>* cfg.dataset = [DataDir filesep EEGFile]; *>* cfg.channel = {'EEG'}; *>>* ft_databrowser(cfg) *>>>* %%%%%% *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no *>* triggers or EOG), 30 second segments at a time. What it does *not* do is *>* label the channels along the y-axis so that I can readily tell which one is *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is *>* supposed to do, and yet, it does not. I've also tried doing this as *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label *>* contains the correct channel names, and that *still* doesn't work. *>>* I'm aware that this was marked as a bug before, but bugzilla shows it *>* closed long ago, before r7276 that I'm using I believe. *>>* MATLAB r2013a on OS X, if it matters. *>>* Am I simply misunderstanding what this cfg argument does or how to use it? *>>>* Alik Widge, MD, PhD *>* alik.widge at gmail.com *>* (206) 866-5435 *>>>* _______________________________________________ *>* fieldtrip mailing list *>* fieldtrip at donders.ru.nl *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip *> -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Sun Aug 10 15:18:42 2014 From: alik.widge at gmail.com (Alik Widge) Date: Sun, 10 Aug 2014 09:18:42 -0400 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: References: Message-ID: Not that I've heard, and it's still driving me a little bit nuts. Guys, I know that this is because I don't use old MATLAB, but it is going towards the end of 2014. 2012b and older are really not available for a lot of us, especially since our university licenses often force us onto newer versions. Any chance of a fix? Alik On Sunday, August 10, 2014, KatrinH Heimann wrote: > Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? > > Best > > Katrin > > > Hi Alik, > > Using cfg.plotlabels = 'some', only plots several of the channel labels. > Leaving it empty, or setting it to 'yes', will show all labels, is that > what you intended? > > Additionally, right now we cannot guarantee compatibility with matlab > R2012b onwards due to low level changes in several MathWorks functions. > Please use a version older dan R2013a. > > Cheers, > Roemer > > > On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: > > >* I have pounded on this one from a few different angles and even gone and > *>* looked at the source, and still can't quite figure out what I'm doing wrong. > *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying > *>* to do is load it up and inspect the data a bit to get a sense of how badly > *>* artifacted it is. So: > *>>* %%%%%% > *>>* cfg = []; > *>* cfg.blocksize = 30; % num of seconds to display at once > *>* cfg.continuous = 'yes'; % not yet cut into trials > *>* cfg.plotlabels = 'some'; > *>* cfg.viewmode = 'vertical'; > *>* cfg.colorgroups = 'chantype'; > *>>* cfg.dataset = [DataDir filesep EEGFile]; > *>* cfg.channel = {'EEG'}; > *>>* ft_databrowser(cfg) > *>>>* %%%%%% > *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no > *>* triggers or EOG), 30 second segments at a time. What it does *not* do is > *>* label the channels along the y-axis so that I can readily tell which one is > *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is > *>* supposed to do, and yet, it does not. I've also tried doing this as > *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label > *>* contains the correct channel names, and that *still* doesn't work. > *>>* I'm aware that this was marked as a bug before, but bugzilla shows it > *>* closed long ago, before r7276 that I'm using I believe. > *>>* MATLAB r2013a on OS X, if it matters. > *>>* Am I simply misunderstanding what this cfg argument does or how to use it? > *>>>* Alik Widge, MD, PhD > *>* alik.widge at gmail.com > *>* (206) 866-5435 > *>>>* _______________________________________________ > *>* fieldtrip mailing list > *>* fieldtrip at donders.ru.nl > *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > *> > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail: r.vandermeij at donders.ru.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > -- Sent from Gmail Mobile; apologies for the brevity -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Aug 11 12:43:27 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 11 Aug 2014 12:43:27 +0200 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Message-ID: Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie wrote: > Dear Fieldtrip members, > > I would like to apply to my data a bandpass filter from 0.016 (or at least > 0.1) to 30 Hz > > bpfilterRange = [.1 30]; > > However, it seems that Fieltrip doesn't accept small high-pass filter > values. I have the following mistake : > > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, > which is quite high. > > I wonder if the problem comes from my data (but I had no problems on others > programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? > > Thank in advance, > > Emilie > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Spachtholz at psy.lmu.de Tue Aug 12 10:46:35 2014 From: Spachtholz at psy.lmu.de (Philipp Spachtholz) Date: Tue, 12 Aug 2014 10:46:35 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: References: Message-ID: <53E9D46B.7060200@psy.lmu.de> Dear Katrin, I had the same problem. This is what worked for me: Apparently, at least in my case, the channel labels not showing up in the databrowser resulted from are wrong specification of the fontsize in ft_databrowser. You have to locate the line that corresponds to your viewmode ('component' in my case, around line 1715) and replace the 'FontSize', 18 to a relative value, e.g 0.02, so that the call to plotting the text looks like this: ft_plot_text(labelx(laysel), labely(laysel), opt.hdr.label(chanindx(i)), 'tag', 'chanlabel', 'HorizontalAlignment', 'right','interpreter','none','FontUnits','normalized','FontSize',0.02,'FontName', 'Arial'); I am very unsure about wether this works for other MATLAB versions but you can give it a try. Just make sure to make a backup of the ft_databrowser before you make any changes there. Best Philipp Am 8/10/2014 3:18 PM, schrieb Alik Widge: > Not that I've heard, and it's still driving me a little bit nuts. > Guys, I know that this is because I don't use old MATLAB, but it is > going towards the end of 2014. 2012b and older are really not > available for a lot of us, especially since our university licenses > often force us onto newer versions. Any chance of a fix? > > Alik > > On Sunday, August 10, 2014, KatrinH Heimann > wrote: > > Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? > > Best > > Katrin > > Hi Alik, > > Using cfg.plotlabels = 'some', only plots several of the channel labels. > Leaving it empty, or setting it to 'yes', will show all labels, is that > what you intended? > > Additionally, right now we cannot guarantee compatibility with matlab > R2012b onwards due to low level changes in several MathWorks functions. > Please use a version older dan R2013a. > > Cheers, > Roemer > > > On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: > > >/ I have pounded on this one from a few different angles and even gone and > />/ looked at the source, and still can't quite figure out what I'm doing wrong. > />/ > />/ I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying > />/ to do is load it up and inspect the data a bit to get a sense of how badly > />/ artifacted it is. So: > />/ > />/ %%%%%% > />/ > />/ cfg = []; > />/ cfg.blocksize = 30; % num of seconds to display at once > />/ cfg.continuous = 'yes'; % not yet cut into trials > />/ cfg.plotlabels = 'some'; > />/ cfg.viewmode = 'vertical'; > />/ cfg.colorgroups = 'chantype'; > />/ > />/ cfg.dataset = [DataDir filesep EEGFile]; > />/ cfg.channel = {'EEG'}; > />/ > />/ ft_databrowser(cfg) > />/ > />/ > />/ %%%%%% > />/ > />/ This does 90% of what it ought to do -- it shows me the EEG channels (no > />/ triggers or EOG), 30 second segments at a time. What it does *not* do is > />/ label the channels along the y-axis so that I can readily tell which one is > />/ Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is > />/ supposed to do, and yet, it does not. I've also tried doing this as > />/ ft_databrowser(cfg,data), where I explicitly make sure that data.label > />/ contains the correct channel names, and that *still* doesn't work. > />/ > />/ I'm aware that this was marked as a bug before, but bugzilla shows it > />/ closed long ago, before r7276 that I'm using I believe. > />/ > />/ MATLAB r2013a on OS X, if it matters. > />/ > />/ Am I simply misunderstanding what this cfg argument does or how to use it? > />/ > />/ > />/ Alik Widge, MD, PhD > />/ alik.widge at gmail.com > />/ (206) 866-5435 > />/ > />/ > />/ _______________________________________________ > />/ fieldtrip mailing list > />/ fieldtrip at donders.ru.nl > />/ http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > />/ > / > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail:r.vandermeij at donders.ru.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > > > -- > Sent from Gmail Mobile; apologies for the brevity > > > _______________________________________________ > 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 Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 13 00:47:30 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Tue, 12 Aug 2014 22:47:30 +0000 Subject: [FieldTrip] Volume Conduction Models Message-ID: Hello, I am having a problem with my conduction models. [cid:72261DB6-9B5F-4784-B6EB-6D0E2E491F33 at host.ucla.edu] [cid:9595825F-C607-4946-9F35-A012A9A990B6 at host.ucla.edu][cid:8A2A417B-F1DB-4369-A690-FC5B059B6B42 at host.ucla.edu] I have tried to change the parameters at various times. Does anyone have an idea on how to fix this problem. The MRIs have nothing below the nose, as well as nothing above the head. Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.30 PM.png Type: image/png Size: 134746 bytes Desc: Screen Shot 2014-08-12 at 3.42.30 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.40 PM.png Type: image/png Size: 133318 bytes Desc: Screen Shot 2014-08-12 at 3.42.40 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.58 PM.png Type: image/png Size: 132607 bytes Desc: Screen Shot 2014-08-12 at 3.42.58 PM.png URL: From hweeling.lee at gmail.com Wed Aug 13 10:43:22 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 13 Aug 2014 10:43:22 +0200 Subject: [FieldTrip] Question regarding coherence statistics Message-ID: Dear all, I refer to a previous post regarding 'question about coherenece statistics for group analysis related to J. Neuroscience 2011 and Science 2005 (both papers by Jan-Mathijs Schoffelen). I tried to follow the suggestions regarding the comparison of coherence for two conditions. This is what I set up for my case: cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; (there are 60 EEG channels in this case). cfg.channelcmb = {cfg.channel, cfg.channel}; freq1 = ft_connectivityanalysis(cfg, cond1); %this is done for 5 subjects separately freq2 = ft_connectivityanalysis(cfg, cond2); %this is done for 5 subjects separately freq1 = atanh(freq1.cohspctrm) - atanh(freq2.cohspctrm); %this is done for 5 subjects separately freq2.cohspctrm(:) = 0; %this is done for 5 subjects separately cfg = []; cfg.layout = 'EEG1010.lay'; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.alpha = 0.05; cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; cfg.avgoverfreq = 'yes'; cfg.frequency = [2 4]; % this will be performed for different frequency bands [prec200_delta_stat] = ft_freqstatistics(cfg, sub01_freq1, sub02_freq1, sub03_freq1, sub04_freq1, sub05_freq1, sub01_freq2, sub02_freq2, sub03_freq2, sub04_freq2, sub05_freq2); However, when I tried to run this script, I get an error message: Reference to non-existent field 'label'. Error in ft_freqstatistics (line 131) haschan(i) = ~isempty(strfind(varargin{i}.dimord, 'chan')) ... Can someone please help? Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Wed Aug 13 17:16:57 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 17:16:57 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: <53E9D46B.7060200@psy.lmu.de> References: <53E9D46B.7060200@psy.lmu.de> Message-ID: Philipp! You made my day! This works perfectly!!! Thanks a million! k 2014-08-12 10:46 GMT+02:00 Philipp Spachtholz : > Dear Katrin, > > I had the same problem. This is what worked for me: > > Apparently, at least in my case, the channel labels not showing up in the > databrowser resulted > from are wrong specification of the fontsize in ft_databrowser. > > You have to locate the line that corresponds to your viewmode ('component' > in my case, around line 1715) > and replace the > > 'FontSize', 18 to a relative value, e.g 0.02, so that the call to plotting > the text looks like this: > > ft_plot_text(labelx(laysel), labely(laysel), opt.hdr.label(chanindx(i)), > 'tag', 'chanlabel', 'HorizontalAlignment', > 'right','interpreter','none','FontUnits','normalized','FontSize',0.02,'FontName', > 'Arial'); > > I am very unsure about wether this works for other MATLAB versions but you > can give it a try. > Just make sure to make a backup of the ft_databrowser before you make any > changes there. > > Best > > Philipp > > > > Am 8/10/2014 3:18 PM, schrieb Alik Widge: > > Not that I've heard, and it's still driving me a little bit nuts. > Guys, I know that this is because I don't use old MATLAB, but it is going > towards the end of 2014. 2012b and older are really not available for a lot > of us, especially since our university licenses often force us onto newer > versions. Any chance of a fix? > > Alik > > On Sunday, August 10, 2014, KatrinH Heimann > wrote: > >> Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? >> >> Best >> >> Katrin >> >> Hi Alik, >> >> Using cfg.plotlabels = 'some', only plots several of the channel labels. >> Leaving it empty, or setting it to 'yes', will show all labels, is that >> what you intended? >> >> Additionally, right now we cannot guarantee compatibility with matlab >> R2012b onwards due to low level changes in several MathWorks functions. >> Please use a version older dan R2013a. >> >> Cheers, >> Roemer >> >> >> On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: >> >> >* I have pounded on this one from a few different angles and even gone and >> *>* looked at the source, and still can't quite figure out what I'm doing wrong. >> *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying >> *>* to do is load it up and inspect the data a bit to get a sense of how badly >> *>* artifacted it is. So: >> *>>* %%%%%% >> *>>* cfg = []; >> *>* cfg.blocksize = 30; % num of seconds to display at once >> *>* cfg.continuous = 'yes'; % not yet cut into trials >> *>* cfg.plotlabels = 'some'; >> *>* cfg.viewmode = 'vertical'; >> *>* cfg.colorgroups = 'chantype'; >> *>>* cfg.dataset = [DataDir filesep EEGFile]; >> *>* cfg.channel = {'EEG'}; >> *>>* ft_databrowser(cfg) >> *>>>* %%%%%% >> *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no >> *>* triggers or EOG), 30 second segments at a time. What it does *not* do is >> *>* label the channels along the y-axis so that I can readily tell which one is >> *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is >> *>* supposed to do, and yet, it does not. I've also tried doing this as >> *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label >> *>* contains the correct channel names, and that *still* doesn't work. >> *>>* I'm aware that this was marked as a bug before, but bugzilla shows it >> *>* closed long ago, before r7276 that I'm using I believe. >> *>>* MATLAB r2013a on OS X, if it matters. >> *>>* Am I simply misunderstanding what this cfg argument does or how to use it? >> *>>>* Alik Widge, MD, PhD >> *>* alik.widge at gmail.com >> *>* (206) 866-5435 <%28206%29%20866-5435> >> *>>>* _______________________________________________ >> *>* fieldtrip mailing list >> *>* fieldtrip at donders.ru.nl >> *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> *> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> > > -- > Sent from Gmail Mobile; apologies for the brevity > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 katrinheimann at gmail.com Wed Aug 13 19:22:41 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 19:22:41 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all Message-ID: Dear all. I am trying to replace bad channels. This is my code (very basic I think):%% Preparing neighbours for channel repair cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {}; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) I do not get any error but fieldtrip even tells me that the interpolation worked. However I do not see ANY trace of it in my data when inspecting it afterwards. I also tried to change the method (to average) - no change. Anybody who can help me with that? Thanks a million Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 13 21:55:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 13 Aug 2014 21:55:30 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Katrin, Have you tried putting the labels of the channels you want interpolated into the cfg.badchannel array? Best, Eelke Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : > Dear all. I am trying to replace bad channels. > This is my code (very basic I think):%% Preparing neighbours for channel > repair > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > I do not get any error but fieldtrip even tells me that the interpolation > worked. However I do not see ANY trace of it in my data when inspecting it > afterwards. I also tried to change the method (to average) - no change. > Anybody who can help me with that? > Thanks a million > Katrin > > > > _______________________________________________ > 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 katrinheimann at gmail.com Wed Aug 13 22:12:44 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 22:12:44 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Eelke, yes, sure, sorry, I did that. No effect. 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > Dear Katrin, > > Have you tried putting the labels of the channels you want interpolated > into the cfg.badchannel array? > > Best, > Eelke > Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : > >> Dear all. I am trying to replace bad channels. >> This is my code (very basic I think):%% Preparing neighbours for channel >> repair >> >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> % Interpolate and put into new data structure >> >> cfg = []; >> >> cfg.badchannel = {}; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.method = 'nearest'; >> >> cfg.neighbours = neighbours; >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> I do not get any error but fieldtrip even tells me that the interpolation >> worked. However I do not see ANY trace of it in my data when inspecting it >> afterwards. I also tried to change the method (to average) - no change. >> Anybody who can help me with that? >> Thanks a million >> Katrin >> >> >> >> _______________________________________________ >> 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 katrinheimann at gmail.com Thu Aug 14 08:25:09 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 14 Aug 2014 08:25:09 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis Message-ID: Dear all, I am sorry I have another silly problem. I try to create the cell array for a within-analysis. I am using the following code to load the single subject structs and put them in an array calles all90. load ('ERP_AnnaLisa13obs90_ERP.mat') all90(1,:) = obs90_data_ERP load ('ERP_Benedetta23obs90_ERP.mat') all90(2,:) = obs90_data_ERP Unfortunately the result is a struct array. I can convert it to a cell by struct2cell but then fieldtrip does not recognise it as ERP data anymore as the labels inside of the struct disappear. Anybody who can help? k -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 14 08:54:41 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Aug 2014 08:54:41 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Hi Katrin, Try using curly braces {} to index your cell arrays when you want to access or change their content. The parentheses index the elements of the cell array (which are themselves cells, just like elements of double arrays are doubles). Curly braces index the *contents* of these cells. The following blog post might be helpful for you: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . Best, Eelke On 14 August 2014 08:25, KatrinH Heimann wrote: > Dear all, > I am sorry I have another silly problem. I try to create the cell array for > a within-analysis. > > I am using the following code to load the single subject structs and put > them in an array calles all90. > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90(1,:) = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90(2,:) = obs90_data_ERP > > > Unfortunately the result is a struct array. I can convert it to a cell by > struct2cell but then fieldtrip does not recognise it as ERP data anymore as > the labels inside of the struct disappear. Anybody who can help? > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nick.peatfield at gmail.com Thu Aug 14 08:56:13 2014 From: nick.peatfield at gmail.com (Nicholas A. Peatfield) Date: Thu, 14 Aug 2014 08:56:13 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Dear Katrin, The problem I can see here is that you are not indexing the data like you should with a cell. For that you have to use the curly brackets, for example: load ('ERP_AnnaLisa13obs90_ERP.mat') all90{1} = obs90_data_ERP load ('ERP_Benedetta23obs90_ERP.mat') all90{2} = obs90_data_ERP Cheers, Nick On 14 August 2014 08:25, KatrinH Heimann wrote: > Dear all, > I am sorry I have another silly problem. I try to create the cell array > for a within-analysis. > > I am using the following code to load the single subject structs and put > them in an array calles all90. > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90(1,:) = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90(2,:) = obs90_data_ERP > > Unfortunately the result is a struct array. I can convert it to a cell by > struct2cell but then fieldtrip does not recognise it as ERP data anymore as > the labels inside of the struct disappear. Anybody who can help? > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Nicholas Peatfield, PhD Centro Interdipartimentale Mente/Cervello- CIMEC Assegnista di ricerca - Research Fellow Via delle Regole, 101 - 38060 Mattarello +39 0461 283086 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 14 08:57:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Aug 2014 08:57:38 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: OK just checking :) In that case, could you post a small snippet of data and the actual cfg you used (including which channels to repair) on e.g. dropbox or so? Then I can have a look. Best, Eelke On 13 August 2014 22:12, KatrinH Heimann wrote: > Dear Eelke, yes, sure, sorry, I did that. No effect. > > > 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> Dear Katrin, >> >> Have you tried putting the labels of the channels you want interpolated >> into the cfg.badchannel array? >> >> Best, >> Eelke >> >> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : >>> >>> Dear all. I am trying to replace bad channels. >>> This is my code (very basic I think):%% Preparing neighbours for channel >>> repair >>> >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> % Interpolate and put into new data structure >>> >>> cfg = []; >>> >>> cfg.badchannel = {}; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.method = 'nearest'; >>> >>> cfg.neighbours = neighbours; >>> >>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >>> >>> I do not get any error but fieldtrip even tells me that the interpolation >>> worked. However I do not see ANY trace of it in my data when inspecting it >>> afterwards. I also tried to change the method (to average) - no change. >>> Anybody who can help me with that? >>> Thanks a million >>> Katrin >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From k.kessler at aston.ac.uk Thu Aug 14 10:18:44 2014 From: k.kessler at aston.ac.uk (Kessler, Klaus) Date: Thu, 14 Aug 2014 08:18:44 +0000 Subject: [FieldTrip] PhD scholarship at the Aston Brain Centre (Birmingham, UK) Message-ID: Dear Fieldtrippers We would be grateful if you could disseminate this fully funded PhD opportunity (for UK and EU students) to potential candidates. It will mainly involve MEG recordings and analysis in attention paradigms where participants switch between "space and time". For the final year we have also planned an EEG study in a driving simulator. The PhD is funded in part by the Aston Brain Centre (within the School of Life and Health Sciences) and in part by the Rees Jeffreys Road Fund. If this sounds interesting to you, please follow the link below for applying and/or get in touch by email to learn more. http://www.findaphd.com/search/ProjectDetails.aspx?PJID=56302 Thanks Klaus __________________________ Professor Klaus Kessler Aston Brain Centre School of Life and Health Sciences Aston University Aston Triangle Birmingham, B4 7ET Phone: +44 (0)121 204 3187 Email: k.kessler at aston.ac.uk __________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Thu Aug 14 12:19:39 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 14 Aug 2014 12:19:39 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Thanks Eelke and Nick, that worked of course :) k 2014-08-14 8:56 GMT+02:00 Nicholas A. Peatfield : > Dear Katrin, > > The problem I can see here is that you are not indexing the data like you > should with a cell. For that you have to use the curly brackets, for > example: > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90{1} = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90{2} = obs90_data_ERP > > Cheers, > > Nick > > > On 14 August 2014 08:25, KatrinH Heimann wrote: > >> Dear all, >> I am sorry I have another silly problem. I try to create the cell array >> for a within-analysis. >> >> I am using the following code to load the single subject structs and put >> them in an array calles all90. >> >> load ('ERP_AnnaLisa13obs90_ERP.mat') >> >> all90(1,:) = obs90_data_ERP >> >> load ('ERP_Benedetta23obs90_ERP.mat') >> >> all90(2,:) = obs90_data_ERP >> >> Unfortunately the result is a struct array. I can convert it to a cell by >> struct2cell but then fieldtrip does not recognise it as ERP data anymore as >> the labels inside of the struct disappear. Anybody who can help? >> k >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Nicholas Peatfield, PhD > Centro Interdipartimentale Mente/Cervello- CIMEC > > Assegnista di ricerca - Research Fellow > Via delle Regole, 101 - 38060 Mattarello > +39 0461 283086 > > _______________________________________________ > 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 katrinheimann at gmail.com Sun Aug 17 11:23:20 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 17 Aug 2014 11:23:20 +0200 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? Message-ID: Dear all I still have problem with the channel interpolation (just not working at all, without error message, see my previous post). Now I am thinking if I just remove the bad channels for the single subjects and leave it like that. My question is though: Will this create problems for my Grand average over subjects later (as in each subject I remove different channels)? and which layout do I have to use to plot my Grand average data later? Every help is very welcome Cheers k -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Aug 18 08:58:15 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Aug 2014 08:58:15 +0200 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? In-Reply-To: References: Message-ID: Dear Kathrin, Re your previous post about repairing bad channels, I've also tried this on Fieldtrip and it works for me. I've not used the triangulation method, but maybe you could try again. I guess it depends on your template. For me, I was using Easycap 64 channels, but maybe it's different for you. Here's how I set up my repair channels options: % repairing bad channels with averaged of its neighbours load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, data2); cfg = []; if strcmp('S004', dir_analysis{sub}) == 1 cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; end cfg.trials = 'all'; cfg.method = 'average'; cfg.layout = lay; cfg.neighbours = neighbours; data3 = ft_channelrepair(cfg, data2); Re removing bad channels. Your question regarding if this will create problems for your grand average over subjects later. Well, it depends which channels you remove for individual subjects. As far as I'm aware, when you averaged your data across subjects, it will only pick the common channels across subjects for the statistical analyses. When you plot, you can always call for the template layout (e.g. 'EEG1020.lay'). This will plot the available channels across all subjects, and leave out the ones that are not in the data. I hope this helps. Cheers, Hweeling On 17 August 2014 11:23, KatrinH Heimann wrote: > Dear all > I still have problem with the channel interpolation (just not working at > all, without error message, see my previous post). Now I am thinking if I > just remove the bad channels for the single subjects and leave it like > that. My question is though: Will this create problems for my Grand average > over subjects later (as in each subject I remove different channels)? and > which layout do I have to use to plot my Grand average data later? > Every help is very welcome > Cheers > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Aug 18 10:18:46 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 18 Aug 2014 10:18:46 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Katrin, When I look at the data you've shown me, in fact I do see an effect of ft_channelrepair. I run your code: load ('ERP_Francesca17obs90_clean.mat') %% Preparing neighbours for channel repair cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {'E49', 'E68'}; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); followed by: dat1=obs90_data_clean2; dat2=obs90_data_channelrepaired; x=dat1.trial{1}(68,:); % 68 is channel index of E68 y=dat2.trial{1}(68,:); plot(x);hold on;plot(y,'r'); x=dat1.trial{1}(49,:); y=dat2.trial{1}(49,:); figure; plot(x);hold on;plot(y,'r') and the two figures that come up are shown in the attachments. The original (blue) and channel-repaired (red) traces are clearly different. These plots are for trial 1, but the same result holds when I plot a different trial. Does it work on your end too now? Best, Eelke On 14 August 2014 08:57, Eelke Spaak wrote: > OK just checking :) In that case, could you post a small snippet of > data and the actual cfg you used (including which channels to repair) > on e.g. dropbox or so? Then I can have a look. > > Best, > Eelke > > On 13 August 2014 22:12, KatrinH Heimann wrote: >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : >> >>> Dear Katrin, >>> >>> Have you tried putting the labels of the channels you want interpolated >>> into the cfg.badchannel array? >>> >>> Best, >>> Eelke >>> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : >>>> >>>> Dear all. I am trying to replace bad channels. >>>> This is my code (very basic I think):%% Preparing neighbours for channel >>>> repair >>>> >>>> >>>> >>>> cfg_neighb = []; >>>> >>>> cfg_neighb.feedback = 'yes'; >>>> >>>> cfg_neighb.method = 'triangulation'; >>>> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>> >>>> >>>> >>>> % Interpolate and put into new data structure >>>> >>>> cfg = []; >>>> >>>> cfg.badchannel = {}; >>>> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> cfg.method = 'nearest'; >>>> >>>> cfg.neighbours = neighbours; >>>> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>>> >>>> >>>> I do not get any error but fieldtrip even tells me that the interpolation >>>> worked. However I do not see ANY trace of it in my data when inspecting it >>>> afterwards. I also tried to change the method (to average) - no change. >>>> Anybody who can help me with that? >>>> Thanks a million >>>> Katrin >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 -------------- A non-text attachment was scrubbed... Name: E68.png Type: image/png Size: 10268 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: E49.png Type: image/png Size: 11130 bytes Desc: not available URL: From hweeling.lee at gmail.com Mon Aug 18 12:08:08 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Aug 2014 12:08:08 +0200 Subject: [FieldTrip] Question regarding coherence statistics and viewing of results Message-ID: Dear all, I've previously posted this question however, I did not get any replies. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' variable that would allow me to perform cluster-based statistical analyses. However, I was not sure how I could plot the results. I get an error message from Fieldtrip: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); Also, according to the paper by Maris et al., 2007 'Nonparametric statistical testing of coherence differences', the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, I would really appreciate if someone can help me how to make such a plot. Thank you very much. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Mon Aug 18 19:26:19 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 18 Aug 2014 13:26:19 -0400 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? In-Reply-To: References: Message-ID: Hi Kathrin, I like having my data saved before (I can apply a montage later) and after repairing channels. As Hweeling suggests, you will have difficulty grand averaging if the channel of interest is missing from one of your subjects. I no longer have your original post and apologize if I am repeating suggestions from others. Did you review and display your neighbors before repairing channels? Are you sure your channels had neighbors? I've used this function for years - when I switched EEG systems, I was unaware of the change in units, and ran into the same problem you are having. I think you are best off understanding why ft_channelrepair isn't working. I also found it helpful to have the ft_default settings provide me with feedback: ft_default.trackconfig = 'report'; ft_default.checkconfig = 'pendantic'; Hopefully my suggestions help you determine what's going on. If not, I could review your neighbors, and data structure. Best, Raquel On Mon, Aug 18, 2014 at 2:58 AM, Hwee Ling Lee wrote: > Dear Kathrin, > > Re your previous post about repairing bad channels, I've also tried this > on Fieldtrip and it works for me. I've not used the triangulation method, > but maybe you could try again. I guess it depends on your template. For me, > I was using Easycap 64 channels, but maybe it's different for you. Here's > how I set up my repair channels options: > > % repairing bad channels with averaged of its neighbours > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'template'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data2); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.layout = lay; > cfg.neighbours = neighbours; > data3 = ft_channelrepair(cfg, data2); > > Re removing bad channels. Your question regarding if this will create > problems for your grand average over subjects later. Well, it depends which > channels you remove for individual subjects. As far as I'm aware, when you > averaged your data across subjects, it will only pick the common channels > across subjects for the statistical analyses. When you plot, you can always > call for the template layout (e.g. 'EEG1020.lay'). This will plot the > available channels across all subjects, and leave out the ones that are not > in the data. > > I hope this helps. > > Cheers, > Hweeling > > > > On 17 August 2014 11:23, KatrinH Heimann wrote: > >> Dear all >> I still have problem with the channel interpolation (just not working at >> all, without error message, see my previous post). Now I am thinking if I >> just remove the bad channels for the single subjects and leave it like >> that. My question is though: Will this create problems for my Grand average >> over subjects later (as in each subject I remove different channels)? and >> which layout do I have to use to plot my Grand average data later? >> Every help is very welcome >> Cheers >> k >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > > _______________________________________________ > 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 jingfan.jf at gmail.com Mon Aug 18 21:05:02 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 18 Aug 2014 14:05:02 -0500 Subject: [FieldTrip] undefined function or variable 'abort' error when trying to run ft_definetrial(cfg) Message-ID: <010701cfbb17$51471a90$f3d54fb0$@gmail.com> Hi there, I am new to fieldtrip. I am trying the trigger-based trial selection tutorial. An error occurs when running cfg = ft_definetrial(cfg). In ft_preamble function, I couldn't find where abort is defined. I appreciate any help! Best, Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Mon Aug 18 23:52:38 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Mon, 18 Aug 2014 21:52:38 +0000 Subject: [FieldTrip] Aligning Electrodes Message-ID: Hello, I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. mri = ft_read_mri('Subject01.mri'); disp(mri.hdr.fiducial.mri) nas: [87 60 116] lpa: [29 145 155] rpa: [144 142 158] Reference to non-existent field 'hdr'. I cannot display. Am I missing a prior step? Best, Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Tue Aug 19 00:09:07 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Tue, 19 Aug 2014 00:09:07 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Eelke, ok, so i installed an older version of matlab (which also solved some other problems with fieldtrip) and now it works. However I am running into another problem with it. Maybe you can help too: If I try to run the ICA after the bad channel replacement it takes hours and wchange just does not get lower. In my naive thinking I thought that might be due to the fact that the replaced channels are recognized as interpolations of the others??? But what could I do otherwise?: I thought about doing the bcr later, but that means that my ica suffers from all the electrode jumps from my bad channels. or I just exclude them from the ica - but how to proceed then: apply the reject component function on the data without the channels and then replace them? sorry, I am just a bit lost. The weirdest thing is: if I replace the channels with the help of another software before even processing the data, the ica works perfectly later in fieldtrip. WHY???? Would be wonderful if you could give me another hand... Thanks so much in advance!!! Katrin 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > Dear Katrin, > > When I look at the data you've shown me, in fact I do see an effect of > ft_channelrepair. I run your code: > > load ('ERP_Francesca17obs90_clean.mat') > > %% Preparing neighbours for channel repair > > cfg_neighb = []; > cfg_neighb.feedback = 'yes'; > cfg_neighb.method = 'triangulation'; > cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); > > % Interpolate and put into new data structure > cfg = []; > cfg.badchannel = {'E49', 'E68'}; > cfg.layout = 'GSN-HydroCel-129.sfp'; > cfg.method = 'nearest'; > cfg.neighbours = neighbours; > obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); > > followed by: > > dat1=obs90_data_clean2; > dat2=obs90_data_channelrepaired; > > x=dat1.trial{1}(68,:); % 68 is channel index of E68 > y=dat2.trial{1}(68,:); > plot(x);hold on;plot(y,'r'); > > x=dat1.trial{1}(49,:); > y=dat2.trial{1}(49,:); > figure; > plot(x);hold on;plot(y,'r') > > and the two figures that come up are shown in the attachments. The > original (blue) and channel-repaired (red) traces are clearly > different. These plots are for trial 1, but the same result holds when > I plot a different trial. > > Does it work on your end too now? > > Best, > Eelke > > On 14 August 2014 08:57, Eelke Spaak wrote: > > OK just checking :) In that case, could you post a small snippet of > > data and the actual cfg you used (including which channels to repair) > > on e.g. dropbox or so? Then I can have a look. > > > > Best, > > Eelke > > > > On 13 August 2014 22:12, KatrinH Heimann > wrote: > >> Dear Eelke, yes, sure, sorry, I did that. No effect. > >> > >> > >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> > >>> Dear Katrin, > >>> > >>> Have you tried putting the labels of the channels you want interpolated > >>> into the cfg.badchannel array? > >>> > >>> Best, > >>> Eelke > >>> > >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" < > katrinheimann at gmail.com>: > >>>> > >>>> Dear all. I am trying to replace bad channels. > >>>> This is my code (very basic I think):%% Preparing neighbours for > channel > >>>> repair > >>>> > >>>> > >>>> > >>>> cfg_neighb = []; > >>>> > >>>> cfg_neighb.feedback = 'yes'; > >>>> > >>>> cfg_neighb.method = 'triangulation'; > >>>> > >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >>>> > >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>> > >>>> > >>>> > >>>> % Interpolate and put into new data structure > >>>> > >>>> cfg = []; > >>>> > >>>> cfg.badchannel = {}; > >>>> > >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>> > >>>> cfg.method = 'nearest'; > >>>> > >>>> cfg.neighbours = neighbours; > >>>> > >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >>>> > >>>> > >>>> I do not get any error but fieldtrip even tells me that the > interpolation > >>>> worked. However I do not see ANY trace of it in my data when > inspecting it > >>>> afterwards. I also tried to change the method (to average) - no > change. > >>>> Anybody who can help me with that? > >>>> Thanks a million > >>>> Katrin > >>>> > >>>> > >>>> > >>>> _______________________________________________ > >>>> fieldtrip mailing list > >>>> fieldtrip at donders.ru.nl > >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Aug 19 09:14:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 19 Aug 2014 09:14:44 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Hi Katrin, Hmm, the MATLAB version difference points to a potential bug in the code. Could you tell me which version it now works on, and which version it did not work on earlier? ICA not working on your repaired data makes sense, and the cause is in fact pretty much what you mentioned yourself. The data in the repaired channels are now linear combinations (i.e. weighted sums) of the data in other channels, so the rank of your data (number of orthogonal data vectors) is now smaller than the number of channels. In other words, your data is rank deficient. ICA does not work properly on rank-deficient data. There are a few solutions to this. I would not recommend including the bad channels in the ICA. Your second suggestion would be better: compute ICA on the data without the bad channels, then interpolate them after backprojecting to channel space. A third option would be to reduce the dimensionality of the ICA input data to its 'true' dimensionality. If you specify cfg.numcomponent = N when calling ft_componentanalysis, the data will first undergo PCA, keeping N dimensions. In your case you would need to set N to be maximally the number of recorded channels minus the number of interpolated ones. This third option is probably the easiest and best way to go. Lastly, the fact that ICA still works if you repair the channels in other software is possibly due to this other software applying some form of non-linear algorithm to repair the channels. In that case the rank of your data might not be altered. Best, Eelke On 19 August 2014 00:09, KatrinH Heimann wrote: > Dear Eelke, > > ok, so i installed an older version of matlab (which also solved some other > problems with fieldtrip) and now it works. However I am running into another > problem with it. Maybe you can help too: > If I try to run the ICA after the bad channel replacement it takes hours and > wchange just does not get lower. In my naive thinking I thought that might > be due to the fact that the replaced channels are recognized as > interpolations of the others??? But what could I do otherwise?: I thought > about doing the bcr later, but that means that my ica suffers from all the > electrode jumps from my bad channels. or I just exclude them from the ica - > but how to proceed then: apply the reject component function on the data > without the channels and then replace them? sorry, I am just a bit lost. The > weirdest thing is: if I replace the channels with the help of another > software before even processing the data, the ica works perfectly later in > fieldtrip. WHY???? > Would be wonderful if you could give me another hand... Thanks so much in > advance!!! > Katrin > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > >> Dear Katrin, >> >> When I look at the data you've shown me, in fact I do see an effect of >> ft_channelrepair. I run your code: >> >> load ('ERP_Francesca17obs90_clean.mat') >> >> %% Preparing neighbours for channel repair >> >> cfg_neighb = []; >> cfg_neighb.feedback = 'yes'; >> cfg_neighb.method = 'triangulation'; >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); >> >> % Interpolate and put into new data structure >> cfg = []; >> cfg.badchannel = {'E49', 'E68'}; >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> cfg.method = 'nearest'; >> cfg.neighbours = neighbours; >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); >> >> followed by: >> >> dat1=obs90_data_clean2; >> dat2=obs90_data_channelrepaired; >> >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 >> y=dat2.trial{1}(68,:); >> plot(x);hold on;plot(y,'r'); >> >> x=dat1.trial{1}(49,:); >> y=dat2.trial{1}(49,:); >> figure; >> plot(x);hold on;plot(y,'r') >> >> and the two figures that come up are shown in the attachments. The >> original (blue) and channel-repaired (red) traces are clearly >> different. These plots are for trial 1, but the same result holds when >> I plot a different trial. >> >> Does it work on your end too now? >> >> Best, >> Eelke >> >> On 14 August 2014 08:57, Eelke Spaak wrote: >> > OK just checking :) In that case, could you post a small snippet of >> > data and the actual cfg you used (including which channels to repair) >> > on e.g. dropbox or so? Then I can have a look. >> > >> > Best, >> > Eelke >> > >> > On 13 August 2014 22:12, KatrinH Heimann >> > wrote: >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : >> >> >> >>> Dear Katrin, >> >>> >> >>> Have you tried putting the labels of the channels you want >> >>> interpolated >> >>> into the cfg.badchannel array? >> >>> >> >>> Best, >> >>> Eelke >> >>> >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" >> >>> : >> >>>> >> >>>> Dear all. I am trying to replace bad channels. >> >>>> This is my code (very basic I think):%% Preparing neighbours for >> >>>> channel >> >>>> repair >> >>>> >> >>>> >> >>>> >> >>>> cfg_neighb = []; >> >>>> >> >>>> cfg_neighb.feedback = 'yes'; >> >>>> >> >>>> cfg_neighb.method = 'triangulation'; >> >>>> >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>> >> >>>> >> >>>> >> >>>> % Interpolate and put into new data structure >> >>>> >> >>>> cfg = []; >> >>>> >> >>>> cfg.badchannel = {}; >> >>>> >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> cfg.method = 'nearest'; >> >>>> >> >>>> cfg.neighbours = neighbours; >> >>>> >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >>>> >> >>>> >> >>>> I do not get any error but fieldtrip even tells me that the >> >>>> interpolation >> >>>> worked. However I do not see ANY trace of it in my data when >> >>>> inspecting it >> >>>> afterwards. I also tried to change the method (to average) - no >> >>>> change. >> >>>> Anybody who can help me with that? >> >>>> Thanks a million >> >>>> Katrin >> >>>> >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> fieldtrip mailing list >> >>>> fieldtrip at donders.ru.nl >> >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From katrinheimann at gmail.com Tue Aug 19 10:05:53 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Tue, 19 Aug 2014 10:05:53 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Eelke! I am sure your name translates in Angel actually! Now everthing works!!! And so easily! The version I reinstalled is Matlab R2012a. I had R 2014a for some weeks, but loads of things did not work with that... Thanks a million for your help, really! Katrin 2014-08-19 9:14 GMT+02:00 Eelke Spaak : > Hi Katrin, > > Hmm, the MATLAB version difference points to a potential bug in the > code. Could you tell me which version it now works on, and which > version it did not work on earlier? > > ICA not working on your repaired data makes sense, and the cause is in > fact pretty much what you mentioned yourself. The data in the repaired > channels are now linear combinations (i.e. weighted sums) of the data > in other channels, so the rank of your data (number of orthogonal data > vectors) is now smaller than the number of channels. In other words, > your data is rank deficient. ICA does not work properly on > rank-deficient data. There are a few solutions to this. > > I would not recommend including the bad channels in the ICA. Your > second suggestion would be better: compute ICA on the data without the > bad channels, then interpolate them after backprojecting to channel > space. A third option would be to reduce the dimensionality of the ICA > input data to its 'true' dimensionality. If you specify > cfg.numcomponent = N when calling ft_componentanalysis, the data will > first undergo PCA, keeping N dimensions. In your case you would need > to set N to be maximally the number of recorded channels minus the > number of interpolated ones. This third option is probably the easiest > and best way to go. > > Lastly, the fact that ICA still works if you repair the channels in > other software is possibly due to this other software applying some > form of non-linear algorithm to repair the channels. In that case the > rank of your data might not be altered. > > Best, > Eelke > > On 19 August 2014 00:09, KatrinH Heimann wrote: > > Dear Eelke, > > > > ok, so i installed an older version of matlab (which also solved some > other > > problems with fieldtrip) and now it works. However I am running into > another > > problem with it. Maybe you can help too: > > If I try to run the ICA after the bad channel replacement it takes hours > and > > wchange just does not get lower. In my naive thinking I thought that > might > > be due to the fact that the replaced channels are recognized as > > interpolations of the others??? But what could I do otherwise?: I thought > > about doing the bcr later, but that means that my ica suffers from all > the > > electrode jumps from my bad channels. or I just exclude them from the > ica - > > but how to proceed then: apply the reject component function on the data > > without the channels and then replace them? sorry, I am just a bit lost. > The > > weirdest thing is: if I replace the channels with the help of another > > software before even processing the data, the ica works perfectly later > in > > fieldtrip. WHY???? > > Would be wonderful if you could give me another hand... Thanks so much in > > advance!!! > > Katrin > > > > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > > > >> Dear Katrin, > >> > >> When I look at the data you've shown me, in fact I do see an effect of > >> ft_channelrepair. I run your code: > >> > >> load ('ERP_Francesca17obs90_clean.mat') > >> > >> %% Preparing neighbours for channel repair > >> > >> cfg_neighb = []; > >> cfg_neighb.feedback = 'yes'; > >> cfg_neighb.method = 'triangulation'; > >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); > >> > >> % Interpolate and put into new data structure > >> cfg = []; > >> cfg.badchannel = {'E49', 'E68'}; > >> cfg.layout = 'GSN-HydroCel-129.sfp'; > >> cfg.method = 'nearest'; > >> cfg.neighbours = neighbours; > >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); > >> > >> followed by: > >> > >> dat1=obs90_data_clean2; > >> dat2=obs90_data_channelrepaired; > >> > >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 > >> y=dat2.trial{1}(68,:); > >> plot(x);hold on;plot(y,'r'); > >> > >> x=dat1.trial{1}(49,:); > >> y=dat2.trial{1}(49,:); > >> figure; > >> plot(x);hold on;plot(y,'r') > >> > >> and the two figures that come up are shown in the attachments. The > >> original (blue) and channel-repaired (red) traces are clearly > >> different. These plots are for trial 1, but the same result holds when > >> I plot a different trial. > >> > >> Does it work on your end too now? > >> > >> Best, > >> Eelke > >> > >> On 14 August 2014 08:57, Eelke Spaak wrote: > >> > OK just checking :) In that case, could you post a small snippet of > >> > data and the actual cfg you used (including which channels to repair) > >> > on e.g. dropbox or so? Then I can have a look. > >> > > >> > Best, > >> > Eelke > >> > > >> > On 13 August 2014 22:12, KatrinH Heimann > >> > wrote: > >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. > >> >> > >> >> > >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> >> > >> >>> Dear Katrin, > >> >>> > >> >>> Have you tried putting the labels of the channels you want > >> >>> interpolated > >> >>> into the cfg.badchannel array? > >> >>> > >> >>> Best, > >> >>> Eelke > >> >>> > >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" > >> >>> : > >> >>>> > >> >>>> Dear all. I am trying to replace bad channels. > >> >>>> This is my code (very basic I think):%% Preparing neighbours for > >> >>>> channel > >> >>>> repair > >> >>>> > >> >>>> > >> >>>> > >> >>>> cfg_neighb = []; > >> >>>> > >> >>>> cfg_neighb.feedback = 'yes'; > >> >>>> > >> >>>> cfg_neighb.method = 'triangulation'; > >> >>>> > >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >> >>>> > >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> >>>> > >> >>>> > >> >>>> > >> >>>> % Interpolate and put into new data structure > >> >>>> > >> >>>> cfg = []; > >> >>>> > >> >>>> cfg.badchannel = {}; > >> >>>> > >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >> >>>> > >> >>>> cfg.method = 'nearest'; > >> >>>> > >> >>>> cfg.neighbours = neighbours; > >> >>>> > >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> >>>> > >> >>>> > >> >>>> I do not get any error but fieldtrip even tells me that the > >> >>>> interpolation > >> >>>> worked. However I do not see ANY trace of it in my data when > >> >>>> inspecting it > >> >>>> afterwards. I also tried to change the method (to average) - no > >> >>>> change. > >> >>>> Anybody who can help me with that? > >> >>>> Thanks a million > >> >>>> Katrin > >> >>>> > >> >>>> > >> >>>> > >> >>>> _______________________________________________ > >> >>>> 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 > _______________________________________________ > 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 Tue Aug 19 10:26:58 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 19 Aug 2014 10:26:58 +0200 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hi Isaiah, could you check which FT-Version & Matlab-Version you are using? I just checked it and it seems to work fine (on Matlab 2011b). Also, could you post the output from calling "mri" and "mri.hdr"? 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: > Hello, > > I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. > > mri = ft_read_mri('Subject01.mri'); > > disp(mri.hdr.fiducial.mri) > nas: [87 60 116] > lpa: [29 145 155] > rpa: [144 142 158] > Reference to non-existent field 'hdr'. > > I cannot display. Am I missing a prior step? > > Best, > Isaiah Smith > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Aug 19 10:54:52 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 19 Aug 2014 08:54:52 +0000 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: , Message-ID: I'm just going to chime in and say that Matlab 2014a has been causing issues for me in other toolboxes too, do you definitely are not alone! Eelke is awesome :) Sent from my iPhone On 19 Aug 2014, at 5:39 pm, "KatrinH Heimann" > wrote: Eelke! I am sure your name translates in Angel actually! Now everthing works!!! And so easily! The version I reinstalled is Matlab R2012a. I had R 2014a for some weeks, but loads of things did not work with that... Thanks a million for your help, really! Katrin 2014-08-19 9:14 GMT+02:00 Eelke Spaak >: Hi Katrin, Hmm, the MATLAB version difference points to a potential bug in the code. Could you tell me which version it now works on, and which version it did not work on earlier? ICA not working on your repaired data makes sense, and the cause is in fact pretty much what you mentioned yourself. The data in the repaired channels are now linear combinations (i.e. weighted sums) of the data in other channels, so the rank of your data (number of orthogonal data vectors) is now smaller than the number of channels. In other words, your data is rank deficient. ICA does not work properly on rank-deficient data. There are a few solutions to this. I would not recommend including the bad channels in the ICA. Your second suggestion would be better: compute ICA on the data without the bad channels, then interpolate them after backprojecting to channel space. A third option would be to reduce the dimensionality of the ICA input data to its 'true' dimensionality. If you specify cfg.numcomponent = N when calling ft_componentanalysis, the data will first undergo PCA, keeping N dimensions. In your case you would need to set N to be maximally the number of recorded channels minus the number of interpolated ones. This third option is probably the easiest and best way to go. Lastly, the fact that ICA still works if you repair the channels in other software is possibly due to this other software applying some form of non-linear algorithm to repair the channels. In that case the rank of your data might not be altered. Best, Eelke On 19 August 2014 00:09, KatrinH Heimann > wrote: > Dear Eelke, > > ok, so i installed an older version of matlab (which also solved some other > problems with fieldtrip) and now it works. However I am running into another > problem with it. Maybe you can help too: > If I try to run the ICA after the bad channel replacement it takes hours and > wchange just does not get lower. In my naive thinking I thought that might > be due to the fact that the replaced channels are recognized as > interpolations of the others??? But what could I do otherwise?: I thought > about doing the bcr later, but that means that my ica suffers from all the > electrode jumps from my bad channels. or I just exclude them from the ica - > but how to proceed then: apply the reject component function on the data > without the channels and then replace them? sorry, I am just a bit lost. The > weirdest thing is: if I replace the channels with the help of another > software before even processing the data, the ica works perfectly later in > fieldtrip. WHY???? > Would be wonderful if you could give me another hand... Thanks so much in > advance!!! > Katrin > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak >: > >> Dear Katrin, >> >> When I look at the data you've shown me, in fact I do see an effect of >> ft_channelrepair. I run your code: >> >> load ('ERP_Francesca17obs90_clean.mat') >> >> %% Preparing neighbours for channel repair >> >> cfg_neighb = []; >> cfg_neighb.feedback = 'yes'; >> cfg_neighb.method = 'triangulation'; >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); >> >> % Interpolate and put into new data structure >> cfg = []; >> cfg.badchannel = {'E49', 'E68'}; >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> cfg.method = 'nearest'; >> cfg.neighbours = neighbours; >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); >> >> followed by: >> >> dat1=obs90_data_clean2; >> dat2=obs90_data_channelrepaired; >> >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 >> y=dat2.trial{1}(68,:); >> plot(x);hold on;plot(y,'r'); >> >> x=dat1.trial{1}(49,:); >> y=dat2.trial{1}(49,:); >> figure; >> plot(x);hold on;plot(y,'r') >> >> and the two figures that come up are shown in the attachments. The >> original (blue) and channel-repaired (red) traces are clearly >> different. These plots are for trial 1, but the same result holds when >> I plot a different trial. >> >> Does it work on your end too now? >> >> Best, >> Eelke >> >> On 14 August 2014 08:57, Eelke Spaak > wrote: >> > OK just checking :) In that case, could you post a small snippet of >> > data and the actual cfg you used (including which channels to repair) >> > on e.g. dropbox or so? Then I can have a look. >> > >> > Best, >> > Eelke >> > >> > On 13 August 2014 22:12, KatrinH Heimann > >> > wrote: >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak >: >> >> >> >>> Dear Katrin, >> >>> >> >>> Have you tried putting the labels of the channels you want >> >>> interpolated >> >>> into the cfg.badchannel array? >> >>> >> >>> Best, >> >>> Eelke >> >>> >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" >> >>> >: >> >>>> >> >>>> Dear all. I am trying to replace bad channels. >> >>>> This is my code (very basic I think):%% Preparing neighbours for >> >>>> channel >> >>>> repair >> >>>> >> >>>> >> >>>> >> >>>> cfg_neighb = []; >> >>>> >> >>>> cfg_neighb.feedback = 'yes'; >> >>>> >> >>>> cfg_neighb.method = 'triangulation'; >> >>>> >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>> >> >>>> >> >>>> >> >>>> % Interpolate and put into new data structure >> >>>> >> >>>> cfg = []; >> >>>> >> >>>> cfg.badchannel = {}; >> >>>> >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> cfg.method = 'nearest'; >> >>>> >> >>>> cfg.neighbours = neighbours; >> >>>> >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >>>> >> >>>> >> >>>> I do not get any error but fieldtrip even tells me that the >> >>>> interpolation >> >>>> worked. However I do not see ANY trace of it in my data when >> >>>> inspecting it >> >>>> afterwards. I also tried to change the method (to average) - no >> >>>> change. >> >>>> Anybody who can help me with that? >> >>>> Thanks a million >> >>>> Katrin >> >>>> >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> 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 _______________________________________________ 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 tyler.grummett at flinders.edu.au Wed Aug 20 04:47:14 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Wed, 20 Aug 2014 02:47:14 +0000 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) Message-ID: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> Hello fieldtrip experts, I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. I have tried multiplying the source.avg.mom by the source.leadfield. I wont clutter the email with code, however I can once requested. I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. Any help would be greatly appreciated. Tyler Sent from my iPad From eelke.spaak at donders.ru.nl Wed Aug 20 14:29:00 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Aug 2014 14:29:00 +0200 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) In-Reply-To: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> References: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> Message-ID: Hi Tyler, Beamforming is a scanning method, which means that the power/current density at each grid point is estimated independently from all other grid points. In general one would not expect sum_i(leadfield_ix * pow_i), where i indexes grid points, to faithfully reproduce the potential measured at sensor x. This as opposed to something like e.g. minimum-norm estimate, where the estimation is done in one regression-like step, rather than by scanning grid points. Best, Eelke On 20 August 2014 04:47, Tyler Grummett wrote: > Hello fieldtrip experts, > > I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. > > I have tried multiplying the source.avg.mom by the source.leadfield. > I wont clutter the email with code, however I can once requested. > > I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. > > Any help would be greatly appreciated. > > Tyler > > Sent from my iPad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Wed Aug 20 14:54:47 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Wed, 20 Aug 2014 12:54:47 +0000 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) In-Reply-To: References: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au>, Message-ID: <3E2D3E20-2A83-4ABC-BADC-FB53DD7651C4@flinders.edu.au> Thank you clearing that up eelke :) Tyler Sent from my iPhone > On 20 Aug 2014, at 10:03 pm, "Eelke Spaak" wrote: > > Hi Tyler, > > Beamforming is a scanning method, which means that the power/current > density at each grid point is estimated independently from all other > grid points. In general one would not expect sum_i(leadfield_ix * > pow_i), where i indexes grid points, to faithfully reproduce the > potential measured at sensor x. This as opposed to something like e.g. > minimum-norm estimate, where the estimation is done in one > regression-like step, rather than by scanning grid points. > > Best, > Eelke > >> On 20 August 2014 04:47, Tyler Grummett wrote: >> Hello fieldtrip experts, >> >> I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. >> >> I have tried multiplying the source.avg.mom by the source.leadfield. >> I wont clutter the email with code, however I can once requested. >> >> I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. >> >> Any help would be greatly appreciated. >> >> Tyler >> >> Sent from my iPad >> _______________________________________________ >> 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 jingfan.jf at gmail.com Wed Aug 20 16:03:51 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Wed, 20 Aug 2014 09:03:51 -0500 Subject: [FieldTrip] undefined function or variable 'abort' error when trying to run ft_definetrial(cfg) Message-ID: <002101cfbc7f$92d84830$b888d890$@gmail.com> Hi there, I am new to fieldtrip. I am trying the trigger-based trial selection tutorial. An error occurs when running cfg = ft_definetrial(cfg). In ft_preamble function, I couldn't find where abort is defined. I appreciate any help! Best, Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Aug 20 16:23:46 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 20 Aug 2014 17:23:46 +0300 Subject: [FieldTrip] MNE Source Reconstruction Sanity Check In-Reply-To: <53D1FD3B.7040600@donders.ru.nl> References: <346147900.8004488.1406126123454.JavaMail.root@sculptor.zimbra.ru.nl> <790E6AB9-6372-4F70-9B98-2DE6E084F552@donders.ru.nl> <53D1FD3B.7040600@donders.ru.nl> Message-ID: Dear fieldtrippers, dear Jörn, I am currently trying to use the standard BEM head model provided in the fieldtrip toolbox (on a 19 electrodes EEG recording, segmented into 10-seconds trials, not time-locked), but I have encountered a problem I could not resolve: Error using svd Input to SVD must not contain NaN or Inf. Error in pinv (line 29) [U,S,V] = svd(A,0); Error in pinv (line 27) X = pinv(A',varargin{:})'; Error in minimumnormestimate (line 151) w = pinv(lf); Error in ft_sourceanalysis (line 876) dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Following some old posts in the mailing list I made sure the electrodes data structure of the data is the same as that given in the cfg of ft_sourceanalysis. However, it is still possible that using a 19 electrodes recording is not possible using the source model I am using? I am also afraid computing the source reconstruction on such continuous data, that is not time-locked, could be a problem. For example, having to calculate the “avg” field artificially seems a little fishy. I also tried running the code on the EEG data of the continuous data preprocessing tutorial (after choosing only 19 of its electrodes, though possibly not the right ones). Any advice would be greatly appreciated! Thank you all, Roey THE CODE --------------- % Load head model, “vol” hdmfile = fullfile(which('standard_bem.mat')); load(hdmfile); % Create grid gridcfg = []; gridcfg.grid.xgrid = -20:1:20; gridcfg.grid.ygrid = -20:1:20; gridcfg.grid.zgrid = -20:1:20; gridcfg.grid.unit = 'cm'; gridcfg.grid.tight = 'yes'; gridcfg.inwardshift = -1.5; gridcfg.vol = vol; gridVar = ft_prepare_sourcemodel(gridcfg); % Restrict source reconstruction to outside of the cerrebellum gridVar = getRidOfCerrebellum([], gridVar); % Source reconstruction slcfg = struct; slcfg.method = ‘mne’; slcfg.elec = data.elec; slcfg.grid = gridVar; slcfg.vol = vol; slcfg.rawtrial = 'yes'; slcfg.hdmfile = hdmfile; slcfg.mne.lambda = '5%'; slcfg.keepfilter = 'yes'; slcfg.rawtrial = 'no'; % this is because we are now just computing the spatial filter slcfg.singletrial = 'no'; slcfg.keeptrials = 'yes'; % calculate the avg of each trial, for use in ft_sourceanalysis for trialI = 1:length(data.trial) data.avg(:,trialI) = mean(data.trial{trialI}')'; end source_for_filter = ft_sourceanalysis(slcfg, data); %this source structure is used to compute the filter to be used later On Fri, Jul 25, 2014 at 9:46 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Dear Roey, > > I agreet that this is a bad idea - independently of what result you will > get, the error is just too big to draw any reliable conclusions. Imho, you > can better try using ICA to decompose your data into components. > > Concerning the headmodel, there is a standard BEM headmodel template > available in FieldTrip. > > Best, > Jörn > > > On 7/24/2014 8:50 PM, Roey Schurr wrote: > >> Dear Jim, >> Thank you for drawing my attention to this problem. I have actually tried >> building a realistic head model using OPENMEG but encountered some >> compitability problems since our lab does not use Linux. This is indeed one >> of the most important (short) future tasks - being able to use such >> realistic head models. >> Best, >> roey >> >> >> On Thu, Jul 24, 2014 at 6:34 PM, E688205 > > wrote: >> >> Dear Roey, >> >> To add to Diego's comments, since you are dealing with EEG data a >> single sphere headmodel is not a good idea because it does not >> take into account the differences in conductivity between the >> skull, scalp, and brain. This is not a problem for MEG but is >> important for EEG. Therefore it is better to use, for example, a >> BEM head model. >> >> Best, >> >> Jim >> >> On 23 jul. 2014, at 16:38, "Lozano Soldevilla, D. (Diego)" >> > > wrote: >> >> Dear Roey, >>> >>> In my opinion it's definitely not a good idea to compute MNE >>> using 19 sensors. There are studies that have found a drastic >>> localization precision from 31 to 63 electrodes and further >>> improvements till 123: >>> >>> http://www.ncbi.nlm.nih.gov/pubmed/15351361 (see figure 1) >>> http://www.ncbi.nlm.nih.gov/pubmed/12495765 >>> >>> Although it's very difficult to know the "minimum" number of >>> electrodes needed to accurately localize a given source (it >>> depends on the strength of the source you want to localize, >>> source reconstruction algorithm, data noise...), 19 electrodes >>> are too low to trust the results you can get. >>> >>> best, >>> >>> Diego >>> >>> >>> ------------------------------------------------------------ >>> ------------ >>> From roeysc atgmail.com Mon Jul 21 11:21:32 >>> 2014 >>> From: roeysc atgmail.com (Roey Schurr) >>> >>> Date: Mon, 21 Jul 2014 12:21:32 +0300 >>> Subject: [FieldTrip] MNE Source Reconstruction Sanity Check >>> Message-ID: >> mail.gmail.com >> AQ_W43cHF_8J2b+rNyzd55x4aRviw at mail.gmail.com>> >>> >>> >>> Dear fieldtrippers, >>> >>> >>> >>> I want to do a sanity check on mne source reconstruction. >>> >>> I'm working on continuous EEG recordings (19 electrodes), estimating >>> the >>> source reconstruction activity using the *mne* (minimum norm >>> estimate) >>> method, a *template MRI* (Colin27) and a *singlesphere* headmodel. >>> As a >>> sanity check for the source reconstruction itself, I wanted to >>> compare >>> conditions in which I could estimate the loci of significant >>> changes, e.g.: >>> rest vs movement of the hand, moving the right hand vs the left >>> hand, etc. >>> I have about 60 seconds of recording for each condition. >>> >>> >>> >>> What I did was: >>> >>> 1) Segment the recording of each condition into many "trials" of 2 >>> seconds >>> each. >>> >>> 2) For each trial, average the activity in each of the 90 ROIs of >>> the aal >>> atlas (I excluded the cerebellum from the source reconstruction). >>> >>> >>> >>> I was wondering what comparison would be best in this case. Since >>> this is >>> not Evoked Responses data, I find it hard to find relevant ideas, >>> and would >>> like to hear your thoughts. >>> >>> >>> >>> 1) I did a frequency analysis (mtmfft) in conventional bands of >>> interest >>> and ran ft_freqstatistics on the resulting structures (using ttest2 >>> and the >>> bonferoni correction for the multiple comparison problem). This gave >>> some >>> results, however for most conditions they are not very encouraging >>> (the >>> ROIs that showed significant differences were not close to those >>> that I >>> have assumed). >>> >>> >>> >>> *QUESTION 1*: do you think this is a proper method? Note that I did >>> not use >>> a frequency based source reconstruction in the first place, because >>> I'm >>> ultimately interested in the time course in the source space. >>> >>> >>> >>> 2) I was wondering if a cluster based permutation test is impossible >>> to use >>> here, since this is a continuous recording, so clustering according >>> to time >>> adjacency seems irrelevant. >>> >>> >>> >>> *QUESTION 2*: is it possible to use a cluster based statistical test >>> here? >>> If so, it could be better than a-priori averaging the source >>> activity in >>> the atlas ROIs, which could mask some of the effects, if they are >>> located >>> in a small area. >>> >>> >>> >>> 3) Another possibility is looking at the data itself. Unfortunately I >>> encountered some problems using ft_sourcemovie, though this is a >>> subject >>> for a different thread. >>> >>> >>> >>> Any thoughts and advice are highly appreciated! >>> >>> Thank you for taking the time, >>> >>> roey >>> _______________________________________________ >>> >>> 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 >> > > > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 20 21:55:37 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 20 Aug 2014 19:55:37 +0000 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hello Julian, Thanks for the help. I am using MATLAB 2014a, and I am using my own mri, and locations. FieldTrip is up to date as well. The result is below.[cid:889764B9-93C3-4878-B240-9029C6836FAA at host.ucla.edu] I am trying to move the electrodes slightly. When I follow the steps on the website. >> disp(mri.hdr.fiducial.mri) Reference to non-existent field 'HDR'. Isaiah On Aug 19, 2014, at 1:26 AM, Julian Keil > wrote: Hi Isaiah, could you check which FT-Version & Matlab-Version you are using? I just checked it and it seems to work fine (on Matlab 2011b). Also, could you post the output from calling "mri" and "mri.hdr"? 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: Hello, I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. mri = ft_read_mri('Subject01.mri'); disp(mri.hdr.fiducial.mri) nas: [87 60 116] lpa: [29 145 155] rpa: [144 142 158] Reference to non-existent field 'hdr'. I cannot display. Am I missing a prior step? Best, Isaiah Smith _______________________________________________ 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: Screen Shot 2014-08-20 at 12.48.14 PM.png Type: image/png Size: 40529 bytes Desc: Screen Shot 2014-08-20 at 12.48.14 PM.png URL: From julian.keil at gmail.com Thu Aug 21 09:15:39 2014 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 21 Aug 2014 09:15:39 +0200 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hi Isaiah, so you are having trouble using your own MRI, right? Have you tried the example-MRI that comes with the tutorial or the standard mri found in the templates-folder? Depending on your MRI-machine you might not actually get any header info (which is stored in .hdr). For example, with the Simens Verio which I use here, I get DICOM files which contain a .hdr when read into field trip, however the .hdr field does not contain any information on the fiducials. So, in order to realign your EEG-Electrodes and the MRI without the fiducials, you need to use the ft_electroderealign-function with cfg.method = interactive. You also need to take some steps before that, i.e. you need to realign your MRI (ft_volumerealign), segment the MRI (ft_volumesegment) and create a head model (ft_prepare_headmodel). From your plot I guess that you already have the head model and EEG-Electrodes, so you can use the code from the example script (http://fieldtrip.fcdonders.nl/example/align_eeg_electrode_positions_to_bem_headmodel): % align interactive to surface of headmodel stored in vol.bnd cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1); elec_new = ft_electroderealign(cfg); Good luck, in case you're still having trouble I can also send you a copy of my personal script I use to create head models. Julian Am 20.08.2014 um 21:55 schrieb Isaiah C. Smith: > Hello Julian, > > Thanks for the help. I am using MATLAB 2014a, and I am using my own mri, and locations. FieldTrip is up to date as well. The result is below. > I am trying to move the electrodes slightly. > > When I follow the steps on the website. > >> disp(mri.hdr.fiducial.mri) > Reference to non-existent field 'HDR'. > > Isaiah > On Aug 19, 2014, at 1:26 AM, Julian Keil wrote: > >> Hi Isaiah, >> >> could you check which FT-Version & Matlab-Version you are using? >> I just checked it and it seems to work fine (on Matlab 2011b). >> Also, could you post the output from calling "mri" and "mri.hdr"? >> >> 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: >> >>> Hello, >>> >>> I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. >>> >>> mri = ft_read_mri('Subject01.mri'); >>> >>> disp(mri.hdr.fiducial.mri) >>> nas: [87 60 116] >>> lpa: [29 145 155] >>> rpa: [144 142 158] >>> Reference to non-existent field 'hdr'. >>> >>> I cannot display. Am I missing a prior step? >>> >>> Best, >>> Isaiah Smith >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Fri Aug 22 11:01:14 2014 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Fri, 22 Aug 2014 11:01:14 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR Message-ID: Hi All, I want to have a TFR plot that has the same portion for : - alpha (7-15 Hz) - beta (15-30 Hz) - low gamma (30-60 Hz) - high gamma (60-120 Hz) Since those bands have exponential frequency steps, I could only see very small part of alpha and (too) many high gamma band. Is there a way to make the cfg.foi in fieldtrip to have non linear steps? I tried to insert a exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); But fieldtrip seems only detect first and last number and make linear steps out of it. Thank you in advance for any help and share! Sandhy -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Fri Aug 22 11:13:22 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Fri, 22 Aug 2014 11:13:22 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: References: Message-ID: Hey Sandhy, Try, cfg.foi = [7:30, 30:5:60, 60:10:120]; Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. Is this what you need? -- Regards, Kousik Sarathy, S On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < prasandhya.a.yusuf at gmail.com> wrote: > Hi All, > > I want to have a TFR plot that has the same portion for : > - alpha (7-15 Hz) > - beta (15-30 Hz) > - low gamma (30-60 Hz) > - high gamma (60-120 Hz) > > Since those bands have exponential frequency steps, I could only see very > small part of alpha and (too) many high gamma band. Is there a way to make > the cfg.foi in fieldtrip to have non linear steps? I tried to insert a > exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); > But fieldtrip seems only detect first and last number and make linear > steps out of it. > > Thank you in advance for any help and share! > > Sandhy > > _______________________________________________ > 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 d.lozanosoldevilla at fcdonders.ru.nl Fri Aug 22 13:08:34 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Fri, 22 Aug 2014 13:08:34 +0200 (CEST) Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: Message-ID: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> Hi Sandhy , Could you please tell us a bit more info about how do you compute your TFR ? Your problem sounds to me as your data length does not match the frequency you're asking: http :// fieldtrip . fcdonders . nl / faq /why_does_my_output.freq_not_match_my_ cfg . foi _when_using_wavelet_formerly_ wltconvol _in_ft_ freqanalyis http :// fieldtrip . fcdonders . nl / faq /why_does_my_output.freq_not_match_my_ cfg . foi _when_using_ mtmconvol _in_ft_ freqanalyis If you want to space frequency logarithmically, I'd recommend you to change the y-axes scale to log-scale after the TFR . Alternatively, other people approach the frequency resolution modifying the wavelets. You can make a modified wavelets with different number of cycles per frequency although this approach it's more vulnerable to spectral leakage. This is because the wavelet at particular frequency wont fit an interger number of cycles : cfg = []; cfg .output = 'pow' ; cfg .channel = 'MEG' ; cfg .method = 'mtmconvol' ; cfg .taper = 'hanning' ; cfg . foi = 2:1:50; cfg .t_ ftimwin = linspace (3,37.5,size( cfg . foi ,2))./ cfg . foi ; cfg . toi = -0.5:0.05:1.5; freq = ft_ freqanalysis ( cfg , data); I hope it helps, Diego ----- Original Message ----- > From: " kousik sarathy " < sarathykousik @ gmail .com> > To: " FieldTrip discussion list" < fieldtrip @science. ru . nl > > Sent: Friday, 22 August, 2014 11:13:22 AM > Subject: Re: [ FieldTrip ] Non linear frequency steps in TFR > Hey Sandhy , > Try, > cfg . foi = [7:30, 30:5:60, 60:10:120]; > Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. > Is this what you need? > -- > Regards, > Kousik Sarathy , S > On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < > prasandhya .a. yusuf @ gmail .com > wrote: > > Hi All, > > I want to have a TFR plot that has the same portion for : > > - alpha (7-15 Hz) > > - beta (15-30 Hz) > > - low gamma (30-60 Hz) > > - high gamma (60-120 Hz) > > Since those bands have exponential frequency steps, I could only see > > very small part of alpha and (too) many high gamma band. Is there a > > way to make the cfg . foi in fieldtrip to have non linear steps? I > > tried to insert a exponential function: cfg . foi = > > 0.5*exp(0.6931*(3.8:0.02:7.9)); > > But fieldtrip seems only detect first and last number and make > > linear > > steps out of it. > > Thank you in advance for any help and share! > > Sandhy > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip @ donders . ru . nl > > http ://mailman.science. ru . nl /mailman/ listinfo / fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip @ donders . ru . nl > http ://mailman.science. ru . nl /mailman/ listinfo / fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http :// www . ru . nl /people/ donders /lozano-soldevilla-d/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Aug 22 16:56:57 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 22 Aug 2014 16:56:57 +0200 Subject: [FieldTrip] normalization of already baselinecorrected EEG data Message-ID: Dear all, I have again a rather conceptual question: I just did all the steps until timelock with a set of 20 subjects. Now i realized (far too late) that the baseline I chose in the preprocessing was not ideal (it is before stimulusonset but actually not before the point 0 of my ERP analysis as that is within the stimulus). Is there anything I can do about that without repeating all steps for all subjects? could I baseline correct again? Or do a z score of the single trials(would make sense as I have a strong intersubject variability too) Every advice is appreciated! Best Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.grova at mcgill.ca Fri Aug 22 21:04:15 2014 From: christophe.grova at mcgill.ca (Christophe Grova) Date: Fri, 22 Aug 2014 19:04:15 +0000 Subject: [FieldTrip] Postdoctoral and/or MSc/PhD positions available in the Multimodal Functional Imaging Lab in Montreal Message-ID: <9E1647EDA3EBB44AADA162CEC4C4222E3CAF7741@exmbx2010-9.campus.MCGILL.CA> Postdoctoral and/or MSc/PhD positions available at Concordia University in the Multimodal Functional Imaging Lab I am pleased to announce that I am currently looking for a Postdoctoral fellow and/or M.Sc./PhD students to join my lab, the Multimodal Functional Imaging lab. The candidates will join a multidisciplinary team composed of neurologists and methodologists within the Multimodal Functional Imaging Laboratory. This laboratory directed by Pr. Grova is based on two sites: (i) Physics Dpt at Concordia University and PERFORM center, (ii) Biomedical Engineering Dpt and part of the epilepsy group of the Montreal Neurological Institute, McGill University. Both environments offer unique platforms with access to several modalities (simultaneous high-density EEG/fMRI, MEG, simultaneous EEG/NIRS, TMS, SPECT/CT, PET/CT). The candidates will notably have access to the brand new multimodal imaging platform of PERFORM center, dedicated to neuroscience studies over large cohort of subjects (effect of age, exercising, ...), whereas clinical applications during the presurgical investigation of patients with epilepsy will be primarly based at the Montreal Neurological Institute. The main expertise of the team is the development and the validation of source localization methods dedicated for EEG, MEG and NIRS as well as multimodal characterization of brain activity and especially resting state functional connectivity. Project 1: Multimodal characterization of resting state functional connectivity The main originality of this project is to consider frequency-based source localization of EEG and MEG data, using notably wavelet-based Maximum on the Mean (Lina et al IEEE TBME 2012) in order to investigate resting state functional connectivity from simultaneous EEG/MEG data and simultaneous high-density EEG/fMRI data. These multimodal data will be considered in order to investigate the dynamic of resting state functional connectivity patterns in healthy controls and patients with epilepsy. Project 2: Multimodal assessement of the integrity of the neuromuscular coupling The main originality of this project is a complete multimodal investigation of neurovascular coupling processes involving EEG/MEG, EEG/fMRI and EEG/NIRS data. Neurovascular coupling during excitation and inhibition will be analyzed either in healthy conditions during well-controlled paradigms (e.g. finger tapping, electrical median nerve stimulation, TMS stimulations) or in resting state conditions and notably at the time of transient epileptic activity. One of the main objective will consist in assessing the integrity of the neurovascular coupling processes in these conditions. Developpments will involve statistical analysis of NIRS signal, 3D tomographic reconstruction of EEG and NIRS data, evaluation of neurovascular coupling models. Supervisor: Christophe Grova Ph.D. Assistant Professor, Physics Dpt and PERFORM, Concordia University, Montreal, Canada Adjunct Professor, Biomedical Engineering and Neurology & Neurosurgery dpts, McGill University, Montreal, Canada Director of the Multimodal Functional Imaging Laboratory Email: christophe.grova at concordia.ca christophe.grova at mcgill.ca Requirements: The candidate should have expertise in image and signal processing, involving notably one or few of the modalities mentioned. Computational skills including neuroimaging softwares and Matlab are important additional qualifications. Experience in the field of epilepsy will be appreciated Please send your CV and motivation letter before Sept. 20th 2014 to christophe.grova at concordia.ca Cordially Christophe Grova *************************** Christophe Grova, PhD Assistant Professor, Physics Dpt, Concordia University PERFORM centre, Concordia University Adjunct Prof in Biomedical Engineering, and Neurology and Neurosurgery Dpt, McGill University Multimodal Functional Imaging Lab (Multi FunkIm) Montreal Neurological Institute - epilepsy group Centre de Recherches en Mathématiques Biomedical Engineering Department - Room 304 McGill University 3775 University Street, Montreal, Quebec, Canada, H3A 2B4 email : christophe.grova at concordia.ca , christophe.grova at mcgill.ca tel : (514) 398 2516 fax : (514) 398 7461 web: Physics, Concordia University: http://physics.concordia.ca/facultyandresearch/bios/grova.php McGill University: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/PeopleChristophe MultiFunkIm Lab: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/HomePage *************************** [X] -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Aug 22 22:33:18 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 22 Aug 2014 22:33:18 +0200 Subject: [FieldTrip] example for nonparametric permutation anova using ft_statfun_depsamplesF? Message-ID: Dear all, I would like to replicate the results of a study using exactly what they used. I need to do a nonparametric permutation anova (repeated measures) of ERP data with 2 levels of Hemisphere, 4 levels of ROI and 3 levels of Time (windows). Could somebody post an example of such an analysis? I can't figure out how to determine the different levels by the cfg structure etc. Thanks a million Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.barcelo at uib.es Sat Aug 23 00:33:59 2014 From: f.barcelo at uib.es (Francisco Barcelo) Date: Sat, 23 Aug 2014 00:33:59 +0200 Subject: [FieldTrip] PhD and Postdoctoral positions in Majorca, Spain Message-ID: One PhD and one Postdoctoral research positions are available at the Department of Psychology (University of Balearic Islands, Spain) to join an ongoing project on the Cognitive neuroscience of executive control aimed to assess functional and effective connectivity (e.g., Dynamic Causal Modeling) in M/EEG data sets from healthy controls and brain injured patients. The project aims to develop state-of-the-art neuropsychological tools for a more valid and cost-effective evaluation of dysexecutive symptoms in elderly adults and patients with frontal lobe lesions (cf., Barceló & Knight, Cereb. Cortex, 2007; Nyhus & Barceló, Brain & Cognition, 2009). Successful pre/postdoctoral candidates will hold a MSc/PhD in Psychology, Biology, Cognitive Neuroscience, Physics, or related fields, and will play a key role in designing, conducting, analyzing and reporting M/EEG studies, with a focus on event-related potentials, oscillatory neural activity and synchrony. Candidates will be fluent in English (knowledge of Spanish is not required), and will prove good interpersonal and communication skills, including writing to a high standard. Both positions are funded by the Spanish Government (MINECO’s grant PSI2013-44760-R), as well as other local research agencies. Requirements for the PhD student position: 1) EU citizenship; 2) a Master degree and excellent academic marks; 3) Programming skills (eg., Matlab will be a plus); and 4) Demonstrated ability and high motivation to conduct high-quality research publishable in quality international peer-reviewed journals. Requirements for the Postdoc position: 1) Strong background publishing EEG and/or MEG studies; 2) Advanced programming skills (eg., Matlab, C, Python); 3) Excellent command of EEG/MEG data analysis software (EEGLAB, SPM8, Brainstorm, etc); and 4) demonstrate creative and independent work. Applicants must submit an updated CV in pdf format, a letter of motivation, and the names and emails of two referees to the grant holder: Francisco Barceló (f.barcelo at uib.es). The PhD studentship is for 3 years, and the postdoc position is for one year, with the possibility of renewal. Starting date October 1st 2014, or until the positions are filled. Informal inquires are welcomed. For more information visit: www.mcst.es, or www.neuropsicologiaclinica.es. ><><><><><><><><><><><><><>< Francisco Barceló, PhD Full Professor of Neuropsychology University of Illes Balears (UIB) Ctra. Valldemossa, km 7.5 E-07122 Palma de Mallorca - Spain Personal: www.mcst.es Lab: www.neuropsicologiaclinica.es Phone: 971 172750 Fax: 971 172309 ><><><><><><><><><><><><><>< -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sat Aug 23 18:08:26 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sat, 23 Aug 2014 18:08:26 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! Message-ID: Dear all, my problems seem neverending. This time however i really need help. I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: computing average of avg over 19 subjects Warning: discarding electrode information because it cannot be averaged > In ft_timelockgrandaverage at 249 the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB computing average of avg over 2 subjects Warning: discarding electrode information because it cannot be averaged > In ft_timelockgrandaverage at 249 the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) I guess that there is a problem with the layout I use. Here the code that I use %For generating the layout (also in the single subjects): cfg = []; cfg.channel = obs_data.label; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.feedback = 'yes'; lay = ft_prepare_layout(cfg); cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); %For computing the grand average cfg = []; cfg.channel = 'all'; cfg.latency = 'all'; cfg.parameter = 'avg'; cfg.keepindividual = 'no' GA_90 = ft_timelockgrandaverage(cfg,all90{:}); GA_180 = ft_timelockgrandaverage(cfg,all180{:}); % "{:}" means to use data from all elements of the variable For plotting the significant clusters cfg = []; cfg.style = 'blank'; cfg.layout = lay; cfg.channellabels = 'yes'; cfg.highlight = 'labels'; cfg.highlightchannel = find(stat.mask); cfg.comment = 'no'; figure; ft_topoplotER(cfg, GA_90) title('Nonparametric: significant with cluster multiple comparison correction') Do you have ANY idea to this? I am really completely helpless.... thanks and best Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sun Aug 24 05:40:34 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sun, 24 Aug 2014 15:40:34 +1200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Try this one I use On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: > Dear all, my problems seem neverending. This time however i really need > help. > I implemented a pipeline for ERPs. All works now, trialdefinition, > preprocessing, channelreplacement, ica, componentrejection, final > artifactdetection, timelock of the single subject data. However, when I > wanna compute the grandaverage of the single subjects I get the following > error message: > > computing average of avg over 19 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the > additional allocation of an estimated 3 MB > computing average of avg over 2 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the > additional allocation of an estimated 0 MB > the call to "ft_prepare_layout" took 0 seconds and required the additional > allocation of an estimated 0 MB > the call to "ft_topoplotER" took 0 seconds and required the additional > allocation of an estimated 0 MB > > Furthermore in the plot of the significant clusters, the channelnames are > mixed up (do not correspond to my net) > > > I guess that there is a problem with the layout I use. > Here the code that I use > > %For generating the layout (also in the single subjects): > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = lay; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > > > %For computing the grand average > > cfg = []; > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > cfg.parameter = 'avg'; > > cfg.keepindividual = 'no' > > GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > > GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > > % "{:}" means to use data from all elements of the variable > > > > For plotting the significant clusters > > cfg = []; > > cfg.style = 'blank'; > > cfg.layout = lay; > > cfg.channellabels = 'yes'; > > cfg.highlight = 'labels'; > > cfg.highlightchannel = find(stat.mask); > > cfg.comment = 'no'; > > figure; ft_topoplotER(cfg, GA_90) > > title('Nonparametric: significant with cluster multiple comparison > correction') > > > Do you have ANY idea to this? I am really completely helpless.... > > thanks and best > > Katrin > > _______________________________________________ > 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 e.caspar at ucl.ac.uk Sun Aug 24 12:49:24 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sun, 24 Aug 2014 10:49:24 +0000 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Message-ID: <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Thank you for your answer. The complete error message I have is this one, but I'm not able to decrypt it. Error using filter_with_correction (line 44) Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter. Error in filter_with_correction (line 44) error('Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter.'); Error in ft_preproc_bandpassfilter (line 148) filt = filter_with_correction(B,A,dat,dir); Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); It only occurs when I ask for a bpfilterrange from .1 to 30, or any values lower than .9. Thanks! Emilie Le 11 août 2014 à 12:43, Eelke Spaak > a écrit : Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie > wrote: Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie _______________________________________________ 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 roeysc at gmail.com Sun Aug 24 13:47:55 2014 From: roeysc at gmail.com (Roey Schurr) Date: Sun, 24 Aug 2014 14:47:55 +0300 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Message-ID: Dear Emilie, Try reading this thread and see if it helps: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005360.html The bottom line is, if you want a low highpass filer, you need to change the order of the filter you're using. In the example in the thread above, using a filter of order 5 helped Philipp applying a 0.1 Hz highpass filter. So you could try using something like: cfg.hpfiltord = 5; Hope this helps! Roey On Sun, Aug 24, 2014 at 1:49 PM, Caspar, Emilie wrote: > Thank you for your answer. The complete error message I have is this one, > but I'm not able to decrypt it. > > Error using filter_with_correction (line 44) > Calculated filter coefficients have poles on or outside the unit circle > and will not be stable. Try a higher cutoff > frequency or a different type/order of filter. > > Error in filter_with_correction (line 44) > error('Calculated filter coefficients have poles on or outside the unit > circle and will not be stable. Try a > higher cutoff frequency or a different type/order of filter.'); > > Error in ft_preproc_bandpassfilter (line 148) > filt = filter_with_correction(B,A,dat,dir); > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > It only occurs when I ask for a bpfilterrange from .1 to 30, or any > values lower than .9. > > Thanks! > > Emilie > > > > Le 11 août 2014 à 12:43, Eelke Spaak a écrit > : > > Dear Emilie, > > The error message you include only specifies *where* in the code the > error happened, not *what* the actual error was. Could you include the > actual error as well? Perhaps someone can then help you fix it. (In > general there is no fixed lower limit on filter low-/highpass > frequency, although a practical limit could depend on your data.) > > Best, > Eelke > > On 9 August 2014 09:31, Caspar, Emilie wrote: > > Dear Fieldtrip members, > > I would like to apply to my data a bandpass filter from 0.016 (or at least > 0.1) to 30 Hz > > bpfilterRange = [.1 30]; > > However, it seems that Fieltrip doesn't accept small high-pass filter > values. I have the following mistake : > > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, > which is quite high. > > I wonder if the problem comes from my data (but I had no problems on others > programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? > > Thank in advance, > > Emilie > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Sun Aug 24 14:15:48 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Sun, 24 Aug 2014 14:15:48 +0200 Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences Message-ID: Dear all and Prof Maris, I'm re-posting this question again, as I didn't get any replies previously. I’m interested to investigate if there are any differences in phase synchronization in resting state data at timepoint 2 versus timepoint 1. The EEG data was collected using 64 EEG channels, resting state, eyes opened and eyes closed. I’ve arbitrarily segmented the resting state data into epochs of 2s each, and the epochs with artifacts are excluded completely from further analyses. I then performed mtmfft to get the fourier representation of the data, extracted the coherence, and compared the coherence difference of timepoint 2 versus timepoint 1 of all channels paired with all other channels. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to perform cluster-based statistical analyses. I get an output with ‘chan_chan’ dimord variable. However, I was not 100% sure that this is correct, hence, I’ve inserted my code (see below). It’ll be great if you could tell me if what I’m doing makes any sense at all. Also, I don’t know how I can plot the results to see if it make any sense at all. Also, I checked the values obtained from when I specified "cfg.channelcmb" and when I did not specify "cfg.channelcmb", I noticed that the values were somehow different. I would assume that the values to be similar, although I'm not sure why they would have differences in the values obtained from specifying "cfg.channelcmb". This is my code that I've used thus far: for sub = 1:5 cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; cfg.foilim = [0 100]; cfg.taper = 'dpss'; % find the index for the c200 condition pre_c200_idx = find(data5.trialinfo == 201); cfg.trials = pre_c200_idx; HLF_pre_c200 = ft_freqanalysis(cfg, data5); post_c200_idx = find(data5.trialinfo == 200); cfg.trials = post_c200_idx; HLF_post_c200 = ft_freqanalysis(cfg, data5); cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'coh'; HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_post_c200); end load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; cfg_neighb.channel = 'all'; neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); cfg = []; cfg.layout = lay; cfg.neighbours = neighbours; cfg.channel = 'all'; cfg.channelcmb = {cfg.channel, cfg.channel}; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.tail = 0; % cfg.clustertail = 0; cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency bands. cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; % for theta band cfg.avgoverfreq = 'yes'; cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), and gamma (40-100). [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, sub_HLF_pre_c200coh{:}); When I tried to plot the results, I used this code: cfg = []; cfg.channel = 'all'; cfg.layout = 'lay'; cfg.zlim = [-1 1]; cfg.alpha = 0.05; cfg.refchannel = 'all'; ft_clusterplot(cfg, diffc200_theta_stat); However, I was not sure how I could plot the results. I get an error message from Fieldtrip when using ft_clusterplot: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); According to your paper in 2007, the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, and I would really appreciate if you can show me how to make such a plot. Thank you very much. Kind regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sun Aug 24 21:52:32 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 24 Aug 2014 21:52:32 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Dear Ana, dear all, the layout you used does not correspond to our nets. I tried the GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? Cheers Katrin 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > Try this one > I use > > > On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > wrote: > >> Dear all, my problems seem neverending. This time however i really need >> help. >> I implemented a pipeline for ERPs. All works now, trialdefinition, >> preprocessing, channelreplacement, ica, componentrejection, final >> artifactdetection, timelock of the single subject data. However, when I >> wanna compute the grandaverage of the single subjects I get the following >> error message: >> >> computing average of avg over 19 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the >> additional allocation of an estimated 3 MB >> computing average of avg over 2 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> the call to "ft_prepare_layout" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> the call to "ft_topoplotER" took 0 seconds and required the additional >> allocation of an estimated 0 MB >> >> Furthermore in the plot of the significant clusters, the channelnames are >> mixed up (do not correspond to my net) >> >> >> I guess that there is a problem with the layout I use. >> Here the code that I use >> >> %For generating the layout (also in the single subjects): >> >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = lay; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >> >> %For computing the grand average >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.latency = 'all'; >> >> cfg.parameter = 'avg'; >> >> cfg.keepindividual = 'no' >> >> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >> % "{:}" means to use data from all elements of the variable >> >> >> >> For plotting the significant clusters >> >> cfg = []; >> >> cfg.style = 'blank'; >> >> cfg.layout = lay; >> >> cfg.channellabels = 'yes'; >> >> cfg.highlight = 'labels'; >> >> cfg.highlightchannel = find(stat.mask); >> >> cfg.comment = 'no'; >> >> figure; ft_topoplotER(cfg, GA_90) >> >> title('Nonparametric: significant with cluster multiple comparison >> correction') >> >> >> Do you have ANY idea to this? I am really completely helpless.... >> >> thanks and best >> >> Katrin >> >> _______________________________________________ >> 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 prasandhya.a.yusuf at gmail.com Mon Aug 25 15:00:09 2014 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Mon, 25 Aug 2014 15:00:09 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> References: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Kousik Sarathy and Diego, thank you for your repply and suggestions! Thanks a lot for the Field Trip links Diego, it helps me to understand how Field Trip compute with wavelet. I thought field trip compute the wavelet the same way as cwt function in Matlab (using scales instead of frequencies). Yes, I think I need to consider the frequencies "available" from my computation and should be more aware of the spectral interpolation with vulnerable spectral leakage. I am still trying to play around with the parameters so I can get what I want. Cheers :) Sandhy On Fri, Aug 22, 2014 at 1:08 PM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Sandhy, > > Could you please tell us a bit more info about how do you compute your > TFR? Your problem sounds to me as your data length does not match the > frequency you're asking: > > > http://fieldtrip.fcdonders.nl/faq/why_does_my_output.freq_not_match_my_cfg.foi_when_using_wavelet_formerly_wltconvol_in_ft_freqanalyis > > http://fieldtrip.fcdonders.nl/faq/why_does_my_output.freq_not_match_my_cfg.foi_when_using_mtmconvol_in_ft_freqanalyis > > If you want to space frequency logarithmically, I'd recommend you to > change the y-axes scale to log-scale after the TFR. Alternatively, other > people approach the frequency resolution modifying the wavelets. You can > make a modified wavelets with different number of cycles per frequency > although this approach it's more vulnerable to spectral leakage. This is > because the wavelet at particular frequency wont fit an interger number of > cycles : > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:50; > cfg.t_ftimwin = linspace(3,37.5,size(cfg.foi,2))./cfg.foi; > cfg.toi = -0.5:0.05:1.5; > freq = ft_freqanalysis(cfg, data); > > I hope it helps, > > Diego > > ------------------------------ > > *From: *"kousik sarathy" > *To: *"FieldTrip discussion list" > *Sent: *Friday, 22 August, 2014 11:13:22 AM > *Subject: *Re: [FieldTrip] Non linear frequency steps in TFR > > > Hey Sandhy, > > Try, > cfg.foi = [7:30, 30:5:60, 60:10:120]; > > Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. > > Is this what you need? > > > -- > Regards, > Kousik Sarathy, S > > > > On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < > prasandhya.a.yusuf at gmail.com> wrote: > >> Hi All, >> >> I want to have a TFR plot that has the same portion for : >> - alpha (7-15 Hz) >> - beta (15-30 Hz) >> - low gamma (30-60 Hz) >> - high gamma (60-120 Hz) >> >> Since those bands have exponential frequency steps, I could only see very >> small part of alpha and (too) many high gamma band. Is there a way to make >> the cfg.foi in fieldtrip to have non linear steps? I tried to insert a >> exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); >> But fieldtrip seems only detect first and last number and make linear >> steps out of it. >> >> Thank you in advance for any help and share! >> >> Sandhy >> >> _______________________________________________ >> 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 > > > > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > 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 e.caspar at ucl.ac.uk Mon Aug 25 15:11:59 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 25 Aug 2014 13:11:59 +0000 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Message-ID: <86F3C645-6F78-449F-8576-2E3584CABA25@live.ucl.ac.uk> Thank you for your answer. I have found a solution with an order of 3 Thank you for the help :) Emilie Le 24 août 2014 à 13:47, Roey Schurr > a écrit : Dear Emilie, Try reading this thread and see if it helps: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005360.html The bottom line is, if you want a low highpass filer, you need to change the order of the filter you're using. In the example in the thread above, using a filter of order 5 helped Philipp applying a 0.1 Hz highpass filter. So you could try using something like: cfg.hpfiltord = 5; Hope this helps! Roey On Sun, Aug 24, 2014 at 1:49 PM, Caspar, Emilie > wrote: Thank you for your answer. The complete error message I have is this one, but I'm not able to decrypt it. Error using filter_with_correction (line 44) Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter. Error in filter_with_correction (line 44) error('Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter.'); Error in ft_preproc_bandpassfilter (line 148) filt = filter_with_correction(B,A,dat,dir); Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); It only occurs when I ask for a bpfilterrange from .1 to 30, or any values lower than .9. Thanks! Emilie Le 11 août 2014 à 12:43, Eelke Spaak > a écrit : Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie > wrote: Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.marshall at fcdonders.ru.nl Mon Aug 25 17:15:23 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Mon, 25 Aug 2014 17:15:23 +0200 Subject: [FieldTrip] example for nonparametric permutation anova using ft_statfun_depsamplesF? In-Reply-To: References: Message-ID: <53FB530B.5080904@fcdonders.ru.nl> Hi Katrin, It sounds like what you want is a factorial ANOVA with 3 factors. Fortunately the feasibility, sense and implemenation of a permutation factorial ANOVA has been discussed a great deal on this mailing list. For some examples, see: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004280.html http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-September/003113.html http://mailman.science.ru.nl/pipermail/fieldtrip/2011-December/004578.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-November/003285.html http://mailman.science.ru.nl/pipermail/fieldtrip/2009-November/002485.html http://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005466.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-January/006029.html Hopefully something there should allow you to get started. Best of luck! Tom On 8/22/2014 10:33 PM, KatrinH Heimann wrote: > Dear all, > I would like to replicate the results of a study using exactly what > they used. I need to do a nonparametric permutation anova (repeated > measures) of ERP data with 2 levels of Hemisphere, 4 levels of ROI and > 3 levels of Time (windows). Could somebody post an example of such an > analysis? I can't figure out how to determine the different levels by > the cfg structure etc. > Thanks a million > Katrin > > > _______________________________________________ > 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 ktyler at swin.edu.au Tue Aug 26 02:57:27 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 26 Aug 2014 00:57:27 +0000 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer Message-ID: Hi all, I am raking through my script trying to sort out potential faults in my analysis. One issue I have come across is whether ft_timelock analysis should be performed once, or twice when using lcmv method of beamformer. The tutorial on lcmv beamfomer found here http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow seems to indicate that time-locking is only performed once only in the analysis pipeline. However, elsewhere on the FT site, I found the following advice: "In order for the beamformer to work, we need the covariance between sensor pairs. This should be the covariance of (a particular latency window) of the averaged single trials. This is essentially different from the average covariance of the single trials. Therefore, we have to call timelockanalysis more than once: the first time we obtain the evoked field, and the second time we obtain the covariance matrix/ces at interesting latency/ies" Which is correct? I have been time locking twice: using data sets which were already time-locked using ft_timelockanalysis, and then time locking again, prior to using ft_sourceanalysis........... Wrong? The phrase 'sanity check' comes up quite often on this list, and I absolutely understand! As always, any help is very much appreciated!! Kaelasha -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Tue Aug 26 06:53:11 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Tue, 26 Aug 2014 16:53:11 +1200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: > Dear Ana, dear all, > the layout you used does not correspond to our nets. I tried the > GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. > Please can anybody help? > Cheers > Katrin > > > 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > > Try this one >> I use >> >> >> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > > wrote: >> >>> Dear all, my problems seem neverending. This time however i really need >>> help. >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> preprocessing, channelreplacement, ica, componentrejection, final >>> artifactdetection, timelock of the single subject data. However, when I >>> wanna compute the grandaverage of the single subjects I get the following >>> error message: >>> >>> computing average of avg over 19 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>> additional allocation of an estimated 3 MB >>> computing average of avg over 2 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_topoplotER" took 0 seconds and required the additional >>> allocation of an estimated 0 MB >>> >>> Furthermore in the plot of the significant clusters, the channelnames >>> are mixed up (do not correspond to my net) >>> >>> >>> I guess that there is a problem with the layout I use. >>> Here the code that I use >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> cfg.channel = obs_data.label; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.feedback = 'yes'; >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = lay; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> %For computing the grand average >>> >>> cfg = []; >>> >>> cfg.channel = 'all'; >>> >>> cfg.latency = 'all'; >>> >>> cfg.parameter = 'avg'; >>> >>> cfg.keepindividual = 'no' >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> For plotting the significant clusters >>> >>> cfg = []; >>> >>> cfg.style = 'blank'; >>> >>> cfg.layout = lay; >>> >>> cfg.channellabels = 'yes'; >>> >>> cfg.highlight = 'labels'; >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> cfg.comment = 'no'; >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> correction') >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> thanks and best >>> >>> Katrin >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.marshall at fcdonders.ru.nl Tue Aug 26 17:49:17 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Tue, 26 Aug 2014 17:49:17 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions Message-ID: <53FCAC7D.4040402@fcdonders.ru.nl> Hi Trippers, I have performed dipole fitting on some data and I would like to identify the anatomical regions in which various dipoles are located - ie, to make statements of the sort, 'dipole X was (best) localised to the right superior parietal cortex'. Specifically - I have the output from ft_dipolefitting which gives positions in the head space of the individual subjects, and I would like to anatomically label the dipoles according to the AAL atlas, which is based on the MNI template brain. I *think* what I will need to do is apply some warping of the subject MRI to the MNI template, and then apply the same warping to the dipole co-ordinate. However it is not clear to me how to warp a single point, rather than an entire volume. Is there some fieldtrip function that could be used for this? I do not think the approach detailed in // will be much use here, since (if I understand correctly) the MNI-aligned grid created here would only be used as a starting point for ft_dipolefitting. In the end a given dipole might not correspond to any grid point. Can anybody advise me on how to set about this? Thanks a lot. Best, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Aug 26 18:03:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 26 Aug 2014 18:03:44 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: <53FCAC7D.4040402@fcdonders.ru.nl> References: <53FCAC7D.4040402@fcdonders.ru.nl> Message-ID: Hi Tom, ft_volumenormalise will allow you to normalise an anatomical volume to MNI space. The output of ft_volumenormalise will have a .params and .initial field. These you need, you can discard the actual normalised volumetric data. The fields contain the linear (.initial) and nonlinear (.params) warps needed to go from subject-specific to MNI space, and vice versa. Using these you can do something like: normalised = ft_volumenormalise([], mri); mnipos = ft_warp_apply(normalised.params, ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); where subjectpos is an Nx3 array of subject-specific coordinates, and mnipos will of course be Nx3 in MNI space. In case of questions we can discuss tomorrow in person :) Best, Eelke On 26 August 2014 17:49, Tom Marshall wrote: > Hi Trippers, > > I have performed dipole fitting on some data and I would like to identify > the anatomical regions in which various dipoles are located - ie, to make > statements of the sort, 'dipole X was (best) localised to the right superior > parietal cortex'. Specifically - I have the output from ft_dipolefitting > which gives positions in the head space of the individual subjects, and I > would like to anatomically label the dipoles according to the AAL atlas, > which is based on the MNI template brain. > > I *think* what I will need to do is apply some warping of the subject MRI to > the MNI template, and then apply the same warping to the dipole co-ordinate. > However it is not clear to me how to warp a single point, rather than an > entire volume. Is there some fieldtrip function that could be used for this? > > I do not think the approach detailed in > > will be much use here, since (if I understand correctly) the MNI-aligned > grid created here would only be used as a starting point for > ft_dipolefitting. In the end a given dipole might not correspond to any grid > point. > > Can anybody advise me on how to set about this? > > Thanks a lot. > > Best, > Tom > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From t.marshall at fcdonders.ru.nl Tue Aug 26 18:38:23 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Tue, 26 Aug 2014 18:38:23 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: References: <53FCAC7D.4040402@fcdonders.ru.nl> Message-ID: <53FCB7FF.80907@fcdonders.ru.nl> Hi Eelke, Fantastic! I'm now almost where I want to be... Now I have the MNI co-ordinate, and plotting: cfg=[]; cfg.location=mnipos; cfg.locationcoordinates='head'; cfg.atlas='/home/common/matlab/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; cfg.funparameter='anatomy'; ft_sourceplot(cfg,normalised); Gives me the plot with the dipole position where I expect it (based on where it was pre-warping) and an anatomical label from the AAL atlas. So far so good. I'd like to go one better though, and directly look up the label from the atlas. ft_volumelookup returns an anatomical label if you give it a binary mask, so I could try to create a volume-sized mask full of zeroes with a single 1 at 'mnipos'. However, mnipos is an MNI co-ordinate, and I would need to specify the 1 in voxel co-ordinates (ie, as an index in the matrix rather than a co-ordinate which could be -ve). How to convert the co-ordinate? Best, Tom On 8/26/2014 6:03 PM, Eelke Spaak wrote: > Hi Tom, > > ft_volumenormalise will allow you to normalise an anatomical volume to > MNI space. The output of ft_volumenormalise will have a .params and > .initial field. These you need, you can discard the actual normalised > volumetric data. The fields contain the linear (.initial) and > nonlinear (.params) warps needed to go from subject-specific to MNI > space, and vice versa. Using these you can do something like: > > normalised = ft_volumenormalise([], mri); > mnipos = ft_warp_apply(normalised.params, > ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); > > where subjectpos is an Nx3 array of subject-specific coordinates, and > mnipos will of course be Nx3 in MNI space. > > In case of questions we can discuss tomorrow in person :) > > Best, > Eelke > > On 26 August 2014 17:49, Tom Marshall wrote: >> Hi Trippers, >> >> I have performed dipole fitting on some data and I would like to identify >> the anatomical regions in which various dipoles are located - ie, to make >> statements of the sort, 'dipole X was (best) localised to the right superior >> parietal cortex'. Specifically - I have the output from ft_dipolefitting >> which gives positions in the head space of the individual subjects, and I >> would like to anatomically label the dipoles according to the AAL atlas, >> which is based on the MNI template brain. >> >> I *think* what I will need to do is apply some warping of the subject MRI to >> the MNI template, and then apply the same warping to the dipole co-ordinate. >> However it is not clear to me how to warp a single point, rather than an >> entire volume. Is there some fieldtrip function that could be used for this? >> >> I do not think the approach detailed in >> >> will be much use here, since (if I understand correctly) the MNI-aligned >> grid created here would only be used as a starting point for >> ft_dipolefitting. In the end a given dipole might not correspond to any grid >> point. >> >> Can anybody advise me on how to set about this? >> >> Thanks a lot. >> >> Best, >> Tom >> >> _______________________________________________ >> 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 prarobinson at gmail.com Tue Aug 26 19:37:42 2014 From: prarobinson at gmail.com (Paul Robinson) Date: Tue, 26 Aug 2014 10:37:42 -0700 Subject: [FieldTrip] rda2ft.exe pthread error In-Reply-To: References: Message-ID: Greetings, All. I hope to run rda2ft as a stand-alone executable under Windows XP (that's the OS I'm stuck with for now), but I get an error to the effect that pthreadGC2.dll can't be found. Does anyone have a version of this executable available that will work? Alternatively, I may be able to re-compile under Ubuntu with MinGW, but I expect that's what created the versions of rda2ft.exe I'm finding on line to begin with... Any help would be most appreciated! Best, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 27 10:04:18 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 10:04:18 +0200 Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences In-Reply-To: References: Message-ID: Dear Hweeling, I'm not sure if I understand all your questions correctly, but I can give two pointers that might be of help. First, the error message you get when trying to plot ("no reference channel is specified") tells you what you should do: specify a reference channel :) Connectivity is between channels, so if you want to plot a spatial topography, you are plotting connectivity of all channels versus *one* channel, which is called the reference channel. You can do this with cfg.refchannel = 'chan'. You might want to take a look at this part of our tutorials: http://fieldtrip.fcdonders.nl/tutorial/sensor_analysis#cortico-muscular_coherence where plotting connectivity data is explained. Second, I see that you are using cfg.alpha = 0.05/8, implementing Bonferroni correction for multiple comparisons. Cluster statistics is already a way of dealing with multiple comparisons (i.e. the cluster test is a single test), so there is no need for this. (Unless you are iteratively doing cluster statistics across some dimension, but your code suggests to me that is not the case.) Hope that helps. Best, Eelke On 24 August 2014 14:15, Hwee Ling Lee wrote: > Dear all and Prof Maris, > > I'm re-posting this question again, as I didn't get any replies previously. > > I’m interested to investigate if there are any differences in phase > synchronization in resting state data at timepoint 2 versus timepoint 1. The > EEG data was collected using 64 EEG channels, resting state, eyes opened and > eyes closed. I’ve arbitrarily segmented the resting state data into epochs > of 2s each, and the epochs with artifacts are excluded completely from > further analyses. I then performed mtmfft to get the fourier representation > of the data, extracted the coherence, and compared the coherence difference > of timepoint 2 versus timepoint 1 of all channels paired with all other > channels. > > I figured that if I extract the connectivity analyses without specifying the > channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to > perform cluster-based statistical analyses. I get an output with ‘chan_chan’ > dimord variable. However, I was not 100% sure that this is correct, hence, > I’ve inserted my code (see below). It’ll be great if you could tell me if > what I’m doing makes any sense at all. Also, I don’t know how I can plot the > results to see if it make any sense at all. > > Also, I checked the values obtained from when I specified "cfg.channelcmb" > and when I did not specify "cfg.channelcmb", I noticed that the values were > somehow different. I would assume that the values to be similar, although > I'm not sure why they would have differences in the values obtained from > specifying "cfg.channelcmb". > > This is my code that I've used thus far: > > for sub = 1:5 > > cfg = []; > > cfg.output = 'fourier'; > > cfg.channel = {'all'}; > > cfg.method = 'mtmfft'; > > cfg.keeptrials = 'yes'; > > cfg.tapsmofrq = 5; > > cfg.foilim = [0 100]; > > cfg.taper = 'dpss'; > > % find the index for the c200 condition > > pre_c200_idx = find(data5.trialinfo == 201); > > cfg.trials = pre_c200_idx; > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > post_c200_idx = find(data5.trialinfo == 200); > > cfg.trials = post_c200_idx; > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > cfg = []; > > cfg.keeptrials = 'no'; > > cfg.channel = {'all'}; > > cfg.removemean = 'yes'; > > cfg.method = 'coh'; > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > HLF_post_c200); > > end > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > cfg_neighb.method = 'template'; > > cfg_neighb.layout = lay; > > cfg_neighb.channel = 'all'; > > neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); > > > > cfg = []; > > cfg.layout = lay; > > cfg.neighbours = neighbours; > > cfg.channel = 'all'; > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > cfg.latency = 'all'; > > cfg.avgovertime = 'no'; > > cfg.avgoverchan = 'no'; > > cfg.parameter = 'cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'depsamplesT'; > > cfg.correctm = 'cluster'; > > cfg.tail = 0; > > % cfg.clustertail = 0; > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency > bands. > > cfg.numrandomization = 10000; > > cfg.ivar = 2; > > cfg.uvar = 1; > > > > % design matrices > > clear design; > > design(1,:) = [1:5, 1:5]; > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > cfg.design = design; > > % for theta band > > cfg.avgoverfreq = 'yes'; > > cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), > and gamma (40-100). > > [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, > sub_HLF_pre_c200coh{:}); > > > When I tried to plot the results, I used this code: > > cfg = []; > > cfg.channel = 'all'; > > cfg.layout = 'lay'; > > cfg.zlim = [-1 1]; > > cfg.alpha = 0.05; > > cfg.refchannel = 'all'; > > ft_clusterplot(cfg, diffc200_theta_stat); > > However, I was not sure how I could plot the results. I get an error message > from Fieldtrip when using ft_clusterplot: > > Error using topoplot_common (line 366) > > no reference channel is specified > > Error in ft_topoplotTFR (line 192) > > [cfg] = topoplot_common(cfg, varargin{:}); > > Error in ft_clusterplot (line 372) > > ft_topoplotTFR(cfgtopo, stat); > > > > According to your paper in 2007, the topoplot of the results were masked by > the spatio-spectral pattern of the significant clusters. I don't know how to > do this, and I would really appreciate if you can show me how to make such a > plot. > > Thank you very much. > > Kind regards, > > Hweeling > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Wed Aug 27 10:52:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 10:52:38 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: <53FCB7FF.80907@fcdonders.ru.nl> References: <53FCAC7D.4040402@fcdonders.ru.nl> <53FCB7FF.80907@fcdonders.ru.nl> Message-ID: Hi Tom, Let me split your post into two questions: (1) how to compute voxel indices from known anatomical coordinates? (2) how to get an anatomical label for a known coordinate? (1) Any volumetric data should have a .transform matrix attached to it. This matrix describes the linear transformation needed to get *from* voxel indices *to* anatomical coordinates. (The type of coordinates the matrix projects to is described by the .coordsys field.). To go the other way, from anatomical coordinates to voxel indices, you just apply the inverse transformation (the round() is needed to get exact integers, otherwise matlab complains): voxinds = round(ft_warp_apply(pinv(mri.transform), mnipos)); (2) There is a function private/atlas_lookup.m that takes an atlas structure and a 1x3 position and returns the anatomical label. So there is no need to go through the creation of the mask etc. (and the answer to (1) becomes irrelevant in this instance, though still good to know :) ). This very straightforward functionality should actually be merged into ft_volumelookup and atlas_lookup needs to be deprecated, however for now the function is still very useful. Best, Eelke On 26 August 2014 18:38, Tom Marshall wrote: > Hi Eelke, > > Fantastic! I'm now almost where I want to be... > > Now I have the MNI co-ordinate, and plotting: > > cfg=[]; > cfg.location=mnipos; > cfg.locationcoordinates='head'; > cfg.atlas='/home/common/matlab/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; > cfg.funparameter='anatomy'; > ft_sourceplot(cfg,normalised); > > Gives me the plot with the dipole position where I expect it (based on where > it was pre-warping) and an anatomical label from the AAL atlas. So far so > good. > > I'd like to go one better though, and directly look up the label from the > atlas. ft_volumelookup returns an anatomical label if you give it a binary > mask, so I could try to create a volume-sized mask full of zeroes with a > single 1 at 'mnipos'. However, mnipos is an MNI co-ordinate, and I would > need to specify the 1 in voxel co-ordinates (ie, as an index in the matrix > rather than a co-ordinate which could be -ve). How to convert the > co-ordinate? > > Best, > Tom > > > On 8/26/2014 6:03 PM, Eelke Spaak wrote: >> >> Hi Tom, >> >> ft_volumenormalise will allow you to normalise an anatomical volume to >> MNI space. The output of ft_volumenormalise will have a .params and >> .initial field. These you need, you can discard the actual normalised >> volumetric data. The fields contain the linear (.initial) and >> nonlinear (.params) warps needed to go from subject-specific to MNI >> space, and vice versa. Using these you can do something like: >> >> normalised = ft_volumenormalise([], mri); >> mnipos = ft_warp_apply(normalised.params, >> ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); >> >> where subjectpos is an Nx3 array of subject-specific coordinates, and >> mnipos will of course be Nx3 in MNI space. >> >> In case of questions we can discuss tomorrow in person :) >> >> Best, >> Eelke >> >> On 26 August 2014 17:49, Tom Marshall wrote: >>> >>> Hi Trippers, >>> >>> I have performed dipole fitting on some data and I would like to identify >>> the anatomical regions in which various dipoles are located - ie, to make >>> statements of the sort, 'dipole X was (best) localised to the right >>> superior >>> parietal cortex'. Specifically - I have the output from ft_dipolefitting >>> which gives positions in the head space of the individual subjects, and I >>> would like to anatomically label the dipoles according to the AAL atlas, >>> which is based on the MNI template brain. >>> >>> I *think* what I will need to do is apply some warping of the subject MRI >>> to >>> the MNI template, and then apply the same warping to the dipole >>> co-ordinate. >>> However it is not clear to me how to warp a single point, rather than an >>> entire volume. Is there some fieldtrip function that could be used for >>> this? >>> >>> I do not think the approach detailed in >>> >>> >>> will be much use here, since (if I understand correctly) the MNI-aligned >>> grid created here would only be used as a starting point for >>> ft_dipolefitting. In the end a given dipole might not correspond to any >>> grid >>> point. >>> >>> Can anybody advise me on how to set about this? >>> >>> Thanks a lot. >>> >>> Best, >>> Tom >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From praajhen at gmail.com Wed Aug 27 13:00:17 2014 From: praajhen at gmail.com (Praghajieeth Raajhen) Date: Wed, 27 Aug 2014 13:00:17 +0200 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer Message-ID: Hello!!!! Please Help out. where am I going wrong? cfg = []; cfg.channel = 'EEG'; cfg.method = 'sam'; cfg.grid = grid; cfg.vol = vol1; cfg.projectnoise = 'yes'; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); workspace of grid,vol1,timelock (.mat) https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 1. Using fieldtrip 2013 version When i do EEG sourceanalysis using "SAM" method, following error occurs Attempted to access noise(0); index must be a positive integer or logical. Error in ==> beamformer_sam at 111 noise = noise(end); Error in ==> ft_sourceanalysis at 841 dip(i) = beamformer_sam(grid, sens, vol, squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); PS: same code for MEG source reconsturction works quite good. 2. Using fieldtrip 2014 version when i do the same I'm getting this kind of errors Undefined function or variable 'abort'. Error in ==> ft_sourceanalysis at 156 if abort PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It is showing same above error. advance thanks for your kind help. Praghajith R.S. praajhen at gmail.com Master Thesis @ UKSH Kiel, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 27 16:12:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 16:12:12 +0200 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer In-Reply-To: References: Message-ID: Dear Kaelasha, The tutorial is correct, it's best to use the averaged covariance, computed on the unaveraged data (so a single call to ft_timelockanalysis). We thought we had removed the example script you mentioned some time ago, but apparently somewhere on the wiki it still lingers. Could you let us know where you found this? Or better yet, just remove it? (It is a wiki, after all.) Best, Eelke On 26 August 2014 02:57, Kaelasha Tyler wrote: > Hi all, > > I am raking through my script trying to sort out potential faults in my > analysis. > One issue I have come across is whether ft_timelock analysis should be > performed once, or twice when using lcmv method of beamformer. > > The tutorial on lcmv beamfomer found here > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > seems to indicate that time-locking is only performed once only in the > analysis pipeline. > > However, elsewhere on the FT site, I found the following advice: > "In order for the beamformer to work, we need the covariance between sensor > pairs. This should be the covariance of (a particular latency window) of the > averaged single trials. This is essentially different from the average > covariance of the single trials. Therefore, we have to call timelockanalysis > more than once: the first time we obtain the evoked field, and the second > time we obtain the covariance matrix/ces at interesting latency/ies" > > Which is correct? > > I have been time locking twice: using data sets which were already > time-locked using ft_timelockanalysis, and then time locking again, prior to > using ft_sourceanalysis........... Wrong? > > The phrase 'sanity check' comes up quite often on this list, and I > absolutely understand! As always, any help is very much appreciated!! > > Kaelasha > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From sarita.tamang at mssm.edu Wed Aug 27 19:56:01 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Wed, 27 Aug 2014 17:56:01 +0000 Subject: [FieldTrip] Preprocessing data Message-ID: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> Hello Everybody, I'm just starting to use FieldTrip and I have some very basic questions. I'm trying to analyze LFP data along with the spikes which is in Plexon format. For the preprocessing part I tried to read it as continuous data so I did clear all close all cfg = []; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data data_org = ft_preprocessing(cfg); It gave me this error with 32 u int thing Error using timestamp_plexon (line 27) invalid input Error in ft_read_data (line 1064) ts = timestamp_plexon(tsl, tsh); % use helper function, this returns an uint64 array Error in ft_preprocessing (line 573) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in LFP (line 8) data_org = ft_preprocessing(cfg); I though this was probably due to reading it as continuous data or something I couldn't figure out so i tried using the example to see if the code runs clear all close all cfg = []; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'Strobed' cfg.trialdef.eventvalue = 35; % the value of the stimulus trigger for fully incongruent (FIC). cfg.trialdef.prestim = 0.5; % in seconds cfg.trialdef.poststim = 1; % in seconds cfg.channel = {'AD01' 'AD03'}; cfg.continuous = 'yes'; trl = []; for i=1:length(event) if strcmp(event(i).type, cfg.trialdef.eventtype) % it is a trigger, see whether it has the right value if ismember(event(i).value, cfg.trialdef.eventvalue) % add this to the trl definition begsample = event(i).sample - cfg.trialdef.prestim*hdr.Fs; endsample = event(i).sample + cfg.trialdef.poststim*hdr.Fs - 1; offset = -cfg.trialdef.prestim*hdr.Fs; trigger = event(i).value; % remember the trigger (=condition) for each trial trl(end+1, :) = [round([begsample endsample offset]) trigger]; end end end cfg = ft_definetrial(cfg); data_org = ft_preprocessing(cfg); And I just used the trl loop from the example give in the website because i kept getting error saying the trial is not defined. However even after putting the code I still get the same error. Error using ft_definetrial (line 184) no trials were defined, see FT_DEFINETRIAL for help I don't know what else should I try because I'm having trouble just doing the preprocessing. Your help will be very much appreciated. Thank you, Sarita -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Wed Aug 27 21:37:00 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 27 Aug 2014 12:37:00 -0700 Subject: [FieldTrip] Non-parametric connectivity analysis Message-ID: Hi, I'm currently trying to run a connectivity analysis. I am using 127 channel data, of which has been preprocessed using standard processing steps. I have then derived the CSD estimates using the CSD toolbox. When computing the non-parametric connectivity analysis I encounter the following warnings when computing the PDC (see below). I get similar warnings when computing granger causality, however, with the granger spectrum the solution is characterized by - Inf values In connectivity\private\sfactorization_wilson at 150 In ft_connectivity_csd2transfer at 181 In ft_connectivityanalysis at 390 Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 8.828770e-23. Can anyone shed some light on the situation? Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Thu Aug 28 01:37:34 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 27 Aug 2014 23:37:34 +0000 Subject: [FieldTrip] Preprocessing Message-ID: Hello, I am having some trouble. I need to process my data and gain access to the information below so that I can test a file converter. Can someone help me through that process? data : array of shape (n_channels, n_times) The channels’ evoked response. info : instance of Info Info dictionary. Consider using create_info to populate this structure. tmin : float Start time before event. comment : string Comment on dataset. Can be the condition. Defaults to ‘’. nave : int Number of averaged epochs. Defaults to 1. kind : str Type of data, either average or standard_error. Defaults to ‘average’. verbose : bool, str, int, or None If not None, override default verbose level (see mne.verbose). Defaults to raw.verbose. Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Thu Aug 28 08:45:32 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 06:45:32 +0000 Subject: [FieldTrip] Reject bad trials Message-ID: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlene.boenstrup at googlemail.com Thu Aug 28 09:05:55 2014 From: marlene.boenstrup at googlemail.com (=?UTF-8?Q?Marlene_B=C3=B6nstrup?=) Date: Thu, 28 Aug 2014 09:05:55 +0200 Subject: [FieldTrip] channelorder in leadfields, filter, ft_sourceanalysis Message-ID: Dear mailing-list, I am confused with the ordering of channels during leadfield computation and subsequent filter computation. Following the code in ft_prepare_leadfield, I am convinced that the channelorder of the leadfields is the same as in the input data to the function (second input to ft_prepare_leadfields). When I follow the leadfield order during ft_sourceanalysis it stays the same until the filter is computed based on that leadfield. The filter however is then applied to my data, which, during the course of ft_sourceanalysis, become reordered alphabetically during ft_checkdata in line 244 of ft_sourceanalysis (version 18.12.2013). So then the crssspectrum order and leadfield order would not match. Can you help me out with this paradox? I hope my question is not too confused, if so I will try to rephrase and exemplify, but maybe someone knows what I mean. Many thanks, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 09:07:36 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 07:07:36 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 28 09:18:35 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:18:35 +0200 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: Hi Emilie, It seems to me you are passing the non-cleaned data (epData) into ft_timelockanalysis, and not the cleaned data (data_clean). Best, Eelke On 28 August 2014 08:45, Caspar, Emilie wrote: > Hello, > > I'm preprocessing my EEG data. The script works correctly, but I think there > is something wrong, when I look at the output. > I reject bad trials with : > > cfg = []; > cfg.alim = 100; > cfg.keepchannel = 'yes'; > cfg.layout = 'biosemi64.lay'; > % cfg.method = 'summary'; > % cfg.method = 'trial'; > cfg.method = 'channel'; %% Or 'trial' > cfg.metric = 'var'; > [data_clean] = ft_rejectvisual(cfg, epData); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > > > And apparently, Fieldtrip correctly identifies what the trials to reject > are, Matlab indicates: > > 91 trials marked as GOOD, 9 trials marked as BAD > 66 channels marked as GOOD, 0 channels marked as BAD > the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 > the call to "ft_rejectvisual" took 27 seconds and required the additional > allocation of an estimated NaN MB > > So I save this file, before averaging with : > avgFC = ft_timelockanalysis(cfg, epData); > ft_singleplotER(cfg,avgFC); > > > What is strange, is that during the averaging, I can see that in my matlab > window that the averaging is on 100 trials (= the basic number of trials, > without rejection), as if Fieldtrip did not take into account the bad trials > in the averaging. > > averaging trials > averaging trial 100 of 100 > > > By reading, I though that maybe it was because of this function that was > missing into my script : > cleandata = ft_rejectartifact(cfg,'epData'); > > > However, I have the following mistake, and I don't understand it: > Error using ft_rejectartifact (line 234) > no trials were selected, cannot perform artifact detection/rejection > > Error in preprocessing_Libet (line 274) > cleandata = ft_rejectartifact(cfg,'epData'); > > > > Can someone help? > > > Thank you in advance, > > Emilie > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Thu Aug 28 09:19:27 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 07:19:27 +0000 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer In-Reply-To: References: Message-ID: Hey Praghajieeth, Firstly, I am by no means an expert of fieldtrip (I only started using it six or so months ago), so if I am wrong I apologise but you have been warned haha. Ill try and help, can you look up the following: Can you tell me what the dimensions of Cy is and whether there are any NaNs. What dimensions are data.chan.elec and data.label? Also its worth checking your vol1.mat for NaNs aswell. Good luck! Tyler Sent from my iPad On 27 Aug 2014, at 8:33 pm, "Praghajieeth Raajhen" > wrote: Hello!!!! Please Help out. where am I going wrong? cfg = []; cfg.channel = 'EEG'; cfg.method = 'sam'; cfg.grid = grid; cfg.vol = vol1; cfg.projectnoise = 'yes'; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); workspace of grid,vol1,timelock (.mat) https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 1. Using fieldtrip 2013 version When i do EEG sourceanalysis using "SAM" method, following error occurs Attempted to access noise(0); index must be a positive integer or logical. Error in ==> beamformer_sam at 111 noise = noise(end); Error in ==> ft_sourceanalysis at 841 dip(i) = beamformer_sam(grid, sens, vol, squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); PS: same code for MEG source reconsturction works quite good. 2. Using fieldtrip 2014 version when i do the same I'm getting this kind of errors Undefined function or variable 'abort'. Error in ==> ft_sourceanalysis at 156 if abort PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It is showing same above error. advance thanks for your kind help. Praghajith R.S. praajhen at gmail.com Master Thesis @ UKSH Kiel, Germany _______________________________________________ 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 Thu Aug 28 09:16:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:16:08 +0200 Subject: [FieldTrip] channelorder in leadfields, filter, ft_sourceanalysis In-Reply-To: References: Message-ID: Dear Marlene, Have a look at this bug: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2639 If you don't have an account on our bugzilla, it is easy to create one using just your e-mail address, then you can add yourself as CC to that bug. Best, Eelke On 28 August 2014 09:05, Marlene Bönstrup wrote: > Dear mailing-list, > > I am confused with the ordering of channels during leadfield computation and > subsequent filter computation. > Following the code in ft_prepare_leadfield, I am convinced that the > channelorder of the leadfields is the same as in the input data to the > function (second input to ft_prepare_leadfields). > When I follow the leadfield order during ft_sourceanalysis it stays the same > until the filter is computed based on that leadfield. The filter however is > then applied to my data, which, during the course of ft_sourceanalysis, > become reordered alphabetically during ft_checkdata in line 244 of > ft_sourceanalysis (version 18.12.2013). > So then the crssspectrum order and leadfield order would not match. > > Can you help me out with this paradox? > > I hope my question is not too confused, if so I will try to rephrase and > exemplify, but maybe someone knows what I mean. > > Many thanks, > > Marlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Thu Aug 28 09:23:41 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 07:23:41 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ 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 eelke.spaak at donders.ru.nl Thu Aug 28 09:24:39 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:24:39 +0200 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer In-Reply-To: References: Message-ID: Hi Praghajith, You should use the latest version of fieldtrip; it should work with the 2014 one you mentioned. The error concerning the 'abort' variable might be caused by fieldtrip not being on your path correctly. You should add *only* the root folder to the path yourself (i.e. not using addpath(genpath()) ), then fieldtrip takes care of the path itself. So do: restoredefaultpath addpath ft_defaults and then it should work. If it doesn't, let us know. Best, Eelke On 27 August 2014 13:00, Praghajieeth Raajhen wrote: > Hello!!!! > > Please Help out. where am I going wrong? > > cfg = []; > cfg.channel = 'EEG'; > cfg.method = 'sam'; > cfg.grid = grid; > cfg.vol = vol1; > cfg.projectnoise = 'yes'; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > workspace of grid,vol1,timelock (.mat) > https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 > > 1. Using fieldtrip 2013 version > When i do EEG sourceanalysis using "SAM" method, following error occurs > > Attempted to access noise(0); index must be a positive integer or logical. > > Error in ==> beamformer_sam at 111 > noise = noise(end); > > Error in ==> ft_sourceanalysis at 841 > dip(i) = beamformer_sam(grid, sens, vol, > squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); > > > PS: same code for MEG source reconsturction works quite good. > > 2. Using fieldtrip 2014 version > when i do the same I'm getting this kind of errors > > Undefined function or variable 'abort'. > > Error in ==> ft_sourceanalysis at 156 > if abort > > PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It > is showing same above error. > > > advance thanks for your kind help. > > Praghajith R.S. > praajhen at gmail.com > Master Thesis @ UKSH > Kiel, Germany > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Thu Aug 28 09:27:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:27:44 +0200 Subject: [FieldTrip] Preprocessing data In-Reply-To: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> References: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> Message-ID: Hello Sarita, It should not be a surprise that ft_definetrial does not find any trials for your data, since you are using trigger codes specified for the example dataset used in the tutorials. For reading continuous data, try adding cfg.continuous = 'yes' for your call to ft_preprocessing: cfg = []; cfg.continuous = 'yes'; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data data_org = ft_preprocessing(cfg); If that does not work, there is an error in some of the low-level functions for reading Plexon data, and I would not know how to help you on that. Hope this helps, best, Eelke On 27 August 2014 19:56, Tamang, Sarita wrote: > > Hello Everybody, > > I'm just starting to use FieldTrip and I have some very basic questions. > > I'm trying to analyze LFP data along with the spikes which is in Plexon > format. > > For the preprocessing part I tried to read it as continuous data so I did > clear all > close all > > cfg = []; > > cfg.dataset = 'fr041110a_nat1.plx'; %reading the data > data_org = ft_preprocessing(cfg); > > It gave me this error with 32 u int thing > > Error using timestamp_plexon (line 27) > invalid input > > Error in ft_read_data (line 1064) > ts = timestamp_plexon(tsl, tsh); % use helper function, this returns > an uint64 array > > Error in ft_preprocessing (line 573) > dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', > endsample, 'chanindx', rawindx, 'checkboundary', > strcmp(cfg.continuous, 'no'), > 'dataformat', cfg.dataformat); > > Error in LFP (line 8) > data_org = ft_preprocessing(cfg); > > > I though this was probably due to reading it as continuous data or > something I couldn't figure out so i tried using the example to see if the > code runs > > clear all > close all > > cfg = []; > > cfg.dataset = 'fr041110a_nat1.plx'; %reading the data > > hdr = ft_read_header(cfg.dataset); > event = ft_read_event(cfg.dataset); > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'Strobed' > cfg.trialdef.eventvalue = 35; % the value of the stimulus trigger for > fully incongruent (FIC). > cfg.trialdef.prestim = 0.5; % in seconds > cfg.trialdef.poststim = 1; % in seconds > cfg.channel = {'AD01' 'AD03'}; > cfg.continuous = 'yes'; > > trl = []; > > for i=1:length(event) > if strcmp(event(i).type, cfg.trialdef.eventtype) > % it is a trigger, see whether it has the right value > if ismember(event(i).value, cfg.trialdef.eventvalue) > % add this to the trl definition > begsample = event(i).sample - cfg.trialdef.prestim*hdr.Fs; > endsample = event(i).sample + cfg.trialdef.poststim*hdr.Fs - 1; > offset = -cfg.trialdef.prestim*hdr.Fs; > trigger = event(i).value; % remember the trigger (=condition) > for each trial > trl(end+1, :) = [round([begsample endsample offset]) trigger]; > end > end > end > > cfg = ft_definetrial(cfg); > data_org = ft_preprocessing(cfg); > > And I just used the trl loop from the example give in the website because i > kept getting error saying the trial is not defined. However even after > putting the code I still get the same error. > > Error using ft_definetrial (line 184) > no trials were defined, see FT_DEFINETRIAL for help > > I don't know what else should I try because I'm having trouble just doing > the preprocessing. Your help will be very much appreciated. > > Thank you, > Sarita > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Thu Aug 28 10:02:35 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 08:02:35 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> Message-ID: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 09:23, "Caspar, Emilie" > a écrit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 10:29:07 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 08:29:07 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk>, <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: Hey Emilie, It looks to me like you are creating clean_data twice. Could you change the first clean_data to a different name and then use that variable name when you call ft_rejectartifact? Tyler Sent from my iPad On 28 Aug 2014, at 5:35 pm, "Caspar, Emilie" > wrote: Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Universit? Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 ao?t 2014 ? 09:23, "Caspar, Emilie" > a ?crit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 ao?t 2014 ? 09:07, Tyler Grummett > a ?crit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 10:30:55 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 08:30:55 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk>, <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: <68CB9987-A228-4D54-AD12-93FD7DAD7D62@flinders.edu.au> Alternatively you could keep the same variable after you first make it. ie: cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,clean_data); ** avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); Tyler Sent from my iPad On 28 Aug 2014, at 5:35 pm, "Caspar, Emilie" > wrote: cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Thu Aug 28 10:41:07 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 08:41:07 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: <93F42BBB-7FC2-4CF6-9418-3B5A4C1D8982@live.ucl.ac.uk> Dear all, I found a solution, just by removing brackets here :[clean_data] = ft_rejectvisual(cfg, epData); Thank you again for your help! Emilie --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 10:02, "Caspar, Emilie" > a écrit : Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 09:23, "Caspar, Emilie" > a écrit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Aug 29 18:36:14 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Fri, 29 Aug 2014 18:36:14 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd Message-ID: Dear Fieldtrippers We have a 3x3 design and MEG data, say only mag channels (n102) to simplify. We want to perform a cluster-based permutation approach but timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', etc) cannot deal with interactions when you have more than three levels (true?) So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical Package- and feed 'clusterstat.m' with them We have done this with one channel over time with success. However, I am clueless now about how to solve the problem when dealing with the whole channel set. I wonder what is the nature of the cfg.dim that we need to feed 'clusterstat.m' with. Up to now, we use, (cioming out of -R-): size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) and the following presets: cfg=[]; cfg.clustercritval = Fcritmain; % We genereate this before hand cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here load('neuromag306mag_neighb.mat'); cfg.neighbours = neighbours; cfg.feedback = 'yes'; cfg.numrandomization = 1000; cfg.clusterstatistic = 'maxsum'; cfg.layout = 'neuromag306mag.lay'; for i = 1:length(cfg.neighbours) cfg.channel{i} = cfg.neighbours(i).label; end stat = clusterstat(cfg,statrnd, statobs) Which lead us to an error within findcluster Error using findcluster (line 59) invalid dimension of spatdimneighbstructmat Error in clusterstat (line 197) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); If anybody has got some insigth it would be greatly appreciated. Or any hints. Are the size of my statobs and starnd correct? I can share more information and firstly apologize if I was not able to describe the problem accurately, I am confused regarding that 'reshape' and the addition of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the problem arises first when findcluster.m tries to calculate the size of spatdimneighbstructmat First line of findcluster.m calcualtes 'spatdimlength' by : " spatdimlength = size(onoff, 1);" which in our case is "1", which is obviously wrong?. manythanks&peace2all -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Sat Aug 30 12:47:10 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Sat, 30 Aug 2014 10:47:10 +0000 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer In-Reply-To: References: , Message-ID: Hi Eelke, Thanks so much for this. As it happens I copied the script recommending to time lock twice some time ago, and wasn't able to see it when I looked through the FT site this time. So, problem solved all round. Cheers! Kaelasha ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Thursday, 28 August 2014 12:12 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer Dear Kaelasha, The tutorial is correct, it's best to use the averaged covariance, computed on the unaveraged data (so a single call to ft_timelockanalysis). We thought we had removed the example script you mentioned some time ago, but apparently somewhere on the wiki it still lingers. Could you let us know where you found this? Or better yet, just remove it? (It is a wiki, after all.) Best, Eelke On 26 August 2014 02:57, Kaelasha Tyler wrote: > Hi all, > > I am raking through my script trying to sort out potential faults in my > analysis. > One issue I have come across is whether ft_timelock analysis should be > performed once, or twice when using lcmv method of beamformer. > > The tutorial on lcmv beamfomer found here > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > seems to indicate that time-locking is only performed once only in the > analysis pipeline. > > However, elsewhere on the FT site, I found the following advice: > "In order for the beamformer to work, we need the covariance between sensor > pairs. This should be the covariance of (a particular latency window) of the > averaged single trials. This is essentially different from the average > covariance of the single trials. Therefore, we have to call timelockanalysis > more than once: the first time we obtain the evoked field, and the second > time we obtain the covariance matrix/ces at interesting latency/ies" > > Which is correct? > > I have been time locking twice: using data sets which were already > time-locked using ft_timelockanalysis, and then time locking again, prior to > using ft_sourceanalysis........... Wrong? > > The phrase 'sanity check' comes up quite often on this list, and I > absolutely understand! As always, any help is very much appreciated!! > > Kaelasha > > > > > > > > _______________________________________________ > 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 tim.curran at Colorado.EDU Fri Aug 1 21:00:44 2014 From: tim.curran at Colorado.EDU (Tim Curran) Date: Fri, 1 Aug 2014 13:00:44 -0600 Subject: [FieldTrip] Postdoc Position, Colorado Message-ID: <5AE917E0-2DC4-4DFD-A5DF-12E2CD19FC01@colorado.edu> Postdoctoral Research Associate Position Curran Lab, University of Colorado Boulder Postdoctoral research position available in the lab of Tim Curran at the Department of Psychology & Neuroscience, University of Colorado Boulder to work on an ONR-funded grant focusing on top-down influences on visual object recognition. Curran’s lab will focus on human EEG studies in collaboration with Randy O’Reilly (UC Boulder, computational modeling), David Sheinberg (Brown, primate electrophysiology), and Tor Wager (UC Boulder, fMRI). PhD in psychology, neuroscience, or related fields required. Desirable qualifications include human EEG research experience, especially involving advanced analyses approaches including machine learning. fMRI experience is also valuable, but not necessary. The position is available immediately, but the start date is flexible. The University of Colorado is an Equal Opportunity Employer committed to building a diverse workforce. We encourage applications from women, racial and ethnic minorities, individuals with disabilities and veterans. Alternative formats of this ad can be provided upon request for individuals with disabilities by contacting the ADA Coordinator at hr-ada at colorado.edu. The University of Colorado Boulder conducts background checks on all final applicants being considered for employment. For further information contact, tim.curran at colorado.edu. Applicants must submit a CV, a statement of research experience/interests, a cover letter including email addresses for at least three referees, and one recommendation letter. The other referees will be contacted for letters if needed. Applications will be accepted electronically at https://www.jobsatcu.com/postings/85712 . The job posting # is RF01616. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dragos.n.stanciu at gmail.com Sat Aug 2 03:32:54 2014 From: dragos.n.stanciu at gmail.com (Dragos Stanciu) Date: Sat, 2 Aug 2014 02:32:54 +0100 Subject: [FieldTrip] Connectivity analysis after applying Welch's method In-Reply-To: <53DA41D1.7080604@donders.ru.nl> References: <53DA41D1.7080604@donders.ru.nl> Message-ID: Hello Jörn, Thank you for the suggestion. I managed to get connectivity plots with that function. Coming back to the question in my previous email, would it be OK to take the absolute value of the debiased wpli values to be used in graph analysis as edge weights? For example, HERMES, another connectivity toolbox returns only values between 0 and 1 for this measure. Also, Vinck et al. paper says that the value should be positive, I guess by taking the absolute value in the case of a lagging phase. Sorry if this is a basic question, but I would appreciate if someone can shed some light on this. Kind regards, Dragos Stanciu On Jul 31, 2014 2:18 PM, Jörn M. Horschig wrote: > Hi Dragos, > > have yoi checked ft_topoplotCC? > > Best, > Jörn > > On 7/31/2014 12:06 AM, Dragos Stanciu wrote: > >> Hello Jörn, >> >> Thank you so much for responding. The suggested changes were spot on and >> ft_connectivityanalysis executed successfully. >> In the end, I went with the approach of redefining the 10s epoch in 2s >> minitrials and performing ft_freqanalysis on these minitrials with >> /cfg.output='fourier'/ and /keeptrial='yes'. /I then did >> ft_connectivityanalysis on the frequency structures resulted from >> processing the segmented data. This would give me connectivity matrices for >> each 10s epoch, which I then average to get one connectivity matrix for the >> subject (technically, I have a connectivity matrix for each frequency bin, >> but I can again average across the frequency spectrum). >> >> I have a question on the debiased weighted phase lag index measure. The >> values in the matrix vary between -1 and 1 (depending if the relative phase >> lags or leads). When I construct the adjacency matrices, is it just a >> matter of taking the absolute value of these values? >> >> I would also like some advice on plotting connectivity matrices. I was >> able to plot one matrix with ft_plot_matrix, but it would be really nice if >> I could plot a connectivity graph where the thickness of the edges >> correspond to the strength of the connectivity measure. I tried >> ft_topoplotER with 4D148.lay as the layout file and 'gui' as refchannel, >> but I didn't get anything interesting. As my data is MEG, it doesn't make >> sense to me to choose a reference channel... >> Ideally, I would like to combine the layout (4D148.lay) with the >> connectivity matrix for plotting the graph. Do you have any ideas for this? >> Also, do you have any other suggestions on what other plotting functions >> can be used with these connectivity matrices? I've looked through the >> tutorial, but the functions don't seem very relevant to my type of data. >> >> Thank you for your help. >> >> Regards, >> Dragos Stanciu >> >> Message: 9 >> Date: Wed, 30 Jul 2014 10:28:50 +0200 >> From: "J?rn M. Horschig" > > >> To: FieldTrip discussion list > > >> Subject: Re: [FieldTrip] Connectivity analysis after applying Welch's >> method >> >> Hi Dragos, >> >> while quickly browisng through your mail, it appears to me that you >> simply need to set single_epoch_freq.dimord = 'rpt_chan_freq'. >> FieldTrip >> is using the dimord field to infer the order of the dimensions >> (*dim*ension *ord*er). The actual dimensions of powspctrm and >> crsspctrm >> are now inconsistent with the dimord specifications. >> >> Best, >> J?rn >> >> >> On 7/30/2014 1:18 AM, Dragos Stanciu wrote: >> > Dear FieldTrippers, >> > >> > I'm Dragos Stanciu and I'm working on my MSc in Neuroinformatics >> > dissertation at the University of Edinburgh. My project involves >> > analysis of resting-state functional connectivity using graph theory >> > in Alzheimer's disease based on MEG data. >> > >> > Each of my subjects has a number of 10s epochs (trials) associated >> > with him/her. I was able to compute the coherence and weighted phase >> > lag index measures (with /ft_freqanalysis /and >> > /ft_connectivityanalysis) /by treating my 10s epochs as trials, but >> > now I would like to reduce the amount of noise in the estimation of >> > the frequency spectrum by employing Welch's method. >> > >> > For this, I split each 10s epoch in 2s segments (minitrials) >> with 50% >> > overlap: >> > >> > [sep_epoch_data] = ft_redefinetrial(cfg_cut, >> single_epoch_data)/. / >> > >> > >> > I then apply /ft_preprocessing /on the minitrials: >> > >> > [processed_single_epoch] = ft_preprocessing(cfg, >> sep_epoch_data); >> > >> > I then do frequency analysis on the preprocessed segmented data: >> > >> > [single_epoch_freq] = ft_freqanalysis(cfg_freq, >> > processed_single_epoch); >> > >> > where >> > >> > display(cfg_freq) >> > method: 'mtmfft' >> > taper: 'hanning' >> > foilim: [0.5000 4] >> > output: 'powandcsd' >> > channel: {148x1 cell} % 148 channels labelled from >> A1 to >> > A148 >> > keeptrial: 'no' % don't keep the minitrials, as we want >> > to average them >> > keeptapers: 'no' >> > >> > Please note that I average the minitrials (/keeptrial = 'no'/) as I >> > want to get an average of the frequencies. >> > >> > The resulting /single_epoch_freq/ structure looks like: >> > >> > display(single_epoch_freq) >> > label: {148x1 cell} >> > dimord: 'chan_freq' >> > freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008 >> > 4.0009] >> > powspctrm: [148x8 double] >> > labelcmb: {10878x2 cell} % channel combinations >> (148*147/2) >> > crsspctrm: [10878x8 double] >> > cfg: [1x1 struct] >> > >> > >> > The last step is to append the averaged frequency structures of each >> > 10s epoch together and perform connectivity analysis on the main 10s >> > epochs. I do the concatenation like so: >> > freq_avgs_powspctrm = [freq_avgs_powspctrm; >> > permute(single_epoch_freq.powspctrm, [3,1,2])]; >> > >> > freq_avgs_crsspctrm = [freq_avgs_crsspctrm; >> > permute(single_epoch_freq.crsspctrm, [3,1,2])]; >> > >> > The idea behind /permute(..., [3, 1, 2])/ is that I want the first >> > dimension to represent trials, the second dimension channel >> > combinations and the third dimension frequencies, as this is needed >> > for the input of /ft_connectivity_wpli /(Repetitions x >> > Channelcombination (x Frequency)). >> > >> > I then call stat_conn = ft_connectivityanalysis(cfg_conn, >> freq_avgs); >> > where: >> > >> > display(cfg_conn) >> > method: 'wpli_debiased' >> > channel: {148x1 cell} >> > >> > and >> > >> > display(freq_avgs) >> > powspctrm: [4x148x8 double] % as I have 4 ten >> second epochs >> > crsspctrm: [4x10878x8 double] % as I have 4 ten >> second epochs >> > label: {148x1 cell} >> > dimord: 'chan_freq' >> > freq: [0.5001 1.0002 1.5004 2.0005 2.5006 3.0007 3.5008 >> > 4.0009] >> > labelcmb: {10878x2 cell} >> > cfg: [1x1 struct] >> > >> > >> > The error that I get when running /ft_connectivityanalysis/ is: >> > >> > Error using cat >> > CAT arguments dimensions are not consistent. >> > Error in ft_checkdata>fixcsd (line 1170) >> > data.crsspctrm = cat(catdim, data.powspctrm, >> data.crsspctrm); >> > >> > >> > When debugging, /catdim/ is equal to 1. The error occurs because the >> > 2nd dimension of data.powspctrm and data.crsspctrm are not equal >> > (former is 148, latter is 10878). Do you have any suggestions on >> > getting around this problem? Should I construct /freq_avgs /(data >> > input to ft_connectivityanalysis) differently? I'm also open to >> > different approaches to working out Welch's method in FieldTrip. >> > >> > Please download this archive that contains my test script and 4 >> > example 10s epochs of a subject: >> > https://www.dropbox.com/s/js7pztai02f5p27/Welch_fieldtrip.zip >> The code >> > should make things clearer (or the opposite). >> > Observations: I thought about using /ft_freqanalysis_mtmwelch/, but >> > apparently it's deprecated. >> > >> > Thank you all in advance for your feedback. >> > >> > Kind regards, >> > Dragos Stanciu >> > >> >> >> -- >> J?rn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> >> >> >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniele.marinazzo at ugent.be Sun Aug 3 20:05:16 2014 From: daniele.marinazzo at ugent.be (Daniele Marinazzo) Date: Sun, 3 Aug 2014 20:05:16 +0200 Subject: [FieldTrip] Controversies in EEG source imaging - workshop, data and special issue in Brain Topography Message-ID: Dear Colleague The Key Laboratory of Neuroinformation of the Ministery of Education of China in Chengdu (NIL), in collaboration with the Cuban Neuroscience Center (CNEURO), and the University of Ghent (UG) are organizing a workshop on “Controversies in EEG source imaging (ESI)” Which will be held in Chengdu, China from the 20th to the 22nd of August. All the info on the workshop and related activities are on the website http://www.neuro.uestc.edu.cn/ceegsi/ Confirmed speakers include: Anna Custo Jorge Bosch-Bayard Claude Bédard Fabrizio de Vico Fallani Daqing Guo Stefan Haufe Xu Lei Daniele Marinazzo Cu Peng Dimitris Pinotsis Jorge Riera Andreas Spiegler Pedro Valdes Sosa Dezhong Yao Rather than having traditional presentations we shall be discussing questions such as: --Are there monopoles in the brain, and if so what impact to the have on ESI? --Is there is a best EEG reference and does it matter for ESI? --What is the best way to measure brain connectivity in ESI? --What if any, will the impact of Neural Field theory on ESI be? with short presentations followed by discussions. We hope you can come and join us there. In any case, the workshop is structured in such a way that interested researchers can contribute even remotely. This can happen in several ways: -on the website several types of data (scalp and intracranial recordings from human, rat and monkey) have been uploaded. You can play with these data and share results and discussions. -you can contribute to the discussion participating to the forum on the website, uploading papers, preliminary results, etc. -ultimately, these discussions will result in a special issue of Brain Topography, to which we invite you to contribute. The papers should ideally reflect the discussions during the workshop as well as before and after on the forum, and/or analyze the simulations and at least one experimental data set. Kind regards Dezhong Yao, Daqing Gu, Xu Peng, Daniele Marinazzo and Pedro Valdes Sosa -- Daniele Marinazzo -- Department of Data Analysis Faculty of Psychology and Pedagogical Sciences, Gent University Henri Dunantlaan 1, B-9000 Gent, Belgium +32 (0) 9 264 6375 http://users.ugent.be/~dmarinaz/ http://helpdesk.ugent.be/e-maildisclaimer.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Aug 5 13:53:42 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 5 Aug 2014 13:53:42 +0200 Subject: [FieldTrip] repairing bad channels Message-ID: Dear all, I'm trying to repair the bad channels by using the ft_channelrepair function for 64 channels EEG data. I've set up the structure like this: load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); cfg_neighb.method = 'distance'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, data4); cfg = []; if strcmp('S004', dir_analysis{sub}) == 1 cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; end cfg.trials = 'all'; cfg.method = 'average'; cfg.neighbours = neighbours; cfg.elec = lay.pos; data5 = ft_channelrepair(cfg, data4); However, I get an error message: ttempt to reference field of non-structure array. Error in ft_datatype_sens (line 136) nchan = length(sens.label); Error in ft_checkconfig (line 246) cfg.elec = ft_datatype_sens(cfg.elec); Error in ft_preamble_trackconfig (line 38) cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); Error in ft_preamble (line 54) evalin('caller', ['ft_preamble_' cmd]); Error in ft_channelrepair (line 76) ft_preamble trackconfig Can someone please help me? Thank you very much! Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From edueeg at gmail.com Tue Aug 5 14:09:25 2014 From: edueeg at gmail.com (Eduardo Schenberg) Date: Tue, 5 Aug 2014 13:09:25 +0100 Subject: [FieldTrip] fieldtrip workshop Message-ID: Hello, I would please like to know more about the course scheduled for September 17-19 in Birmingham UK, as announced at http://fieldtrip.fcdonders.nl/workshop/birmingham Specifically, I would like to know if the course is confirmed and how to apply Thank you very much eduardo schenberg -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Aug 5 14:10:59 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 05 Aug 2014 14:10:59 +0200 Subject: [FieldTrip] repairing bad channels In-Reply-To: References: Message-ID: <53E0C9D3.9080508@donders.ru.nl> Hi Hweeling, reading the help of the function might help ;) > The EEG or MEG sensor positions can be present in the data or can be specified as > cfg.elec = structure with electrode positions, seeFT_DATATYPE_SENS > cfg.grad = structure with gradiometer definition, seeFT_DATATYPE_SENS > cfg.elecfile = name of file containing the electrode positions, seeFT_READ_SENS > cfg.gradfile = name of file containing the gradiometer definition, seeFT_READ_SENS The cross-reference to ft_datatype_sens should help you to resolve your issue (and check out the FieldTrip/template directory) Best, Jörn On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > Dear all, > > I'm trying to repair the bad channels by using the ft_channelrepair > function for 64 channels EEG data. > > I've set up the structure like this: > > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'distance'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data4); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.neighbours = neighbours; > cfg.elec = lay.pos; > data5 = ft_channelrepair(cfg, data4); > > However, I get an error message: > > ttempt to reference field of non-structure array. > Error in ft_datatype_sens (line 136) > nchan = length(sens.label); > Error in ft_checkconfig (line 246) > cfg.elec = ft_datatype_sens(cfg.elec); > Error in ft_preamble_trackconfig (line 38) > cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); > Error in ft_preamble (line 54) > evalin('caller', ['ft_preamble_' cmd]); > Error in ft_channelrepair (line 76) > ft_preamble trackconfig > > Can someone please help me? > > Thank you very much! > > Best regards, > Hweeling > > > > _______________________________________________ > 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 agreene24 at gmail.com Wed Aug 6 07:12:06 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 14:12:06 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? Message-ID: Hello, I'm somewhat new to ft, so forgive me if this is a seemingly trivial question. I ran runica on ft preprocessed MEG data, but I also want to see the frequency power spectrum of the components. I've tried using freqanalysis on the components in the following manner: comp.cfg.previous.tapsmofrq=4; comp.cfg.previous.foi=[0:2:30]; comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; comp.cfg.previous.toi=[-0.5:0.05:1.5]; comp.cfg.previous.channel='all'; [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) // but the errors I receive are as follows: Warning: Input arguments must be scalar. > In specest/private/ft_preproc_polyremoval at 57 In ft_specest_mtmfft at 66 In ft_freqanalysis at 526 ??? For colon operator with char operands, first and last operands must be char. Error in ==> ft_preproc_polyremoval at 58 for i = 0:order Error in ==> ft_specest_mtmfft at 66 dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); Error in ==> ft_freqanalysis at 526 [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', cfg.taper, options{:}, 'feedback', fbopt); // Is using freqanalysis on the components possible? If so, what needs to be modified in order to employ it? If not, is there another method to outputting the frequency power spectrum of ica components? Thanks, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Aug 6 09:07:38 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 6 Aug 2014 10:07:38 +0300 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Dear Ashly, I'm trying to recreate the error you got, but I couldn't. Did you specify the method? Try using comp.cfg.previous.method = 'mtmfft'; When I run ft_freqanalysis using the mtmfft method on the comp structure I get from the ICA tutorial, everything seems to work fine. Did you try running the same function on a tutorial structure? Best. Roey On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene wrote: > Hello, > > I'm somewhat new to ft, so forgive me if this is a seemingly trivial > question. > I ran runica on ft preprocessed MEG data, but I also want to see the > frequency power spectrum of the components. I've tried using freqanalysis > on the components in the following manner: > > > comp.cfg.previous.tapsmofrq=4; > comp.cfg.previous.foi=[0:2:30]; > comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; > comp.cfg.previous.toi=[-0.5:0.05:1.5]; > comp.cfg.previous.channel='all'; > > [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) > > > // but the errors I receive are as follows: > > > Warning: Input arguments must be scalar. > > In specest/private/ft_preproc_polyremoval at 57 > In ft_specest_mtmfft at 66 > In ft_freqanalysis at 526 > ??? For colon operator with char operands, first and last operands must be > char. > > Error in ==> ft_preproc_polyremoval at 58 > for i = 0:order > > Error in ==> ft_specest_mtmfft at 66 > dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); > > Error in ==> ft_freqanalysis at 526 > [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', > cfg.taper, options{:}, 'feedback', fbopt); > > // Is using freqanalysis on the components possible? If so, what needs to > be modified in order to employ it? If not, is there another method to > outputting the frequency power spectrum of ica components? > > Thanks, > > Ashley > > > > _______________________________________________ > 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 Aug 6 09:32:34 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 6 Aug 2014 09:32:34 +0200 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Hi Ashley, In addition to Roey's remark, in general I would say it is not a good idea to explicitly modify the xxx.cfg.previous structure. Just create a new cfg from scratch for each FT function call: cfg = []; cfg.method = 'mtmfft'; cfg.foi = .... etc. compfreq = ft_freqanalysis(cfg, comp); Best, Eelke On 6 August 2014 09:07, Roey Schurr wrote: > Dear Ashly, > > I'm trying to recreate the error you got, but I couldn't. > Did you specify the method? Try using > comp.cfg.previous.method = 'mtmfft'; > > When I run ft_freqanalysis using the mtmfft method on the comp structure I > get from the ICA tutorial, everything seems to work fine. Did you try > running the same function on a tutorial structure? > > Best. > Roey > > > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene wrote: >> >> Hello, >> >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial >> question. >> I ran runica on ft preprocessed MEG data, but I also want to see the >> frequency power spectrum of the components. I've tried using freqanalysis on >> the components in the following manner: >> >> >> comp.cfg.previous.tapsmofrq=4; >> comp.cfg.previous.foi=[0:2:30]; >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; >> comp.cfg.previous.channel='all'; >> >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) >> >> >> // but the errors I receive are as follows: >> >> >> Warning: Input arguments must be scalar. >> > In specest/private/ft_preproc_polyremoval at 57 >> In ft_specest_mtmfft at 66 >> In ft_freqanalysis at 526 >> ??? For colon operator with char operands, first and last operands must be >> char. >> >> Error in ==> ft_preproc_polyremoval at 58 >> for i = 0:order >> >> Error in ==> ft_specest_mtmfft at 66 >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); >> >> Error in ==> ft_freqanalysis at 526 >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', >> cfg.taper, options{:}, 'feedback', fbopt); >> >> // Is using freqanalysis on the components possible? If so, what needs to >> be modified in order to employ it? If not, is there another method to >> outputting the frequency power spectrum of ica components? >> >> Thanks, >> >> Ashley >> >> >> >> _______________________________________________ >> 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 agreene24 at gmail.com Wed Aug 6 10:11:10 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 17:11:10 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: Hi Eelke, It worked fine once I just created a new cfg. It's always the small, overlooked things... Thanks!! Ashley On Wed, Aug 6, 2014 at 4:32 PM, Eelke Spaak wrote: > Hi Ashley, > > In addition to Roey's remark, in general I would say it is not a good > idea to explicitly modify the xxx.cfg.previous structure. Just create > a new cfg from scratch for each FT function call: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.foi = .... > etc. > > compfreq = ft_freqanalysis(cfg, comp); > > Best, > Eelke > > On 6 August 2014 09:07, Roey Schurr wrote: > > Dear Ashly, > > > > I'm trying to recreate the error you got, but I couldn't. > > Did you specify the method? Try using > > comp.cfg.previous.method = 'mtmfft'; > > > > When I run ft_freqanalysis using the mtmfft method on the comp structure > I > > get from the ICA tutorial, everything seems to work fine. Did you try > > running the same function on a tutorial structure? > > > > Best. > > Roey > > > > > > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene > wrote: > >> > >> Hello, > >> > >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial > >> question. > >> I ran runica on ft preprocessed MEG data, but I also want to see the > >> frequency power spectrum of the components. I've tried using > freqanalysis on > >> the components in the following manner: > >> > >> > >> comp.cfg.previous.tapsmofrq=4; > >> comp.cfg.previous.foi=[0:2:30]; > >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; > >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; > >> comp.cfg.previous.channel='all'; > >> > >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) > >> > >> > >> // but the errors I receive are as follows: > >> > >> > >> Warning: Input arguments must be scalar. > >> > In specest/private/ft_preproc_polyremoval at 57 > >> In ft_specest_mtmfft at 66 > >> In ft_freqanalysis at 526 > >> ??? For colon operator with char operands, first and last operands must > be > >> char. > >> > >> Error in ==> ft_preproc_polyremoval at 58 > >> for i = 0:order > >> > >> Error in ==> ft_specest_mtmfft at 66 > >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); > >> > >> Error in ==> ft_freqanalysis at 526 > >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', > >> cfg.taper, options{:}, 'feedback', fbopt); > >> > >> // Is using freqanalysis on the components possible? If so, what needs > to > >> be modified in order to employ it? If not, is there another method to > >> outputting the frequency power spectrum of ica components? > >> > >> Thanks, > >> > >> Ashley > >> > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agreene24 at gmail.com Wed Aug 6 10:12:06 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 6 Aug 2014 17:12:06 +0900 Subject: [FieldTrip] How to obtain the frequency power spectrum of ica components? In-Reply-To: References: Message-ID: And, also of course Roey, thank you as well Ashley On Wed, Aug 6, 2014 at 5:11 PM, Ashley Greene wrote: > Hi Eelke, > > It worked fine once I just created a new cfg. It's always the small, > overlooked things... > > Thanks!! > > Ashley > > > On Wed, Aug 6, 2014 at 4:32 PM, Eelke Spaak > wrote: > >> Hi Ashley, >> >> In addition to Roey's remark, in general I would say it is not a good >> idea to explicitly modify the xxx.cfg.previous structure. Just create >> a new cfg from scratch for each FT function call: >> >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.foi = .... >> etc. >> >> compfreq = ft_freqanalysis(cfg, comp); >> >> Best, >> Eelke >> >> On 6 August 2014 09:07, Roey Schurr wrote: >> > Dear Ashly, >> > >> > I'm trying to recreate the error you got, but I couldn't. >> > Did you specify the method? Try using >> > comp.cfg.previous.method = 'mtmfft'; >> > >> > When I run ft_freqanalysis using the mtmfft method on the comp >> structure I >> > get from the ICA tutorial, everything seems to work fine. Did you try >> > running the same function on a tutorial structure? >> > >> > Best. >> > Roey >> > >> > >> > On Wed, Aug 6, 2014 at 8:12 AM, Ashley Greene >> wrote: >> >> >> >> Hello, >> >> >> >> I'm somewhat new to ft, so forgive me if this is a seemingly trivial >> >> question. >> >> I ran runica on ft preprocessed MEG data, but I also want to see the >> >> frequency power spectrum of the components. I've tried using >> freqanalysis on >> >> the components in the following manner: >> >> >> >> >> >> comp.cfg.previous.tapsmofrq=4; >> >> comp.cfg.previous.foi=[0:2:30]; >> >> comp.cfg.previous.t_ftimwin = 5./comp.cfg.previous.foi; >> >> comp.cfg.previous.toi=[-0.5:0.05:1.5]; >> >> comp.cfg.previous.channel='all'; >> >> >> >> [freqcomp] = ft_freqanalysis(comp.cfg.previous, comp) >> >> >> >> >> >> // but the errors I receive are as follows: >> >> >> >> >> >> Warning: Input arguments must be scalar. >> >> > In specest/private/ft_preproc_polyremoval at 57 >> >> In ft_specest_mtmfft at 66 >> >> In ft_freqanalysis at 526 >> >> ??? For colon operator with char operands, first and last operands >> must be >> >> char. >> >> >> >> Error in ==> ft_preproc_polyremoval at 58 >> >> for i = 0:order >> >> >> >> Error in ==> ft_specest_mtmfft at 66 >> >> dat = ft_preproc_polyremoval(dat, polyorder, 1, ndatsample); >> >> >> >> Error in ==> ft_freqanalysis at 526 >> >> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', >> >> cfg.taper, options{:}, 'feedback', fbopt); >> >> >> >> // Is using freqanalysis on the components possible? If so, what needs >> to >> >> be modified in order to employ it? If not, is there another method to >> >> outputting the frequency power spectrum of ica components? >> >> >> >> Thanks, >> >> >> >> Ashley >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Aug 6 14:12:28 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 6 Aug 2014 14:12:28 +0200 Subject: [FieldTrip] repairing bad channels In-Reply-To: <53E0C9D3.9080508@donders.ru.nl> References: <53E0C9D3.9080508@donders.ru.nl> Message-ID: Dear Jörn, Pardon my ignorance, however, I'm not exactly sure what you mean as I'm not an expert in matlab programming. I've checked the functions, but I still don't understand how I could resolve my issue. In addition, I checked on Easycap website, and find that the Montage 11 (or what the template directory called 'easycapM11.mat') is the closest fit to the cap that I used for the EEG recordings (At least that's what I gathered from their website). Could you please alternatively show me how you would do for repairing bad channels for the EEG data (an example)? Thank you. Cheers, Hweeling On 5 August 2014 14:10, "Jörn M. Horschig" wrote: > Hi Hweeling, > > reading the help of the function might help ;) > > The EEG or MEG sensor positions can be present in the data or can be >> specified as >> cfg.elec = structure with electrode positions, >> seeFT_DATATYPE_SENS > nl/reference/ft_datatype_sens> >> cfg.grad = structure with gradiometer definition, >> seeFT_DATATYPE_SENS > nl/reference/ft_datatype_sens> >> cfg.elecfile = name of file containing the electrode positions, >> seeFT_READ_SENS >> cfg.gradfile = name of file containing the gradiometer >> definition, seeFT_READ_SENS > nl/reference/ft_read_sens> >> > > The cross-reference to ft_datatype_sens should help you to resolve your > issue (and check out the FieldTrip/template directory) > > Best, > Jörn > > > > On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > >> Dear all, >> >> I'm trying to repair the bad channels by using the ft_channelrepair >> function for 64 channels EEG data. >> >> I've set up the structure like this: >> >> >> load('/home/leeh/Programs/fieldtrip-20140803/template/ >> layout/easycapM11.mat'); >> >> cfg_neighb.method = 'distance'; >> cfg_neighb.layout = lay; >> neighbours = ft_prepare_neighbours(cfg_neighb, data4); >> >> cfg = []; >> if strcmp('S004', dir_analysis{sub}) == 1 >> cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; >> end >> cfg.trials = 'all'; >> cfg.method = 'average'; >> cfg.neighbours = neighbours; >> cfg.elec = lay.pos; >> data5 = ft_channelrepair(cfg, data4); >> >> However, I get an error message: >> >> ttempt to reference field of non-structure array. >> Error in ft_datatype_sens (line 136) >> nchan = length(sens.label); >> Error in ft_checkconfig (line 246) >> cfg.elec = ft_datatype_sens(cfg.elec); >> Error in ft_preamble_trackconfig (line 38) >> cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); >> Error in ft_preamble (line 54) >> evalin('caller', ['ft_preamble_' cmd]); >> Error in ft_channelrepair (line 76) >> ft_preamble trackconfig >> >> Can someone please help me? >> >> Thank you very much! >> >> Best regards, >> Hweeling >> >> >> >> _______________________________________________ >> 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 > > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Aug 6 16:40:49 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Wed, 06 Aug 2014 16:40:49 +0200 Subject: [FieldTrip] Fwd: Re: repairing bad channels In-Reply-To: <53E22351.6080300@donders.ru.nl> References: <53E22351.6080300@donders.ru.nl> Message-ID: <53E23E71.1070005@donders.ru.nl> I forgot to include the mailing list in my response to Hweeling, my apologies for leaving you out ;) -------- Original Message -------- Subject: Re: [FieldTrip] repairing bad channels Date: Wed, 06 Aug 2014 14:45:05 +0200 From: "Jörn M. Horschig" Organization: Donders Institute for Brain, Cognition and Behaviour, Radboud University Nijmegen To: hweeling.lee at gmail.com Dear Hweeling, in FieldTrip/template there are different directories, one of the is 'elec'. The help that I copied in my last mail mentions that you can (should) define cfg.elec, which is a particular type of sensor-description (sens, thus ft_datatype_sens). The layout templates in the template/layout directory are layouts, not electrode positions, i.e. they are 2D projections of the electrodes optimized for visual inspections, topoplots, etc. There are three ways for you to go: 1) choose a template file from the 'elec' directory and specify cfg.elec or cfg.elecfile accordingly. The M11 cap is basically a 10-10 electrode cap, so you could use electrode positions from any 10-10 system as a template. 2) instead of specifying cfg.elec, you can specify cfg.layout and point to the layout file that you want to use (just like when calling a plotting function). FieldTrip will then extract the 2D positions and infer neighbours from that. 3) You can set cfg.method to 'template', which will load alreay pre-defined neighbours for your particular data, see http://fieldtrip.fcdonders.nl/template/neighbours Hope this helps and clarifies things :) Best, Jörn On 8/6/2014 2:12 PM, Hwee Ling Lee wrote: > Dear Jörn, > > Pardon my ignorance, however, I'm not exactly sure what you mean as > I'm not an expert in matlab programming. I've checked the functions, > but I still don't understand how I could resolve my issue. > > In addition, I checked on Easycap website, and find that the Montage > 11 (or what the template directory called 'easycapM11.mat') is the > closest fit to the cap that I used for the EEG recordings (At least > that's what I gathered from their website). > > Could you please alternatively show me how you would do for repairing > bad channels for the EEG data (an example)? > > Thank you. > > Cheers, > Hweeling > > > > On 5 August 2014 14:10, "Jörn M. Horschig" > wrote: > > Hi Hweeling, > > reading the help of the function might help ;) > > The EEG or MEG sensor positions can be present in the data > or can be specified as > cfg.elec = structure with electrode positions, > seeFT_DATATYPE_SENS > > cfg.grad = structure with gradiometer > definition, seeFT_DATATYPE_SENS > > cfg.elecfile = name of file containing the electrode > positions, seeFT_READ_SENS > > cfg.gradfile = name of file containing the > gradiometer definition, seeFT_READ_SENS > > > > The cross-reference to ft_datatype_sens should help you to resolve > your issue (and check out the FieldTrip/template directory) > > Best, > Jörn > > > > On 8/5/2014 1:53 PM, Hwee Ling Lee wrote: > > Dear all, > > I'm trying to repair the bad channels by using the > ft_channelrepair function for 64 channels EEG data. > > I've set up the structure like this: > > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'distance'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data4); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.neighbours = neighbours; > cfg.elec = lay.pos; > data5 = ft_channelrepair(cfg, data4); > > However, I get an error message: > > ttempt to reference field of non-structure array. > Error in ft_datatype_sens (line 136) > nchan = length(sens.label); > Error in ft_checkconfig (line 246) > cfg.elec = ft_datatype_sens(cfg.elec); > Error in ft_preamble_trackconfig (line 38) > cfg = ft_checkconfig(cfg, 'trackconfig', 'on'); > Error in ft_preamble (line 54) > evalin('caller', ['ft_preamble_' cmd]); > Error in ft_channelrepair (line 76) > ft_preamble trackconfig > > Can someone please help me? > > Thank you very much! > > Best regards, > Hweeling > > > > _______________________________________________ > 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 > > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= -- 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 Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 6 22:46:05 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 6 Aug 2014 20:46:05 +0000 Subject: [FieldTrip] Crossing Segmentations Message-ID: Hello All, Thank you for the help. I looked at my surface images in free view and they are crossing. The crossing seems to be taking place between the the brain and inner skull crossing over outer skull and outer skin. I believe that this is because the data that we have only goes down so far in the original mr images (Below). And when the individual surfaces are created they cross towards the posterior part of the head (Next Image). I attached the surfaces just in case to allow you to see. Would it be possible to extend outer skull and skin when using freesurfer, or get around this some other way. And lastly we are getting a very bumpy skin (Last Photo). Will this be a problem when creating the head model, finding the lead field matrix, etc. with MNE because the crossing sections prevent me from proceeding? Isaiah [cid:25735CD5-80A7-45EE-A539-AE0A4415EF42 at host.ucla.edu][cid:F69DE3BB-8642-475B-A56C-693438F83929 at host.ucla.edu][cid:BBA7098A-DBA4-4161-AA9D-1F3B08646948 at host.ucla.edu] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.13.20 PM.png Type: image/png Size: 62870 bytes Desc: Screen Shot 2014-08-06 at 1.13.20 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.25.14 PM.png Type: image/png Size: 154778 bytes Desc: Screen Shot 2014-08-06 at 1.25.14 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-06 at 1.28.46 PM.png Type: image/png Size: 124960 bytes Desc: Screen Shot 2014-08-06 at 1.28.46 PM.png URL: From pierre.megevand at gmail.com Thu Aug 7 23:16:51 2014 From: pierre.megevand at gmail.com (=?UTF-8?Q?Pierre_M=C3=A9gevand?=) Date: Thu, 7 Aug 2014 17:16:51 -0400 Subject: [FieldTrip] Post-doctoral position in cognitive neurophysiology/epilepsy Message-ID: The Laboratory for Multimodal Human Brain Mapping, at New York’s Feinstein Institute for Medical Research, has an immediate opening for a postdoctoral fellow with interests in epilepsy, cognitive neuroscience, and functional connectivity. The lab uses human intracranial EEG, direct electrical stimulation of the brain, and functional MRI to study: (1) neural mechanisms of cognitive abilities such as attention, visual processing, and language; (2) extent and dynamics of macroscale functional networks in the human brain; (3) how to improve the identification of functional and pathological brain regions in individuals suffering from epilepsy. The fellow will be involved in all aspects of experimental design, data collection and analysis, and publication of research. In addition, they will have extensive opportunities for work with colleagues in collaborating groups, including researchers at Columbia University, Albert Einstein College of Medicine, Child Mind Institute, and Nathan Kline Institute (all in New York), and the Weizmann Institute of Science in Israel. Candidates should have a background in at least one of the major techniques used in the lab: neurophysiology (EEG/MEG), neuroimaging (structural and functional MRI), or brain stimulation (direct electrical stimulation, TMS, tDCS/ACS). Additional experience in another of these techniques would be a plus. Strong programming skills (especially in the MATLAB environment) are required. Candidates with Ph.D. and/or M.D. degrees are welcome to apply. For more information about the lab, please visit: http://www.feinsteininstitute.org/faculty/ashesh-mehta-md-phd/ Interested candidates should submit CV and brief statement of interest to Dr. Ashesh Mehta at amehta at nshs.edu. From e.caspar at ucl.ac.uk Sat Aug 9 09:31:05 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sat, 9 Aug 2014 07:31:05 +0000 Subject: [FieldTrip] High-pass filter - 0.1 Message-ID: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sun Aug 10 10:01:00 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 10 Aug 2014 10:01:00 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser Message-ID: Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? Best Katrin Hi Alik, Using cfg.plotlabels = 'some', only plots several of the channel labels. Leaving it empty, or setting it to 'yes', will show all labels, is that what you intended? Additionally, right now we cannot guarantee compatibility with matlab R2012b onwards due to low level changes in several MathWorks functions. Please use a version older dan R2013a. Cheers, Roemer On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: >* I have pounded on this one from a few different angles and even gone and *>* looked at the source, and still can't quite figure out what I'm doing wrong. *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying *>* to do is load it up and inspect the data a bit to get a sense of how badly *>* artifacted it is. So: *>>* %%%%%% *>>* cfg = []; *>* cfg.blocksize = 30; % num of seconds to display at once *>* cfg.continuous = 'yes'; % not yet cut into trials *>* cfg.plotlabels = 'some'; *>* cfg.viewmode = 'vertical'; *>* cfg.colorgroups = 'chantype'; *>>* cfg.dataset = [DataDir filesep EEGFile]; *>* cfg.channel = {'EEG'}; *>>* ft_databrowser(cfg) *>>>* %%%%%% *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no *>* triggers or EOG), 30 second segments at a time. What it does *not* do is *>* label the channels along the y-axis so that I can readily tell which one is *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is *>* supposed to do, and yet, it does not. I've also tried doing this as *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label *>* contains the correct channel names, and that *still* doesn't work. *>>* I'm aware that this was marked as a bug before, but bugzilla shows it *>* closed long ago, before r7276 that I'm using I believe. *>>* MATLAB r2013a on OS X, if it matters. *>>* Am I simply misunderstanding what this cfg argument does or how to use it? *>>>* Alik Widge, MD, PhD *>* alik.widge at gmail.com *>* (206) 866-5435 *>>>* _______________________________________________ *>* fieldtrip mailing list *>* fieldtrip at donders.ru.nl *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip *> -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Sun Aug 10 15:18:42 2014 From: alik.widge at gmail.com (Alik Widge) Date: Sun, 10 Aug 2014 09:18:42 -0400 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: References: Message-ID: Not that I've heard, and it's still driving me a little bit nuts. Guys, I know that this is because I don't use old MATLAB, but it is going towards the end of 2014. 2012b and older are really not available for a lot of us, especially since our university licenses often force us onto newer versions. Any chance of a fix? Alik On Sunday, August 10, 2014, KatrinH Heimann wrote: > Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? > > Best > > Katrin > > > Hi Alik, > > Using cfg.plotlabels = 'some', only plots several of the channel labels. > Leaving it empty, or setting it to 'yes', will show all labels, is that > what you intended? > > Additionally, right now we cannot guarantee compatibility with matlab > R2012b onwards due to low level changes in several MathWorks functions. > Please use a version older dan R2013a. > > Cheers, > Roemer > > > On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: > > >* I have pounded on this one from a few different angles and even gone and > *>* looked at the source, and still can't quite figure out what I'm doing wrong. > *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying > *>* to do is load it up and inspect the data a bit to get a sense of how badly > *>* artifacted it is. So: > *>>* %%%%%% > *>>* cfg = []; > *>* cfg.blocksize = 30; % num of seconds to display at once > *>* cfg.continuous = 'yes'; % not yet cut into trials > *>* cfg.plotlabels = 'some'; > *>* cfg.viewmode = 'vertical'; > *>* cfg.colorgroups = 'chantype'; > *>>* cfg.dataset = [DataDir filesep EEGFile]; > *>* cfg.channel = {'EEG'}; > *>>* ft_databrowser(cfg) > *>>>* %%%%%% > *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no > *>* triggers or EOG), 30 second segments at a time. What it does *not* do is > *>* label the channels along the y-axis so that I can readily tell which one is > *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is > *>* supposed to do, and yet, it does not. I've also tried doing this as > *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label > *>* contains the correct channel names, and that *still* doesn't work. > *>>* I'm aware that this was marked as a bug before, but bugzilla shows it > *>* closed long ago, before r7276 that I'm using I believe. > *>>* MATLAB r2013a on OS X, if it matters. > *>>* Am I simply misunderstanding what this cfg argument does or how to use it? > *>>>* Alik Widge, MD, PhD > *>* alik.widge at gmail.com > *>* (206) 866-5435 > *>>>* _______________________________________________ > *>* fieldtrip mailing list > *>* fieldtrip at donders.ru.nl > *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > *> > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail: r.vandermeij at donders.ru.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > -- Sent from Gmail Mobile; apologies for the brevity -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Aug 11 12:43:27 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 11 Aug 2014 12:43:27 +0200 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Message-ID: Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie wrote: > Dear Fieldtrip members, > > I would like to apply to my data a bandpass filter from 0.016 (or at least > 0.1) to 30 Hz > > bpfilterRange = [.1 30]; > > However, it seems that Fieltrip doesn't accept small high-pass filter > values. I have the following mistake : > > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, > which is quite high. > > I wonder if the problem comes from my data (but I had no problems on others > programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? > > Thank in advance, > > Emilie > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From Spachtholz at psy.lmu.de Tue Aug 12 10:46:35 2014 From: Spachtholz at psy.lmu.de (Philipp Spachtholz) Date: Tue, 12 Aug 2014 10:46:35 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: References: Message-ID: <53E9D46B.7060200@psy.lmu.de> Dear Katrin, I had the same problem. This is what worked for me: Apparently, at least in my case, the channel labels not showing up in the databrowser resulted from are wrong specification of the fontsize in ft_databrowser. You have to locate the line that corresponds to your viewmode ('component' in my case, around line 1715) and replace the 'FontSize', 18 to a relative value, e.g 0.02, so that the call to plotting the text looks like this: ft_plot_text(labelx(laysel), labely(laysel), opt.hdr.label(chanindx(i)), 'tag', 'chanlabel', 'HorizontalAlignment', 'right','interpreter','none','FontUnits','normalized','FontSize',0.02,'FontName', 'Arial'); I am very unsure about wether this works for other MATLAB versions but you can give it a try. Just make sure to make a backup of the ft_databrowser before you make any changes there. Best Philipp Am 8/10/2014 3:18 PM, schrieb Alik Widge: > Not that I've heard, and it's still driving me a little bit nuts. > Guys, I know that this is because I don't use old MATLAB, but it is > going towards the end of 2014. 2012b and older are really not > available for a lot of us, especially since our university licenses > often force us onto newer versions. Any chance of a fix? > > Alik > > On Sunday, August 10, 2014, KatrinH Heimann > wrote: > > Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? > > Best > > Katrin > > Hi Alik, > > Using cfg.plotlabels = 'some', only plots several of the channel labels. > Leaving it empty, or setting it to 'yes', will show all labels, is that > what you intended? > > Additionally, right now we cannot guarantee compatibility with matlab > R2012b onwards due to low level changes in several MathWorks functions. > Please use a version older dan R2013a. > > Cheers, > Roemer > > > On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: > > >/ I have pounded on this one from a few different angles and even gone and > />/ looked at the source, and still can't quite figure out what I'm doing wrong. > />/ > />/ I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying > />/ to do is load it up and inspect the data a bit to get a sense of how badly > />/ artifacted it is. So: > />/ > />/ %%%%%% > />/ > />/ cfg = []; > />/ cfg.blocksize = 30; % num of seconds to display at once > />/ cfg.continuous = 'yes'; % not yet cut into trials > />/ cfg.plotlabels = 'some'; > />/ cfg.viewmode = 'vertical'; > />/ cfg.colorgroups = 'chantype'; > />/ > />/ cfg.dataset = [DataDir filesep EEGFile]; > />/ cfg.channel = {'EEG'}; > />/ > />/ ft_databrowser(cfg) > />/ > />/ > />/ %%%%%% > />/ > />/ This does 90% of what it ought to do -- it shows me the EEG channels (no > />/ triggers or EOG), 30 second segments at a time. What it does *not* do is > />/ label the channels along the y-axis so that I can readily tell which one is > />/ Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is > />/ supposed to do, and yet, it does not. I've also tried doing this as > />/ ft_databrowser(cfg,data), where I explicitly make sure that data.label > />/ contains the correct channel names, and that *still* doesn't work. > />/ > />/ I'm aware that this was marked as a bug before, but bugzilla shows it > />/ closed long ago, before r7276 that I'm using I believe. > />/ > />/ MATLAB r2013a on OS X, if it matters. > />/ > />/ Am I simply misunderstanding what this cfg argument does or how to use it? > />/ > />/ > />/ Alik Widge, MD, PhD > />/ alik.widge at gmail.com > />/ (206) 866-5435 > />/ > />/ > />/ _______________________________________________ > />/ fieldtrip mailing list > />/ fieldtrip at donders.ru.nl > />/ http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > />/ > / > > > -- > Roemer van der Meij M.Sc. > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3655932 > E-mail:r.vandermeij at donders.ru.nl > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > > > -- > Sent from Gmail Mobile; apologies for the brevity > > > _______________________________________________ > 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 Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 13 00:47:30 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Tue, 12 Aug 2014 22:47:30 +0000 Subject: [FieldTrip] Volume Conduction Models Message-ID: Hello, I am having a problem with my conduction models. [cid:72261DB6-9B5F-4784-B6EB-6D0E2E491F33 at host.ucla.edu] [cid:9595825F-C607-4946-9F35-A012A9A990B6 at host.ucla.edu][cid:8A2A417B-F1DB-4369-A690-FC5B059B6B42 at host.ucla.edu] I have tried to change the parameters at various times. Does anyone have an idea on how to fix this problem. The MRIs have nothing below the nose, as well as nothing above the head. Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.30 PM.png Type: image/png Size: 134746 bytes Desc: Screen Shot 2014-08-12 at 3.42.30 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.40 PM.png Type: image/png Size: 133318 bytes Desc: Screen Shot 2014-08-12 at 3.42.40 PM.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2014-08-12 at 3.42.58 PM.png Type: image/png Size: 132607 bytes Desc: Screen Shot 2014-08-12 at 3.42.58 PM.png URL: From hweeling.lee at gmail.com Wed Aug 13 10:43:22 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 13 Aug 2014 10:43:22 +0200 Subject: [FieldTrip] Question regarding coherence statistics Message-ID: Dear all, I refer to a previous post regarding 'question about coherenece statistics for group analysis related to J. Neuroscience 2011 and Science 2005 (both papers by Jan-Mathijs Schoffelen). I tried to follow the suggestions regarding the comparison of coherence for two conditions. This is what I set up for my case: cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; (there are 60 EEG channels in this case). cfg.channelcmb = {cfg.channel, cfg.channel}; freq1 = ft_connectivityanalysis(cfg, cond1); %this is done for 5 subjects separately freq2 = ft_connectivityanalysis(cfg, cond2); %this is done for 5 subjects separately freq1 = atanh(freq1.cohspctrm) - atanh(freq2.cohspctrm); %this is done for 5 subjects separately freq2.cohspctrm(:) = 0; %this is done for 5 subjects separately cfg = []; cfg.layout = 'EEG1010.lay'; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.alpha = 0.05; cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; cfg.avgoverfreq = 'yes'; cfg.frequency = [2 4]; % this will be performed for different frequency bands [prec200_delta_stat] = ft_freqstatistics(cfg, sub01_freq1, sub02_freq1, sub03_freq1, sub04_freq1, sub05_freq1, sub01_freq2, sub02_freq2, sub03_freq2, sub04_freq2, sub05_freq2); However, when I tried to run this script, I get an error message: Reference to non-existent field 'label'. Error in ft_freqstatistics (line 131) haschan(i) = ~isempty(strfind(varargin{i}.dimord, 'chan')) ... Can someone please help? Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Wed Aug 13 17:16:57 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 17:16:57 +0200 Subject: [FieldTrip] Missing Channel labels in Data browser In-Reply-To: <53E9D46B.7060200@psy.lmu.de> References: <53E9D46B.7060200@psy.lmu.de> Message-ID: Philipp! You made my day! This works perfectly!!! Thanks a million! k 2014-08-12 10:46 GMT+02:00 Philipp Spachtholz : > Dear Katrin, > > I had the same problem. This is what worked for me: > > Apparently, at least in my case, the channel labels not showing up in the > databrowser resulted > from are wrong specification of the fontsize in ft_databrowser. > > You have to locate the line that corresponds to your viewmode ('component' > in my case, around line 1715) > and replace the > > 'FontSize', 18 to a relative value, e.g 0.02, so that the call to plotting > the text looks like this: > > ft_plot_text(labelx(laysel), labely(laysel), opt.hdr.label(chanindx(i)), > 'tag', 'chanlabel', 'HorizontalAlignment', > 'right','interpreter','none','FontUnits','normalized','FontSize',0.02,'FontName', > 'Arial'); > > I am very unsure about wether this works for other MATLAB versions but you > can give it a try. > Just make sure to make a backup of the ft_databrowser before you make any > changes there. > > Best > > Philipp > > > > Am 8/10/2014 3:18 PM, schrieb Alik Widge: > > Not that I've heard, and it's still driving me a little bit nuts. > Guys, I know that this is because I don't use old MATLAB, but it is going > towards the end of 2014. 2012b and older are really not available for a lot > of us, especially since our university licenses often force us onto newer > versions. Any chance of a fix? > > Alik > > On Sunday, August 10, 2014, KatrinH Heimann > wrote: > >> Dear all! I found the conversation quoted below among last years posts. I have the same problem than Alik, I never see any channel labels on the y axis, also not in the "some" option. Has this problem ever been solved? >> >> Best >> >> Katrin >> >> Hi Alik, >> >> Using cfg.plotlabels = 'some', only plots several of the channel labels. >> Leaving it empty, or setting it to 'yes', will show all labels, is that >> what you intended? >> >> Additionally, right now we cannot guarantee compatibility with matlab >> R2012b onwards due to low level changes in several MathWorks functions. >> Please use a version older dan R2013a. >> >> Cheers, >> Roemer >> >> >> On Fri, Sep 27, 2013 at 9:57 PM, Alik Widge > wrote: >> >> >* I have pounded on this one from a few different angles and even gone and >> *>* looked at the source, and still can't quite figure out what I'm doing wrong. >> *>>* I have a datafile from an eXimia TMS-EEG system. Right now, all I'm trying >> *>* to do is load it up and inspect the data a bit to get a sense of how badly >> *>* artifacted it is. So: >> *>>* %%%%%% >> *>>* cfg = []; >> *>* cfg.blocksize = 30; % num of seconds to display at once >> *>* cfg.continuous = 'yes'; % not yet cut into trials >> *>* cfg.plotlabels = 'some'; >> *>* cfg.viewmode = 'vertical'; >> *>* cfg.colorgroups = 'chantype'; >> *>>* cfg.dataset = [DataDir filesep EEGFile]; >> *>* cfg.channel = {'EEG'}; >> *>>* ft_databrowser(cfg) >> *>>>* %%%%%% >> *>>* This does 90% of what it ought to do -- it shows me the EEG channels (no >> *>* triggers or EOG), 30 second segments at a time. What it does *not* do is >> *>* label the channels along the y-axis so that I can readily tell which one is >> *>* Pz, F3, O1, etc., etc. I am pretty sure that's what cfg.plotlabels is >> *>* supposed to do, and yet, it does not. I've also tried doing this as >> *>* ft_databrowser(cfg,data), where I explicitly make sure that data.label >> *>* contains the correct channel names, and that *still* doesn't work. >> *>>* I'm aware that this was marked as a bug before, but bugzilla shows it >> *>* closed long ago, before r7276 that I'm using I believe. >> *>>* MATLAB r2013a on OS X, if it matters. >> *>>* Am I simply misunderstanding what this cfg argument does or how to use it? >> *>>>* Alik Widge, MD, PhD >> *>* alik.widge at gmail.com >> *>* (206) 866-5435 <%28206%29%20866-5435> >> *>>>* _______________________________________________ >> *>* fieldtrip mailing list >> *>* fieldtrip at donders.ru.nl >> *>* http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> *> >> >> >> -- >> Roemer van der Meij M.Sc. >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3655932 >> E-mail: r.vandermeij at donders.ru.nl >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> > > -- > Sent from Gmail Mobile; apologies for the brevity > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 katrinheimann at gmail.com Wed Aug 13 19:22:41 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 19:22:41 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all Message-ID: Dear all. I am trying to replace bad channels. This is my code (very basic I think):%% Preparing neighbours for channel repair cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {}; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) I do not get any error but fieldtrip even tells me that the interpolation worked. However I do not see ANY trace of it in my data when inspecting it afterwards. I also tried to change the method (to average) - no change. Anybody who can help me with that? Thanks a million Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 13 21:55:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 13 Aug 2014 21:55:30 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Katrin, Have you tried putting the labels of the channels you want interpolated into the cfg.badchannel array? Best, Eelke Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : > Dear all. I am trying to replace bad channels. > This is my code (very basic I think):%% Preparing neighbours for channel > repair > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > I do not get any error but fieldtrip even tells me that the interpolation > worked. However I do not see ANY trace of it in my data when inspecting it > afterwards. I also tried to change the method (to average) - no change. > Anybody who can help me with that? > Thanks a million > Katrin > > > > _______________________________________________ > 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 katrinheimann at gmail.com Wed Aug 13 22:12:44 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Wed, 13 Aug 2014 22:12:44 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Eelke, yes, sure, sorry, I did that. No effect. 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > Dear Katrin, > > Have you tried putting the labels of the channels you want interpolated > into the cfg.badchannel array? > > Best, > Eelke > Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : > >> Dear all. I am trying to replace bad channels. >> This is my code (very basic I think):%% Preparing neighbours for channel >> repair >> >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> % Interpolate and put into new data structure >> >> cfg = []; >> >> cfg.badchannel = {}; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.method = 'nearest'; >> >> cfg.neighbours = neighbours; >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> I do not get any error but fieldtrip even tells me that the interpolation >> worked. However I do not see ANY trace of it in my data when inspecting it >> afterwards. I also tried to change the method (to average) - no change. >> Anybody who can help me with that? >> Thanks a million >> Katrin >> >> >> >> _______________________________________________ >> 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 katrinheimann at gmail.com Thu Aug 14 08:25:09 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 14 Aug 2014 08:25:09 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis Message-ID: Dear all, I am sorry I have another silly problem. I try to create the cell array for a within-analysis. I am using the following code to load the single subject structs and put them in an array calles all90. load ('ERP_AnnaLisa13obs90_ERP.mat') all90(1,:) = obs90_data_ERP load ('ERP_Benedetta23obs90_ERP.mat') all90(2,:) = obs90_data_ERP Unfortunately the result is a struct array. I can convert it to a cell by struct2cell but then fieldtrip does not recognise it as ERP data anymore as the labels inside of the struct disappear. Anybody who can help? k -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 14 08:54:41 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Aug 2014 08:54:41 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Hi Katrin, Try using curly braces {} to index your cell arrays when you want to access or change their content. The parentheses index the elements of the cell array (which are themselves cells, just like elements of double arrays are doubles). Curly braces index the *contents* of these cells. The following blog post might be helpful for you: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . Best, Eelke On 14 August 2014 08:25, KatrinH Heimann wrote: > Dear all, > I am sorry I have another silly problem. I try to create the cell array for > a within-analysis. > > I am using the following code to load the single subject structs and put > them in an array calles all90. > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90(1,:) = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90(2,:) = obs90_data_ERP > > > Unfortunately the result is a struct array. I can convert it to a cell by > struct2cell but then fieldtrip does not recognise it as ERP data anymore as > the labels inside of the struct disappear. Anybody who can help? > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From nick.peatfield at gmail.com Thu Aug 14 08:56:13 2014 From: nick.peatfield at gmail.com (Nicholas A. Peatfield) Date: Thu, 14 Aug 2014 08:56:13 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Dear Katrin, The problem I can see here is that you are not indexing the data like you should with a cell. For that you have to use the curly brackets, for example: load ('ERP_AnnaLisa13obs90_ERP.mat') all90{1} = obs90_data_ERP load ('ERP_Benedetta23obs90_ERP.mat') all90{2} = obs90_data_ERP Cheers, Nick On 14 August 2014 08:25, KatrinH Heimann wrote: > Dear all, > I am sorry I have another silly problem. I try to create the cell array > for a within-analysis. > > I am using the following code to load the single subject structs and put > them in an array calles all90. > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90(1,:) = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90(2,:) = obs90_data_ERP > > Unfortunately the result is a struct array. I can convert it to a cell by > struct2cell but then fieldtrip does not recognise it as ERP data anymore as > the labels inside of the struct disappear. Anybody who can help? > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Nicholas Peatfield, PhD Centro Interdipartimentale Mente/Cervello- CIMEC Assegnista di ricerca - Research Fellow Via delle Regole, 101 - 38060 Mattarello +39 0461 283086 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 14 08:57:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 14 Aug 2014 08:57:38 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: OK just checking :) In that case, could you post a small snippet of data and the actual cfg you used (including which channels to repair) on e.g. dropbox or so? Then I can have a look. Best, Eelke On 13 August 2014 22:12, KatrinH Heimann wrote: > Dear Eelke, yes, sure, sorry, I did that. No effect. > > > 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> Dear Katrin, >> >> Have you tried putting the labels of the channels you want interpolated >> into the cfg.badchannel array? >> >> Best, >> Eelke >> >> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : >>> >>> Dear all. I am trying to replace bad channels. >>> This is my code (very basic I think):%% Preparing neighbours for channel >>> repair >>> >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> % Interpolate and put into new data structure >>> >>> cfg = []; >>> >>> cfg.badchannel = {}; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.method = 'nearest'; >>> >>> cfg.neighbours = neighbours; >>> >>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >>> >>> I do not get any error but fieldtrip even tells me that the interpolation >>> worked. However I do not see ANY trace of it in my data when inspecting it >>> afterwards. I also tried to change the method (to average) - no change. >>> Anybody who can help me with that? >>> Thanks a million >>> Katrin >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From k.kessler at aston.ac.uk Thu Aug 14 10:18:44 2014 From: k.kessler at aston.ac.uk (Kessler, Klaus) Date: Thu, 14 Aug 2014 08:18:44 +0000 Subject: [FieldTrip] PhD scholarship at the Aston Brain Centre (Birmingham, UK) Message-ID: Dear Fieldtrippers We would be grateful if you could disseminate this fully funded PhD opportunity (for UK and EU students) to potential candidates. It will mainly involve MEG recordings and analysis in attention paradigms where participants switch between "space and time". For the final year we have also planned an EEG study in a driving simulator. The PhD is funded in part by the Aston Brain Centre (within the School of Life and Health Sciences) and in part by the Rees Jeffreys Road Fund. If this sounds interesting to you, please follow the link below for applying and/or get in touch by email to learn more. http://www.findaphd.com/search/ProjectDetails.aspx?PJID=56302 Thanks Klaus __________________________ Professor Klaus Kessler Aston Brain Centre School of Life and Health Sciences Aston University Aston Triangle Birmingham, B4 7ET Phone: +44 (0)121 204 3187 Email: k.kessler at aston.ac.uk __________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Thu Aug 14 12:19:39 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 14 Aug 2014 12:19:39 +0200 Subject: [FieldTrip] Problem in creating cell array for within-analysis In-Reply-To: References: Message-ID: Thanks Eelke and Nick, that worked of course :) k 2014-08-14 8:56 GMT+02:00 Nicholas A. Peatfield : > Dear Katrin, > > The problem I can see here is that you are not indexing the data like you > should with a cell. For that you have to use the curly brackets, for > example: > > load ('ERP_AnnaLisa13obs90_ERP.mat') > > all90{1} = obs90_data_ERP > > load ('ERP_Benedetta23obs90_ERP.mat') > > all90{2} = obs90_data_ERP > > Cheers, > > Nick > > > On 14 August 2014 08:25, KatrinH Heimann wrote: > >> Dear all, >> I am sorry I have another silly problem. I try to create the cell array >> for a within-analysis. >> >> I am using the following code to load the single subject structs and put >> them in an array calles all90. >> >> load ('ERP_AnnaLisa13obs90_ERP.mat') >> >> all90(1,:) = obs90_data_ERP >> >> load ('ERP_Benedetta23obs90_ERP.mat') >> >> all90(2,:) = obs90_data_ERP >> >> Unfortunately the result is a struct array. I can convert it to a cell by >> struct2cell but then fieldtrip does not recognise it as ERP data anymore as >> the labels inside of the struct disappear. Anybody who can help? >> k >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Nicholas Peatfield, PhD > Centro Interdipartimentale Mente/Cervello- CIMEC > > Assegnista di ricerca - Research Fellow > Via delle Regole, 101 - 38060 Mattarello > +39 0461 283086 > > _______________________________________________ > 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 katrinheimann at gmail.com Sun Aug 17 11:23:20 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 17 Aug 2014 11:23:20 +0200 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? Message-ID: Dear all I still have problem with the channel interpolation (just not working at all, without error message, see my previous post). Now I am thinking if I just remove the bad channels for the single subjects and leave it like that. My question is though: Will this create problems for my Grand average over subjects later (as in each subject I remove different channels)? and which layout do I have to use to plot my Grand average data later? Every help is very welcome Cheers k -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Aug 18 08:58:15 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Aug 2014 08:58:15 +0200 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? In-Reply-To: References: Message-ID: Dear Kathrin, Re your previous post about repairing bad channels, I've also tried this on Fieldtrip and it works for me. I've not used the triangulation method, but maybe you could try again. I guess it depends on your template. For me, I was using Easycap 64 channels, but maybe it's different for you. Here's how I set up my repair channels options: % repairing bad channels with averaged of its neighbours load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, data2); cfg = []; if strcmp('S004', dir_analysis{sub}) == 1 cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; end cfg.trials = 'all'; cfg.method = 'average'; cfg.layout = lay; cfg.neighbours = neighbours; data3 = ft_channelrepair(cfg, data2); Re removing bad channels. Your question regarding if this will create problems for your grand average over subjects later. Well, it depends which channels you remove for individual subjects. As far as I'm aware, when you averaged your data across subjects, it will only pick the common channels across subjects for the statistical analyses. When you plot, you can always call for the template layout (e.g. 'EEG1020.lay'). This will plot the available channels across all subjects, and leave out the ones that are not in the data. I hope this helps. Cheers, Hweeling On 17 August 2014 11:23, KatrinH Heimann wrote: > Dear all > I still have problem with the channel interpolation (just not working at > all, without error message, see my previous post). Now I am thinking if I > just remove the bad channels for the single subjects and leave it like > that. My question is though: Will this create problems for my Grand average > over subjects later (as in each subject I remove different channels)? and > which layout do I have to use to plot my Grand average data later? > Every help is very welcome > Cheers > k > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Aug 18 10:18:46 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 18 Aug 2014 10:18:46 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Katrin, When I look at the data you've shown me, in fact I do see an effect of ft_channelrepair. I run your code: load ('ERP_Francesca17obs90_clean.mat') %% Preparing neighbours for channel repair cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {'E49', 'E68'}; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); followed by: dat1=obs90_data_clean2; dat2=obs90_data_channelrepaired; x=dat1.trial{1}(68,:); % 68 is channel index of E68 y=dat2.trial{1}(68,:); plot(x);hold on;plot(y,'r'); x=dat1.trial{1}(49,:); y=dat2.trial{1}(49,:); figure; plot(x);hold on;plot(y,'r') and the two figures that come up are shown in the attachments. The original (blue) and channel-repaired (red) traces are clearly different. These plots are for trial 1, but the same result holds when I plot a different trial. Does it work on your end too now? Best, Eelke On 14 August 2014 08:57, Eelke Spaak wrote: > OK just checking :) In that case, could you post a small snippet of > data and the actual cfg you used (including which channels to repair) > on e.g. dropbox or so? Then I can have a look. > > Best, > Eelke > > On 13 August 2014 22:12, KatrinH Heimann wrote: >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : >> >>> Dear Katrin, >>> >>> Have you tried putting the labels of the channels you want interpolated >>> into the cfg.badchannel array? >>> >>> Best, >>> Eelke >>> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" : >>>> >>>> Dear all. I am trying to replace bad channels. >>>> This is my code (very basic I think):%% Preparing neighbours for channel >>>> repair >>>> >>>> >>>> >>>> cfg_neighb = []; >>>> >>>> cfg_neighb.feedback = 'yes'; >>>> >>>> cfg_neighb.method = 'triangulation'; >>>> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>> >>>> >>>> >>>> % Interpolate and put into new data structure >>>> >>>> cfg = []; >>>> >>>> cfg.badchannel = {}; >>>> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> cfg.method = 'nearest'; >>>> >>>> cfg.neighbours = neighbours; >>>> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>>> >>>> >>>> I do not get any error but fieldtrip even tells me that the interpolation >>>> worked. However I do not see ANY trace of it in my data when inspecting it >>>> afterwards. I also tried to change the method (to average) - no change. >>>> Anybody who can help me with that? >>>> Thanks a million >>>> Katrin >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 -------------- A non-text attachment was scrubbed... Name: E68.png Type: image/png Size: 10268 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: E49.png Type: image/png Size: 11130 bytes Desc: not available URL: From hweeling.lee at gmail.com Mon Aug 18 12:08:08 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 18 Aug 2014 12:08:08 +0200 Subject: [FieldTrip] Question regarding coherence statistics and viewing of results Message-ID: Dear all, I've previously posted this question however, I did not get any replies. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' variable that would allow me to perform cluster-based statistical analyses. However, I was not sure how I could plot the results. I get an error message from Fieldtrip: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); Also, according to the paper by Maris et al., 2007 'Nonparametric statistical testing of coherence differences', the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, I would really appreciate if someone can help me how to make such a plot. Thank you very much. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Mon Aug 18 19:26:19 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Mon, 18 Aug 2014 13:26:19 -0400 Subject: [FieldTrip] Does deleting bad channels in single subjects create problems for grand average later? In-Reply-To: References: Message-ID: Hi Kathrin, I like having my data saved before (I can apply a montage later) and after repairing channels. As Hweeling suggests, you will have difficulty grand averaging if the channel of interest is missing from one of your subjects. I no longer have your original post and apologize if I am repeating suggestions from others. Did you review and display your neighbors before repairing channels? Are you sure your channels had neighbors? I've used this function for years - when I switched EEG systems, I was unaware of the change in units, and ran into the same problem you are having. I think you are best off understanding why ft_channelrepair isn't working. I also found it helpful to have the ft_default settings provide me with feedback: ft_default.trackconfig = 'report'; ft_default.checkconfig = 'pendantic'; Hopefully my suggestions help you determine what's going on. If not, I could review your neighbors, and data structure. Best, Raquel On Mon, Aug 18, 2014 at 2:58 AM, Hwee Ling Lee wrote: > Dear Kathrin, > > Re your previous post about repairing bad channels, I've also tried this > on Fieldtrip and it works for me. I've not used the triangulation method, > but maybe you could try again. I guess it depends on your template. For me, > I was using Easycap 64 channels, but maybe it's different for you. Here's > how I set up my repair channels options: > > % repairing bad channels with averaged of its neighbours > > load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat'); > > cfg_neighb.method = 'template'; > cfg_neighb.layout = lay; > neighbours = ft_prepare_neighbours(cfg_neighb, data2); > > cfg = []; > if strcmp('S004', dir_analysis{sub}) == 1 > cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'}; > end > cfg.trials = 'all'; > cfg.method = 'average'; > cfg.layout = lay; > cfg.neighbours = neighbours; > data3 = ft_channelrepair(cfg, data2); > > Re removing bad channels. Your question regarding if this will create > problems for your grand average over subjects later. Well, it depends which > channels you remove for individual subjects. As far as I'm aware, when you > averaged your data across subjects, it will only pick the common channels > across subjects for the statistical analyses. When you plot, you can always > call for the template layout (e.g. 'EEG1020.lay'). This will plot the > available channels across all subjects, and leave out the ones that are not > in the data. > > I hope this helps. > > Cheers, > Hweeling > > > > On 17 August 2014 11:23, KatrinH Heimann wrote: > >> Dear all >> I still have problem with the channel interpolation (just not working at >> all, without error message, see my previous post). Now I am thinking if I >> just remove the bad channels for the single subjects and leave it like >> that. My question is though: Will this create problems for my Grand average >> over subjects later (as in each subject I remove different channels)? and >> which layout do I have to use to plot my Grand average data later? >> Every help is very welcome >> Cheers >> k >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > > _______________________________________________ > 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 jingfan.jf at gmail.com Mon Aug 18 21:05:02 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 18 Aug 2014 14:05:02 -0500 Subject: [FieldTrip] undefined function or variable 'abort' error when trying to run ft_definetrial(cfg) Message-ID: <010701cfbb17$51471a90$f3d54fb0$@gmail.com> Hi there, I am new to fieldtrip. I am trying the trigger-based trial selection tutorial. An error occurs when running cfg = ft_definetrial(cfg). In ft_preamble function, I couldn't find where abort is defined. I appreciate any help! Best, Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Mon Aug 18 23:52:38 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Mon, 18 Aug 2014 21:52:38 +0000 Subject: [FieldTrip] Aligning Electrodes Message-ID: Hello, I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. mri = ft_read_mri('Subject01.mri'); disp(mri.hdr.fiducial.mri) nas: [87 60 116] lpa: [29 145 155] rpa: [144 142 158] Reference to non-existent field 'hdr'. I cannot display. Am I missing a prior step? Best, Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Tue Aug 19 00:09:07 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Tue, 19 Aug 2014 00:09:07 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Dear Eelke, ok, so i installed an older version of matlab (which also solved some other problems with fieldtrip) and now it works. However I am running into another problem with it. Maybe you can help too: If I try to run the ICA after the bad channel replacement it takes hours and wchange just does not get lower. In my naive thinking I thought that might be due to the fact that the replaced channels are recognized as interpolations of the others??? But what could I do otherwise?: I thought about doing the bcr later, but that means that my ica suffers from all the electrode jumps from my bad channels. or I just exclude them from the ica - but how to proceed then: apply the reject component function on the data without the channels and then replace them? sorry, I am just a bit lost. The weirdest thing is: if I replace the channels with the help of another software before even processing the data, the ica works perfectly later in fieldtrip. WHY???? Would be wonderful if you could give me another hand... Thanks so much in advance!!! Katrin 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > Dear Katrin, > > When I look at the data you've shown me, in fact I do see an effect of > ft_channelrepair. I run your code: > > load ('ERP_Francesca17obs90_clean.mat') > > %% Preparing neighbours for channel repair > > cfg_neighb = []; > cfg_neighb.feedback = 'yes'; > cfg_neighb.method = 'triangulation'; > cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); > > % Interpolate and put into new data structure > cfg = []; > cfg.badchannel = {'E49', 'E68'}; > cfg.layout = 'GSN-HydroCel-129.sfp'; > cfg.method = 'nearest'; > cfg.neighbours = neighbours; > obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); > > followed by: > > dat1=obs90_data_clean2; > dat2=obs90_data_channelrepaired; > > x=dat1.trial{1}(68,:); % 68 is channel index of E68 > y=dat2.trial{1}(68,:); > plot(x);hold on;plot(y,'r'); > > x=dat1.trial{1}(49,:); > y=dat2.trial{1}(49,:); > figure; > plot(x);hold on;plot(y,'r') > > and the two figures that come up are shown in the attachments. The > original (blue) and channel-repaired (red) traces are clearly > different. These plots are for trial 1, but the same result holds when > I plot a different trial. > > Does it work on your end too now? > > Best, > Eelke > > On 14 August 2014 08:57, Eelke Spaak wrote: > > OK just checking :) In that case, could you post a small snippet of > > data and the actual cfg you used (including which channels to repair) > > on e.g. dropbox or so? Then I can have a look. > > > > Best, > > Eelke > > > > On 13 August 2014 22:12, KatrinH Heimann > wrote: > >> Dear Eelke, yes, sure, sorry, I did that. No effect. > >> > >> > >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> > >>> Dear Katrin, > >>> > >>> Have you tried putting the labels of the channels you want interpolated > >>> into the cfg.badchannel array? > >>> > >>> Best, > >>> Eelke > >>> > >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" < > katrinheimann at gmail.com>: > >>>> > >>>> Dear all. I am trying to replace bad channels. > >>>> This is my code (very basic I think):%% Preparing neighbours for > channel > >>>> repair > >>>> > >>>> > >>>> > >>>> cfg_neighb = []; > >>>> > >>>> cfg_neighb.feedback = 'yes'; > >>>> > >>>> cfg_neighb.method = 'triangulation'; > >>>> > >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >>>> > >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>> > >>>> > >>>> > >>>> % Interpolate and put into new data structure > >>>> > >>>> cfg = []; > >>>> > >>>> cfg.badchannel = {}; > >>>> > >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>> > >>>> cfg.method = 'nearest'; > >>>> > >>>> cfg.neighbours = neighbours; > >>>> > >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >>>> > >>>> > >>>> I do not get any error but fieldtrip even tells me that the > interpolation > >>>> worked. However I do not see ANY trace of it in my data when > inspecting it > >>>> afterwards. I also tried to change the method (to average) - no > change. > >>>> Anybody who can help me with that? > >>>> Thanks a million > >>>> Katrin > >>>> > >>>> > >>>> > >>>> _______________________________________________ > >>>> fieldtrip mailing list > >>>> fieldtrip at donders.ru.nl > >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >>> > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Aug 19 09:14:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 19 Aug 2014 09:14:44 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Hi Katrin, Hmm, the MATLAB version difference points to a potential bug in the code. Could you tell me which version it now works on, and which version it did not work on earlier? ICA not working on your repaired data makes sense, and the cause is in fact pretty much what you mentioned yourself. The data in the repaired channels are now linear combinations (i.e. weighted sums) of the data in other channels, so the rank of your data (number of orthogonal data vectors) is now smaller than the number of channels. In other words, your data is rank deficient. ICA does not work properly on rank-deficient data. There are a few solutions to this. I would not recommend including the bad channels in the ICA. Your second suggestion would be better: compute ICA on the data without the bad channels, then interpolate them after backprojecting to channel space. A third option would be to reduce the dimensionality of the ICA input data to its 'true' dimensionality. If you specify cfg.numcomponent = N when calling ft_componentanalysis, the data will first undergo PCA, keeping N dimensions. In your case you would need to set N to be maximally the number of recorded channels minus the number of interpolated ones. This third option is probably the easiest and best way to go. Lastly, the fact that ICA still works if you repair the channels in other software is possibly due to this other software applying some form of non-linear algorithm to repair the channels. In that case the rank of your data might not be altered. Best, Eelke On 19 August 2014 00:09, KatrinH Heimann wrote: > Dear Eelke, > > ok, so i installed an older version of matlab (which also solved some other > problems with fieldtrip) and now it works. However I am running into another > problem with it. Maybe you can help too: > If I try to run the ICA after the bad channel replacement it takes hours and > wchange just does not get lower. In my naive thinking I thought that might > be due to the fact that the replaced channels are recognized as > interpolations of the others??? But what could I do otherwise?: I thought > about doing the bcr later, but that means that my ica suffers from all the > electrode jumps from my bad channels. or I just exclude them from the ica - > but how to proceed then: apply the reject component function on the data > without the channels and then replace them? sorry, I am just a bit lost. The > weirdest thing is: if I replace the channels with the help of another > software before even processing the data, the ica works perfectly later in > fieldtrip. WHY???? > Would be wonderful if you could give me another hand... Thanks so much in > advance!!! > Katrin > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > >> Dear Katrin, >> >> When I look at the data you've shown me, in fact I do see an effect of >> ft_channelrepair. I run your code: >> >> load ('ERP_Francesca17obs90_clean.mat') >> >> %% Preparing neighbours for channel repair >> >> cfg_neighb = []; >> cfg_neighb.feedback = 'yes'; >> cfg_neighb.method = 'triangulation'; >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); >> >> % Interpolate and put into new data structure >> cfg = []; >> cfg.badchannel = {'E49', 'E68'}; >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> cfg.method = 'nearest'; >> cfg.neighbours = neighbours; >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); >> >> followed by: >> >> dat1=obs90_data_clean2; >> dat2=obs90_data_channelrepaired; >> >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 >> y=dat2.trial{1}(68,:); >> plot(x);hold on;plot(y,'r'); >> >> x=dat1.trial{1}(49,:); >> y=dat2.trial{1}(49,:); >> figure; >> plot(x);hold on;plot(y,'r') >> >> and the two figures that come up are shown in the attachments. The >> original (blue) and channel-repaired (red) traces are clearly >> different. These plots are for trial 1, but the same result holds when >> I plot a different trial. >> >> Does it work on your end too now? >> >> Best, >> Eelke >> >> On 14 August 2014 08:57, Eelke Spaak wrote: >> > OK just checking :) In that case, could you post a small snippet of >> > data and the actual cfg you used (including which channels to repair) >> > on e.g. dropbox or so? Then I can have a look. >> > >> > Best, >> > Eelke >> > >> > On 13 August 2014 22:12, KatrinH Heimann >> > wrote: >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : >> >> >> >>> Dear Katrin, >> >>> >> >>> Have you tried putting the labels of the channels you want >> >>> interpolated >> >>> into the cfg.badchannel array? >> >>> >> >>> Best, >> >>> Eelke >> >>> >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" >> >>> : >> >>>> >> >>>> Dear all. I am trying to replace bad channels. >> >>>> This is my code (very basic I think):%% Preparing neighbours for >> >>>> channel >> >>>> repair >> >>>> >> >>>> >> >>>> >> >>>> cfg_neighb = []; >> >>>> >> >>>> cfg_neighb.feedback = 'yes'; >> >>>> >> >>>> cfg_neighb.method = 'triangulation'; >> >>>> >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>> >> >>>> >> >>>> >> >>>> % Interpolate and put into new data structure >> >>>> >> >>>> cfg = []; >> >>>> >> >>>> cfg.badchannel = {}; >> >>>> >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> cfg.method = 'nearest'; >> >>>> >> >>>> cfg.neighbours = neighbours; >> >>>> >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >>>> >> >>>> >> >>>> I do not get any error but fieldtrip even tells me that the >> >>>> interpolation >> >>>> worked. However I do not see ANY trace of it in my data when >> >>>> inspecting it >> >>>> afterwards. I also tried to change the method (to average) - no >> >>>> change. >> >>>> Anybody who can help me with that? >> >>>> Thanks a million >> >>>> Katrin >> >>>> >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> fieldtrip mailing list >> >>>> fieldtrip at donders.ru.nl >> >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >>> >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From katrinheimann at gmail.com Tue Aug 19 10:05:53 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Tue, 19 Aug 2014 10:05:53 +0200 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: Message-ID: Eelke! I am sure your name translates in Angel actually! Now everthing works!!! And so easily! The version I reinstalled is Matlab R2012a. I had R 2014a for some weeks, but loads of things did not work with that... Thanks a million for your help, really! Katrin 2014-08-19 9:14 GMT+02:00 Eelke Spaak : > Hi Katrin, > > Hmm, the MATLAB version difference points to a potential bug in the > code. Could you tell me which version it now works on, and which > version it did not work on earlier? > > ICA not working on your repaired data makes sense, and the cause is in > fact pretty much what you mentioned yourself. The data in the repaired > channels are now linear combinations (i.e. weighted sums) of the data > in other channels, so the rank of your data (number of orthogonal data > vectors) is now smaller than the number of channels. In other words, > your data is rank deficient. ICA does not work properly on > rank-deficient data. There are a few solutions to this. > > I would not recommend including the bad channels in the ICA. Your > second suggestion would be better: compute ICA on the data without the > bad channels, then interpolate them after backprojecting to channel > space. A third option would be to reduce the dimensionality of the ICA > input data to its 'true' dimensionality. If you specify > cfg.numcomponent = N when calling ft_componentanalysis, the data will > first undergo PCA, keeping N dimensions. In your case you would need > to set N to be maximally the number of recorded channels minus the > number of interpolated ones. This third option is probably the easiest > and best way to go. > > Lastly, the fact that ICA still works if you repair the channels in > other software is possibly due to this other software applying some > form of non-linear algorithm to repair the channels. In that case the > rank of your data might not be altered. > > Best, > Eelke > > On 19 August 2014 00:09, KatrinH Heimann wrote: > > Dear Eelke, > > > > ok, so i installed an older version of matlab (which also solved some > other > > problems with fieldtrip) and now it works. However I am running into > another > > problem with it. Maybe you can help too: > > If I try to run the ICA after the bad channel replacement it takes hours > and > > wchange just does not get lower. In my naive thinking I thought that > might > > be due to the fact that the replaced channels are recognized as > > interpolations of the others??? But what could I do otherwise?: I thought > > about doing the bcr later, but that means that my ica suffers from all > the > > electrode jumps from my bad channels. or I just exclude them from the > ica - > > but how to proceed then: apply the reject component function on the data > > without the channels and then replace them? sorry, I am just a bit lost. > The > > weirdest thing is: if I replace the channels with the help of another > > software before even processing the data, the ica works perfectly later > in > > fieldtrip. WHY???? > > Would be wonderful if you could give me another hand... Thanks so much in > > advance!!! > > Katrin > > > > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak : > > > >> Dear Katrin, > >> > >> When I look at the data you've shown me, in fact I do see an effect of > >> ft_channelrepair. I run your code: > >> > >> load ('ERP_Francesca17obs90_clean.mat') > >> > >> %% Preparing neighbours for channel repair > >> > >> cfg_neighb = []; > >> cfg_neighb.feedback = 'yes'; > >> cfg_neighb.method = 'triangulation'; > >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); > >> > >> % Interpolate and put into new data structure > >> cfg = []; > >> cfg.badchannel = {'E49', 'E68'}; > >> cfg.layout = 'GSN-HydroCel-129.sfp'; > >> cfg.method = 'nearest'; > >> cfg.neighbours = neighbours; > >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); > >> > >> followed by: > >> > >> dat1=obs90_data_clean2; > >> dat2=obs90_data_channelrepaired; > >> > >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 > >> y=dat2.trial{1}(68,:); > >> plot(x);hold on;plot(y,'r'); > >> > >> x=dat1.trial{1}(49,:); > >> y=dat2.trial{1}(49,:); > >> figure; > >> plot(x);hold on;plot(y,'r') > >> > >> and the two figures that come up are shown in the attachments. The > >> original (blue) and channel-repaired (red) traces are clearly > >> different. These plots are for trial 1, but the same result holds when > >> I plot a different trial. > >> > >> Does it work on your end too now? > >> > >> Best, > >> Eelke > >> > >> On 14 August 2014 08:57, Eelke Spaak wrote: > >> > OK just checking :) In that case, could you post a small snippet of > >> > data and the actual cfg you used (including which channels to repair) > >> > on e.g. dropbox or so? Then I can have a look. > >> > > >> > Best, > >> > Eelke > >> > > >> > On 13 August 2014 22:12, KatrinH Heimann > >> > wrote: > >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. > >> >> > >> >> > >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak : > >> >> > >> >>> Dear Katrin, > >> >>> > >> >>> Have you tried putting the labels of the channels you want > >> >>> interpolated > >> >>> into the cfg.badchannel array? > >> >>> > >> >>> Best, > >> >>> Eelke > >> >>> > >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" > >> >>> : > >> >>>> > >> >>>> Dear all. I am trying to replace bad channels. > >> >>>> This is my code (very basic I think):%% Preparing neighbours for > >> >>>> channel > >> >>>> repair > >> >>>> > >> >>>> > >> >>>> > >> >>>> cfg_neighb = []; > >> >>>> > >> >>>> cfg_neighb.feedback = 'yes'; > >> >>>> > >> >>>> cfg_neighb.method = 'triangulation'; > >> >>>> > >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; > >> >>>> > >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> >>>> > >> >>>> > >> >>>> > >> >>>> % Interpolate and put into new data structure > >> >>>> > >> >>>> cfg = []; > >> >>>> > >> >>>> cfg.badchannel = {}; > >> >>>> > >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >> >>>> > >> >>>> cfg.method = 'nearest'; > >> >>>> > >> >>>> cfg.neighbours = neighbours; > >> >>>> > >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> >>>> > >> >>>> > >> >>>> I do not get any error but fieldtrip even tells me that the > >> >>>> interpolation > >> >>>> worked. However I do not see ANY trace of it in my data when > >> >>>> inspecting it > >> >>>> afterwards. I also tried to change the method (to average) - no > >> >>>> change. > >> >>>> Anybody who can help me with that? > >> >>>> Thanks a million > >> >>>> Katrin > >> >>>> > >> >>>> > >> >>>> > >> >>>> _______________________________________________ > >> >>>> 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 > _______________________________________________ > 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 Tue Aug 19 10:26:58 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 19 Aug 2014 10:26:58 +0200 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hi Isaiah, could you check which FT-Version & Matlab-Version you are using? I just checked it and it seems to work fine (on Matlab 2011b). Also, could you post the output from calling "mri" and "mri.hdr"? 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: > Hello, > > I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. > > mri = ft_read_mri('Subject01.mri'); > > disp(mri.hdr.fiducial.mri) > nas: [87 60 116] > lpa: [29 145 155] > rpa: [144 142 158] > Reference to non-existent field 'hdr'. > > I cannot display. Am I missing a prior step? > > Best, > Isaiah Smith > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Aug 19 10:54:52 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 19 Aug 2014 08:54:52 +0000 Subject: [FieldTrip] ft_channelrepair shows no effect at all In-Reply-To: References: , Message-ID: I'm just going to chime in and say that Matlab 2014a has been causing issues for me in other toolboxes too, do you definitely are not alone! Eelke is awesome :) Sent from my iPhone On 19 Aug 2014, at 5:39 pm, "KatrinH Heimann" > wrote: Eelke! I am sure your name translates in Angel actually! Now everthing works!!! And so easily! The version I reinstalled is Matlab R2012a. I had R 2014a for some weeks, but loads of things did not work with that... Thanks a million for your help, really! Katrin 2014-08-19 9:14 GMT+02:00 Eelke Spaak >: Hi Katrin, Hmm, the MATLAB version difference points to a potential bug in the code. Could you tell me which version it now works on, and which version it did not work on earlier? ICA not working on your repaired data makes sense, and the cause is in fact pretty much what you mentioned yourself. The data in the repaired channels are now linear combinations (i.e. weighted sums) of the data in other channels, so the rank of your data (number of orthogonal data vectors) is now smaller than the number of channels. In other words, your data is rank deficient. ICA does not work properly on rank-deficient data. There are a few solutions to this. I would not recommend including the bad channels in the ICA. Your second suggestion would be better: compute ICA on the data without the bad channels, then interpolate them after backprojecting to channel space. A third option would be to reduce the dimensionality of the ICA input data to its 'true' dimensionality. If you specify cfg.numcomponent = N when calling ft_componentanalysis, the data will first undergo PCA, keeping N dimensions. In your case you would need to set N to be maximally the number of recorded channels minus the number of interpolated ones. This third option is probably the easiest and best way to go. Lastly, the fact that ICA still works if you repair the channels in other software is possibly due to this other software applying some form of non-linear algorithm to repair the channels. In that case the rank of your data might not be altered. Best, Eelke On 19 August 2014 00:09, KatrinH Heimann > wrote: > Dear Eelke, > > ok, so i installed an older version of matlab (which also solved some other > problems with fieldtrip) and now it works. However I am running into another > problem with it. Maybe you can help too: > If I try to run the ICA after the bad channel replacement it takes hours and > wchange just does not get lower. In my naive thinking I thought that might > be due to the fact that the replaced channels are recognized as > interpolations of the others??? But what could I do otherwise?: I thought > about doing the bcr later, but that means that my ica suffers from all the > electrode jumps from my bad channels. or I just exclude them from the ica - > but how to proceed then: apply the reject component function on the data > without the channels and then replace them? sorry, I am just a bit lost. The > weirdest thing is: if I replace the channels with the help of another > software before even processing the data, the ica works perfectly later in > fieldtrip. WHY???? > Would be wonderful if you could give me another hand... Thanks so much in > advance!!! > Katrin > > > 2014-08-18 10:18 GMT+02:00 Eelke Spaak >: > >> Dear Katrin, >> >> When I look at the data you've shown me, in fact I do see an effect of >> ft_channelrepair. I run your code: >> >> load ('ERP_Francesca17obs90_clean.mat') >> >> %% Preparing neighbours for channel repair >> >> cfg_neighb = []; >> cfg_neighb.feedback = 'yes'; >> cfg_neighb.method = 'triangulation'; >> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> neighbours = ft_prepare_neighbours(cfg_neighb, obs90_data_clean2); >> >> % Interpolate and put into new data structure >> cfg = []; >> cfg.badchannel = {'E49', 'E68'}; >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> cfg.method = 'nearest'; >> cfg.neighbours = neighbours; >> obs90_data_channelrepaired = ft_channelrepair(cfg,obs90_data_clean2); >> >> followed by: >> >> dat1=obs90_data_clean2; >> dat2=obs90_data_channelrepaired; >> >> x=dat1.trial{1}(68,:); % 68 is channel index of E68 >> y=dat2.trial{1}(68,:); >> plot(x);hold on;plot(y,'r'); >> >> x=dat1.trial{1}(49,:); >> y=dat2.trial{1}(49,:); >> figure; >> plot(x);hold on;plot(y,'r') >> >> and the two figures that come up are shown in the attachments. The >> original (blue) and channel-repaired (red) traces are clearly >> different. These plots are for trial 1, but the same result holds when >> I plot a different trial. >> >> Does it work on your end too now? >> >> Best, >> Eelke >> >> On 14 August 2014 08:57, Eelke Spaak > wrote: >> > OK just checking :) In that case, could you post a small snippet of >> > data and the actual cfg you used (including which channels to repair) >> > on e.g. dropbox or so? Then I can have a look. >> > >> > Best, >> > Eelke >> > >> > On 13 August 2014 22:12, KatrinH Heimann > >> > wrote: >> >> Dear Eelke, yes, sure, sorry, I did that. No effect. >> >> >> >> >> >> 2014-08-13 21:55 GMT+02:00 Eelke Spaak >: >> >> >> >>> Dear Katrin, >> >>> >> >>> Have you tried putting the labels of the channels you want >> >>> interpolated >> >>> into the cfg.badchannel array? >> >>> >> >>> Best, >> >>> Eelke >> >>> >> >>> Op 13 aug. 2014 19:24 schreef "KatrinH Heimann" >> >>> >: >> >>>> >> >>>> Dear all. I am trying to replace bad channels. >> >>>> This is my code (very basic I think):%% Preparing neighbours for >> >>>> channel >> >>>> repair >> >>>> >> >>>> >> >>>> >> >>>> cfg_neighb = []; >> >>>> >> >>>> cfg_neighb.feedback = 'yes'; >> >>>> >> >>>> cfg_neighb.method = 'triangulation'; >> >>>> >> >>>> cfg_neighb.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>> >> >>>> >> >>>> >> >>>> % Interpolate and put into new data structure >> >>>> >> >>>> cfg = []; >> >>>> >> >>>> cfg.badchannel = {}; >> >>>> >> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>> >> >>>> cfg.method = 'nearest'; >> >>>> >> >>>> cfg.neighbours = neighbours; >> >>>> >> >>>> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >>>> >> >>>> >> >>>> I do not get any error but fieldtrip even tells me that the >> >>>> interpolation >> >>>> worked. However I do not see ANY trace of it in my data when >> >>>> inspecting it >> >>>> afterwards. I also tried to change the method (to average) - no >> >>>> change. >> >>>> Anybody who can help me with that? >> >>>> Thanks a million >> >>>> Katrin >> >>>> >> >>>> >> >>>> >> >>>> _______________________________________________ >> >>>> 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 _______________________________________________ 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 tyler.grummett at flinders.edu.au Wed Aug 20 04:47:14 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Wed, 20 Aug 2014 02:47:14 +0000 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) Message-ID: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> Hello fieldtrip experts, I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. I have tried multiplying the source.avg.mom by the source.leadfield. I wont clutter the email with code, however I can once requested. I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. Any help would be greatly appreciated. Tyler Sent from my iPad From eelke.spaak at donders.ru.nl Wed Aug 20 14:29:00 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 20 Aug 2014 14:29:00 +0200 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) In-Reply-To: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> References: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au> Message-ID: Hi Tyler, Beamforming is a scanning method, which means that the power/current density at each grid point is estimated independently from all other grid points. In general one would not expect sum_i(leadfield_ix * pow_i), where i indexes grid points, to faithfully reproduce the potential measured at sensor x. This as opposed to something like e.g. minimum-norm estimate, where the estimation is done in one regression-like step, rather than by scanning grid points. Best, Eelke On 20 August 2014 04:47, Tyler Grummett wrote: > Hello fieldtrip experts, > > I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. > > I have tried multiplying the source.avg.mom by the source.leadfield. > I wont clutter the email with code, however I can once requested. > > I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. > > Any help would be greatly appreciated. > > Tyler > > Sent from my iPad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Wed Aug 20 14:54:47 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Wed, 20 Aug 2014 12:54:47 +0000 Subject: [FieldTrip] reconstructing EEG using leadfield (Beamformer) In-Reply-To: References: <7FB982E5-0EB9-4F5E-8027-91E96C4A2BC6@flinders.edu.au>, Message-ID: <3E2D3E20-2A83-4ABC-BADC-FB53DD7651C4@flinders.edu.au> Thank you clearing that up eelke :) Tyler Sent from my iPhone > On 20 Aug 2014, at 10:03 pm, "Eelke Spaak" wrote: > > Hi Tyler, > > Beamforming is a scanning method, which means that the power/current > density at each grid point is estimated independently from all other > grid points. In general one would not expect sum_i(leadfield_ix * > pow_i), where i indexes grid points, to faithfully reproduce the > potential measured at sensor x. This as opposed to something like e.g. > minimum-norm estimate, where the estimation is done in one > regression-like step, rather than by scanning grid points. > > Best, > Eelke > >> On 20 August 2014 04:47, Tyler Grummett wrote: >> Hello fieldtrip experts, >> >> I was just wondering how you would reconstruct EEG using the leadfield, to try and verify how well it is modelling the data. >> >> I have tried multiplying the source.avg.mom by the source.leadfield. >> I wont clutter the email with code, however I can once requested. >> >> I had a look at the spectra of the EEG and the spectra of the reconstructed EEG and they look quite different. >> >> Any help would be greatly appreciated. >> >> Tyler >> >> Sent from my iPad >> _______________________________________________ >> 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 jingfan.jf at gmail.com Wed Aug 20 16:03:51 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Wed, 20 Aug 2014 09:03:51 -0500 Subject: [FieldTrip] undefined function or variable 'abort' error when trying to run ft_definetrial(cfg) Message-ID: <002101cfbc7f$92d84830$b888d890$@gmail.com> Hi there, I am new to fieldtrip. I am trying the trigger-based trial selection tutorial. An error occurs when running cfg = ft_definetrial(cfg). In ft_preamble function, I couldn't find where abort is defined. I appreciate any help! Best, Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Wed Aug 20 16:23:46 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 20 Aug 2014 17:23:46 +0300 Subject: [FieldTrip] MNE Source Reconstruction Sanity Check In-Reply-To: <53D1FD3B.7040600@donders.ru.nl> References: <346147900.8004488.1406126123454.JavaMail.root@sculptor.zimbra.ru.nl> <790E6AB9-6372-4F70-9B98-2DE6E084F552@donders.ru.nl> <53D1FD3B.7040600@donders.ru.nl> Message-ID: Dear fieldtrippers, dear Jörn, I am currently trying to use the standard BEM head model provided in the fieldtrip toolbox (on a 19 electrodes EEG recording, segmented into 10-seconds trials, not time-locked), but I have encountered a problem I could not resolve: Error using svd Input to SVD must not contain NaN or Inf. Error in pinv (line 29) [U,S,V] = svd(A,0); Error in pinv (line 27) X = pinv(A',varargin{:})'; Error in minimumnormestimate (line 151) w = pinv(lf); Error in ft_sourceanalysis (line 876) dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); Following some old posts in the mailing list I made sure the electrodes data structure of the data is the same as that given in the cfg of ft_sourceanalysis. However, it is still possible that using a 19 electrodes recording is not possible using the source model I am using? I am also afraid computing the source reconstruction on such continuous data, that is not time-locked, could be a problem. For example, having to calculate the “avg” field artificially seems a little fishy. I also tried running the code on the EEG data of the continuous data preprocessing tutorial (after choosing only 19 of its electrodes, though possibly not the right ones). Any advice would be greatly appreciated! Thank you all, Roey THE CODE --------------- % Load head model, “vol” hdmfile = fullfile(which('standard_bem.mat')); load(hdmfile); % Create grid gridcfg = []; gridcfg.grid.xgrid = -20:1:20; gridcfg.grid.ygrid = -20:1:20; gridcfg.grid.zgrid = -20:1:20; gridcfg.grid.unit = 'cm'; gridcfg.grid.tight = 'yes'; gridcfg.inwardshift = -1.5; gridcfg.vol = vol; gridVar = ft_prepare_sourcemodel(gridcfg); % Restrict source reconstruction to outside of the cerrebellum gridVar = getRidOfCerrebellum([], gridVar); % Source reconstruction slcfg = struct; slcfg.method = ‘mne’; slcfg.elec = data.elec; slcfg.grid = gridVar; slcfg.vol = vol; slcfg.rawtrial = 'yes'; slcfg.hdmfile = hdmfile; slcfg.mne.lambda = '5%'; slcfg.keepfilter = 'yes'; slcfg.rawtrial = 'no'; % this is because we are now just computing the spatial filter slcfg.singletrial = 'no'; slcfg.keeptrials = 'yes'; % calculate the avg of each trial, for use in ft_sourceanalysis for trialI = 1:length(data.trial) data.avg(:,trialI) = mean(data.trial{trialI}')'; end source_for_filter = ft_sourceanalysis(slcfg, data); %this source structure is used to compute the filter to be used later On Fri, Jul 25, 2014 at 9:46 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Dear Roey, > > I agreet that this is a bad idea - independently of what result you will > get, the error is just too big to draw any reliable conclusions. Imho, you > can better try using ICA to decompose your data into components. > > Concerning the headmodel, there is a standard BEM headmodel template > available in FieldTrip. > > Best, > Jörn > > > On 7/24/2014 8:50 PM, Roey Schurr wrote: > >> Dear Jim, >> Thank you for drawing my attention to this problem. I have actually tried >> building a realistic head model using OPENMEG but encountered some >> compitability problems since our lab does not use Linux. This is indeed one >> of the most important (short) future tasks - being able to use such >> realistic head models. >> Best, >> roey >> >> >> On Thu, Jul 24, 2014 at 6:34 PM, E688205 > > wrote: >> >> Dear Roey, >> >> To add to Diego's comments, since you are dealing with EEG data a >> single sphere headmodel is not a good idea because it does not >> take into account the differences in conductivity between the >> skull, scalp, and brain. This is not a problem for MEG but is >> important for EEG. Therefore it is better to use, for example, a >> BEM head model. >> >> Best, >> >> Jim >> >> On 23 jul. 2014, at 16:38, "Lozano Soldevilla, D. (Diego)" >> > > wrote: >> >> Dear Roey, >>> >>> In my opinion it's definitely not a good idea to compute MNE >>> using 19 sensors. There are studies that have found a drastic >>> localization precision from 31 to 63 electrodes and further >>> improvements till 123: >>> >>> http://www.ncbi.nlm.nih.gov/pubmed/15351361 (see figure 1) >>> http://www.ncbi.nlm.nih.gov/pubmed/12495765 >>> >>> Although it's very difficult to know the "minimum" number of >>> electrodes needed to accurately localize a given source (it >>> depends on the strength of the source you want to localize, >>> source reconstruction algorithm, data noise...), 19 electrodes >>> are too low to trust the results you can get. >>> >>> best, >>> >>> Diego >>> >>> >>> ------------------------------------------------------------ >>> ------------ >>> From roeysc atgmail.com Mon Jul 21 11:21:32 >>> 2014 >>> From: roeysc atgmail.com (Roey Schurr) >>> >>> Date: Mon, 21 Jul 2014 12:21:32 +0300 >>> Subject: [FieldTrip] MNE Source Reconstruction Sanity Check >>> Message-ID: >> mail.gmail.com >> AQ_W43cHF_8J2b+rNyzd55x4aRviw at mail.gmail.com>> >>> >>> >>> Dear fieldtrippers, >>> >>> >>> >>> I want to do a sanity check on mne source reconstruction. >>> >>> I'm working on continuous EEG recordings (19 electrodes), estimating >>> the >>> source reconstruction activity using the *mne* (minimum norm >>> estimate) >>> method, a *template MRI* (Colin27) and a *singlesphere* headmodel. >>> As a >>> sanity check for the source reconstruction itself, I wanted to >>> compare >>> conditions in which I could estimate the loci of significant >>> changes, e.g.: >>> rest vs movement of the hand, moving the right hand vs the left >>> hand, etc. >>> I have about 60 seconds of recording for each condition. >>> >>> >>> >>> What I did was: >>> >>> 1) Segment the recording of each condition into many "trials" of 2 >>> seconds >>> each. >>> >>> 2) For each trial, average the activity in each of the 90 ROIs of >>> the aal >>> atlas (I excluded the cerebellum from the source reconstruction). >>> >>> >>> >>> I was wondering what comparison would be best in this case. Since >>> this is >>> not Evoked Responses data, I find it hard to find relevant ideas, >>> and would >>> like to hear your thoughts. >>> >>> >>> >>> 1) I did a frequency analysis (mtmfft) in conventional bands of >>> interest >>> and ran ft_freqstatistics on the resulting structures (using ttest2 >>> and the >>> bonferoni correction for the multiple comparison problem). This gave >>> some >>> results, however for most conditions they are not very encouraging >>> (the >>> ROIs that showed significant differences were not close to those >>> that I >>> have assumed). >>> >>> >>> >>> *QUESTION 1*: do you think this is a proper method? Note that I did >>> not use >>> a frequency based source reconstruction in the first place, because >>> I'm >>> ultimately interested in the time course in the source space. >>> >>> >>> >>> 2) I was wondering if a cluster based permutation test is impossible >>> to use >>> here, since this is a continuous recording, so clustering according >>> to time >>> adjacency seems irrelevant. >>> >>> >>> >>> *QUESTION 2*: is it possible to use a cluster based statistical test >>> here? >>> If so, it could be better than a-priori averaging the source >>> activity in >>> the atlas ROIs, which could mask some of the effects, if they are >>> located >>> in a small area. >>> >>> >>> >>> 3) Another possibility is looking at the data itself. Unfortunately I >>> encountered some problems using ft_sourcemovie, though this is a >>> subject >>> for a different thread. >>> >>> >>> >>> Any thoughts and advice are highly appreciated! >>> >>> Thank you for taking the time, >>> >>> roey >>> _______________________________________________ >>> >>> 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 >> > > > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Wed Aug 20 21:55:37 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 20 Aug 2014 19:55:37 +0000 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hello Julian, Thanks for the help. I am using MATLAB 2014a, and I am using my own mri, and locations. FieldTrip is up to date as well. The result is below.[cid:889764B9-93C3-4878-B240-9029C6836FAA at host.ucla.edu] I am trying to move the electrodes slightly. When I follow the steps on the website. >> disp(mri.hdr.fiducial.mri) Reference to non-existent field 'HDR'. Isaiah On Aug 19, 2014, at 1:26 AM, Julian Keil > wrote: Hi Isaiah, could you check which FT-Version & Matlab-Version you are using? I just checked it and it seems to work fine (on Matlab 2011b). Also, could you post the output from calling "mri" and "mri.hdr"? 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: Hello, I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. mri = ft_read_mri('Subject01.mri'); disp(mri.hdr.fiducial.mri) nas: [87 60 116] lpa: [29 145 155] rpa: [144 142 158] Reference to non-existent field 'hdr'. I cannot display. Am I missing a prior step? Best, Isaiah Smith _______________________________________________ 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: Screen Shot 2014-08-20 at 12.48.14 PM.png Type: image/png Size: 40529 bytes Desc: Screen Shot 2014-08-20 at 12.48.14 PM.png URL: From julian.keil at gmail.com Thu Aug 21 09:15:39 2014 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 21 Aug 2014 09:15:39 +0200 Subject: [FieldTrip] Aligning Electrodes In-Reply-To: References: Message-ID: Hi Isaiah, so you are having trouble using your own MRI, right? Have you tried the example-MRI that comes with the tutorial or the standard mri found in the templates-folder? Depending on your MRI-machine you might not actually get any header info (which is stored in .hdr). For example, with the Simens Verio which I use here, I get DICOM files which contain a .hdr when read into field trip, however the .hdr field does not contain any information on the fiducials. So, in order to realign your EEG-Electrodes and the MRI without the fiducials, you need to use the ft_electroderealign-function with cfg.method = interactive. You also need to take some steps before that, i.e. you need to realign your MRI (ft_volumerealign), segment the MRI (ft_volumesegment) and create a head model (ft_prepare_headmodel). From your plot I guess that you already have the head model and EEG-Electrodes, so you can use the code from the example script (http://fieldtrip.fcdonders.nl/example/align_eeg_electrode_positions_to_bem_headmodel): % align interactive to surface of headmodel stored in vol.bnd cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = vol.bnd(1); elec_new = ft_electroderealign(cfg); Good luck, in case you're still having trouble I can also send you a copy of my personal script I use to create head models. Julian Am 20.08.2014 um 21:55 schrieb Isaiah C. Smith: > Hello Julian, > > Thanks for the help. I am using MATLAB 2014a, and I am using my own mri, and locations. FieldTrip is up to date as well. The result is below. > I am trying to move the electrodes slightly. > > When I follow the steps on the website. > >> disp(mri.hdr.fiducial.mri) > Reference to non-existent field 'HDR'. > > Isaiah > On Aug 19, 2014, at 1:26 AM, Julian Keil wrote: > >> Hi Isaiah, >> >> could you check which FT-Version & Matlab-Version you are using? >> I just checked it and it seems to work fine (on Matlab 2011b). >> Also, could you post the output from calling "mri" and "mri.hdr"? >> >> 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 18.08.2014 um 23:52 schrieb Isaiah C. Smith: >> >>> Hello, >>> >>> I am trying to realign the electrodes that I have, and I am going along with the cook book, but I keep getting an error. >>> >>> mri = ft_read_mri('Subject01.mri'); >>> >>> disp(mri.hdr.fiducial.mri) >>> nas: [87 60 116] >>> lpa: [29 145 155] >>> rpa: [144 142 158] >>> Reference to non-existent field 'hdr'. >>> >>> I cannot display. Am I missing a prior step? >>> >>> Best, >>> Isaiah Smith >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Fri Aug 22 11:01:14 2014 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Fri, 22 Aug 2014 11:01:14 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR Message-ID: Hi All, I want to have a TFR plot that has the same portion for : - alpha (7-15 Hz) - beta (15-30 Hz) - low gamma (30-60 Hz) - high gamma (60-120 Hz) Since those bands have exponential frequency steps, I could only see very small part of alpha and (too) many high gamma band. Is there a way to make the cfg.foi in fieldtrip to have non linear steps? I tried to insert a exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); But fieldtrip seems only detect first and last number and make linear steps out of it. Thank you in advance for any help and share! Sandhy -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Fri Aug 22 11:13:22 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Fri, 22 Aug 2014 11:13:22 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: References: Message-ID: Hey Sandhy, Try, cfg.foi = [7:30, 30:5:60, 60:10:120]; Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. Is this what you need? -- Regards, Kousik Sarathy, S On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < prasandhya.a.yusuf at gmail.com> wrote: > Hi All, > > I want to have a TFR plot that has the same portion for : > - alpha (7-15 Hz) > - beta (15-30 Hz) > - low gamma (30-60 Hz) > - high gamma (60-120 Hz) > > Since those bands have exponential frequency steps, I could only see very > small part of alpha and (too) many high gamma band. Is there a way to make > the cfg.foi in fieldtrip to have non linear steps? I tried to insert a > exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); > But fieldtrip seems only detect first and last number and make linear > steps out of it. > > Thank you in advance for any help and share! > > Sandhy > > _______________________________________________ > 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 d.lozanosoldevilla at fcdonders.ru.nl Fri Aug 22 13:08:34 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Fri, 22 Aug 2014 13:08:34 +0200 (CEST) Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: Message-ID: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> Hi Sandhy , Could you please tell us a bit more info about how do you compute your TFR ? Your problem sounds to me as your data length does not match the frequency you're asking: http :// fieldtrip . fcdonders . nl / faq /why_does_my_output.freq_not_match_my_ cfg . foi _when_using_wavelet_formerly_ wltconvol _in_ft_ freqanalyis http :// fieldtrip . fcdonders . nl / faq /why_does_my_output.freq_not_match_my_ cfg . foi _when_using_ mtmconvol _in_ft_ freqanalyis If you want to space frequency logarithmically, I'd recommend you to change the y-axes scale to log-scale after the TFR . Alternatively, other people approach the frequency resolution modifying the wavelets. You can make a modified wavelets with different number of cycles per frequency although this approach it's more vulnerable to spectral leakage. This is because the wavelet at particular frequency wont fit an interger number of cycles : cfg = []; cfg .output = 'pow' ; cfg .channel = 'MEG' ; cfg .method = 'mtmconvol' ; cfg .taper = 'hanning' ; cfg . foi = 2:1:50; cfg .t_ ftimwin = linspace (3,37.5,size( cfg . foi ,2))./ cfg . foi ; cfg . toi = -0.5:0.05:1.5; freq = ft_ freqanalysis ( cfg , data); I hope it helps, Diego ----- Original Message ----- > From: " kousik sarathy " < sarathykousik @ gmail .com> > To: " FieldTrip discussion list" < fieldtrip @science. ru . nl > > Sent: Friday, 22 August, 2014 11:13:22 AM > Subject: Re: [ FieldTrip ] Non linear frequency steps in TFR > Hey Sandhy , > Try, > cfg . foi = [7:30, 30:5:60, 60:10:120]; > Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. > Is this what you need? > -- > Regards, > Kousik Sarathy , S > On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < > prasandhya .a. yusuf @ gmail .com > wrote: > > Hi All, > > I want to have a TFR plot that has the same portion for : > > - alpha (7-15 Hz) > > - beta (15-30 Hz) > > - low gamma (30-60 Hz) > > - high gamma (60-120 Hz) > > Since those bands have exponential frequency steps, I could only see > > very small part of alpha and (too) many high gamma band. Is there a > > way to make the cfg . foi in fieldtrip to have non linear steps? I > > tried to insert a exponential function: cfg . foi = > > 0.5*exp(0.6931*(3.8:0.02:7.9)); > > But fieldtrip seems only detect first and last number and make > > linear > > steps out of it. > > Thank you in advance for any help and share! > > Sandhy > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip @ donders . ru . nl > > http ://mailman.science. ru . nl /mailman/ listinfo / fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip @ donders . ru . nl > http ://mailman.science. ru . nl /mailman/ listinfo / fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http :// www . ru . nl /people/ donders /lozano-soldevilla-d/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Aug 22 16:56:57 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 22 Aug 2014 16:56:57 +0200 Subject: [FieldTrip] normalization of already baselinecorrected EEG data Message-ID: Dear all, I have again a rather conceptual question: I just did all the steps until timelock with a set of 20 subjects. Now i realized (far too late) that the baseline I chose in the preprocessing was not ideal (it is before stimulusonset but actually not before the point 0 of my ERP analysis as that is within the stimulus). Is there anything I can do about that without repeating all steps for all subjects? could I baseline correct again? Or do a z score of the single trials(would make sense as I have a strong intersubject variability too) Every advice is appreciated! Best Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.grova at mcgill.ca Fri Aug 22 21:04:15 2014 From: christophe.grova at mcgill.ca (Christophe Grova) Date: Fri, 22 Aug 2014 19:04:15 +0000 Subject: [FieldTrip] Postdoctoral and/or MSc/PhD positions available in the Multimodal Functional Imaging Lab in Montreal Message-ID: <9E1647EDA3EBB44AADA162CEC4C4222E3CAF7741@exmbx2010-9.campus.MCGILL.CA> Postdoctoral and/or MSc/PhD positions available at Concordia University in the Multimodal Functional Imaging Lab I am pleased to announce that I am currently looking for a Postdoctoral fellow and/or M.Sc./PhD students to join my lab, the Multimodal Functional Imaging lab. The candidates will join a multidisciplinary team composed of neurologists and methodologists within the Multimodal Functional Imaging Laboratory. This laboratory directed by Pr. Grova is based on two sites: (i) Physics Dpt at Concordia University and PERFORM center, (ii) Biomedical Engineering Dpt and part of the epilepsy group of the Montreal Neurological Institute, McGill University. Both environments offer unique platforms with access to several modalities (simultaneous high-density EEG/fMRI, MEG, simultaneous EEG/NIRS, TMS, SPECT/CT, PET/CT). The candidates will notably have access to the brand new multimodal imaging platform of PERFORM center, dedicated to neuroscience studies over large cohort of subjects (effect of age, exercising, ...), whereas clinical applications during the presurgical investigation of patients with epilepsy will be primarly based at the Montreal Neurological Institute. The main expertise of the team is the development and the validation of source localization methods dedicated for EEG, MEG and NIRS as well as multimodal characterization of brain activity and especially resting state functional connectivity. Project 1: Multimodal characterization of resting state functional connectivity The main originality of this project is to consider frequency-based source localization of EEG and MEG data, using notably wavelet-based Maximum on the Mean (Lina et al IEEE TBME 2012) in order to investigate resting state functional connectivity from simultaneous EEG/MEG data and simultaneous high-density EEG/fMRI data. These multimodal data will be considered in order to investigate the dynamic of resting state functional connectivity patterns in healthy controls and patients with epilepsy. Project 2: Multimodal assessement of the integrity of the neuromuscular coupling The main originality of this project is a complete multimodal investigation of neurovascular coupling processes involving EEG/MEG, EEG/fMRI and EEG/NIRS data. Neurovascular coupling during excitation and inhibition will be analyzed either in healthy conditions during well-controlled paradigms (e.g. finger tapping, electrical median nerve stimulation, TMS stimulations) or in resting state conditions and notably at the time of transient epileptic activity. One of the main objective will consist in assessing the integrity of the neurovascular coupling processes in these conditions. Developpments will involve statistical analysis of NIRS signal, 3D tomographic reconstruction of EEG and NIRS data, evaluation of neurovascular coupling models. Supervisor: Christophe Grova Ph.D. Assistant Professor, Physics Dpt and PERFORM, Concordia University, Montreal, Canada Adjunct Professor, Biomedical Engineering and Neurology & Neurosurgery dpts, McGill University, Montreal, Canada Director of the Multimodal Functional Imaging Laboratory Email: christophe.grova at concordia.ca christophe.grova at mcgill.ca Requirements: The candidate should have expertise in image and signal processing, involving notably one or few of the modalities mentioned. Computational skills including neuroimaging softwares and Matlab are important additional qualifications. Experience in the field of epilepsy will be appreciated Please send your CV and motivation letter before Sept. 20th 2014 to christophe.grova at concordia.ca Cordially Christophe Grova *************************** Christophe Grova, PhD Assistant Professor, Physics Dpt, Concordia University PERFORM centre, Concordia University Adjunct Prof in Biomedical Engineering, and Neurology and Neurosurgery Dpt, McGill University Multimodal Functional Imaging Lab (Multi FunkIm) Montreal Neurological Institute - epilepsy group Centre de Recherches en Mathématiques Biomedical Engineering Department - Room 304 McGill University 3775 University Street, Montreal, Quebec, Canada, H3A 2B4 email : christophe.grova at concordia.ca , christophe.grova at mcgill.ca tel : (514) 398 2516 fax : (514) 398 7461 web: Physics, Concordia University: http://physics.concordia.ca/facultyandresearch/bios/grova.php McGill University: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/PeopleChristophe MultiFunkIm Lab: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/HomePage *************************** [X] -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Aug 22 22:33:18 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 22 Aug 2014 22:33:18 +0200 Subject: [FieldTrip] example for nonparametric permutation anova using ft_statfun_depsamplesF? Message-ID: Dear all, I would like to replicate the results of a study using exactly what they used. I need to do a nonparametric permutation anova (repeated measures) of ERP data with 2 levels of Hemisphere, 4 levels of ROI and 3 levels of Time (windows). Could somebody post an example of such an analysis? I can't figure out how to determine the different levels by the cfg structure etc. Thanks a million Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.barcelo at uib.es Sat Aug 23 00:33:59 2014 From: f.barcelo at uib.es (Francisco Barcelo) Date: Sat, 23 Aug 2014 00:33:59 +0200 Subject: [FieldTrip] PhD and Postdoctoral positions in Majorca, Spain Message-ID: One PhD and one Postdoctoral research positions are available at the Department of Psychology (University of Balearic Islands, Spain) to join an ongoing project on the Cognitive neuroscience of executive control aimed to assess functional and effective connectivity (e.g., Dynamic Causal Modeling) in M/EEG data sets from healthy controls and brain injured patients. The project aims to develop state-of-the-art neuropsychological tools for a more valid and cost-effective evaluation of dysexecutive symptoms in elderly adults and patients with frontal lobe lesions (cf., Barceló & Knight, Cereb. Cortex, 2007; Nyhus & Barceló, Brain & Cognition, 2009). Successful pre/postdoctoral candidates will hold a MSc/PhD in Psychology, Biology, Cognitive Neuroscience, Physics, or related fields, and will play a key role in designing, conducting, analyzing and reporting M/EEG studies, with a focus on event-related potentials, oscillatory neural activity and synchrony. Candidates will be fluent in English (knowledge of Spanish is not required), and will prove good interpersonal and communication skills, including writing to a high standard. Both positions are funded by the Spanish Government (MINECO’s grant PSI2013-44760-R), as well as other local research agencies. Requirements for the PhD student position: 1) EU citizenship; 2) a Master degree and excellent academic marks; 3) Programming skills (eg., Matlab will be a plus); and 4) Demonstrated ability and high motivation to conduct high-quality research publishable in quality international peer-reviewed journals. Requirements for the Postdoc position: 1) Strong background publishing EEG and/or MEG studies; 2) Advanced programming skills (eg., Matlab, C, Python); 3) Excellent command of EEG/MEG data analysis software (EEGLAB, SPM8, Brainstorm, etc); and 4) demonstrate creative and independent work. Applicants must submit an updated CV in pdf format, a letter of motivation, and the names and emails of two referees to the grant holder: Francisco Barceló (f.barcelo at uib.es). The PhD studentship is for 3 years, and the postdoc position is for one year, with the possibility of renewal. Starting date October 1st 2014, or until the positions are filled. Informal inquires are welcomed. For more information visit: www.mcst.es, or www.neuropsicologiaclinica.es. ><><><><><><><><><><><><><>< Francisco Barceló, PhD Full Professor of Neuropsychology University of Illes Balears (UIB) Ctra. Valldemossa, km 7.5 E-07122 Palma de Mallorca - Spain Personal: www.mcst.es Lab: www.neuropsicologiaclinica.es Phone: 971 172750 Fax: 971 172309 ><><><><><><><><><><><><><>< -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sat Aug 23 18:08:26 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sat, 23 Aug 2014 18:08:26 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! Message-ID: Dear all, my problems seem neverending. This time however i really need help. I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: computing average of avg over 19 subjects Warning: discarding electrode information because it cannot be averaged > In ft_timelockgrandaverage at 249 the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB computing average of avg over 2 subjects Warning: discarding electrode information because it cannot be averaged > In ft_timelockgrandaverage at 249 the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) I guess that there is a problem with the layout I use. Here the code that I use %For generating the layout (also in the single subjects): cfg = []; cfg.channel = obs_data.label; cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.feedback = 'yes'; lay = ft_prepare_layout(cfg); cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = lay; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); %For computing the grand average cfg = []; cfg.channel = 'all'; cfg.latency = 'all'; cfg.parameter = 'avg'; cfg.keepindividual = 'no' GA_90 = ft_timelockgrandaverage(cfg,all90{:}); GA_180 = ft_timelockgrandaverage(cfg,all180{:}); % "{:}" means to use data from all elements of the variable For plotting the significant clusters cfg = []; cfg.style = 'blank'; cfg.layout = lay; cfg.channellabels = 'yes'; cfg.highlight = 'labels'; cfg.highlightchannel = find(stat.mask); cfg.comment = 'no'; figure; ft_topoplotER(cfg, GA_90) title('Nonparametric: significant with cluster multiple comparison correction') Do you have ANY idea to this? I am really completely helpless.... thanks and best Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sun Aug 24 05:40:34 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sun, 24 Aug 2014 15:40:34 +1200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Try this one I use On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: > Dear all, my problems seem neverending. This time however i really need > help. > I implemented a pipeline for ERPs. All works now, trialdefinition, > preprocessing, channelreplacement, ica, componentrejection, final > artifactdetection, timelock of the single subject data. However, when I > wanna compute the grandaverage of the single subjects I get the following > error message: > > computing average of avg over 19 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the > additional allocation of an estimated 3 MB > computing average of avg over 2 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the > additional allocation of an estimated 0 MB > the call to "ft_prepare_layout" took 0 seconds and required the additional > allocation of an estimated 0 MB > the call to "ft_topoplotER" took 0 seconds and required the additional > allocation of an estimated 0 MB > > Furthermore in the plot of the significant clusters, the channelnames are > mixed up (do not correspond to my net) > > > I guess that there is a problem with the layout I use. > Here the code that I use > > %For generating the layout (also in the single subjects): > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = lay; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > > > %For computing the grand average > > cfg = []; > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > cfg.parameter = 'avg'; > > cfg.keepindividual = 'no' > > GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > > GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > > % "{:}" means to use data from all elements of the variable > > > > For plotting the significant clusters > > cfg = []; > > cfg.style = 'blank'; > > cfg.layout = lay; > > cfg.channellabels = 'yes'; > > cfg.highlight = 'labels'; > > cfg.highlightchannel = find(stat.mask); > > cfg.comment = 'no'; > > figure; ft_topoplotER(cfg, GA_90) > > title('Nonparametric: significant with cluster multiple comparison > correction') > > > Do you have ANY idea to this? I am really completely helpless.... > > thanks and best > > Katrin > > _______________________________________________ > 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 e.caspar at ucl.ac.uk Sun Aug 24 12:49:24 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Sun, 24 Aug 2014 10:49:24 +0000 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> Message-ID: <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Thank you for your answer. The complete error message I have is this one, but I'm not able to decrypt it. Error using filter_with_correction (line 44) Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter. Error in filter_with_correction (line 44) error('Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter.'); Error in ft_preproc_bandpassfilter (line 148) filt = filter_with_correction(B,A,dat,dir); Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); It only occurs when I ask for a bpfilterrange from .1 to 30, or any values lower than .9. Thanks! Emilie Le 11 août 2014 à 12:43, Eelke Spaak > a écrit : Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie > wrote: Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie _______________________________________________ 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 roeysc at gmail.com Sun Aug 24 13:47:55 2014 From: roeysc at gmail.com (Roey Schurr) Date: Sun, 24 Aug 2014 14:47:55 +0300 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Message-ID: Dear Emilie, Try reading this thread and see if it helps: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005360.html The bottom line is, if you want a low highpass filer, you need to change the order of the filter you're using. In the example in the thread above, using a filter of order 5 helped Philipp applying a 0.1 Hz highpass filter. So you could try using something like: cfg.hpfiltord = 5; Hope this helps! Roey On Sun, Aug 24, 2014 at 1:49 PM, Caspar, Emilie wrote: > Thank you for your answer. The complete error message I have is this one, > but I'm not able to decrypt it. > > Error using filter_with_correction (line 44) > Calculated filter coefficients have poles on or outside the unit circle > and will not be stable. Try a higher cutoff > frequency or a different type/order of filter. > > Error in filter_with_correction (line 44) > error('Calculated filter coefficients have poles on or outside the unit > circle and will not be stable. Try a > higher cutoff frequency or a different type/order of filter.'); > > Error in ft_preproc_bandpassfilter (line 148) > filt = filter_with_correction(B,A,dat,dir); > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > It only occurs when I ask for a bpfilterrange from .1 to 30, or any > values lower than .9. > > Thanks! > > Emilie > > > > Le 11 août 2014 à 12:43, Eelke Spaak a écrit > : > > Dear Emilie, > > The error message you include only specifies *where* in the code the > error happened, not *what* the actual error was. Could you include the > actual error as well? Perhaps someone can then help you fix it. (In > general there is no fixed lower limit on filter low-/highpass > frequency, although a practical limit could depend on your data.) > > Best, > Eelke > > On 9 August 2014 09:31, Caspar, Emilie wrote: > > Dear Fieldtrip members, > > I would like to apply to my data a bandpass filter from 0.016 (or at least > 0.1) to 30 Hz > > bpfilterRange = [.1 30]; > > However, it seems that Fieltrip doesn't accept small high-pass filter > values. I have the following mistake : > > > Error in preproc (line 299) > if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, > fsample, cfg.bpfreq, cfg.bpfiltord, > cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end > > Error in ft_preprocessing (line 559) > [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), > tim, cfg, begpadding, endpadding); > > Error in preprocessing_Libet (line 70) > allData_prepross = ft_preprocessing(cfg); > > I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, > which is quite high. > > I wonder if the problem comes from my data (but I had no problems on others > programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? > > Thank in advance, > > Emilie > > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Sun Aug 24 14:15:48 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Sun, 24 Aug 2014 14:15:48 +0200 Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences Message-ID: Dear all and Prof Maris, I'm re-posting this question again, as I didn't get any replies previously. I’m interested to investigate if there are any differences in phase synchronization in resting state data at timepoint 2 versus timepoint 1. The EEG data was collected using 64 EEG channels, resting state, eyes opened and eyes closed. I’ve arbitrarily segmented the resting state data into epochs of 2s each, and the epochs with artifacts are excluded completely from further analyses. I then performed mtmfft to get the fourier representation of the data, extracted the coherence, and compared the coherence difference of timepoint 2 versus timepoint 1 of all channels paired with all other channels. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to perform cluster-based statistical analyses. I get an output with ‘chan_chan’ dimord variable. However, I was not 100% sure that this is correct, hence, I’ve inserted my code (see below). It’ll be great if you could tell me if what I’m doing makes any sense at all. Also, I don’t know how I can plot the results to see if it make any sense at all. Also, I checked the values obtained from when I specified "cfg.channelcmb" and when I did not specify "cfg.channelcmb", I noticed that the values were somehow different. I would assume that the values to be similar, although I'm not sure why they would have differences in the values obtained from specifying "cfg.channelcmb". This is my code that I've used thus far: for sub = 1:5 cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; cfg.foilim = [0 100]; cfg.taper = 'dpss'; % find the index for the c200 condition pre_c200_idx = find(data5.trialinfo == 201); cfg.trials = pre_c200_idx; HLF_pre_c200 = ft_freqanalysis(cfg, data5); post_c200_idx = find(data5.trialinfo == 200); cfg.trials = post_c200_idx; HLF_post_c200 = ft_freqanalysis(cfg, data5); cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'coh'; HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_post_c200); end load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; cfg_neighb.channel = 'all'; neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); cfg = []; cfg.layout = lay; cfg.neighbours = neighbours; cfg.channel = 'all'; cfg.channelcmb = {cfg.channel, cfg.channel}; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.tail = 0; % cfg.clustertail = 0; cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency bands. cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; % for theta band cfg.avgoverfreq = 'yes'; cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), and gamma (40-100). [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, sub_HLF_pre_c200coh{:}); When I tried to plot the results, I used this code: cfg = []; cfg.channel = 'all'; cfg.layout = 'lay'; cfg.zlim = [-1 1]; cfg.alpha = 0.05; cfg.refchannel = 'all'; ft_clusterplot(cfg, diffc200_theta_stat); However, I was not sure how I could plot the results. I get an error message from Fieldtrip when using ft_clusterplot: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); According to your paper in 2007, the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, and I would really appreciate if you can show me how to make such a plot. Thank you very much. Kind regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Sun Aug 24 21:52:32 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 24 Aug 2014 21:52:32 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Dear Ana, dear all, the layout you used does not correspond to our nets. I tried the GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? Cheers Katrin 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > Try this one > I use > > > On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > wrote: > >> Dear all, my problems seem neverending. This time however i really need >> help. >> I implemented a pipeline for ERPs. All works now, trialdefinition, >> preprocessing, channelreplacement, ica, componentrejection, final >> artifactdetection, timelock of the single subject data. However, when I >> wanna compute the grandaverage of the single subjects I get the following >> error message: >> >> computing average of avg over 19 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the >> additional allocation of an estimated 3 MB >> computing average of avg over 2 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> the call to "ft_prepare_layout" took 0 seconds and required the >> additional allocation of an estimated 0 MB >> the call to "ft_topoplotER" took 0 seconds and required the additional >> allocation of an estimated 0 MB >> >> Furthermore in the plot of the significant clusters, the channelnames are >> mixed up (do not correspond to my net) >> >> >> I guess that there is a problem with the layout I use. >> Here the code that I use >> >> %For generating the layout (also in the single subjects): >> >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = lay; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >> >> %For computing the grand average >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.latency = 'all'; >> >> cfg.parameter = 'avg'; >> >> cfg.keepindividual = 'no' >> >> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >> % "{:}" means to use data from all elements of the variable >> >> >> >> For plotting the significant clusters >> >> cfg = []; >> >> cfg.style = 'blank'; >> >> cfg.layout = lay; >> >> cfg.channellabels = 'yes'; >> >> cfg.highlight = 'labels'; >> >> cfg.highlightchannel = find(stat.mask); >> >> cfg.comment = 'no'; >> >> figure; ft_topoplotER(cfg, GA_90) >> >> title('Nonparametric: significant with cluster multiple comparison >> correction') >> >> >> Do you have ANY idea to this? I am really completely helpless.... >> >> thanks and best >> >> Katrin >> >> _______________________________________________ >> 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 prasandhya.a.yusuf at gmail.com Mon Aug 25 15:00:09 2014 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Mon, 25 Aug 2014 15:00:09 +0200 Subject: [FieldTrip] Non linear frequency steps in TFR In-Reply-To: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> References: <199134982.8358973.1408705714157.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Hi Kousik Sarathy and Diego, thank you for your repply and suggestions! Thanks a lot for the Field Trip links Diego, it helps me to understand how Field Trip compute with wavelet. I thought field trip compute the wavelet the same way as cwt function in Matlab (using scales instead of frequencies). Yes, I think I need to consider the frequencies "available" from my computation and should be more aware of the spectral interpolation with vulnerable spectral leakage. I am still trying to play around with the parameters so I can get what I want. Cheers :) Sandhy On Fri, Aug 22, 2014 at 1:08 PM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Sandhy, > > Could you please tell us a bit more info about how do you compute your > TFR? Your problem sounds to me as your data length does not match the > frequency you're asking: > > > http://fieldtrip.fcdonders.nl/faq/why_does_my_output.freq_not_match_my_cfg.foi_when_using_wavelet_formerly_wltconvol_in_ft_freqanalyis > > http://fieldtrip.fcdonders.nl/faq/why_does_my_output.freq_not_match_my_cfg.foi_when_using_mtmconvol_in_ft_freqanalyis > > If you want to space frequency logarithmically, I'd recommend you to > change the y-axes scale to log-scale after the TFR. Alternatively, other > people approach the frequency resolution modifying the wavelets. You can > make a modified wavelets with different number of cycles per frequency > although this approach it's more vulnerable to spectral leakage. This is > because the wavelet at particular frequency wont fit an interger number of > cycles : > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:50; > cfg.t_ftimwin = linspace(3,37.5,size(cfg.foi,2))./cfg.foi; > cfg.toi = -0.5:0.05:1.5; > freq = ft_freqanalysis(cfg, data); > > I hope it helps, > > Diego > > ------------------------------ > > *From: *"kousik sarathy" > *To: *"FieldTrip discussion list" > *Sent: *Friday, 22 August, 2014 11:13:22 AM > *Subject: *Re: [FieldTrip] Non linear frequency steps in TFR > > > Hey Sandhy, > > Try, > cfg.foi = [7:30, 30:5:60, 60:10:120]; > > Alpha and beta in steps of 1 Hz, low gamma in steps of 5 Hz and so on. > > Is this what you need? > > > -- > Regards, > Kousik Sarathy, S > > > > On Fri, Aug 22, 2014 at 11:01 AM, Prasandhya Astagiri Yusuf < > prasandhya.a.yusuf at gmail.com> wrote: > >> Hi All, >> >> I want to have a TFR plot that has the same portion for : >> - alpha (7-15 Hz) >> - beta (15-30 Hz) >> - low gamma (30-60 Hz) >> - high gamma (60-120 Hz) >> >> Since those bands have exponential frequency steps, I could only see very >> small part of alpha and (too) many high gamma band. Is there a way to make >> the cfg.foi in fieldtrip to have non linear steps? I tried to insert a >> exponential function: cfg.foi = 0.5*exp(0.6931*(3.8:0.02:7.9)); >> But fieldtrip seems only detect first and last number and make linear >> steps out of it. >> >> Thank you in advance for any help and share! >> >> Sandhy >> >> _______________________________________________ >> 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 > > > > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > 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 e.caspar at ucl.ac.uk Mon Aug 25 15:11:59 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 25 Aug 2014 13:11:59 +0000 Subject: [FieldTrip] High-pass filter - 0.1 In-Reply-To: References: <72723464-5371-42BC-97B7-A0CFF6B06B57@live.ucl.ac.uk> <36D64EC6-56EF-4450-85C7-1E1DD14C032B@live.ucl.ac.uk> Message-ID: <86F3C645-6F78-449F-8576-2E3584CABA25@live.ucl.ac.uk> Thank you for your answer. I have found a solution with an order of 3 Thank you for the help :) Emilie Le 24 août 2014 à 13:47, Roey Schurr > a écrit : Dear Emilie, Try reading this thread and see if it helps: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005360.html The bottom line is, if you want a low highpass filer, you need to change the order of the filter you're using. In the example in the thread above, using a filter of order 5 helped Philipp applying a 0.1 Hz highpass filter. So you could try using something like: cfg.hpfiltord = 5; Hope this helps! Roey On Sun, Aug 24, 2014 at 1:49 PM, Caspar, Emilie > wrote: Thank you for your answer. The complete error message I have is this one, but I'm not able to decrypt it. Error using filter_with_correction (line 44) Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter. Error in filter_with_correction (line 44) error('Calculated filter coefficients have poles on or outside the unit circle and will not be stable. Try a higher cutoff frequency or a different type/order of filter.'); Error in ft_preproc_bandpassfilter (line 148) filt = filter_with_correction(B,A,dat,dir); Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); It only occurs when I ask for a bpfilterrange from .1 to 30, or any values lower than .9. Thanks! Emilie Le 11 août 2014 à 12:43, Eelke Spaak > a écrit : Dear Emilie, The error message you include only specifies *where* in the code the error happened, not *what* the actual error was. Could you include the actual error as well? Perhaps someone can then help you fix it. (In general there is no fixed lower limit on filter low-/highpass frequency, although a practical limit could depend on your data.) Best, Eelke On 9 August 2014 09:31, Caspar, Emilie > wrote: Dear Fieldtrip members, I would like to apply to my data a bandpass filter from 0.016 (or at least 0.1) to 30 Hz bpfilterRange = [.1 30]; However, it seems that Fieltrip doesn't accept small high-pass filter values. I have the following mistake : Error in preproc (line 299) if strcmp(cfg.bpfilter, 'yes'), dat = ft_preproc_bandpassfilter(dat, fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir, cfg.bpinstabilityfix); end Error in ft_preprocessing (line 559) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Error in preprocessing_Libet (line 70) allData_prepross = ft_preprocessing(cfg); I also tried with 0.2, 0.5, and the minimum acceptable I found was 0.9, which is quite high. I wonder if the problem comes from my data (but I had no problems on others programs) or if there is a way to apply 0.1 high-pass filter on Fieldtrip? Thank in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.marshall at fcdonders.ru.nl Mon Aug 25 17:15:23 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Mon, 25 Aug 2014 17:15:23 +0200 Subject: [FieldTrip] example for nonparametric permutation anova using ft_statfun_depsamplesF? In-Reply-To: References: Message-ID: <53FB530B.5080904@fcdonders.ru.nl> Hi Katrin, It sounds like what you want is a factorial ANOVA with 3 factors. Fortunately the feasibility, sense and implemenation of a permutation factorial ANOVA has been discussed a great deal on this mailing list. For some examples, see: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004280.html http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-September/003113.html http://mailman.science.ru.nl/pipermail/fieldtrip/2011-December/004578.html http://mailman.science.ru.nl/pipermail/fieldtrip/2010-November/003285.html http://mailman.science.ru.nl/pipermail/fieldtrip/2009-November/002485.html http://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005466.html http://mailman.science.ru.nl/pipermail/fieldtrip/2013-January/006029.html Hopefully something there should allow you to get started. Best of luck! Tom On 8/22/2014 10:33 PM, KatrinH Heimann wrote: > Dear all, > I would like to replicate the results of a study using exactly what > they used. I need to do a nonparametric permutation anova (repeated > measures) of ERP data with 2 levels of Hemisphere, 4 levels of ROI and > 3 levels of Time (windows). Could somebody post an example of such an > analysis? I can't figure out how to determine the different levels by > the cfg structure etc. > Thanks a million > Katrin > > > _______________________________________________ > 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 ktyler at swin.edu.au Tue Aug 26 02:57:27 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Tue, 26 Aug 2014 00:57:27 +0000 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer Message-ID: Hi all, I am raking through my script trying to sort out potential faults in my analysis. One issue I have come across is whether ft_timelock analysis should be performed once, or twice when using lcmv method of beamformer. The tutorial on lcmv beamfomer found here http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow seems to indicate that time-locking is only performed once only in the analysis pipeline. However, elsewhere on the FT site, I found the following advice: "In order for the beamformer to work, we need the covariance between sensor pairs. This should be the covariance of (a particular latency window) of the averaged single trials. This is essentially different from the average covariance of the single trials. Therefore, we have to call timelockanalysis more than once: the first time we obtain the evoked field, and the second time we obtain the covariance matrix/ces at interesting latency/ies" Which is correct? I have been time locking twice: using data sets which were already time-locked using ft_timelockanalysis, and then time locking again, prior to using ft_sourceanalysis........... Wrong? The phrase 'sanity check' comes up quite often on this list, and I absolutely understand! As always, any help is very much appreciated!! Kaelasha -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Tue Aug 26 06:53:11 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Tue, 26 Aug 2014 16:53:11 +1200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: > Dear Ana, dear all, > the layout you used does not correspond to our nets. I tried the > GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. > Please can anybody help? > Cheers > Katrin > > > 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > > Try this one >> I use >> >> >> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > > wrote: >> >>> Dear all, my problems seem neverending. This time however i really need >>> help. >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> preprocessing, channelreplacement, ica, componentrejection, final >>> artifactdetection, timelock of the single subject data. However, when I >>> wanna compute the grandaverage of the single subjects I get the following >>> error message: >>> >>> computing average of avg over 19 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>> additional allocation of an estimated 3 MB >>> computing average of avg over 2 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_topoplotER" took 0 seconds and required the additional >>> allocation of an estimated 0 MB >>> >>> Furthermore in the plot of the significant clusters, the channelnames >>> are mixed up (do not correspond to my net) >>> >>> >>> I guess that there is a problem with the layout I use. >>> Here the code that I use >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> cfg.channel = obs_data.label; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.feedback = 'yes'; >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = lay; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> %For computing the grand average >>> >>> cfg = []; >>> >>> cfg.channel = 'all'; >>> >>> cfg.latency = 'all'; >>> >>> cfg.parameter = 'avg'; >>> >>> cfg.keepindividual = 'no' >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> For plotting the significant clusters >>> >>> cfg = []; >>> >>> cfg.style = 'blank'; >>> >>> cfg.layout = lay; >>> >>> cfg.channellabels = 'yes'; >>> >>> cfg.highlight = 'labels'; >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> cfg.comment = 'no'; >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> correction') >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> thanks and best >>> >>> Katrin >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.marshall at fcdonders.ru.nl Tue Aug 26 17:49:17 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Tue, 26 Aug 2014 17:49:17 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions Message-ID: <53FCAC7D.4040402@fcdonders.ru.nl> Hi Trippers, I have performed dipole fitting on some data and I would like to identify the anatomical regions in which various dipoles are located - ie, to make statements of the sort, 'dipole X was (best) localised to the right superior parietal cortex'. Specifically - I have the output from ft_dipolefitting which gives positions in the head space of the individual subjects, and I would like to anatomically label the dipoles according to the AAL atlas, which is based on the MNI template brain. I *think* what I will need to do is apply some warping of the subject MRI to the MNI template, and then apply the same warping to the dipole co-ordinate. However it is not clear to me how to warp a single point, rather than an entire volume. Is there some fieldtrip function that could be used for this? I do not think the approach detailed in // will be much use here, since (if I understand correctly) the MNI-aligned grid created here would only be used as a starting point for ft_dipolefitting. In the end a given dipole might not correspond to any grid point. Can anybody advise me on how to set about this? Thanks a lot. Best, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Aug 26 18:03:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 26 Aug 2014 18:03:44 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: <53FCAC7D.4040402@fcdonders.ru.nl> References: <53FCAC7D.4040402@fcdonders.ru.nl> Message-ID: Hi Tom, ft_volumenormalise will allow you to normalise an anatomical volume to MNI space. The output of ft_volumenormalise will have a .params and .initial field. These you need, you can discard the actual normalised volumetric data. The fields contain the linear (.initial) and nonlinear (.params) warps needed to go from subject-specific to MNI space, and vice versa. Using these you can do something like: normalised = ft_volumenormalise([], mri); mnipos = ft_warp_apply(normalised.params, ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); where subjectpos is an Nx3 array of subject-specific coordinates, and mnipos will of course be Nx3 in MNI space. In case of questions we can discuss tomorrow in person :) Best, Eelke On 26 August 2014 17:49, Tom Marshall wrote: > Hi Trippers, > > I have performed dipole fitting on some data and I would like to identify > the anatomical regions in which various dipoles are located - ie, to make > statements of the sort, 'dipole X was (best) localised to the right superior > parietal cortex'. Specifically - I have the output from ft_dipolefitting > which gives positions in the head space of the individual subjects, and I > would like to anatomically label the dipoles according to the AAL atlas, > which is based on the MNI template brain. > > I *think* what I will need to do is apply some warping of the subject MRI to > the MNI template, and then apply the same warping to the dipole co-ordinate. > However it is not clear to me how to warp a single point, rather than an > entire volume. Is there some fieldtrip function that could be used for this? > > I do not think the approach detailed in > > will be much use here, since (if I understand correctly) the MNI-aligned > grid created here would only be used as a starting point for > ft_dipolefitting. In the end a given dipole might not correspond to any grid > point. > > Can anybody advise me on how to set about this? > > Thanks a lot. > > Best, > Tom > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From t.marshall at fcdonders.ru.nl Tue Aug 26 18:38:23 2014 From: t.marshall at fcdonders.ru.nl (Tom Marshall) Date: Tue, 26 Aug 2014 18:38:23 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: References: <53FCAC7D.4040402@fcdonders.ru.nl> Message-ID: <53FCB7FF.80907@fcdonders.ru.nl> Hi Eelke, Fantastic! I'm now almost where I want to be... Now I have the MNI co-ordinate, and plotting: cfg=[]; cfg.location=mnipos; cfg.locationcoordinates='head'; cfg.atlas='/home/common/matlab/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; cfg.funparameter='anatomy'; ft_sourceplot(cfg,normalised); Gives me the plot with the dipole position where I expect it (based on where it was pre-warping) and an anatomical label from the AAL atlas. So far so good. I'd like to go one better though, and directly look up the label from the atlas. ft_volumelookup returns an anatomical label if you give it a binary mask, so I could try to create a volume-sized mask full of zeroes with a single 1 at 'mnipos'. However, mnipos is an MNI co-ordinate, and I would need to specify the 1 in voxel co-ordinates (ie, as an index in the matrix rather than a co-ordinate which could be -ve). How to convert the co-ordinate? Best, Tom On 8/26/2014 6:03 PM, Eelke Spaak wrote: > Hi Tom, > > ft_volumenormalise will allow you to normalise an anatomical volume to > MNI space. The output of ft_volumenormalise will have a .params and > .initial field. These you need, you can discard the actual normalised > volumetric data. The fields contain the linear (.initial) and > nonlinear (.params) warps needed to go from subject-specific to MNI > space, and vice versa. Using these you can do something like: > > normalised = ft_volumenormalise([], mri); > mnipos = ft_warp_apply(normalised.params, > ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); > > where subjectpos is an Nx3 array of subject-specific coordinates, and > mnipos will of course be Nx3 in MNI space. > > In case of questions we can discuss tomorrow in person :) > > Best, > Eelke > > On 26 August 2014 17:49, Tom Marshall wrote: >> Hi Trippers, >> >> I have performed dipole fitting on some data and I would like to identify >> the anatomical regions in which various dipoles are located - ie, to make >> statements of the sort, 'dipole X was (best) localised to the right superior >> parietal cortex'. Specifically - I have the output from ft_dipolefitting >> which gives positions in the head space of the individual subjects, and I >> would like to anatomically label the dipoles according to the AAL atlas, >> which is based on the MNI template brain. >> >> I *think* what I will need to do is apply some warping of the subject MRI to >> the MNI template, and then apply the same warping to the dipole co-ordinate. >> However it is not clear to me how to warp a single point, rather than an >> entire volume. Is there some fieldtrip function that could be used for this? >> >> I do not think the approach detailed in >> >> will be much use here, since (if I understand correctly) the MNI-aligned >> grid created here would only be used as a starting point for >> ft_dipolefitting. In the end a given dipole might not correspond to any grid >> point. >> >> Can anybody advise me on how to set about this? >> >> Thanks a lot. >> >> Best, >> Tom >> >> _______________________________________________ >> 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 prarobinson at gmail.com Tue Aug 26 19:37:42 2014 From: prarobinson at gmail.com (Paul Robinson) Date: Tue, 26 Aug 2014 10:37:42 -0700 Subject: [FieldTrip] rda2ft.exe pthread error In-Reply-To: References: Message-ID: Greetings, All. I hope to run rda2ft as a stand-alone executable under Windows XP (that's the OS I'm stuck with for now), but I get an error to the effect that pthreadGC2.dll can't be found. Does anyone have a version of this executable available that will work? Alternatively, I may be able to re-compile under Ubuntu with MinGW, but I expect that's what created the versions of rda2ft.exe I'm finding on line to begin with... Any help would be most appreciated! Best, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 27 10:04:18 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 10:04:18 +0200 Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences In-Reply-To: References: Message-ID: Dear Hweeling, I'm not sure if I understand all your questions correctly, but I can give two pointers that might be of help. First, the error message you get when trying to plot ("no reference channel is specified") tells you what you should do: specify a reference channel :) Connectivity is between channels, so if you want to plot a spatial topography, you are plotting connectivity of all channels versus *one* channel, which is called the reference channel. You can do this with cfg.refchannel = 'chan'. You might want to take a look at this part of our tutorials: http://fieldtrip.fcdonders.nl/tutorial/sensor_analysis#cortico-muscular_coherence where plotting connectivity data is explained. Second, I see that you are using cfg.alpha = 0.05/8, implementing Bonferroni correction for multiple comparisons. Cluster statistics is already a way of dealing with multiple comparisons (i.e. the cluster test is a single test), so there is no need for this. (Unless you are iteratively doing cluster statistics across some dimension, but your code suggests to me that is not the case.) Hope that helps. Best, Eelke On 24 August 2014 14:15, Hwee Ling Lee wrote: > Dear all and Prof Maris, > > I'm re-posting this question again, as I didn't get any replies previously. > > I’m interested to investigate if there are any differences in phase > synchronization in resting state data at timepoint 2 versus timepoint 1. The > EEG data was collected using 64 EEG channels, resting state, eyes opened and > eyes closed. I’ve arbitrarily segmented the resting state data into epochs > of 2s each, and the epochs with artifacts are excluded completely from > further analyses. I then performed mtmfft to get the fourier representation > of the data, extracted the coherence, and compared the coherence difference > of timepoint 2 versus timepoint 1 of all channels paired with all other > channels. > > I figured that if I extract the connectivity analyses without specifying the > channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to > perform cluster-based statistical analyses. I get an output with ‘chan_chan’ > dimord variable. However, I was not 100% sure that this is correct, hence, > I’ve inserted my code (see below). It’ll be great if you could tell me if > what I’m doing makes any sense at all. Also, I don’t know how I can plot the > results to see if it make any sense at all. > > Also, I checked the values obtained from when I specified "cfg.channelcmb" > and when I did not specify "cfg.channelcmb", I noticed that the values were > somehow different. I would assume that the values to be similar, although > I'm not sure why they would have differences in the values obtained from > specifying "cfg.channelcmb". > > This is my code that I've used thus far: > > for sub = 1:5 > > cfg = []; > > cfg.output = 'fourier'; > > cfg.channel = {'all'}; > > cfg.method = 'mtmfft'; > > cfg.keeptrials = 'yes'; > > cfg.tapsmofrq = 5; > > cfg.foilim = [0 100]; > > cfg.taper = 'dpss'; > > % find the index for the c200 condition > > pre_c200_idx = find(data5.trialinfo == 201); > > cfg.trials = pre_c200_idx; > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > post_c200_idx = find(data5.trialinfo == 200); > > cfg.trials = post_c200_idx; > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > cfg = []; > > cfg.keeptrials = 'no'; > > cfg.channel = {'all'}; > > cfg.removemean = 'yes'; > > cfg.method = 'coh'; > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > HLF_post_c200); > > end > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > cfg_neighb.method = 'template'; > > cfg_neighb.layout = lay; > > cfg_neighb.channel = 'all'; > > neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); > > > > cfg = []; > > cfg.layout = lay; > > cfg.neighbours = neighbours; > > cfg.channel = 'all'; > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > cfg.latency = 'all'; > > cfg.avgovertime = 'no'; > > cfg.avgoverchan = 'no'; > > cfg.parameter = 'cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'depsamplesT'; > > cfg.correctm = 'cluster'; > > cfg.tail = 0; > > % cfg.clustertail = 0; > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency > bands. > > cfg.numrandomization = 10000; > > cfg.ivar = 2; > > cfg.uvar = 1; > > > > % design matrices > > clear design; > > design(1,:) = [1:5, 1:5]; > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > cfg.design = design; > > % for theta band > > cfg.avgoverfreq = 'yes'; > > cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), > and gamma (40-100). > > [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, > sub_HLF_pre_c200coh{:}); > > > When I tried to plot the results, I used this code: > > cfg = []; > > cfg.channel = 'all'; > > cfg.layout = 'lay'; > > cfg.zlim = [-1 1]; > > cfg.alpha = 0.05; > > cfg.refchannel = 'all'; > > ft_clusterplot(cfg, diffc200_theta_stat); > > However, I was not sure how I could plot the results. I get an error message > from Fieldtrip when using ft_clusterplot: > > Error using topoplot_common (line 366) > > no reference channel is specified > > Error in ft_topoplotTFR (line 192) > > [cfg] = topoplot_common(cfg, varargin{:}); > > Error in ft_clusterplot (line 372) > > ft_topoplotTFR(cfgtopo, stat); > > > > According to your paper in 2007, the topoplot of the results were masked by > the spatio-spectral pattern of the significant clusters. I don't know how to > do this, and I would really appreciate if you can show me how to make such a > plot. > > Thank you very much. > > Kind regards, > > Hweeling > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Wed Aug 27 10:52:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 10:52:38 +0200 Subject: [FieldTrip] anatomical labelling of dipole positions In-Reply-To: <53FCB7FF.80907@fcdonders.ru.nl> References: <53FCAC7D.4040402@fcdonders.ru.nl> <53FCB7FF.80907@fcdonders.ru.nl> Message-ID: Hi Tom, Let me split your post into two questions: (1) how to compute voxel indices from known anatomical coordinates? (2) how to get an anatomical label for a known coordinate? (1) Any volumetric data should have a .transform matrix attached to it. This matrix describes the linear transformation needed to get *from* voxel indices *to* anatomical coordinates. (The type of coordinates the matrix projects to is described by the .coordsys field.). To go the other way, from anatomical coordinates to voxel indices, you just apply the inverse transformation (the round() is needed to get exact integers, otherwise matlab complains): voxinds = round(ft_warp_apply(pinv(mri.transform), mnipos)); (2) There is a function private/atlas_lookup.m that takes an atlas structure and a 1x3 position and returns the anatomical label. So there is no need to go through the creation of the mask etc. (and the answer to (1) becomes irrelevant in this instance, though still good to know :) ). This very straightforward functionality should actually be merged into ft_volumelookup and atlas_lookup needs to be deprecated, however for now the function is still very useful. Best, Eelke On 26 August 2014 18:38, Tom Marshall wrote: > Hi Eelke, > > Fantastic! I'm now almost where I want to be... > > Now I have the MNI co-ordinate, and plotting: > > cfg=[]; > cfg.location=mnipos; > cfg.locationcoordinates='head'; > cfg.atlas='/home/common/matlab/fieldtrip/template/atlas/aal/ROI_MNI_V4.nii'; > cfg.funparameter='anatomy'; > ft_sourceplot(cfg,normalised); > > Gives me the plot with the dipole position where I expect it (based on where > it was pre-warping) and an anatomical label from the AAL atlas. So far so > good. > > I'd like to go one better though, and directly look up the label from the > atlas. ft_volumelookup returns an anatomical label if you give it a binary > mask, so I could try to create a volume-sized mask full of zeroes with a > single 1 at 'mnipos'. However, mnipos is an MNI co-ordinate, and I would > need to specify the 1 in voxel co-ordinates (ie, as an index in the matrix > rather than a co-ordinate which could be -ve). How to convert the > co-ordinate? > > Best, > Tom > > > On 8/26/2014 6:03 PM, Eelke Spaak wrote: >> >> Hi Tom, >> >> ft_volumenormalise will allow you to normalise an anatomical volume to >> MNI space. The output of ft_volumenormalise will have a .params and >> .initial field. These you need, you can discard the actual normalised >> volumetric data. The fields contain the linear (.initial) and >> nonlinear (.params) warps needed to go from subject-specific to MNI >> space, and vice versa. Using these you can do something like: >> >> normalised = ft_volumenormalise([], mri); >> mnipos = ft_warp_apply(normalised.params, >> ft_warp_apply(normalised.initial, subjectpos), 'individual2sn'); >> >> where subjectpos is an Nx3 array of subject-specific coordinates, and >> mnipos will of course be Nx3 in MNI space. >> >> In case of questions we can discuss tomorrow in person :) >> >> Best, >> Eelke >> >> On 26 August 2014 17:49, Tom Marshall wrote: >>> >>> Hi Trippers, >>> >>> I have performed dipole fitting on some data and I would like to identify >>> the anatomical regions in which various dipoles are located - ie, to make >>> statements of the sort, 'dipole X was (best) localised to the right >>> superior >>> parietal cortex'. Specifically - I have the output from ft_dipolefitting >>> which gives positions in the head space of the individual subjects, and I >>> would like to anatomically label the dipoles according to the AAL atlas, >>> which is based on the MNI template brain. >>> >>> I *think* what I will need to do is apply some warping of the subject MRI >>> to >>> the MNI template, and then apply the same warping to the dipole >>> co-ordinate. >>> However it is not clear to me how to warp a single point, rather than an >>> entire volume. Is there some fieldtrip function that could be used for >>> this? >>> >>> I do not think the approach detailed in >>> >>> >>> will be much use here, since (if I understand correctly) the MNI-aligned >>> grid created here would only be used as a starting point for >>> ft_dipolefitting. In the end a given dipole might not correspond to any >>> grid >>> point. >>> >>> Can anybody advise me on how to set about this? >>> >>> Thanks a lot. >>> >>> Best, >>> Tom >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From praajhen at gmail.com Wed Aug 27 13:00:17 2014 From: praajhen at gmail.com (Praghajieeth Raajhen) Date: Wed, 27 Aug 2014 13:00:17 +0200 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer Message-ID: Hello!!!! Please Help out. where am I going wrong? cfg = []; cfg.channel = 'EEG'; cfg.method = 'sam'; cfg.grid = grid; cfg.vol = vol1; cfg.projectnoise = 'yes'; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); workspace of grid,vol1,timelock (.mat) https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 1. Using fieldtrip 2013 version When i do EEG sourceanalysis using "SAM" method, following error occurs Attempted to access noise(0); index must be a positive integer or logical. Error in ==> beamformer_sam at 111 noise = noise(end); Error in ==> ft_sourceanalysis at 841 dip(i) = beamformer_sam(grid, sens, vol, squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); PS: same code for MEG source reconsturction works quite good. 2. Using fieldtrip 2014 version when i do the same I'm getting this kind of errors Undefined function or variable 'abort'. Error in ==> ft_sourceanalysis at 156 if abort PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It is showing same above error. advance thanks for your kind help. Praghajith R.S. praajhen at gmail.com Master Thesis @ UKSH Kiel, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Aug 27 16:12:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 27 Aug 2014 16:12:12 +0200 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer In-Reply-To: References: Message-ID: Dear Kaelasha, The tutorial is correct, it's best to use the averaged covariance, computed on the unaveraged data (so a single call to ft_timelockanalysis). We thought we had removed the example script you mentioned some time ago, but apparently somewhere on the wiki it still lingers. Could you let us know where you found this? Or better yet, just remove it? (It is a wiki, after all.) Best, Eelke On 26 August 2014 02:57, Kaelasha Tyler wrote: > Hi all, > > I am raking through my script trying to sort out potential faults in my > analysis. > One issue I have come across is whether ft_timelock analysis should be > performed once, or twice when using lcmv method of beamformer. > > The tutorial on lcmv beamfomer found here > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > seems to indicate that time-locking is only performed once only in the > analysis pipeline. > > However, elsewhere on the FT site, I found the following advice: > "In order for the beamformer to work, we need the covariance between sensor > pairs. This should be the covariance of (a particular latency window) of the > averaged single trials. This is essentially different from the average > covariance of the single trials. Therefore, we have to call timelockanalysis > more than once: the first time we obtain the evoked field, and the second > time we obtain the covariance matrix/ces at interesting latency/ies" > > Which is correct? > > I have been time locking twice: using data sets which were already > time-locked using ft_timelockanalysis, and then time locking again, prior to > using ft_sourceanalysis........... Wrong? > > The phrase 'sanity check' comes up quite often on this list, and I > absolutely understand! As always, any help is very much appreciated!! > > Kaelasha > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From sarita.tamang at mssm.edu Wed Aug 27 19:56:01 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Wed, 27 Aug 2014 17:56:01 +0000 Subject: [FieldTrip] Preprocessing data Message-ID: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> Hello Everybody, I'm just starting to use FieldTrip and I have some very basic questions. I'm trying to analyze LFP data along with the spikes which is in Plexon format. For the preprocessing part I tried to read it as continuous data so I did clear all close all cfg = []; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data data_org = ft_preprocessing(cfg); It gave me this error with 32 u int thing Error using timestamp_plexon (line 27) invalid input Error in ft_read_data (line 1064) ts = timestamp_plexon(tsl, tsh); % use helper function, this returns an uint64 array Error in ft_preprocessing (line 573) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); Error in LFP (line 8) data_org = ft_preprocessing(cfg); I though this was probably due to reading it as continuous data or something I couldn't figure out so i tried using the example to see if the code runs clear all close all cfg = []; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data hdr = ft_read_header(cfg.dataset); event = ft_read_event(cfg.dataset); cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'Strobed' cfg.trialdef.eventvalue = 35; % the value of the stimulus trigger for fully incongruent (FIC). cfg.trialdef.prestim = 0.5; % in seconds cfg.trialdef.poststim = 1; % in seconds cfg.channel = {'AD01' 'AD03'}; cfg.continuous = 'yes'; trl = []; for i=1:length(event) if strcmp(event(i).type, cfg.trialdef.eventtype) % it is a trigger, see whether it has the right value if ismember(event(i).value, cfg.trialdef.eventvalue) % add this to the trl definition begsample = event(i).sample - cfg.trialdef.prestim*hdr.Fs; endsample = event(i).sample + cfg.trialdef.poststim*hdr.Fs - 1; offset = -cfg.trialdef.prestim*hdr.Fs; trigger = event(i).value; % remember the trigger (=condition) for each trial trl(end+1, :) = [round([begsample endsample offset]) trigger]; end end end cfg = ft_definetrial(cfg); data_org = ft_preprocessing(cfg); And I just used the trl loop from the example give in the website because i kept getting error saying the trial is not defined. However even after putting the code I still get the same error. Error using ft_definetrial (line 184) no trials were defined, see FT_DEFINETRIAL for help I don't know what else should I try because I'm having trouble just doing the preprocessing. Your help will be very much appreciated. Thank you, Sarita -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Wed Aug 27 21:37:00 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 27 Aug 2014 12:37:00 -0700 Subject: [FieldTrip] Non-parametric connectivity analysis Message-ID: Hi, I'm currently trying to run a connectivity analysis. I am using 127 channel data, of which has been preprocessed using standard processing steps. I have then derived the CSD estimates using the CSD toolbox. When computing the non-parametric connectivity analysis I encounter the following warnings when computing the PDC (see below). I get similar warnings when computing granger causality, however, with the granger spectrum the solution is characterized by - Inf values In connectivity\private\sfactorization_wilson at 150 In ft_connectivity_csd2transfer at 181 In ft_connectivityanalysis at 390 Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 8.828770e-23. Can anyone shed some light on the situation? Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From Isaiah.C.Smith.17 at dartmouth.edu Thu Aug 28 01:37:34 2014 From: Isaiah.C.Smith.17 at dartmouth.edu (Isaiah C. Smith) Date: Wed, 27 Aug 2014 23:37:34 +0000 Subject: [FieldTrip] Preprocessing Message-ID: Hello, I am having some trouble. I need to process my data and gain access to the information below so that I can test a file converter. Can someone help me through that process? data : array of shape (n_channels, n_times) The channels’ evoked response. info : instance of Info Info dictionary. Consider using create_info to populate this structure. tmin : float Start time before event. comment : string Comment on dataset. Can be the condition. Defaults to ‘’. nave : int Number of averaged epochs. Defaults to 1. kind : str Type of data, either average or standard_error. Defaults to ‘average’. verbose : bool, str, int, or None If not None, override default verbose level (see mne.verbose). Defaults to raw.verbose. Isaiah Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Thu Aug 28 08:45:32 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 06:45:32 +0000 Subject: [FieldTrip] Reject bad trials Message-ID: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlene.boenstrup at googlemail.com Thu Aug 28 09:05:55 2014 From: marlene.boenstrup at googlemail.com (=?UTF-8?Q?Marlene_B=C3=B6nstrup?=) Date: Thu, 28 Aug 2014 09:05:55 +0200 Subject: [FieldTrip] channelorder in leadfields, filter, ft_sourceanalysis Message-ID: Dear mailing-list, I am confused with the ordering of channels during leadfield computation and subsequent filter computation. Following the code in ft_prepare_leadfield, I am convinced that the channelorder of the leadfields is the same as in the input data to the function (second input to ft_prepare_leadfields). When I follow the leadfield order during ft_sourceanalysis it stays the same until the filter is computed based on that leadfield. The filter however is then applied to my data, which, during the course of ft_sourceanalysis, become reordered alphabetically during ft_checkdata in line 244 of ft_sourceanalysis (version 18.12.2013). So then the crssspectrum order and leadfield order would not match. Can you help me out with this paradox? I hope my question is not too confused, if so I will try to rephrase and exemplify, but maybe someone knows what I mean. Many thanks, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 09:07:36 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 07:07:36 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Thu Aug 28 09:18:35 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:18:35 +0200 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: Hi Emilie, It seems to me you are passing the non-cleaned data (epData) into ft_timelockanalysis, and not the cleaned data (data_clean). Best, Eelke On 28 August 2014 08:45, Caspar, Emilie wrote: > Hello, > > I'm preprocessing my EEG data. The script works correctly, but I think there > is something wrong, when I look at the output. > I reject bad trials with : > > cfg = []; > cfg.alim = 100; > cfg.keepchannel = 'yes'; > cfg.layout = 'biosemi64.lay'; > % cfg.method = 'summary'; > % cfg.method = 'trial'; > cfg.method = 'channel'; %% Or 'trial' > cfg.metric = 'var'; > [data_clean] = ft_rejectvisual(cfg, epData); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > > > And apparently, Fieldtrip correctly identifies what the trials to reject > are, Matlab indicates: > > 91 trials marked as GOOD, 9 trials marked as BAD > 66 channels marked as GOOD, 0 channels marked as BAD > the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 > the call to "ft_rejectvisual" took 27 seconds and required the additional > allocation of an estimated NaN MB > > So I save this file, before averaging with : > avgFC = ft_timelockanalysis(cfg, epData); > ft_singleplotER(cfg,avgFC); > > > What is strange, is that during the averaging, I can see that in my matlab > window that the averaging is on 100 trials (= the basic number of trials, > without rejection), as if Fieldtrip did not take into account the bad trials > in the averaging. > > averaging trials > averaging trial 100 of 100 > > > By reading, I though that maybe it was because of this function that was > missing into my script : > cleandata = ft_rejectartifact(cfg,'epData'); > > > However, I have the following mistake, and I don't understand it: > Error using ft_rejectartifact (line 234) > no trials were selected, cannot perform artifact detection/rejection > > Error in preprocessing_Libet (line 274) > cleandata = ft_rejectartifact(cfg,'epData'); > > > > Can someone help? > > > Thank you in advance, > > Emilie > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Thu Aug 28 09:19:27 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 07:19:27 +0000 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer In-Reply-To: References: Message-ID: Hey Praghajieeth, Firstly, I am by no means an expert of fieldtrip (I only started using it six or so months ago), so if I am wrong I apologise but you have been warned haha. Ill try and help, can you look up the following: Can you tell me what the dimensions of Cy is and whether there are any NaNs. What dimensions are data.chan.elec and data.label? Also its worth checking your vol1.mat for NaNs aswell. Good luck! Tyler Sent from my iPad On 27 Aug 2014, at 8:33 pm, "Praghajieeth Raajhen" > wrote: Hello!!!! Please Help out. where am I going wrong? cfg = []; cfg.channel = 'EEG'; cfg.method = 'sam'; cfg.grid = grid; cfg.vol = vol1; cfg.projectnoise = 'yes'; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); workspace of grid,vol1,timelock (.mat) https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 1. Using fieldtrip 2013 version When i do EEG sourceanalysis using "SAM" method, following error occurs Attempted to access noise(0); index must be a positive integer or logical. Error in ==> beamformer_sam at 111 noise = noise(end); Error in ==> ft_sourceanalysis at 841 dip(i) = beamformer_sam(grid, sens, vol, squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); PS: same code for MEG source reconsturction works quite good. 2. Using fieldtrip 2014 version when i do the same I'm getting this kind of errors Undefined function or variable 'abort'. Error in ==> ft_sourceanalysis at 156 if abort PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It is showing same above error. advance thanks for your kind help. Praghajith R.S. praajhen at gmail.com Master Thesis @ UKSH Kiel, Germany _______________________________________________ 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 Thu Aug 28 09:16:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:16:08 +0200 Subject: [FieldTrip] channelorder in leadfields, filter, ft_sourceanalysis In-Reply-To: References: Message-ID: Dear Marlene, Have a look at this bug: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2639 If you don't have an account on our bugzilla, it is easy to create one using just your e-mail address, then you can add yourself as CC to that bug. Best, Eelke On 28 August 2014 09:05, Marlene Bönstrup wrote: > Dear mailing-list, > > I am confused with the ordering of channels during leadfield computation and > subsequent filter computation. > Following the code in ft_prepare_leadfield, I am convinced that the > channelorder of the leadfields is the same as in the input data to the > function (second input to ft_prepare_leadfields). > When I follow the leadfield order during ft_sourceanalysis it stays the same > until the filter is computed based on that leadfield. The filter however is > then applied to my data, which, during the course of ft_sourceanalysis, > become reordered alphabetically during ft_checkdata in line 244 of > ft_sourceanalysis (version 18.12.2013). > So then the crssspectrum order and leadfield order would not match. > > Can you help me out with this paradox? > > I hope my question is not too confused, if so I will try to rephrase and > exemplify, but maybe someone knows what I mean. > > Many thanks, > > Marlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Thu Aug 28 09:23:41 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 07:23:41 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: References: Message-ID: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ 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 eelke.spaak at donders.ru.nl Thu Aug 28 09:24:39 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:24:39 +0200 Subject: [FieldTrip] EEG soure reconstruction using SAM beamformer In-Reply-To: References: Message-ID: Hi Praghajith, You should use the latest version of fieldtrip; it should work with the 2014 one you mentioned. The error concerning the 'abort' variable might be caused by fieldtrip not being on your path correctly. You should add *only* the root folder to the path yourself (i.e. not using addpath(genpath()) ), then fieldtrip takes care of the path itself. So do: restoredefaultpath addpath ft_defaults and then it should work. If it doesn't, let us know. Best, Eelke On 27 August 2014 13:00, Praghajieeth Raajhen wrote: > Hello!!!! > > Please Help out. where am I going wrong? > > cfg = []; > cfg.channel = 'EEG'; > cfg.method = 'sam'; > cfg.grid = grid; > cfg.vol = vol1; > cfg.projectnoise = 'yes'; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > workspace of grid,vol1,timelock (.mat) > https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0 > > 1. Using fieldtrip 2013 version > When i do EEG sourceanalysis using "SAM" method, following error occurs > > Attempted to access noise(0); index must be a positive integer or logical. > > Error in ==> beamformer_sam at 111 > noise = noise(end); > > Error in ==> ft_sourceanalysis at 841 > dip(i) = beamformer_sam(grid, sens, vol, > squeeze_avg,squeeze(Cy(i,:,:)), optarg{:}); > > > PS: same code for MEG source reconsturction works quite good. > > 2. Using fieldtrip 2014 version > when i do the same I'm getting this kind of errors > > Undefined function or variable 'abort'. > > Error in ==> ft_sourceanalysis at 156 > if abort > > PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It > is showing same above error. > > > advance thanks for your kind help. > > Praghajith R.S. > praajhen at gmail.com > Master Thesis @ UKSH > Kiel, Germany > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Thu Aug 28 09:27:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 28 Aug 2014 09:27:44 +0200 Subject: [FieldTrip] Preprocessing data In-Reply-To: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> References: <284E8105C3E44A4EA4C52972E5D13E883591C3@EXCHMBXCSM2.ExchMail.mssm.edu> Message-ID: Hello Sarita, It should not be a surprise that ft_definetrial does not find any trials for your data, since you are using trigger codes specified for the example dataset used in the tutorials. For reading continuous data, try adding cfg.continuous = 'yes' for your call to ft_preprocessing: cfg = []; cfg.continuous = 'yes'; cfg.dataset = 'fr041110a_nat1.plx'; %reading the data data_org = ft_preprocessing(cfg); If that does not work, there is an error in some of the low-level functions for reading Plexon data, and I would not know how to help you on that. Hope this helps, best, Eelke On 27 August 2014 19:56, Tamang, Sarita wrote: > > Hello Everybody, > > I'm just starting to use FieldTrip and I have some very basic questions. > > I'm trying to analyze LFP data along with the spikes which is in Plexon > format. > > For the preprocessing part I tried to read it as continuous data so I did > clear all > close all > > cfg = []; > > cfg.dataset = 'fr041110a_nat1.plx'; %reading the data > data_org = ft_preprocessing(cfg); > > It gave me this error with 32 u int thing > > Error using timestamp_plexon (line 27) > invalid input > > Error in ft_read_data (line 1064) > ts = timestamp_plexon(tsl, tsh); % use helper function, this returns > an uint64 array > > Error in ft_preprocessing (line 573) > dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', > begsample, 'endsample', > endsample, 'chanindx', rawindx, 'checkboundary', > strcmp(cfg.continuous, 'no'), > 'dataformat', cfg.dataformat); > > Error in LFP (line 8) > data_org = ft_preprocessing(cfg); > > > I though this was probably due to reading it as continuous data or > something I couldn't figure out so i tried using the example to see if the > code runs > > clear all > close all > > cfg = []; > > cfg.dataset = 'fr041110a_nat1.plx'; %reading the data > > hdr = ft_read_header(cfg.dataset); > event = ft_read_event(cfg.dataset); > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'Strobed' > cfg.trialdef.eventvalue = 35; % the value of the stimulus trigger for > fully incongruent (FIC). > cfg.trialdef.prestim = 0.5; % in seconds > cfg.trialdef.poststim = 1; % in seconds > cfg.channel = {'AD01' 'AD03'}; > cfg.continuous = 'yes'; > > trl = []; > > for i=1:length(event) > if strcmp(event(i).type, cfg.trialdef.eventtype) > % it is a trigger, see whether it has the right value > if ismember(event(i).value, cfg.trialdef.eventvalue) > % add this to the trl definition > begsample = event(i).sample - cfg.trialdef.prestim*hdr.Fs; > endsample = event(i).sample + cfg.trialdef.poststim*hdr.Fs - 1; > offset = -cfg.trialdef.prestim*hdr.Fs; > trigger = event(i).value; % remember the trigger (=condition) > for each trial > trl(end+1, :) = [round([begsample endsample offset]) trigger]; > end > end > end > > cfg = ft_definetrial(cfg); > data_org = ft_preprocessing(cfg); > > And I just used the trl loop from the example give in the website because i > kept getting error saying the trial is not defined. However even after > putting the code I still get the same error. > > Error using ft_definetrial (line 184) > no trials were defined, see FT_DEFINETRIAL for help > > I don't know what else should I try because I'm having trouble just doing > the preprocessing. Your help will be very much appreciated. > > Thank you, > Sarita > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Thu Aug 28 10:02:35 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 08:02:35 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> Message-ID: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 09:23, "Caspar, Emilie" > a écrit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 10:29:07 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 08:29:07 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk>, <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: Hey Emilie, It looks to me like you are creating clean_data twice. Could you change the first clean_data to a different name and then use that variable name when you call ft_rejectartifact? Tyler Sent from my iPad On 28 Aug 2014, at 5:35 pm, "Caspar, Emilie" > wrote: Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Universit? Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 ao?t 2014 ? 09:23, "Caspar, Emilie" > a ?crit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 ao?t 2014 ? 09:07, Tyler Grummett > a ?crit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Aug 28 10:30:55 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 28 Aug 2014 08:30:55 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk>, <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: <68CB9987-A228-4D54-AD12-93FD7DAD7D62@flinders.edu.au> Alternatively you could keep the same variable after you first make it. ie: cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,clean_data); ** avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); Tyler Sent from my iPad On 28 Aug 2014, at 5:35 pm, "Caspar, Emilie" > wrote: cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Thu Aug 28 10:41:07 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Thu, 28 Aug 2014 08:41:07 +0000 Subject: [FieldTrip] Reject bad trials In-Reply-To: <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> References: <2D5FA95D-35F4-4912-AA10-113D22F0968A@live.ucl.ac.uk> <0760DF46-DA2C-4D7F-98A5-32F4F3704D31@live.ucl.ac.uk> Message-ID: <93F42BBB-7FC2-4CF6-9418-3B5A4C1D8982@live.ucl.ac.uk> Dear all, I found a solution, just by removing brackets here :[clean_data] = ft_rejectvisual(cfg, epData); Thank you again for your help! Emilie --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 10:02, "Caspar, Emilie" > a écrit : Dear Elke, Thank you for this suggestion. So I have changed following your suggestion : clean_data = ft_rejectartifact(cfg,epData); 89 trials marked as GOOD, 11 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99 avgFC = ft_timelockanalysis(cfg, clean_data); However, still the same problem : the averaging is always on the 100 trials. the input is raw data with 66 channels and 100 trials averaging trials averaging trial 100 of 100 Emilie -------- cfg = []; % cfg.channel = [65:66]; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; cfg.metric = 'var'; [clean_data] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; clean_data = ft_rejectartifact(cfg,epData); avgFC = ft_timelockanalysis(cfg, clean_data); ft_singleplotER(cfg,avgFC); --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 28 août 2014 à 09:23, "Caspar, Emilie" > a écrit : Hi, Thank you for the answer. Indeed, I have no mistake anymore in the script. However, my basic problem is still there : I reject bad trials, but the averaging is on the 100 trials Any ideas? Emilie Le 28 août 2014 à 09:07, Tyler Grummett > a écrit : Hey Emilie, If you remove the inverted commas from 'epData' on line: cleandata = ft_rejectartifact(cfg,'epData'); So that it is: cleandata = ft_rejectartifact(cfg,epData); does that then work? Tyler Sent from my iPad On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" > wrote: Hello, I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output. I reject bad trials with : cfg = []; cfg.alim = 100; cfg.keepchannel = 'yes'; cfg.layout = 'biosemi64.lay'; % cfg.method = 'summary'; % cfg.method = 'trial'; cfg.method = 'channel'; %% Or 'trial' cfg.metric = 'var'; [data_clean] = ft_rejectvisual(cfg, epData); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates: 91 trials marked as GOOD, 9 trials marked as BAD 66 channels marked as GOOD, 0 channels marked as BAD the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99 the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB So I save this file, before averaging with : avgFC = ft_timelockanalysis(cfg, epData); ft_singleplotER(cfg,avgFC); What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging. averaging trials averaging trial 100 of 100 By reading, I though that maybe it was because of this function that was missing into my script : cleandata = ft_rejectartifact(cfg,'epData'); However, I have the following mistake, and I don't understand it: Error using ft_rejectartifact (line 234) no trials were selected, cannot perform artifact detection/rejection Error in preprocessing_Libet (line 274) cleandata = ft_rejectartifact(cfg,'epData'); Can someone help? Thank you in advance, Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From constantino.mendezbertolo at ctb.upm.es Fri Aug 29 18:36:14 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Fri, 29 Aug 2014 18:36:14 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd Message-ID: Dear Fieldtrippers We have a 3x3 design and MEG data, say only mag channels (n102) to simplify. We want to perform a cluster-based permutation approach but timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', etc) cannot deal with interactions when you have more than three levels (true?) So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical Package- and feed 'clusterstat.m' with them We have done this with one channel over time with success. However, I am clueless now about how to solve the problem when dealing with the whole channel set. I wonder what is the nature of the cfg.dim that we need to feed 'clusterstat.m' with. Up to now, we use, (cioming out of -R-): size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) and the following presets: cfg=[]; cfg.clustercritval = Fcritmain; % We genereate this before hand cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here load('neuromag306mag_neighb.mat'); cfg.neighbours = neighbours; cfg.feedback = 'yes'; cfg.numrandomization = 1000; cfg.clusterstatistic = 'maxsum'; cfg.layout = 'neuromag306mag.lay'; for i = 1:length(cfg.neighbours) cfg.channel{i} = cfg.neighbours(i).label; end stat = clusterstat(cfg,statrnd, statobs) Which lead us to an error within findcluster Error using findcluster (line 59) invalid dimension of spatdimneighbstructmat Error in clusterstat (line 197) posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); If anybody has got some insigth it would be greatly appreciated. Or any hints. Are the size of my statobs and starnd correct? I can share more information and firstly apologize if I was not able to describe the problem accurately, I am confused regarding that 'reshape' and the addition of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the problem arises first when findcluster.m tries to calculate the size of spatdimneighbstructmat First line of findcluster.m calcualtes 'spatdimlength' by : " spatdimlength = size(onoff, 1);" which in our case is "1", which is obviously wrong?. manythanks&peace2all -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Sat Aug 30 12:47:10 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Sat, 30 Aug 2014 10:47:10 +0000 Subject: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer In-Reply-To: References: , Message-ID: Hi Eelke, Thanks so much for this. As it happens I copied the script recommending to time lock twice some time ago, and wasn't able to see it when I looked through the FT site this time. So, problem solved all round. Cheers! Kaelasha ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Thursday, 28 August 2014 12:12 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Covariance matrix, timelocking and lcmv beamformer Dear Kaelasha, The tutorial is correct, it's best to use the averaged covariance, computed on the unaveraged data (so a single call to ft_timelockanalysis). We thought we had removed the example script you mentioned some time ago, but apparently somewhere on the wiki it still lingers. Could you let us know where you found this? Or better yet, just remove it? (It is a wiki, after all.) Best, Eelke On 26 August 2014 02:57, Kaelasha Tyler wrote: > Hi all, > > I am raking through my script trying to sort out potential faults in my > analysis. > One issue I have come across is whether ft_timelock analysis should be > performed once, or twice when using lcmv method of beamformer. > > The tutorial on lcmv beamfomer found here > http://fieldtrip.fcdonders.nl/tutorial/beamformer_lcmv?s[]=covariancewindow > seems to indicate that time-locking is only performed once only in the > analysis pipeline. > > However, elsewhere on the FT site, I found the following advice: > "In order for the beamformer to work, we need the covariance between sensor > pairs. This should be the covariance of (a particular latency window) of the > averaged single trials. This is essentially different from the average > covariance of the single trials. Therefore, we have to call timelockanalysis > more than once: the first time we obtain the evoked field, and the second > time we obtain the covariance matrix/ces at interesting latency/ies" > > Which is correct? > > I have been time locking twice: using data sets which were already > time-locked using ft_timelockanalysis, and then time locking again, prior to > using ft_sourceanalysis........... Wrong? > > The phrase 'sanity check' comes up quite often on this list, and I > absolutely understand! As always, any help is very much appreciated!! > > Kaelasha > > > > > > > > _______________________________________________ > 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