From eelke.spaak at donders.ru.nl Sat Mar 1 09:22:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 1 Mar 2014 09:22:44 +0100 Subject: [FieldTrip] Plotting ERP data: From topoplot to 3D brain surface plot In-Reply-To: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> References: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> Message-ID: Hi Barbara, Could you maybe post some of the code you are using to generate your plots, and examples of the plots you are getting? Best, Eelke On 27 February 2014 09:08, wrote: > Dear Fieldtripers, > > I have ERP data from a normal oddball task (low pitch tones vs. high pitch > tones) resulting in a P300. I know how to plot them with the normal > ft_topoplot command. For just visualization, this is fine, but for a > publication I would like to plot my data on a 3D brain surface. > I know how to do that with the ft_sourceplot command. I tried it with my > data, but the result is not even close to what I see when I plot it with the > ft_topoplot command (I don's see the nice big blob of activity in the > parietal cortex). > I guess the problem is that I do more analizyng steps in order to get the > data structure which is needed for sourceplotting. > > What I really just want to do is putting my topoplot on a brainsurface. Is > that possible in fieldtrip or do I need to use another software? > > Thank you very much for your help!! > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inbalots at gmail.com Sun Mar 2 08:37:51 2014 From: inbalots at gmail.com (Inbal Shapira) Date: Sun, 2 Mar 2014 09:37:51 +0200 Subject: [FieldTrip] Question regarding the meaning of cluster statistic Message-ID: Hi all. My question is: to know if I understand correctly the non parametric process using permutations, and to understand the process for the clustering part in it. I wanted to make sure I understand correctly the meaning of the results I'm getting when using the non parametric approach* for multiple subjects* and the cluster statistics. i.e. I compare an 'Active' and 'Control' data sets that each subject has (for example, for 8 subject I have 16 averages over trials) As far as I understand: Each subject has a subject-specific-average that is calculated for each condition (i.e. one vector (1X248 channels) for each condition that contains the average over selected time, freq and trials). Then, randomly permute the subject-specific averages of the two conditions, independently for every subject (i.e. in each permutation there will be one average selected from each subject) and calculate the statistic results for each channel. We repeat this step many times as to construct a "permutation distribution" from the statistics value from each permutation. finally, we look at the real "active vs control" statistics to see where their value lies in this permutation distribution, and that is the value we will save for that channel in the XXX.stat field. (we have 248 values and permutation distributions, one for each channel). When we want the "clusters" - I am not totally understand the process here. In the paper by Maris and Oostenveld , 2007 they talk about cluster in the following manner: A Cluster based permutation test, is a test in which for each partition we cluster an *adjacent time samples* that exhibit a similar difference (in sign and magnitude). This is done by selecting all samples whose t-values is larger than some threshold, cluster the selected sample in connected set *on the basis of temporal adjacency* and calculate cluster level statistics by taking the sum of t-values within a cluster. Finally, for each partition we take the largest cluster statistics as a value for the permutation distribution. This distribution will serve us for testing the observed largest cluster statistics as was explained earlier. When I use *cfg.correctm = 'cluster'; *Do we look for adjacent channels that are significant? so the clustering process is a spatial one (and not temporal?) Now for what I did: I applied the statistic test using the following definitions and [stat] = ft_freqstatistics(...): sublist = {'2','3','8','11','15','17','18','19'};% 8 subjects... cfg = []; cfg.channel = {'MEG'}; cfg.latency = [1.8 1.95]; * cfg.method = 'montecarlo';* cfg.frequency = 'all'; * cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster';* cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; cfg_neighb.method = 'distance'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb,alphaAvgSub3note2); Nsub = length(sublist); cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)];% condition number cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub];% subject number cfg.ivar = 1; cfg.uvar = 2; % cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'yes'; [stat] = ft_freqstatistics(cfg, alphaAvgSub2note3, alphaAvgSub3note3, alphaAvgSub8note3, alphaAvgSub11note3,... alphaAvgSub15note3, alphaAvgSub17note3, alphaAvgSub18note3, alphaAvgSub19note3,... alphaAvgSub2note2, alphaAvgSub3note2, alphaAvgSub8note2, ... alphaAvgSub11note2, alphaAvgSub15note2, alphaAvgSub17note2, alphaAvgSub18note2, alphaAvgSub19note2); I then plot the results using ft_clusterplot(...) Thanks a lot Inbal -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 3 08:01:39 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Mon, 3 Mar 2014 15:01:39 +0800 Subject: [FieldTrip] What's maxfilter when read .fif file Message-ID: Dear all: I use the ''ft_read_data'' code read .fif file by fieldtrip I get the following error message: ''Maxshield data has not had maxfilter applied to it - cannot be read by fieldtrip. Apply Neuromag maxfilter before converting to fieldtrip format.'' What should I do or Is there some Matlab codes to read .fif file ? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 3 09:42:19 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 3 Mar 2014 09:42:19 +0100 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: <530DEF73.3030605@ucl.ac.uk> References: <530DEF73.3030605@ucl.ac.uk> Message-ID: <146DAD29-49F2-404D-8468-A0F397C81E4C@donders.ru.nl> Dear Ian, The implementation of different filter types is a recurring issue, and we have it on our radar. I suggest you sign up on our bugzilla.fcdonders.nl bug-tracking system and add yourself in the CC for the following bugs: 2453 and 1981. That way you can see what is going on in this direction, and you may even contribute to their swift resolution ;-). As a side note, we try to avoid dependencies on the mathworks toolboxes (such as the signal processing toolbox, stats and image processing) because it allows for broader applicability of the code. In fact, for much of the filtering code we use open source drop in replacement code that has exactly the same functionality as the mathworks version of it. Best, Jan-Mathijs On Feb 26, 2014, at 2:43 PM, Ian M. Andolina wrote: > On 25/02/2014 11:51, fieldtrip-request at science.ru.nl wrote: >> Re: [FieldTrip] Band Limited Power Analysis in Fieldtrip? > Thanks Chaitanya, I get instability for the 1-4Hz band using a 4th order butterworth, but it seems to work for the higher bands (using cfg.bpinstabilityfix = 'reduce' to fix it only for the bands that need it). > > Does anyone know if integrating a chebyshev type-1 filter into fieldtrip preprocessing has been attempted, it is present in the signal processing toolbox and I could do this manually but I'd rather use existing code if possible... > > Thanks again, Ian > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Mar 3 09:55:58 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 3 Mar 2014 08:55:58 +0000 Subject: [FieldTrip] What's maxfilter when read .fif file In-Reply-To: References: Message-ID: Hi Xiao, Maxfilter is a preprocessing step / software package for data coming from MEG systems by Elekta (fif format) (see http://www.megwiki.org/images/a/aa/MaxFilter-2.0.pdf for a description). In short you need to run your data through the Maxfilter software (which should have been provided by Elekta) before you can do anything with it. Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of tongxiao meng [mengtongxiao at gmail.com] Sent: Monday, 3 March 2014 6:01 PM To: fieldtrip Subject: [FieldTrip] What's maxfilter when read .fif file Dear all: I use the ''ft_read_data'' code read .fif file by fieldtrip I get the following error message: ''Maxshield data has not had maxfilter applied to it - cannot be read by fieldtrip. Apply Neuromag maxfilter before converting to fieldtrip format.'' What should I do or Is there some Matlab codes to read .fif file ? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From vanwijk.bernadette at gmail.com Mon Mar 3 18:55:37 2014 From: vanwijk.bernadette at gmail.com (Bernadette van Wijk) Date: Mon, 3 Mar 2014 17:55:37 +0000 Subject: [FieldTrip] SPM course for MEG/EEG in London: May 12-14 Message-ID: Dear all, We are pleased to announce that our annual *SPM course for MEG/EEG* will take place this year from *Monday May 12* to *Wednesday May 14*. Hosted by University College London, the course will be held at Queen Square, a very central location in London (UK). Registration is now open. We offer a reduced rate when attending both the MEG/EEG course and the fMRI course during the second half of the week. For full details see http://www.ucl.ac.uk/ion/articles/courses/SPM2014 The course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course is suitable for both beginners and more advanced users. The topics that will be covered range from pre-processing and statistical analysis to source analysis and dynamic causal modelling. The program is listed below. Available places are limited so please register as early as possible if you would like to attend! *Monday May 12th * 9.30 - 9.45 SPM introduction and resources *Guillaume Flandin* 9.45 - 10.30 What are we measuring with M/EEG? *Saskia Helbling* 10.30 - 11.15 Data pre-processing *Vladimir Litvak* *Coffee* 11.45 - 12.30 Data pre-processing - demo *Deborah Talmi, Max-Philipp Stenner* 12.30 - 13.15 General linear model and classical inference *Christophe Phillips* *Lunch* 14.15 - 15.00 Multiple comparisons problem and solutions *Guillaume Flandin* 15.00 - 15.45 Bayesian inference *Chris Mathys* *Coffee* 16.15 - 17.45 Statistical analysis of images - demo *Rik Henson, Jason Taylor* 17.45 - ... Clinic - questions & answers session *Karl Friston* *Tuesday May 13th * 9.30 - 10.15 M/EEG source analysis *Gareth Barnes* 10.15 - 11.15 M/EEG source analysis - demo *Jose Lopez, Luzia Troebinger, Ashwini Oswal* *Coffee* 11.45 - 12.30 The principles of DCM *Jean Daunizeau* 12.30 - 13.15 DCM for evoked responses *Ryszard Auksztulewicz* *Lunch* 14.15 - 15.00 DCM for steady state responses *Rosalyn Moran* 15.00 - 15.45 DCM for time-frequency *Bernadette van Wijk* 15.45 - 16.30 DCM - demo *Martin Dietz, Andre Marreiros* *Coffee* 17.00 - 17.45 Bayesian model selection and averaging *Will Penny* 17.45 - ... Clinic - questions & answers session *All faculty members* 19.00 onwards - Social Event *Wednesday May 14th* 9.30 - 17.00 Practical hands-on session in UCL computer class rooms. Participants can either work on SPM tutorial datasets or on their own data with the help of the faculty. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Tue Mar 4 09:50:34 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Tue, 4 Mar 2014 09:50:34 +0100 Subject: [FieldTrip] one sample t-test within a group Message-ID: Hello everyonePls I need your assistance in design matrix for one sample t-test within a group of subjects with the same condition. What I want to do basically is comparing one region of the brain ( for instance frontal or by broadman area, BA) to other rest of the brain after source analysis. I will be glad for your assistance. Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From berryv.dberg at gmail.com Tue Mar 4 16:39:11 2014 From: berryv.dberg at gmail.com (berry van den berg) Date: Tue, 4 Mar 2014 10:39:11 -0500 Subject: [FieldTrip] topoplot Message-ID: Dear all, When I export my topoplots to (plot2svg) svg there is this blue square around the headplot (see figure). Does anyone has an idea what causes this? Thanks! Berry [image: Inline images 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 26136 bytes Desc: not available URL: From julian.keil at gmail.com Tue Mar 4 16:56:12 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 4 Mar 2014 16:56:12 +0100 Subject: [FieldTrip] topoplot In-Reply-To: References: Message-ID: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> Dear Berry, have you tried using the print command? That's what I usually use for topoplots and it works fine for me: print -depsc2 -painter Folder/filename.eps Note that I use the "painter" renderer instead of "opengl", as I can't ungroup the elements later on with the latter. Good Luck Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 04.03.2014 um 16:39 schrieb berry van den berg: > Dear all, > > When I export my topoplots to (plot2svg) svg there is this blue square around the headplot (see figure). Does anyone has an idea what causes this? > > Thanks! > > Berry > > > > _______________________________________________ > 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 berryv.dberg at gmail.com Tue Mar 4 17:03:46 2014 From: berryv.dberg at gmail.com (berry van den berg) Date: Tue, 4 Mar 2014 11:03:46 -0500 Subject: [FieldTrip] topoplot In-Reply-To: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> References: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> Message-ID: Thanks! That seems to work a lot better! Cheers, Berry On 4 March 2014 10:56, Julian Keil wrote: > Dear Berry, > > have you tried using the print command? > That's what I usually use for topoplots and it works fine for me: > > print -depsc2 -painter Folder/filename.eps > > Note that I use the "painter" renderer instead of "opengl", as I can't > ungroup the elements later on with the latter. > Good Luck > > Julian > > ******************** > *Dr. Julian Keil* > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 04.03.2014 um 16:39 schrieb berry van den berg: > > Dear all, > > When I export my topoplots to (plot2svg) svg there is this blue square > around the headplot (see figure). Does anyone has an idea what causes this? > > Thanks! > > Berry > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Berry van den Berg berryv.dberg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Mar 5 08:33:46 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 5 Mar 2014 08:33:46 +0100 Subject: [FieldTrip] HCP Releases Initial MEG Dataset References: <003001cf3801$f0be9ba0$d23bd2e0$@pcg.wustl.edu> Message-ID: <060788D0-95FF-4656-8739-00992B8C990D@donders.ru.nl> Dear MEG researchers, Please see the announcement below that I am forwarding on behalf of the HCP. News from the Human Connectome Project (HCP) March 4, 2014 The Human Connectome Project (HCP) WU-Minn consortium is pleased to announce our initial release of magnetoencephalography (MEG) data. What’s in the HCP MEG Initial (MEG1) data release? The MEG1 data include 10 complete, high quality datasets from 14 healthy adults collected at rest (rMEG) and during 3 tasks (tMEG) that measure sensory, motor, and cognitive task performance. For 3 subjects in this MEG release, data has already been released for the other modalities in the HCP protocol (T1w and T2w MRI, rfMRI, tfMRI, dMRI, and behavioral measures). MRI and behavioral measures for the remaining 11 subjects will be released as part of the upcoming HCP 500 Subjects Release scheduled for late spring 2014. The MEG1 release includes: · raw, unprocessed MEG data in 4D Neuroimaging format · co-registration information (in the form of transformation matrices) that allow coordinate transformations between individual subject MEG coordinate systems and the MNI coordinate system · volume conduction model of the head (in MATLAB format) · regular 3-D source models (in MATLAB format) · E-Prime log files (tab-delimited and as Excel spreadsheets) · lists of bad channels and bad segments · sets of independent components (each comprising the time course and the sensor map) together with the related classification output · cleaned channel-level processed data aligned to stimulus and response onsets (for the task data) or segmented in short pieces (2 sec epochs for the resting state data) · averaged event-related fields and time-frequency estimates of power (for the task data) · averaged power spectra (for the resting state data) Download MEG analysis software. Also available for download and use are pipeline scripts specifically written for analyzing HCP MEG data, collectively called “megconnectome software version 1.0”, and the FieldTrip MATLAB toolbox for MEG and EEG analysis. Seehttp://humanconnectome.org/documentation/MEG1/meg-pipeline.html for more information and to download the software. Access MEG1 data on the HCP website. Learn about and download the HCP MEG1 dataset (~300GB of data!) via the ConnectomeDB database. Most HCP image and behavioral data is openly accessible to investigators worldwide who register and accept a limited set of Open Access Data Use Terms. Want more information? Check out the HCP MEG1 Data Release Reference Manual for a comprehensive guide that includes details on scanning protocols, processing pipelines, and information that will help users obtain and analyze the Q3 data. If you are actively using HCP data and tools, we encourage you to join and be active in the hcp-users discussion group (http://www.humanconnectome.org/contact/#subscribe), so that you can tune in to technical discussions on issues that may be of interest. Thanks again for your interest in the HCP. Please send us your questions and comments anytime to info at humanconnectome.org. Best, The WU-Minn HCP Consortium Jennifer Elam, Ph.D. Outreach Coordinator, Human Connectome Project Washington University School of Medicine Department of Anatomy and Neurobiology, Box 8108 660 South Euclid Avenue St. Louis, MO 63110 314-362-9387 elamj at pcg.wustl.edu www.humanconnectome.org -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.png Type: image/png Size: 58922 bytes Desc: not available URL: From mengtongxiao at gmail.com Wed Mar 5 14:28:48 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Wed, 5 Mar 2014 21:28:48 +0800 Subject: [FieldTrip] =?gb2312?b?SGVscCBhYm91dCBmdF90b3BvcGxvdElDo78=?= Message-ID: Dear all, My question is: I use ICA to remove EOG artifacts, can't plot the components for visual inspection using ft_topoplotIC(). Now for what I did: cfg=[]; cfg.grad =data.grad; layout = ft_prepare_layout(cfg, data); figure cfg = []; cfg.component = [1:20]; cfg.layout = layout ; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) ??? Error using ==> surf at 78 X, Y, Z, and C cannot be complex. Error in ==> ft_plot_topo at 251 h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in ==> topoplot_common at 701 ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ==> ft_topoplotTFR at 191 [cfg] = topoplot_common(cfg, varargin{:}); Error in ==> ft_topoplotIC at 142 ft_topoplotTFR(cfg, varargin{:}); how can I do? Thanks a lot Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Mar 5 14:37:33 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Wed, 5 Mar 2014 14:37:33 +0100 (CET) Subject: [FieldTrip] =?utf-8?q?Help_about_ft=5FtopoplotIC=EF=BC=9F?= In-Reply-To: Message-ID: <957227235.5665491.1394026653690.JavaMail.root@sculptor.zimbra.ru.nl> Hi Xiao , It might be not a plotting but a ICA issue. See here: http :// fieldtrip . fcdonders . nl / faq /why_does_my_ ica _output_contain_complex_numbers If your EEG data is rank deficient (due to preprocessing steps as re-referencing, channel interpolations... before ICA computation), ICA output can contain complex number, which is not a good thing. See the above FAQ to see how to solve it. best, Diego ----- Original Message ----- > From: " tongxiao meng " < mengtongxiao @ gmail .com> > To: " fieldtrip " < fieldtrip @science. ru . nl > > Sent: Wednesday, 5 March, 2014 2:28:48 PM > Subject: [ FieldTrip ] Help about ft_ topoplotIC ? > Dear all, > My question is: I use ICA to remove EOG artifacts, can't plot the > components for visual inspection using ft_ topoplotIC (). > Now for what I did: > cfg =[]; > cfg .grad =data.grad; > layout = ft_prepare_layout( cfg , data); > figure > cfg = []; > cfg .component = [1:20]; > cfg .layout = layout ; > cfg .comment = 'no' ; > ft_ topoplotIC ( cfg , comp) > ??? Error using ==> surf at 78 > X, Y, Z, and C cannot be complex. > Error in ==> ft_plot_ topo at 251 > h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size( Zi )), Zi , 'EdgeColor' , > 'none' , 'FaceColor' , shading); > Error in ==> topoplot _common at 701 > ft_plot_ topo ( chanX , chanY , datavector , 'interpmethod' , cfg > .interpolation,... > Error in ==> ft_ topoplotTFR at 191 > [ cfg ] = topoplot _common( cfg , varargin {:}); > Error in ==> ft_ topoplotIC at 142 > ft_ topoplotTFR ( cfg , varargin {:}); > how can I do? > Thanks a lot > Xiao > _______________________________________________ > 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 mariana_b_rebelo at hotmail.com Wed Mar 5 14:37:51 2014 From: mariana_b_rebelo at hotmail.com (Mariana Rebelo) Date: Wed, 5 Mar 2014 13:37:51 +0000 Subject: [FieldTrip] Number of randomizations + 1 in clustering tests? Message-ID: Dear all I am computing some clustering tests on my MEG data and I don't understand the p-value returned in the field stat.posclusters(1).probIf I perform 1000 randomizations I get a p-value of 0.00799201I don't understand how this is possible, the p-value should be equal to integer/1000, so I should get either 0.0070 or 0.0080It seems that in fact I am not performing 1000 randomizations as I set in numrandomization, but 1001, because then: 8/1001 = 0.00799201 Is this really the case? Is the fieldtrip script adding another randomization to what is set by the user? Thanks!Mariana -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 5 14:58:28 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 05 Mar 2014 14:58:28 +0100 Subject: [FieldTrip] Number of randomizations + 1 in clustering tests? In-Reply-To: References: Message-ID: <53172D84.6010101@donders.ru.nl> Hi Mariana, yes, this is the case. You can think of it as your original data also being an observation, thus needs to be added to the number of permutations. If I remember correctly, this is for example explained here in more detail (and probably in more correct terms): http://www.statsci.org/smyth/pubs/permp.pdf Best, Jörn On 3/5/2014 2:37 PM, Mariana Rebelo wrote: > Dear all > > I am computing some clustering tests on my MEG data and I don't > understand the p-value returned in the field stat.posclusters(1).prob > If I perform 1000 randomizations I get a p-value of 0.00799201 > I don't understand how this is possible, the p-value should be equal > to integer/1000, so I should get either 0.0070 or 0.0080 > It seems that in fact I am not performing 1000 randomizations as I set > in numrandomization, but 1001, because then: 8/1001 = 0.00799201 > > Is this really the case? Is the fieldtrip script adding another > randomization to what is set by the user? > > Thanks! > Mariana > > > _______________________________________________ > 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 f.roux at bcbl.eu Wed Mar 5 16:28:58 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: <341671566.860154.1394033338749.JavaMail.root@bcbl.eu> Dear all, I am using ICA to clean my MEG-data before source analysis. My code looks as follows: cfg = []; cfg.component = [comp_idx]; meg_data = ft_rejectcomponent(cfg,comp,meg_data); However, after the call to ft_rejectcomponent there is no grad field in the meg_data structure. Rather, the grad field ist located under meg_data.hdr.grad. Is this the grad-field that I am supposed to use further downstream in the analysis pipeline, or should there be a grad-field under meg_data.grad? Any help would be much appreciated. Fred From singhharsimrat at gmail.com Wed Mar 5 17:45:07 2014 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 5 Mar 2014 16:45:07 +0000 Subject: [FieldTrip] Bipolar neonatal montage -.lay Message-ID: Hi All I was wondering how to create a .lay file for a bipolar montage e.g. the conventional banana shaped neonatal montage - something like 'FP1-T3' 'T3-O1' 'FP1-C3' 'C3-O1' 'Fz-Cz' 'Cz-Pz' 'FP2-C4' 'C4-O2' 'FP2-T4' 'T4-O2' 'T3-C3' 'C3-CZ' 'CZ-C4' 'CZ-PZ' 'C4-T4' Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Thu Mar 6 02:09:11 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Thu, 6 Mar 2014 10:09:11 +0900 Subject: [FieldTrip] ft_prepare_neighbours Message-ID: Hello I have a problem with channel repair. Firstly, I created my own layout because I cannot apply my data into the offered layout files. As far as I know, my EEG data was acquired through SynAmps 2 system with 128 electrodes, but I cannot find a suitable layout files. QuikCap_NSL_128 does not match either. Anyway, I created own customized layout, and usual preprocessing steps were done. However, there were some bad recording channels so I removed them during preprocessing. Moreover, the removed channels are different among the subjects, and now it becomes a big problem for analyzing the data. So I tried channel repair process, but encountered with errors. >>> cfg = []; cfg.method = 'template'; cfg.template = 'bj_plot.mat'; cfg.layout = lay; cfg.channel = 'T7'; % channels for which neighbours should be found cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg, data); >>> I think I have to use 'template' method because, there are some missing channels serially. And here are my question. Is it possible to assign my own layout in the cfg.template or cfg.layout? Actually at this step, I do not understand how to proceed. Also, there are many missing channels differ from each subject, but I am not sure which channels should be placed in the cfg.channel. (T7 is one of the missing channel in a subject in my case.) Finally, at 'data' field, is it possible to assign a finalized preprocessed data? And after ft_prepare_neighbours, >>> cfg = []; cfg.method = 'spline' % cfg.badchannel = 'T7'; cfg.missingchannel = 'T7'; cfg.neighbours = neighbours; cfg.trials = 'all' interpolated = ft_channelrepair(cfg, data) Is that right? -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Mar 6 09:37:18 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 6 Mar 2014 09:37:18 +0100 Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: > > Hi Fred, > I use the same code , but the updated grad is stored in the data. meg_data.hdr.grad is the grad before ICA. After ICA , grad needs to be adjusted ,which is used for the later source reconstruction . Do you have the latest FT ? Best, Haiteng > ------------------------------ > > Message: 5 > Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: [FieldTrip] MEG grad data after ICA cleaning > Message-ID: <341671566.860154.1394033338749.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I am using ICA to clean my MEG-data before source analysis. > > My code looks as follows: > > cfg = []; > cfg.component = [comp_idx]; > > meg_data = ft_rejectcomponent(cfg,comp,meg_data); > > However, after the call to ft_rejectcomponent there is no grad field in > the meg_data structure. Rather, the grad field ist located under > meg_data.hdr.grad. > > Is this the grad-field that I am supposed to use further downstream in the > analysis pipeline, or should there be a grad-field under meg_data.grad? > > Any help would be much appreciated. > > Fred > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Thu Mar 6 11:01:02 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Thu, 6 Mar 2014 11:01:02 +0100 (CET) Subject: [FieldTrip] MEG grad data after ICA cleaning In-Reply-To: Message-ID: <282581989.868311.1394100062381.JavaMail.root@bcbl.eu> Dear Haiteng, thx for your response. The reason why the grad field did not appear in my data-structure was that there was no grad field prior to the call to ft_rejectomponent. After modifying my code to: data.grad = data.hdr.grad; cfg = []; cfg.component = comp_idx; new_data = ft_rejectcomponent(cfg,comp,data); I found that new_data has a grad field which has been adjusted for the rejected components. A question related to this issue is whether it matters if I used two different fieldtrip versions for doing the ICA decomposition (fieldtrip-20131120) vs. component rejection (fieldtrip-20140304)? Does anyone know if there are any changes between these versions that could have an effect on my data? Best regards, Fred Frédéric Roux ----- Original Message ----- From: "Haiteng Jiang" To: fieldtrip at science.ru.nl Sent: Thursday, March 6, 2014 9:37:18 AM Subject: Re: [FieldTrip] MEG grad data after ICA cleaning Hi Fred, I use the same code , but the updated grad is stored in the data. meg_data.hdr.grad is the grad before ICA. After ICA , grad needs to be adjusted ,which is used for the later source reconstruction . Do you have the latest FT ? Best, Haiteng ------------------------------ Message: 5 Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) From: Fr?d?ric Roux < f.roux at bcbl.eu > To: FieldTrip discussion list < fieldtrip at science.ru.nl > Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: < 341671566.860154.1394033338749.JavaMail.root at bcbl.eu > Content-Type: text/plain; charset=utf-8 Dear all, I am using ICA to clean my MEG-data before source analysis. My code looks as follows: cfg = []; cfg.component = [comp_idx]; meg_data = ft_rejectcomponent(cfg,comp,meg_data); However, after the call to ft_rejectcomponent there is no grad field in the meg_data structure. Rather, the grad field ist located under meg_data.hdr.grad. Is this the grad-field that I am supposed to use further downstream in the analysis pipeline, or should there be a grad-field under meg_data.grad? Any help would be much appreciated. Fred -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Thu Mar 6 11:24:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 06 Mar 2014 11:24:43 +0100 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: Message-ID: <53184CEB.9050109@donders.ru.nl> Hi Beom, did your code produce an error? Generally, the 'template' method tries to look for already defined 'template' neighbours. However, as far as I understoog you only created a 'layout', which define where electrodes are placed, but not whether they are neighbours or not. I would advice you to use these settings: cfg = []; cfg.method = 'triangulation'; cfg.layout = lay; cfg.channel = 'all'; % that way you only need to run this once for *all* your subjects cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg); Then, if you are unhappy with the result, for modifcation you can use cfg = []; cfg.neighbours = neighbours; cfg.enableedit = 'yes'; neighbours = ft_neighboursplot(cfg); in that plot, you can click around to mark channels as being neighbours or not. When you are happy, save that neighbour structure and make sure to use it for all your subjects, so that there is no bias for individual subjects. Note that the data variable is used nowhere now, because that would cause missing sensors to be removed from the neighbour structure, but you probably do not want that (or if you do, then use it). And finally, yes, using preprocessed data is possible. Should you have any other questions, feel free to ask. Best, Jörn On 3/6/2014 2:09 AM, Beom Jun Min wrote: > > Hello > > I have a problem with channel repair. > > Firstly, I created my own layout because I cannot apply my data into > the offered layout files. > As far as I know, my EEG data was acquired through SynAmps 2 system > with 128 electrodes, but I cannot find a suitable layout files. > QuikCap_NSL_128 does not match either. > > Anyway, I created own customized layout, and usual preprocessing steps > were done. > However, there were some bad recording channels so I removed them > during preprocessing. > Moreover, the removed channels are different among the subjects, and > now it becomes a big problem for analyzing the data. > > So I tried channel repair process, but encountered with errors. > > >>> > cfg = []; > cfg.method = 'template'; > cfg.template = 'bj_plot.mat'; > cfg.layout = lay; > cfg.channel = 'T7'; % channels for which neighbours should be found > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg, data); > >>> > > I think I have to use 'template' method because, there are some > missing channels serially. > And here are my question. > Is it possible to assign my own layout in the cfg.template or > cfg.layout? Actually at this step, I do not understand how to proceed. > Also, there are many missing channels differ from each subject, but I > am not sure which channels should be placed in the cfg.channel. (T7 is > one of the missing channel in a subject in my case.) > Finally, at 'data' field, is it possible to assign a finalized > preprocessed data? > > And after ft_prepare_neighbours, > > >>> > cfg = []; > cfg.method = 'spline' > % cfg.badchannel = 'T7'; > cfg.missingchannel = 'T7'; > cfg.neighbours = neighbours; > cfg.trials = 'all' > interpolated = ft_channelrepair(cfg, data) > > Is that right? > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com , > http://bmssa.gist.ac.kr > > > _______________________________________________ > 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 mcantor at umich.edu Thu Mar 6 15:19:51 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 6 Mar 2014 09:19:51 -0500 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: <53184CEB.9050109@donders.ru.nl> References: <53184CEB.9050109@donders.ru.nl> Message-ID: Alternatively, you could create a .sfp file for cfg.elecfile of the ft_channelrepair. If your channels are equidistant the equation for determining the neighbours should be fairly straightforward, as long as you have at least the phi and theta coordinates. I talk about it in this thread: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html Here is the conclusion I came to: "For future reference, because I don't remember seeing anything on the fieldtrip FAQ about this and it may be useful to somebody else, the important thing is to turn the phi/theta from degrees into radians, and then applying a trigonometric function to get the X, Y, and Z coordinates. You can do all of these steps in 3 excel functions: X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) Z = =COS(RADIANS(Theta)) This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the coordinate system. I then typed up the channel name, x, y, and z coordinates in a four column notepad document saved as a .sfp file, and used that as my cfg.elecfile." I'm not sure if this is your problem, but I didn't see a cfg.elecfile parameter in your code, so hopefully this helps. On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Beom, > > did your code produce an error? > > Generally, the 'template' method tries to look for already defined > 'template' neighbours. However, as far as I understoog you only created a > 'layout', which define where electrodes are placed, but not whether they > are neighbours or not. I would advice you to use these settings: > > cfg = []; > cfg.method = 'triangulation'; > cfg.layout = lay; > cfg.channel = 'all'; % that way you only need to run this once for > *all* your subjects > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg); > > Then, if you are unhappy with the result, for modifcation you can use > cfg = []; > cfg.neighbours = neighbours; > cfg.enableedit = 'yes'; > neighbours = ft_neighboursplot(cfg); > > in that plot, you can click around to mark channels as being neighbours or > not. When you are happy, save that neighbour structure and make sure to use > it for all your subjects, so that there is no bias for individual subjects. > > Note that the data variable is used nowhere now, because that would cause > missing sensors to be removed from the neighbour structure, but you > probably do not want that (or if you do, then use it). > > And finally, yes, using preprocessed data is possible. > > Should you have any other questions, feel free to ask. > > Best, > Jörn > > > > On 3/6/2014 2:09 AM, Beom Jun Min wrote: > >> >> Hello >> >> I have a problem with channel repair. >> >> Firstly, I created my own layout because I cannot apply my data into the >> offered layout files. >> As far as I know, my EEG data was acquired through SynAmps 2 system with >> 128 electrodes, but I cannot find a suitable layout files. >> QuikCap_NSL_128 does not match either. >> >> Anyway, I created own customized layout, and usual preprocessing steps >> were done. >> However, there were some bad recording channels so I removed them during >> preprocessing. >> Moreover, the removed channels are different among the subjects, and now >> it becomes a big problem for analyzing the data. >> >> So I tried channel repair process, but encountered with errors. >> >> >>> >> cfg = []; >> cfg.method = 'template'; >> cfg.template = 'bj_plot.mat'; >> cfg.layout = lay; >> cfg.channel = 'T7'; % channels for which neighbours should be found >> cfg.feedback = 'yes'; >> neighbours = ft_prepare_neighbours(cfg, data); >> >>> >> >> I think I have to use 'template' method because, there are some missing >> channels serially. >> And here are my question. >> Is it possible to assign my own layout in the cfg.template or cfg.layout? >> Actually at this step, I do not understand how to proceed. >> Also, there are many missing channels differ from each subject, but I am >> not sure which channels should be placed in the cfg.channel. (T7 is one of >> the missing channel in a subject in my case.) >> Finally, at 'data' field, is it possible to assign a finalized >> preprocessed data? >> >> And after ft_prepare_neighbours, >> >> >>> >> cfg = []; >> cfg.method = 'spline' >> % cfg.badchannel = 'T7'; >> cfg.missingchannel = 'T7'; >> cfg.neighbours = neighbours; >> cfg.trials = 'all' >> interpolated = ft_channelrepair(cfg, data) >> >> Is that right? >> >> >> -- >> BeomJun Min, M.D. >> >> Department of Medical System Engineering (DMSE) >> Gwangju Institute of Science and Technology (GIST) >> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >> 500-712, Republic of Korea (South) >> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >> E-mail: mbj0310 at gmail.com , >> http://bmssa.gist.ac.kr >> >> >> _______________________________________________ >> 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 Heng-RuMay.Tan at glasgow.ac.uk Thu Mar 6 23:18:55 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Thu, 6 Mar 2014 22:18:55 +0000 Subject: [FieldTrip] Q: extraction of MNE source filter to reconstruct single trial source timeseries Message-ID: <5318F44F.20209@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Fri Mar 7 01:41:58 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Fri, 7 Mar 2014 09:41:58 +0900 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: <53184CEB.9050109@donders.ru.nl> Message-ID: Dear Jörn and Max Thank you for your help. However, another error occurred. >>> cfg = []; cfg.method = 'triangulation'; %'distance', 'triangulation' or 'template' (default = 'distance') cfg.layout = lay; cfg.channel = {'all', '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'}; cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg); >>> These work successfully. But >>> cfg = []; cfg.neighbours = neighbours; cfg.enableedit = 'yes'; neighbours = ft_neighbourplot(cfg); >>> ??? Error using ==> ft_fetch_sens at 179 no electrodes or gradiometers specified. Error in ==> ft_neighbourplot at 85 sens = ft_fetch_sens(cfg); In addition, >>> cfg = []; cfg.method = 'spline'; %'nearest', 'spline' or 'slap' (default='nearest') cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for details cfg.neighbours = neighbours; cfg.trials = 'all'; % cfg.lambda = % regularisation parameter (default = 1e-5, not for method 'distance') % cfg.order = % order of the polynomial interpolation (default = 4, not for method 'distance') interpolated = ft_channelrepair(cfg, final) >>> ??? Error using ==> ft_fetch_sens at 179 no electrodes or gradiometers specified. Error in ==> ft_channelrepair at 112 sens = ft_fetch_sens(cfg, data); It seems the problem is associated with position of electrode. But I do not have manufacture's file. Do I have to make the positions of electrodes manually? Actually, I do not understand the information from help* ft_datatype_sens, and ft_read_sens.* With regards 2014-03-06 23:19 GMT+09:00 Max Cantor : > Alternatively, you could create a .sfp file for cfg.elecfile of the > ft_channelrepair. If your channels are equidistant the equation for > determining the neighbours should be fairly straightforward, as long as you > have at least the phi and theta coordinates. > > I talk about it in this thread: > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html > > Here is the conclusion I came to: > > "For future reference, because I don't remember seeing anything on the > fieldtrip FAQ about this and it may be useful to somebody else, the > important thing is to turn the phi/theta from degrees into radians, and > then applying a trigonometric function to get the X, Y, and Z coordinates. > > You can do all of these steps in 3 excel functions: > > X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) > Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) > Z = =COS(RADIANS(Theta)) > > This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the > coordinate system. > > I then typed up the channel name, x, y, and z coordinates in a four column > notepad document saved as a .sfp file, and used that as my cfg.elecfile." > > I'm not sure if this is your problem, but I didn't see a cfg.elecfile > parameter in your code, so hopefully this helps. > > > On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < > jm.horschig at donders.ru.nl> wrote: > >> Hi Beom, >> >> did your code produce an error? >> >> Generally, the 'template' method tries to look for already defined >> 'template' neighbours. However, as far as I understoog you only created a >> 'layout', which define where electrodes are placed, but not whether they >> are neighbours or not. I would advice you to use these settings: >> >> cfg = []; >> cfg.method = 'triangulation'; >> cfg.layout = lay; >> cfg.channel = 'all'; % that way you only need to run this once for >> *all* your subjects >> cfg.feedback = 'yes'; >> neighbours = ft_prepare_neighbours(cfg); >> >> Then, if you are unhappy with the result, for modifcation you can use >> cfg = []; >> cfg.neighbours = neighbours; >> cfg.enableedit = 'yes'; >> neighbours = ft_neighboursplot(cfg); >> >> in that plot, you can click around to mark channels as being neighbours >> or not. When you are happy, save that neighbour structure and make sure to >> use it for all your subjects, so that there is no bias for individual >> subjects. >> >> Note that the data variable is used nowhere now, because that would cause >> missing sensors to be removed from the neighbour structure, but you >> probably do not want that (or if you do, then use it). >> >> And finally, yes, using preprocessed data is possible. >> >> Should you have any other questions, feel free to ask. >> >> Best, >> Jörn >> >> >> >> On 3/6/2014 2:09 AM, Beom Jun Min wrote: >> >>> >>> Hello >>> >>> I have a problem with channel repair. >>> >>> Firstly, I created my own layout because I cannot apply my data into the >>> offered layout files. >>> As far as I know, my EEG data was acquired through SynAmps 2 system with >>> 128 electrodes, but I cannot find a suitable layout files. >>> QuikCap_NSL_128 does not match either. >>> >>> Anyway, I created own customized layout, and usual preprocessing steps >>> were done. >>> However, there were some bad recording channels so I removed them during >>> preprocessing. >>> Moreover, the removed channels are different among the subjects, and now >>> it becomes a big problem for analyzing the data. >>> >>> So I tried channel repair process, but encountered with errors. >>> >>> >>> >>> cfg = []; >>> cfg.method = 'template'; >>> cfg.template = 'bj_plot.mat'; >>> cfg.layout = lay; >>> cfg.channel = 'T7'; % channels for which neighbours should be found >>> cfg.feedback = 'yes'; >>> neighbours = ft_prepare_neighbours(cfg, data); >>> >>> >>> >>> I think I have to use 'template' method because, there are some missing >>> channels serially. >>> And here are my question. >>> Is it possible to assign my own layout in the cfg.template or >>> cfg.layout? Actually at this step, I do not understand how to proceed. >>> Also, there are many missing channels differ from each subject, but I am >>> not sure which channels should be placed in the cfg.channel. (T7 is one of >>> the missing channel in a subject in my case.) >>> Finally, at 'data' field, is it possible to assign a finalized >>> preprocessed data? >>> >>> And after ft_prepare_neighbours, >>> >>> >>> >>> cfg = []; >>> cfg.method = 'spline' >>> % cfg.badchannel = 'T7'; >>> cfg.missingchannel = 'T7'; >>> cfg.neighbours = neighbours; >>> cfg.trials = 'all' >>> interpolated = ft_channelrepair(cfg, data) >>> >>> Is that right? >>> >>> >>> -- >>> BeomJun Min, M.D. >>> >>> Department of Medical System Engineering (DMSE) >>> Gwangju Institute of Science and Technology (GIST) >>> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >>> 500-712, Republic of Korea (South) >>> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >>> E-mail: mbj0310 at gmail.com , >>> http://bmssa.gist.ac.kr >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Fri Mar 7 04:26:24 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 6 Mar 2014 22:26:24 -0500 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: <53184CEB.9050109@donders.ru.nl> Message-ID: I think the neighborplot not working may have to do with the cfg.elec parameter not being set in ft_prepareneighbours, though I'm not sure why you don't get the error there. You should try contacting the manufacturer, otherwise you may have to make the electrode positions manually. As I mentioned, I was able to take the phi/theta coordinates provided by the manufacturer to determine the electrode positions, but if you have literally nothing to go by you may have to measure it by hand. If the electrodes are equidistant, finding the measurement between any two should be able to inform the position of all of them, otherwise I'm not sure what you could do. On Thu, Mar 6, 2014 at 7:41 PM, Beom Jun Min wrote: > Dear Jörn and Max > > Thank you for your help. > However, another error occurred. > > >>> > cfg = []; > cfg.method = 'triangulation'; %'distance', 'triangulation' or > 'template' (default = 'distance') > cfg.layout = lay; > cfg.channel = {'all', > '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'}; > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg); > >>> > These work successfully. > > But > >>> > cfg = []; > cfg.neighbours = neighbours; > cfg.enableedit = 'yes'; > neighbours = ft_neighbourplot(cfg); > >>> > ??? Error using ==> ft_fetch_sens at 179 > no electrodes or gradiometers specified. > > Error in ==> ft_neighbourplot at 85 > sens = ft_fetch_sens(cfg); > > In addition, > >>> > cfg = []; > cfg.method = 'spline'; %'nearest', 'spline' or 'slap' > (default='nearest') > cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for > details > cfg.neighbours = neighbours; > cfg.trials = 'all'; > % cfg.lambda = % regularisation parameter (default = 1e-5, not for > method 'distance') > % cfg.order = % order of the polynomial interpolation (default = > 4, not for method 'distance') > interpolated = ft_channelrepair(cfg, final) > >>> > ??? Error using ==> ft_fetch_sens at 179 > no electrodes or gradiometers specified. > > Error in ==> ft_channelrepair at 112 > sens = ft_fetch_sens(cfg, data); > > It seems the problem is associated with position of electrode. But I do > not have manufacture's file. > Do I have to make the positions of electrodes manually? > Actually, I do not understand the information from help* > ft_datatype_sens, and ft_read_sens.* > > With regards > > > > > > 2014-03-06 23:19 GMT+09:00 Max Cantor : > > Alternatively, you could create a .sfp file for cfg.elecfile of the >> ft_channelrepair. If your channels are equidistant the equation for >> determining the neighbours should be fairly straightforward, as long as you >> have at least the phi and theta coordinates. >> >> I talk about it in this thread: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html >> >> Here is the conclusion I came to: >> >> "For future reference, because I don't remember seeing anything on the >> fieldtrip FAQ about this and it may be useful to somebody else, the >> important thing is to turn the phi/theta from degrees into radians, and >> then applying a trigonometric function to get the X, Y, and Z coordinates. >> >> You can do all of these steps in 3 excel functions: >> >> X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) >> Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) >> Z = =COS(RADIANS(Theta)) >> >> This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the >> coordinate system. >> >> I then typed up the channel name, x, y, and z coordinates in a four column >> notepad document saved as a .sfp file, and used that as my cfg.elecfile." >> >> I'm not sure if this is your problem, but I didn't see a cfg.elecfile >> parameter in your code, so hopefully this helps. >> >> >> On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < >> jm.horschig at donders.ru.nl> wrote: >> >>> Hi Beom, >>> >>> did your code produce an error? >>> >>> Generally, the 'template' method tries to look for already defined >>> 'template' neighbours. However, as far as I understoog you only created a >>> 'layout', which define where electrodes are placed, but not whether they >>> are neighbours or not. I would advice you to use these settings: >>> >>> cfg = []; >>> cfg.method = 'triangulation'; >>> cfg.layout = lay; >>> cfg.channel = 'all'; % that way you only need to run this once for >>> *all* your subjects >>> cfg.feedback = 'yes'; >>> neighbours = ft_prepare_neighbours(cfg); >>> >>> Then, if you are unhappy with the result, for modifcation you can use >>> cfg = []; >>> cfg.neighbours = neighbours; >>> cfg.enableedit = 'yes'; >>> neighbours = ft_neighboursplot(cfg); >>> >>> in that plot, you can click around to mark channels as being neighbours >>> or not. When you are happy, save that neighbour structure and make sure to >>> use it for all your subjects, so that there is no bias for individual >>> subjects. >>> >>> Note that the data variable is used nowhere now, because that would >>> cause missing sensors to be removed from the neighbour structure, but you >>> probably do not want that (or if you do, then use it). >>> >>> And finally, yes, using preprocessed data is possible. >>> >>> Should you have any other questions, feel free to ask. >>> >>> Best, >>> Jörn >>> >>> >>> >>> On 3/6/2014 2:09 AM, Beom Jun Min wrote: >>> >>>> >>>> Hello >>>> >>>> I have a problem with channel repair. >>>> >>>> Firstly, I created my own layout because I cannot apply my data into >>>> the offered layout files. >>>> As far as I know, my EEG data was acquired through SynAmps 2 system >>>> with 128 electrodes, but I cannot find a suitable layout files. >>>> QuikCap_NSL_128 does not match either. >>>> >>>> Anyway, I created own customized layout, and usual preprocessing steps >>>> were done. >>>> However, there were some bad recording channels so I removed them >>>> during preprocessing. >>>> Moreover, the removed channels are different among the subjects, and >>>> now it becomes a big problem for analyzing the data. >>>> >>>> So I tried channel repair process, but encountered with errors. >>>> >>>> >>> >>>> cfg = []; >>>> cfg.method = 'template'; >>>> cfg.template = 'bj_plot.mat'; >>>> cfg.layout = lay; >>>> cfg.channel = 'T7'; % channels for which neighbours should be >>>> found >>>> cfg.feedback = 'yes'; >>>> neighbours = ft_prepare_neighbours(cfg, data); >>>> >>> >>>> >>>> I think I have to use 'template' method because, there are some missing >>>> channels serially. >>>> And here are my question. >>>> Is it possible to assign my own layout in the cfg.template or >>>> cfg.layout? Actually at this step, I do not understand how to proceed. >>>> Also, there are many missing channels differ from each subject, but I >>>> am not sure which channels should be placed in the cfg.channel. (T7 is one >>>> of the missing channel in a subject in my case.) >>>> Finally, at 'data' field, is it possible to assign a finalized >>>> preprocessed data? >>>> >>>> And after ft_prepare_neighbours, >>>> >>>> >>> >>>> cfg = []; >>>> cfg.method = 'spline' >>>> % cfg.badchannel = 'T7'; >>>> cfg.missingchannel = 'T7'; >>>> cfg.neighbours = neighbours; >>>> cfg.trials = 'all' >>>> interpolated = ft_channelrepair(cfg, data) >>>> >>>> Is that right? >>>> >>>> >>>> -- >>>> BeomJun Min, M.D. >>>> >>>> Department of Medical System Engineering (DMSE) >>>> Gwangju Institute of Science and Technology (GIST) >>>> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >>>> 500-712, Republic of Korea (South) >>>> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >>>> E-mail: mbj0310 at gmail.com , >>>> http://bmssa.gist.ac.kr >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr > > _______________________________________________ > 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 chris.day-2 at postgrad.manchester.ac.uk Fri Mar 7 16:36:28 2014 From: chris.day-2 at postgrad.manchester.ac.uk (Christopher Day) Date: Fri, 7 Mar 2014 15:36:28 +0000 Subject: [FieldTrip] Creation of MNI-aligned grids in individual gray matter? Message-ID: Hi, I'm quite new to FieldTrip, and I've been following the tutorials and example code online to perform source reconstruction on EEG data. I have had some success at creating MNI-aligned grids in individual head-space following this example: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space This is probably a stupid question, but why are some of the sources in the grid outside of the brain volume boundary in Figure 3 when the figure was plotted with the grid.inside positions? This is the plotting code copied from the example page: figure; ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; ft_plot_mesh(grid.pos(grid.inside,:)); I have also been trying to restrict my source analysis to gray matter using this FAQ: http://fieldtrip.fcdonders.nl/faq/can_i_restrict_the_source_reconstruction_to_the_grey_matter And this old conversation on the mailing list: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-March/004984.html I was wondering whether it is possible to combine these two avenues I've been pursuing and restrict the source analysis to MNI-aligned grids in individual gray matter? If so, how do you do it? And if not, can you explain why not please? Any help gratefully received. Kind regards, Chris Day PhD Student in Psychological Sciences, University of Manchester, Zochonis Building, 3rd Floor, T4. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.day-2 at postgrad.manchester.ac.uk Fri Mar 7 16:52:55 2014 From: chris.day-2 at postgrad.manchester.ac.uk (Christopher Day) Date: Fri, 7 Mar 2014 15:52:55 +0000 Subject: [FieldTrip] Source time series question Message-ID: Hi, I noticed in this old conversation on the mailing list that it is possible to extract a 3-dimensional source moment at each time point in a trial: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-August/004185.html Would anyone be able to tell me whether the direction of this moment remains relatively constant throughout the time course of the trial? And furthermore, that it is mainly the magnitude of the source along this direction that explains the variation in each source? Intuitively, it seems to me that the direction of the source would be constrained by the brain tissue orientation. Is this the case? Any help would be gratefully received. Kind regards, Chris Day PhD Student in Psychological Sciences, University of Manchester, Zochonis Building, 3rd Floor, T4. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Tue Mar 4 09:06:34 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Tue, 4 Mar 2014 16:06:34 +0800 Subject: [FieldTrip] help Message-ID: Dear all: I don't know much about maxfilter, but I have a .fif file that have done tsss. Does it mean that I can use the data to do source reconstruction or some compute (eg.plv) ? thank youi very much again. Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Mar 10 09:48:58 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 10 Mar 2014 09:48:58 +0100 Subject: [FieldTrip] help In-Reply-To: References: Message-ID: Dear Xiao, I am new to maxfilter as well, but this is what I understand; Maxfilter's SSS decomposes your data spatially, separating it into components that arise from the helmet from those that arise from outside the helmet. This results in a reduction of dimensionality of your data, typically to around 80. This should, as I understand it, be still OK for source reconstruction methods and, in fact, I think is often used in those. The tSSS method extends the SSS method to the temporal domain. I would therefor be extremely careful in using tSSS in combination with analyses of temporal correlations in the data, such as PLV. In any case you could test the effect it has on your dependent measures by applying the analysis with and without tSSS. Best of luck, Stephen On 4 March 2014 09:06, tongxiao meng wrote: > Dear all: > > I don't know much about maxfilter, but I have a .fif file that have done > tsss. > Does it mean that I can use the data to do source reconstruction or some > compute (eg.plv) ? > > thank youi very much again. > > Xiao > > _______________________________________________ > 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 maximilien.chaumon at gmail.com Mon Mar 10 13:40:44 2014 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Mon, 10 Mar 2014 13:40:44 +0100 Subject: [FieldTrip] Call for papers, Cutting-edge EEG methods Message-ID: Dear EEG community, Cutting EEG, the first symposium on Cutting-edge EEG methods for research on cognition happened in Berlin on the 19th to 21th February 2014. The success of this small event was resounding and we are now looking to raise its impact by preparing a* special issue at Journal of Neuroscience Methods for the end of this year*. By bringing together leading scientists contributing to the field in this special issue, we wish to create a landmark reference of methods for EEG research on cognition. We would like this issue to cover the most important basic aspects the EEG analysis workflow, as well as making state-of-the-art tools for signal processing, robust statistics and machine learning more accessible to our community. The submission process goes as follows: - Submission via http://ees.elsevier.com/jneumeth/ - Your paper will go through a full review process. We will be in contact through the submission system. The final decision to publish is made by Editor in Chief Vincenzo Crunelli . - There is no hard limit of page length, but we recommend 5000-7000 words. - No mandatory publication charges. Figures in color are free online. Optional charges for authors of color in print (each author will get 4 color figures in print for free but will pay 270 EUR per figure beyond that). There is also an Open Access option at your charge (1,800 USD per article). - For additional and more detailed information and guidelines: http://www.elsevier.com/journals/journal-of-neuroscience-methods/0165-0270/guide-for-authors Time schedule for this Special Issue: 31 May 2014 Deadline for submission of MSs July 2014 Reviews returned to authors October 2014 Acceptance deadline (final notifications) November 2014 Expected publication date Important note: The goal of this issue is to make your method accessible to non-expert EEG researchers. In order to make your contribution as much accessible and useful as possible, we would like to recommend the following: - Include a numbered list of steps required to implement your method - Share tips: the simple manipulations that enhance the quality of the data (e.g. normalization, re-referencing, preprocessing steps...) - Share code (e.g. through code repositories like Git, Google code or Sourceforge) Note also: manuscripts describing *known methods with a new look are also encouraged*. This means that if you think that your method has already been documented, but you have interesting tips or the current view on the topic has changed significantly over recent years, you are welcome to submit. Please *get in contact with us *with your submission inquiry. Finally, we are looking for some really *awesome looking visuals* for the cover-art of our Special Issue. Please feel free to contribute ideas or send us drafts! Please feel free to *contact us* if you have any questions. Best regards, Maximilien Chaumon, Sébastien Crouzet & Niko Busch Guest Editors, Special Issue on Cutting-edge EEG methods. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Tue Mar 11 16:04:51 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Tue, 11 Mar 2014 16:04:51 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: Message-ID: <531F2613.1040808@gmail.com> Dear FT-ers, I found an old posting to the mailing list (see below) that never got answered so my question still holds: given a location I found in the interpolated source, how do I find back the same location in .pos of the non-interpolated data? I can try and go around it by finding the corresponding MNI coordinates in the interpolated data (which by now I have to do by hand, so not optimal anyways), and then look for those coordinates in .pos. But I was wondering, like Cornelius was in his post, whether there is a neater way to get this information. Thanks a lot for the help, Vitória >>>>>>>>>>>>>> Hi mailing list, I'm still struggling with the conversion of coordinates between source and interpolated source space. For example, if i have the position of a single grid point how do i get the corresponding voxel in the interpolated source structure. Or the other way around, how to get the grid point which corresponds to a voxel (e.g the max voxel) in the interpolated source structure. I think this should be a common problem when working with virtual electrodes, shouldn't it? To make things easier i put together a example with the data from the source tutorial where i tried to calculated the grid pos of the max voxel in the interpolated source. clear all; load sourcePost_nocon; % source structure from tutorial mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial sourceNAI = sourcePost_nocon; sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ sourcePost_nocon.avg.noise; sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); % Find position of max activity [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); posInt=[xi, yi, zi]; % Plot interpolated source with position of max activity cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.locationcoordinates = 'voxel'; cfg.location = posInt; % location of max activity is marked correctly. figure; ft_sourceplot(cfg,sourceNAIInt); % Transform coordinate back to uninterpolated source??? dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); % Plot uninterpolated source with position aquired from interpolated source cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.locationcoordinates = 'voxel'; cfg.location = dpos; % unfortunately this coordinate is obviously wrong!!! WHY? figure; ft_sourceplot(cfg,sourceNAI); Unfortunately the solution of Jan Mathijs did not work, nor did mine :( Any ideas??? Cornelius -------------- next part -------------- An HTML attachment was scrubbed... URL: From erick.ortiz at med.uni-tuebingen.de Tue Mar 11 18:35:42 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Tue, 11 Mar 2014 18:35:42 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <531F2613.1040808@gmail.com> References: <531F2613.1040808@gmail.com> Message-ID: Dear Vitória and Cornelius, this is a common problem, and maybe it would be good to clarify the strategies that can be used here. I hope this can help others in a similar situation, which I have found many times. 1) You are trying to convert voxel indexes to head (CTF) coordinates. In this case, there are two mistakes in the code: 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, 'homogeneous' ); ... should be done with sourceNAIInt, not mri. The transforms are different, in general; e.g. note the downsample=2. 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous post. Or remove this line, since 'head' is the default. 2) But if you are working with the same subject/grid, there is no need for interpolation at all. Simply find the grid position with highest 'pow' and take its position. [dummy,ind] = max(source.avg.pow); pos = source.pos(ind,:); 3) However, this is not possible when using different grids, e.g. in a grand average in MNI coordinates. Find the peak ('pos') in the interpolated volume, as in Cornelius' code, then find the index of the nearest grid position for a common (again, MNI) grid. This is also in JM's message. dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); [dummy,ind] = min(sum(dpos.^2,2)); 4) What I have been using, and strongly recommend, is an MNI grid warped to the subject's anatomy, according to this procedure: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space This would give you both the benefits of working in MNI coordinates, and the ease of having a common grid across subjects (for instance, enabling solution #2). Still, some projects do call for one of the other options. Just a couple of details: - Pay utmost attention to coordinate systems and units. For instance, it is common to confuse unlabeled cm for mm, and either of these with voxels. Try to also label all structures as CTF or SPM (MNI). - Using pinv instead of inv is usually a good idea. Here, it is a not an issue, but matrix inversion in MATLAB can lead to a world of hurt to the unwary. Best, Erick On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: > Dear FT-ers, > > I found an old posting to the mailing list (see below) that never got > answered so my question still holds: given a location I found in the > interpolated source, how do I find back the same location in .pos of the > non-interpolated data? > I can try and go around it by finding the corresponding MNI coordinates in > the interpolated data (which by now I have to do by hand, so not optimal > anyways), and then look for those coordinates in .pos. But I was wondering, > like Cornelius was in his post, whether there is a neater way to get this > information. > > Thanks a lot for the help, > Vitória > > > >>>>>>>>>>>>>> >> >> Hi mailing list, >> >> I'm still struggling with the conversion of coordinates between source and >> interpolated source space. >> For example, if i have the position of a single grid point how do i get >> the >> corresponding voxel in the interpolated source structure. Or the other >> way >> around, how to get the grid point which corresponds to a voxel (e.g the >> max >> voxel) in the interpolated source structure. >> >> I think this should be a common problem when working with virtual >> electrodes, shouldn't it? >> >> To make things easier i put together a example with the data from the >> source tutorial where i tried to calculated the grid pos of the max voxel >> in the interpolated source. >> >> clear all; >> load sourcePost_nocon; % source structure from tutorial >> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >> >> sourceNAI = sourcePost_nocon; >> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >> sourcePost_nocon.avg.noise; >> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >> >> % Find position of max activity >> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >> posInt=[xi, yi, zi]; >> >> % Plot interpolated source with position of max activity >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = posInt; % location of max activity is marked >> correctly. >> figure; >> ft_sourceplot(cfg,sourceNAIInt); >> >> % Transform coordinate back to uninterpolated source??? >> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >> >> >> % Plot uninterpolated source with position aquired from interpolated >> source >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = dpos; % unfortunately this coordinate is >> obviously wrong!!! WHY? >> figure; >> ft_sourceplot(cfg,sourceNAI); >> >> >> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >> >> Any ideas??? >> >> Cornelius >> >> >> > > > > _______________________________________________ > 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 v.piai.research at gmail.com Wed Mar 12 09:24:53 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 12 Mar 2014 09:24:53 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> Message-ID: <532019D5.8040204@gmail.com> Dear Erick, Thanks for your detailed reply. I've been using individual MNI-warped grids (point 4 below) and I'm always using ft_convert_unit so those points are alright in my data. The reason why I do need to interpolate (at least, I think I need), is because I'm looking for max 'pow' in anatomically defined regions given the afni atlas. I managed to get it to work by interpolating to the mri and looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. Do you have any experience with this approach (searching within anatomical labels) without having to interpolate? Thanks once more, Vitória On 3/11/2014 6:35 PM, Erick Ortiz wrote: > Dear Vitória and Cornelius, > > this is a common problem, and maybe it would be good to clarify the > strategies that can be used here. I hope this can help others in a > similar situation, which I have found many times. > > 1) You are trying to convert voxel indexes to head (CTF) coordinates. > In this case, there are two mistakes in the code: > 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, > 'homogeneous' ); > ... should be done with sourceNAIInt, not mri. The transforms are > different, in general; e.g. note the downsample=2. > 1b) use cfg.locationcoordinates = 'head', as commented by JM in a > previous post. Or remove this line, since 'head' is the default. > > 2) But if you are working with the same subject/grid, there is no need > for interpolation at all. Simply find the grid position with highest > 'pow' and take its position. > [dummy,ind] = max(source.avg.pow); > pos = source.pos(ind,:); > > 3) However, this is not possible when using different grids, e.g. in a > grand average in MNI coordinates. Find the peak ('pos') in the > interpolated volume, as in Cornelius' code, then find the index of the > nearest grid position for a common (again, MNI) grid. This is also in > JM's message. > > dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); > [dummy,ind] = min(sum(dpos.^2,2)); > > 4) What I have been using, and strongly recommend, is an MNI grid > warped to the subject's anatomy, according to this procedure: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > This would give you both the benefits of working in MNI coordinates, > and the ease of having a common grid across subjects (for instance, > enabling solution #2). Still, some projects do call for one of the > other options. > > Just a couple of details: > - Pay utmost attention to coordinate systems and units. For instance, > it is common to confuse unlabeled cm for mm, and either of these with > voxels. Try to also label all structures as CTF or SPM (MNI). > - Using pinv instead of inv is usually a good idea. Here, it is a not > an issue, but matrix inversion in MATLAB can lead to a world of hurt > to the unwary. > > Best, > Erick > > > > On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai > > wrote: > > Dear FT-ers, > > I found an old posting to the mailing list (see below) that never > got answered so my question still holds: given a location I found > in the interpolated source, how do I find back the same location > in .pos of the non-interpolated data? > I can try and go around it by finding the corresponding MNI > coordinates in the interpolated data (which by now I have to do by > hand, so not optimal anyways), and then look for those coordinates > in .pos. But I was wondering, like Cornelius was in his post, > whether there is a neater way to get this information. > > Thanks a lot for the help, > Vitória > > > >>>>>>>>>>>>>> > > Hi mailing list, > > I'm still struggling with the conversion of coordinates > between source and > interpolated source space. > For example, if i have the position of a single grid point how > do i get the > corresponding voxel in the interpolated source structure. Or > the other way > around, how to get the grid point which corresponds to a voxel > (e.g the max > voxel) in the interpolated source structure. > > I think this should be a common problem when working with virtual > electrodes, shouldn't it? > > To make things easier i put together a example with the data > from the > source tutorial where i tried to calculated the grid pos of > the max voxel > in the interpolated source. > > clear all; > load sourcePost_nocon; % source structure from > tutorial > mri = ft_read_mri('Subject01.mri'); % mri of subject01 from > tutorial > > sourceNAI = sourcePost_nocon; > sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ > sourcePost_nocon.avg.noise; > sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); > > % Find position of max activity > [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); > [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); > posInt=[xi, yi, zi]; > > % Plot interpolated source with position of max activity > cfg = []; > cfg.method = 'ortho'; > cfg.funparameter = 'avg.pow'; > cfg.locationcoordinates = 'voxel'; > cfg.location = posInt; % location of max > activity is marked > correctly. > figure; > ft_sourceplot(cfg,sourceNAIInt); > > % Transform coordinate back to uninterpolated source??? > dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); > > > % Plot uninterpolated source with position aquired from > interpolated source > cfg = []; > cfg.method = 'ortho'; > cfg.funparameter = 'avg.pow'; > cfg.locationcoordinates = 'voxel'; > cfg.location = dpos; % unfortunately this > coordinate is > obviously wrong!!! WHY? > figure; > ft_sourceplot(cfg,sourceNAI); > > > Unfortunately the solution of Jan Mathijs did not work, nor > did mine :( > > Any ideas??? > > Cornelius > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 erick.ortiz at med.uni-tuebingen.de Wed Mar 12 11:37:19 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Wed, 12 Mar 2014 11:37:19 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <532019D5.8040204@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> Message-ID: Dear Vitoria, What I do usually, is to simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch. About the interpolation, I cannot help much more. I have been using my own tools for years, and I was not following the support of atlases in Fieldtrip.I tried it today, but had issues with coordinate system labeling when defining a ROI (I updated to the latest version by SVN): afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); cfg = []; cfg.method = 'ortho'; cfg.interactive = 'yes'; cfg.funparameter = 'coh'; cfg.atlas = afni; cfg.coordsys = 'mni'; % cfg.roi = 'Middle Temporal Gyrus'; % cfg.inputcoord = 'tal'; ft_sourceplot(cfg, interp); Also note that I had to use ft_read_atlas, because ft_prepare_atlas does not generate the brick0label/brick1label fields. It works well, but if I try to define a ROI (uncommenting the two lines), I get the error "The field cfg.inputcoord is required". There seems to be some confusion between inputcoord and coordsys. It can be because I was doing something wrong: maybe a Fieldtrip developer could comment on that? Best, Erick On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: > Dear Erick, > > Thanks for your detailed reply. > I've been using individual MNI-warped grids (point 4 below) and I'm always > using ft_convert_unit so those points are alright in my data. > > The reason why I do need to interpolate (at least, I think I need), is > because I'm looking for max 'pow' in anatomically defined regions given the > afni atlas. I managed to get it to work by interpolating to the mri and > looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using > ft_volumelookup. > Do you have any experience with this approach (searching within anatomical > labels) without having to interpolate? > > Thanks once more, Vitória > > > > > On 3/11/2014 6:35 PM, Erick Ortiz wrote: > > Dear Vitória and Cornelius, > > this is a common problem, and maybe it would be good to clarify the > strategies that can be used here. I hope this can help others in a similar > situation, which I have found many times. > > 1) You are trying to convert voxel indexes to head (CTF) coordinates. In > this case, there are two mistakes in the code: > 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, > 'homogeneous' ); > ... should be done with sourceNAIInt, not mri. The transforms are > different, in general; e.g. note the downsample=2. > 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous > post. Or remove this line, since 'head' is the default. > > 2) But if you are working with the same subject/grid, there is no need for > interpolation at all. Simply find the grid position with highest 'pow' and > take its position. > [dummy,ind] = max(source.avg.pow); > pos = source.pos(ind,:); > > 3) However, this is not possible when using different grids, e.g. in a > grand average in MNI coordinates. Find the peak ('pos') in the interpolated > volume, as in Cornelius' code, then find the index of the nearest grid > position for a common (again, MNI) grid. This is also in JM's message. > > dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); > [dummy,ind] = min(sum(dpos.^2,2)); > > 4) What I have been using, and strongly recommend, is an MNI grid warped > to the subject's anatomy, according to this procedure: > > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > This would give you both the benefits of working in MNI coordinates, and > the ease of having a common grid across subjects (for instance, enabling > solution #2). Still, some projects do call for one of the other options. > > Just a couple of details: > - Pay utmost attention to coordinate systems and units. For instance, it > is common to confuse unlabeled cm for mm, and either of these with voxels. > Try to also label all structures as CTF or SPM (MNI). > - Using pinv instead of inv is usually a good idea. Here, it is a not an > issue, but matrix inversion in MATLAB can lead to a world of hurt to the > unwary. > > Best, > Erick > > > > On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: > >> Dear FT-ers, >> >> I found an old posting to the mailing list (see below) that never got >> answered so my question still holds: given a location I found in the >> interpolated source, how do I find back the same location in .pos of the >> non-interpolated data? >> I can try and go around it by finding the corresponding MNI coordinates >> in the interpolated data (which by now I have to do by hand, so not optimal >> anyways), and then look for those coordinates in .pos. But I was wondering, >> like Cornelius was in his post, whether there is a neater way to get this >> information. >> >> Thanks a lot for the help, >> Vitória >> >> >> >>>>>>>>>>>>>> >>> >>> Hi mailing list, >>> >>> I'm still struggling with the conversion of coordinates between source >>> and >>> interpolated source space. >>> For example, if i have the position of a single grid point how do i get >>> the >>> corresponding voxel in the interpolated source structure. Or the other >>> way >>> around, how to get the grid point which corresponds to a voxel (e.g the >>> max >>> voxel) in the interpolated source structure. >>> >>> I think this should be a common problem when working with virtual >>> electrodes, shouldn't it? >>> >>> To make things easier i put together a example with the data from the >>> source tutorial where i tried to calculated the grid pos of the max voxel >>> in the interpolated source. >>> >>> clear all; >>> load sourcePost_nocon; % source structure from tutorial >>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>> >>> sourceNAI = sourcePost_nocon; >>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>> sourcePost_nocon.avg.noise; >>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>> >>> % Find position of max activity >>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>> posInt=[xi, yi, zi]; >>> >>> % Plot interpolated source with position of max activity >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = posInt; % location of max activity is marked >>> correctly. >>> figure; >>> ft_sourceplot(cfg,sourceNAIInt); >>> >>> % Transform coordinate back to uninterpolated source??? >>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>> >>> >>> % Plot uninterpolated source with position aquired from interpolated >>> source >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = dpos; % unfortunately this coordinate >>> is >>> obviously wrong!!! WHY? >>> figure; >>> ft_sourceplot(cfg,sourceNAI); >>> >>> >>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>> >>> Any ideas??? >>> >>> Cornelius >>> >>> >>> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > _______________________________________________ > 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 juriguen at gmail.com Wed Mar 12 17:48:15 2014 From: juriguen at gmail.com (=?ISO-8859-1?Q?Jose_Antonio_Urig=FCen?=) Date: Wed, 12 Mar 2014 17:48:15 +0100 Subject: [FieldTrip] Problem with "openmeeg_eeg_leadfield_example" Message-ID: Regardless of the Fieldtrip version I use, I keep getting the following error when trying to run the m file "openmeeg_eeg_leadfield_example": "Reference to non-existent field 'cond'. Error in ft_compute_leadfield (line 390) vol.cond = vol.cond(indx); Error in openmeeg_eeg_leadfield_example (line 83) lf_sphere = ft_compute_leadfield(pos, sens, vol_sphere);" I would like to be able to eventually simulate a head model and compute the forward EEG leadfield. I believe this to be a good starting point, any other suggestions? Thanks Toni -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Wed Mar 12 17:50:00 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 12 Mar 2014 17:50:00 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> Message-ID: <53209038.8010906@gmail.com> Dear Erick, "simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch" -> that sounds like a good thing to do. Is this a very complicated thing to do? Would you mind sharing a piece of code or some tips for how I could achieve it? Thanks once more, Vitória On 3/12/2014 11:37 AM, Erick Ortiz wrote: > Dear Vitoria, > > What I do usually, is to simply label and/or define my ROI in the MNI > grid. When I warp to the individuals, everything is in place without a > hitch. > > About the interpolation, I cannot help much more. I have been using my > own tools for years, and I was not following the support of atlases in > Fieldtrip.I tried it today, but had issues with coordinate system > labeling when defining a ROI (I updated to the latest version by SVN): > > afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'yes'; > cfg.funparameter = 'coh'; > cfg.atlas = afni; > cfg.coordsys = 'mni'; > % cfg.roi = 'Middle Temporal Gyrus'; > % cfg.inputcoord = 'tal'; > ft_sourceplot(cfg, interp); > > Also note that I had to use ft_read_atlas, because ft_prepare_atlas > does not generate the brick0label/brick1label fields. > > It works well, but if I try to define a ROI (uncommenting the two > lines), I get the error "The field cfg.inputcoord is required". There > seems to be some confusion between inputcoord and coordsys. > > It can be because I was doing something wrong: maybe a Fieldtrip > developer could comment on that? > > Best, > Erick > > > > On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai > > wrote: > > Dear Erick, > > Thanks for your detailed reply. > I've been using individual MNI-warped grids (point 4 below) and > I'm always using ft_convert_unit so those points are alright in my > data. > > The reason why I do need to interpolate (at least, I think I > need), is because I'm looking for max 'pow' in anatomically > defined regions given the afni atlas. I managed to get it to work > by interpolating to the mri and looking for max 'pow' given a > label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. > Do you have any experience with this approach (searching within > anatomical labels) without having to interpolate? > > Thanks once more, Vitória > > > > > On 3/11/2014 6:35 PM, Erick Ortiz wrote: >> Dear Vitória and Cornelius, >> >> this is a common problem, and maybe it would be good to clarify >> the strategies that can be used here. I hope this can help others >> in a similar situation, which I have found many times. >> >> 1) You are trying to convert voxel indexes to head (CTF) >> coordinates. In this case, there are two mistakes in the code: >> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, >> 'homogeneous' ); >> ... should be done with sourceNAIInt, not mri. The transforms are >> different, in general; e.g. note the downsample=2. >> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a >> previous post. Or remove this line, since 'head' is the default. >> >> 2) But if you are working with the same subject/grid, there is no >> need for interpolation at all. Simply find the grid position with >> highest 'pow' and take its position. >> [dummy,ind] = max(source.avg.pow); >> pos = source.pos(ind,:); >> >> 3) However, this is not possible when using different grids, e.g. >> in a grand average in MNI coordinates. Find the peak ('pos') in >> the interpolated volume, as in Cornelius' code, then find the >> index of the nearest grid position for a common (again, MNI) >> grid. This is also in JM's message. >> >> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >> [dummy,ind] = min(sum(dpos.^2,2)); >> >> 4) What I have been using, and strongly recommend, is an MNI grid >> warped to the subject's anatomy, according to this procedure: >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> This would give you both the benefits of working in MNI >> coordinates, and the ease of having a common grid across subjects >> (for instance, enabling solution #2). Still, some projects do >> call for one of the other options. >> >> Just a couple of details: >> - Pay utmost attention to coordinate systems and units. For >> instance, it is common to confuse unlabeled cm for mm, and either >> of these with voxels. Try to also label all structures as CTF or >> SPM (MNI). >> - Using pinv instead of inv is usually a good idea. Here, it is a >> not an issue, but matrix inversion in MATLAB can lead to a world >> of hurt to the unwary. >> >> Best, >> Erick >> >> >> >> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai >> > wrote: >> >> Dear FT-ers, >> >> I found an old posting to the mailing list (see below) that >> never got answered so my question still holds: given a >> location I found in the interpolated source, how do I find >> back the same location in .pos of the non-interpolated data? >> I can try and go around it by finding the corresponding MNI >> coordinates in the interpolated data (which by now I have to >> do by hand, so not optimal anyways), and then look for those >> coordinates in .pos. But I was wondering, like Cornelius was >> in his post, whether there is a neater way to get this >> information. >> >> Thanks a lot for the help, >> Vitória >> >> >> >>>>>>>>>>>>>> >> >> Hi mailing list, >> >> I'm still struggling with the conversion of coordinates >> between source and >> interpolated source space. >> For example, if i have the position of a single grid >> point how do i get the >> corresponding voxel in the interpolated source >> structure. Or the other way >> around, how to get the grid point which corresponds to a >> voxel (e.g the max >> voxel) in the interpolated source structure. >> >> I think this should be a common problem when working with >> virtual >> electrodes, shouldn't it? >> >> To make things easier i put together a example with the >> data from the >> source tutorial where i tried to calculated the grid pos >> of the max voxel >> in the interpolated source. >> >> clear all; >> load sourcePost_nocon; % source structure from tutorial >> mri = ft_read_mri('Subject01.mri'); % mri of subject01 >> from tutorial >> >> sourceNAI = sourcePost_nocon; >> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >> sourcePost_nocon.avg.noise; >> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that >> to let >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >> >> % Find position of max activity >> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >> posInt=[xi, yi, zi]; >> >> % Plot interpolated source with position of max activity >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = posInt; % location of max >> activity is marked >> correctly. >> figure; >> ft_sourceplot(cfg,sourceNAIInt); >> >> % Transform coordinate back to uninterpolated source??? >> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >> >> >> % Plot uninterpolated source with position aquired from >> interpolated source >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = dpos; % unfortunately this >> coordinate is >> obviously wrong!!! WHY? >> figure; >> ft_sourceplot(cfg,sourceNAI); >> >> >> Unfortunately the solution of Jan Mathijs did not work, >> nor did mine :( >> >> Any ideas??? >> >> Cornelius >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 jan.schoffelen at donders.ru.nl Thu Mar 13 13:00:51 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 13 Mar 2014 13:00:51 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <53209038.8010906@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> Message-ID: <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Hi Vitória, Erick, Cornelius et al, Allow me to chime in to this Brazilio-German interaction ;-). It seems to me that the discussion consists of a few separable elements. -The first one pertains to the specific question how to map source locations between two different representations (source with pos versus volumetric MRI-type image with a transform). -The other one relates to some atlas related business, i.e. mapping locations that have a specific anatomical label to specific MEG source space locations. -And then there's a third one, which is important for 2, and pertains to the usual complicated stuff of mapping between different coordinate systems. There are several ways to achieve what Vitória is looking for, and I think that Erick already solved it, but recent changes in FieldTrip make it quite straightforward. So here goes my recipe: 1 I would go along with Erick to do my beamformer source reconstruction on a subject-specific grid, which is inverse-warped from a regular grid defined on the MNI-template. 2 If we take this template grid, which can be found in ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of your choice onto this sourcemodel, using ft_sourceinterpolate. Reading in of the atlas nowadays indeed should be done with ft_read_atlas (ft_prepare_atlas will be deprecated soon), and my personal taste would be NOT to use the afni atlas, because this one is defined in Talairach space, which is slightly different from MNI-space, and although FT accounts for the differences I am not sure how accurate this is. Anyway, one could do something like atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), load the template sourcemodel with the resolution you need (i.e. the resolution you used in your beamformer grid), and call ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'tissue'; sourcemodel2 = ft_sourceinterpolate(cfg,atlas,sourcemodel); % NOTE: ensure that the units are consistent in atlas and sourcemodel, if not use ft_convert_units 3 Step 2 should have given you sourcemodel2 with a field 'tissue', that represents the anatomical labels, according to the corresponding atlas. Atlas.tissuelabel gives the labels that correspond to the numbers in the tissue field. 4 Then, without the need to call ft_sourceinterpolate, nor ft_volumenormalise on your source-reconstructed data, you can do indx = find(sourcemodel2.tissue==x), where x is the number of your choice, and you directly get the indices of the source positions in your 'source' variable, that have this particular anatomical label. 5 Then, you can do whatever you like with it, e.g. take a max or mean or whatever... I hope I was clear enough, and that someone feels inclined to make this into a FAQ on the FieldTrip wiki ;-). Best wishes, Jan-Mathijs On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > Dear Erick, > > "simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch" -> that sounds like a good thing to do. > Is this a very complicated thing to do? Would you mind sharing a piece of code or some tips for how I could achieve it? > > Thanks once more, Vitória > > On 3/12/2014 11:37 AM, Erick Ortiz wrote: >> Dear Vitoria, >> >> What I do usually, is to simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch. >> >> About the interpolation, I cannot help much more. I have been using my own tools for years, and I was not following the support of atlases in Fieldtrip.I tried it today, but had issues with coordinate system labeling when defining a ROI (I updated to the latest version by SVN): >> >> afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'yes'; >> cfg.funparameter = 'coh'; >> cfg.atlas = afni; >> cfg.coordsys = 'mni'; >> % cfg.roi = 'Middle Temporal Gyrus'; >> % cfg.inputcoord = 'tal'; >> ft_sourceplot(cfg, interp); >> >> Also note that I had to use ft_read_atlas, because ft_prepare_atlas does not generate the brick0label/brick1label fields. >> >> It works well, but if I try to define a ROI (uncommenting the two lines), I get the error "The field cfg.inputcoord is required". There seems to be some confusion between inputcoord and coordsys. >> >> It can be because I was doing something wrong: maybe a Fieldtrip developer could comment on that? >> >> Best, >> Erick >> >> >> >> On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: >> Dear Erick, >> >> Thanks for your detailed reply. >> I've been using individual MNI-warped grids (point 4 below) and I'm always using ft_convert_unit so those points are alright in my data. >> >> The reason why I do need to interpolate (at least, I think I need), is because I'm looking for max 'pow' in anatomically defined regions given the afni atlas. I managed to get it to work by interpolating to the mri and looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. >> Do you have any experience with this approach (searching within anatomical labels) without having to interpolate? >> >> Thanks once more, Vitória >> >> >> >> >> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >>> Dear Vitória and Cornelius, >>> >>> this is a common problem, and maybe it would be good to clarify the strategies that can be used here. I hope this can help others in a similar situation, which I have found many times. >>> >>> 1) You are trying to convert voxel indexes to head (CTF) coordinates. In this case, there are two mistakes in the code: >>> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, 'homogeneous' ); >>> ... should be done with sourceNAIInt, not mri. The transforms are different, in general; e.g. note the downsample=2. >>> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous post. Or remove this line, since 'head' is the default. >>> >>> 2) But if you are working with the same subject/grid, there is no need for interpolation at all. Simply find the grid position with highest 'pow' and take its position. >>> [dummy,ind] = max(source.avg.pow); >>> pos = source.pos(ind,:); >>> >>> 3) However, this is not possible when using different grids, e.g. in a grand average in MNI coordinates. Find the peak ('pos') in the interpolated volume, as in Cornelius' code, then find the index of the nearest grid position for a common (again, MNI) grid. This is also in JM's message. >>> >>> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >>> [dummy,ind] = min(sum(dpos.^2,2)); >>> >>> 4) What I have been using, and strongly recommend, is an MNI grid warped to the subject's anatomy, according to this procedure: >>> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >>> >>> This would give you both the benefits of working in MNI coordinates, and the ease of having a common grid across subjects (for instance, enabling solution #2). Still, some projects do call for one of the other options. >>> >>> Just a couple of details: >>> - Pay utmost attention to coordinate systems and units. For instance, it is common to confuse unlabeled cm for mm, and either of these with voxels. Try to also label all structures as CTF or SPM (MNI). >>> - Using pinv instead of inv is usually a good idea. Here, it is a not an issue, but matrix inversion in MATLAB can lead to a world of hurt to the unwary. >>> >>> Best, >>> Erick >>> >>> >>> >>> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: >>> Dear FT-ers, >>> >>> I found an old posting to the mailing list (see below) that never got answered so my question still holds: given a location I found in the interpolated source, how do I find back the same location in .pos of the non-interpolated data? >>> I can try and go around it by finding the corresponding MNI coordinates in the interpolated data (which by now I have to do by hand, so not optimal anyways), and then look for those coordinates in .pos. But I was wondering, like Cornelius was in his post, whether there is a neater way to get this information. >>> >>> Thanks a lot for the help, >>> Vitória >>> >>> >>> >>>>>>>>>>>>>> >>> >>> Hi mailing list, >>> >>> I'm still struggling with the conversion of coordinates between source and >>> interpolated source space. >>> For example, if i have the position of a single grid point how do i get the >>> corresponding voxel in the interpolated source structure. Or the other way >>> around, how to get the grid point which corresponds to a voxel (e.g the max >>> voxel) in the interpolated source structure. >>> >>> I think this should be a common problem when working with virtual >>> electrodes, shouldn't it? >>> >>> To make things easier i put together a example with the data from the >>> source tutorial where i tried to calculated the grid pos of the max voxel >>> in the interpolated source. >>> >>> clear all; >>> load sourcePost_nocon; % source structure from tutorial >>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>> >>> sourceNAI = sourcePost_nocon; >>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ sourcePost_nocon.avg.noise; >>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>> >>> % Find position of max activity >>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>> posInt=[xi, yi, zi]; >>> >>> % Plot interpolated source with position of max activity >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = posInt; % location of max activity is marked >>> correctly. >>> figure; >>> ft_sourceplot(cfg,sourceNAIInt); >>> >>> % Transform coordinate back to uninterpolated source??? >>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>> >>> >>> % Plot uninterpolated source with position aquired from interpolated source >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = dpos; % unfortunately this coordinate is >>> obviously wrong!!! WHY? >>> figure; >>> ft_sourceplot(cfg,sourceNAI); >>> >>> >>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>> >>> Any ideas??? >>> >>> Cornelius >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From erick.ortiz at med.uni-tuebingen.de Fri Mar 14 02:05:23 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Fri, 14 Mar 2014 02:05:23 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Message-ID: Thanks for shedding light on the issue, JM: I tested your suggestion and it worked brilliantly, far faster and more elegant than the script I wrote years ago. (in my defense, it was only run a couple of times, to label our standard grids...) The old mni2tal question creeps again into the discussion. I would like to use the AFNI atlas, but the conversion introduces too much distortion. For the others (AAL, SPM17/18, Brainweb), all is fine. See attached figure comparing AFNI (blue) with Brainweb grey_matter (red). I might get around to add this to the FAQ next week. :-) Vitória, there is a number of other atlases you can use instead of AFNI then. Either from the link below or any MNI-aligned template, using JM's procedure now it takes 3 seconds to re-label your grid. http://fieldtrip.fcdonders.nl/template/atlas Best, Erick On Thu, Mar 13, 2014 at 1:00 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Vitória, Erick, Cornelius et al, > > Allow me to chime in to this Brazilio-German interaction ;-). > It seems to me that the discussion consists of a few separable elements. > > -The first one pertains to the specific question how to map source > locations between two different representations (source with pos versus > volumetric MRI-type image with a transform). > -The other one relates to some atlas related business, i.e. mapping > locations that have a specific anatomical label to specific MEG source > space locations. > -And then there's a third one, which is important for 2, and pertains to > the usual complicated stuff of mapping between different coordinate systems. > > There are several ways to achieve what Vitória is looking for, and I think > that Erick already solved it, but recent changes in FieldTrip make it quite > straightforward. > > So here goes my recipe: > 1 I would go along with Erick to do my beamformer source reconstruction on > a subject-specific grid, which is inverse-warped from a regular grid > defined on the MNI-template. > 2 If we take this template grid, which can be found in > ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of your > choice onto this sourcemodel, using ft_sourceinterpolate. Reading in of the > atlas nowadays indeed should be done with ft_read_atlas (ft_prepare_atlas > will be deprecated soon), and my personal taste would be NOT to use the > afni atlas, because this one is defined in Talairach space, which is > slightly different from MNI-space, and although FT accounts for the > differences I am not sure how accurate this is. Anyway, one could do > something like atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), > load the template sourcemodel with the resolution you need (i.e. the > resolution you used in your beamformer grid), and call > ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter > = 'tissue'; sourcemodel2 = ft_sourceinterpolate(cfg,atlas,sourcemodel); % > NOTE: ensure that the units are consistent in atlas and sourcemodel, if not > use ft_convert_units > 3 Step 2 should have given you sourcemodel2 with a field 'tissue', that > represents the anatomical labels, according to the corresponding atlas. > Atlas.tissuelabel gives the labels that correspond to the numbers in the > tissue field. > 4 Then, without the need to call ft_sourceinterpolate, nor > ft_volumenormalise on your source-reconstructed data, you can do indx = > find(sourcemodel2.tissue==x), where x is the number of your choice, and you > directly get the indices of the source positions in your 'source' variable, > that have this particular anatomical label. > 5 Then, you can do whatever you like with it, e.g. take a max or mean or > whatever... > > I hope I was clear enough, and that someone feels inclined to make this > into a FAQ on the FieldTrip wiki ;-). > > Best wishes, > Jan-Mathijs > > > > On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > > Dear Erick, > > "simply label and/or define my ROI in the MNI grid. When I warp to the > individuals, everything is in place without a hitch" -> that sounds like a > good thing to do. > Is this a very complicated thing to do? Would you mind sharing a piece of > code or some tips for how I could achieve it? > > Thanks once more, Vitória > > On 3/12/2014 11:37 AM, Erick Ortiz wrote: > > Dear Vitoria, > > What I do usually, is to simply label and/or define my ROI in the MNI > grid. When I warp to the individuals, everything is in place without a > hitch. > > About the interpolation, I cannot help much more. I have been using my > own tools for years, and I was not following the support of atlases in > Fieldtrip.I tried it today, but had issues with coordinate system labeling > when defining a ROI (I updated to the latest version by SVN): > > afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'yes'; > cfg.funparameter = 'coh'; > cfg.atlas = afni; > cfg.coordsys = 'mni'; > % cfg.roi = 'Middle Temporal Gyrus'; > % cfg.inputcoord = 'tal'; > ft_sourceplot(cfg, interp); > > Also note that I had to use ft_read_atlas, because ft_prepare_atlas does > not generate the brick0label/brick1label fields. > > It works well, but if I try to define a ROI (uncommenting the two lines), > I get the error "The field cfg.inputcoord is required". There seems to be > some confusion between inputcoord and coordsys. > > It can be because I was doing something wrong: maybe a Fieldtrip developer > could comment on that? > > Best, > Erick > > > > On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: > >> Dear Erick, >> >> Thanks for your detailed reply. >> I've been using individual MNI-warped grids (point 4 below) and I'm >> always using ft_convert_unit so those points are alright in my data. >> >> The reason why I do need to interpolate (at least, I think I need), is >> because I'm looking for max 'pow' in anatomically defined regions given the >> afni atlas. I managed to get it to work by interpolating to the mri and >> looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using >> ft_volumelookup. >> Do you have any experience with this approach (searching within >> anatomical labels) without having to interpolate? >> >> Thanks once more, Vitória >> >> >> >> >> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >> >> Dear Vitória and Cornelius, >> >> this is a common problem, and maybe it would be good to clarify the >> strategies that can be used here. I hope this can help others in a similar >> situation, which I have found many times. >> >> 1) You are trying to convert voxel indexes to head (CTF) coordinates. In >> this case, there are two mistakes in the code: >> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, >> 'homogeneous' ); >> ... should be done with sourceNAIInt, not mri. The transforms are >> different, in general; e.g. note the downsample=2. >> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a >> previous post. Or remove this line, since 'head' is the default. >> >> 2) But if you are working with the same subject/grid, there is no need >> for interpolation at all. Simply find the grid position with highest 'pow' >> and take its position. >> [dummy,ind] = max(source.avg.pow); >> pos = source.pos(ind,:); >> >> 3) However, this is not possible when using different grids, e.g. in a >> grand average in MNI coordinates. Find the peak ('pos') in the interpolated >> volume, as in Cornelius' code, then find the index of the nearest grid >> position for a common (again, MNI) grid. This is also in JM's message. >> >> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >> [dummy,ind] = min(sum(dpos.^2,2)); >> >> 4) What I have been using, and strongly recommend, is an MNI grid warped >> to the subject's anatomy, according to this procedure: >> >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> This would give you both the benefits of working in MNI coordinates, and >> the ease of having a common grid across subjects (for instance, enabling >> solution #2). Still, some projects do call for one of the other options. >> >> Just a couple of details: >> - Pay utmost attention to coordinate systems and units. For instance, it >> is common to confuse unlabeled cm for mm, and either of these with voxels. >> Try to also label all structures as CTF or SPM (MNI). >> - Using pinv instead of inv is usually a good idea. Here, it is a not an >> issue, but matrix inversion in MATLAB can lead to a world of hurt to the >> unwary. >> >> Best, >> Erick >> >> >> >> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: >> >>> Dear FT-ers, >>> >>> I found an old posting to the mailing list (see below) that never got >>> answered so my question still holds: given a location I found in the >>> interpolated source, how do I find back the same location in .pos of the >>> non-interpolated data? >>> I can try and go around it by finding the corresponding MNI coordinates >>> in the interpolated data (which by now I have to do by hand, so not optimal >>> anyways), and then look for those coordinates in .pos. But I was wondering, >>> like Cornelius was in his post, whether there is a neater way to get this >>> information. >>> >>> Thanks a lot for the help, >>> Vitória >>> >>> >>> >>>>>>>>>>>>>> >>>> >>>> Hi mailing list, >>>> >>>> I'm still struggling with the conversion of coordinates between source >>>> and >>>> interpolated source space. >>>> For example, if i have the position of a single grid point how do i get >>>> the >>>> corresponding voxel in the interpolated source structure. Or the other >>>> way >>>> around, how to get the grid point which corresponds to a voxel (e.g the >>>> max >>>> voxel) in the interpolated source structure. >>>> >>>> I think this should be a common problem when working with virtual >>>> electrodes, shouldn't it? >>>> >>>> To make things easier i put together a example with the data from the >>>> source tutorial where i tried to calculated the grid pos of the max >>>> voxel >>>> in the interpolated source. >>>> >>>> clear all; >>>> load sourcePost_nocon; % source structure from tutorial >>>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>>> >>>> sourceNAI = sourcePost_nocon; >>>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>>> sourcePost_nocon.avg.noise; >>>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>>> >>>> % Find position of max activity >>>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>>> posInt=[xi, yi, zi]; >>>> >>>> % Plot interpolated source with position of max activity >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = posInt; % location of max activity is >>>> marked >>>> correctly. >>>> figure; >>>> ft_sourceplot(cfg,sourceNAIInt); >>>> >>>> % Transform coordinate back to uninterpolated source??? >>>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>>> >>>> >>>> % Plot uninterpolated source with position aquired from interpolated >>>> source >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = dpos; % unfortunately this coordinate >>>> is >>>> obviously wrong!!! WHY? >>>> figure; >>>> ft_sourceplot(cfg,sourceNAI); >>>> >>>> >>>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>>> >>>> Any ideas??? >>>> >>>> Cornelius >>>> >>>> >>>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> _______________________________________________ >> 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 >> > > > > _______________________________________________ > 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 > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 14 07:48:43 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 14 Mar 2014 07:48:43 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Message-ID: <5322A64B.1000603@gmail.com> Hi Erick, I already wrote a FAQ yesterday: http://fieldtrip.fcdonders.nl/faq/how_can_i_map_source_locations_between_two_different_representations Probably not as good as you or JM would have written it though (I'm no specialist), so please feel free to improve it! :) Thanks for all the feedback, Vitória On 3/14/2014 2:05 AM, Erick Ortiz wrote: > Thanks for shedding light on the issue, JM: I tested your suggestion > and it worked brilliantly, far faster and more elegant than the script > I wrote years ago. (in my defense, it was only run a couple of times, > to label our standard grids...) > > The old mni2tal question creeps again into the discussion. I would > like to use the AFNI atlas, but the conversion introduces too much > distortion. For the others (AAL, SPM17/18, Brainweb), all is fine. See > attached figure comparing AFNI (blue) with Brainweb grey_matter (red). > > I might get around to add this to the FAQ next week. :-) > > Vitória, there is a number of other atlases you can use instead of > AFNI then. Either from the link below or any MNI-aligned template, > using JM's procedure now it takes 3 seconds to re-label your grid. > http://fieldtrip.fcdonders.nl/template/atlas > > Best, > Erick > > > > On Thu, Mar 13, 2014 at 1:00 PM, jan-mathijs schoffelen > > > wrote: > > Hi Vitória, Erick, Cornelius et al, > > Allow me to chime in to this Brazilio-German interaction ;-). > It seems to me that the discussion consists of a few separable > elements. > > -The first one pertains to the specific question how to map source > locations between two different representations (source with pos > versus volumetric MRI-type image with a transform). > -The other one relates to some atlas related business, i.e. > mapping locations that have a specific anatomical label to > specific MEG source space locations. > -And then there's a third one, which is important for 2, and > pertains to the usual complicated stuff of mapping between > different coordinate systems. > > There are several ways to achieve what Vitória is looking for, and > I think that Erick already solved it, but recent changes in > FieldTrip make it quite straightforward. > > So here goes my recipe: > 1 I would go along with Erick to do my beamformer source > reconstruction on a subject-specific grid, which is inverse-warped > from a regular grid defined on the MNI-template. > 2 If we take this template grid, which can be found in > ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of > your choice onto this sourcemodel, using ft_sourceinterpolate. > Reading in of the atlas nowadays indeed should be done with > ft_read_atlas (ft_prepare_atlas will be deprecated soon), and my > personal taste would be NOT to use the afni atlas, because this > one is defined in Talairach space, which is slightly different > from MNI-space, and although FT accounts for the differences I am > not sure how accurate this is. Anyway, one could do something like > atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), load the > template sourcemodel with the resolution you need (i.e. the > resolution you used in your beamformer grid), and call > ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; > cfg.parameter = 'tissue'; sourcemodel2 = > ft_sourceinterpolate(cfg,atlas,sourcemodel); % NOTE: ensure that > the units are consistent in atlas and sourcemodel, if not use > ft_convert_units > 3 Step 2 should have given you sourcemodel2 with a field 'tissue', > that represents the anatomical labels, according to the > corresponding atlas. Atlas.tissuelabel gives the labels that > correspond to the numbers in the tissue field. > 4 Then, without the need to call ft_sourceinterpolate, nor > ft_volumenormalise on your source-reconstructed data, you can do > indx = find(sourcemodel2.tissue==x), where x is the number of your > choice, and you directly get the indices of the source positions > in your 'source' variable, that have this particular anatomical label. > 5 Then, you can do whatever you like with it, e.g. take a max or > mean or whatever... > > I hope I was clear enough, and that someone feels inclined to make > this into a FAQ on the FieldTrip wiki ;-). > > Best wishes, > Jan-Mathijs > > > > On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > >> Dear Erick, >> >> "simply label and/or define my ROI in the MNI grid. When I warp >> to the individuals, everything is in place without a hitch" -> >> that sounds like a good thing to do. >> Is this a very complicated thing to do? Would you mind sharing a >> piece of code or some tips for how I could achieve it? >> >> Thanks once more, Vitória >> >> On 3/12/2014 11:37 AM, Erick Ortiz wrote: >>> Dear Vitoria, >>> >>> What I do usually, is to simply label and/or define my ROI in >>> the MNI grid. When I warp to the individuals, everything is in >>> place without a hitch. >>> >>> About the interpolation, I cannot help much more. I have been >>> using my own tools for years, and I was not following the >>> support of atlases in Fieldtrip.I tried it today, but had issues >>> with coordinate system labeling when defining a ROI (I updated >>> to the latest version by SVN): >>> >>> afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.interactive = 'yes'; >>> cfg.funparameter = 'coh'; >>> cfg.atlas = afni; >>> cfg.coordsys = 'mni'; >>> % cfg.roi = 'Middle Temporal Gyrus'; >>> % cfg.inputcoord = 'tal'; >>> ft_sourceplot(cfg, interp); >>> >>> Also note that I had to use ft_read_atlas, because >>> ft_prepare_atlas does not generate the brick0label/brick1label >>> fields. >>> >>> It works well, but if I try to define a ROI (uncommenting the >>> two lines), I get the error "The field cfg.inputcoord is >>> required". There seems to be some confusion between inputcoord >>> and coordsys. >>> >>> It can be because I was doing something wrong: maybe a Fieldtrip >>> developer could comment on that? >>> >>> Best, >>> Erick >>> >>> >>> >>> On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai >>> > >>> wrote: >>> >>> Dear Erick, >>> >>> Thanks for your detailed reply. >>> I've been using individual MNI-warped grids (point 4 below) >>> and I'm always using ft_convert_unit so those points are >>> alright in my data. >>> >>> The reason why I do need to interpolate (at least, I think I >>> need), is because I'm looking for max 'pow' in anatomically >>> defined regions given the afni atlas. I managed to get it to >>> work by interpolating to the mri and looking for max 'pow' >>> given a label (e.g., 'Middle Temporal Gyrus') using >>> ft_volumelookup. >>> Do you have any experience with this approach (searching >>> within anatomical labels) without having to interpolate? >>> >>> Thanks once more, Vitória >>> >>> >>> >>> >>> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >>>> Dear Vitória and Cornelius, >>>> >>>> this is a common problem, and maybe it would be good to >>>> clarify the strategies that can be used here. I hope this >>>> can help others in a similar situation, which I have found >>>> many times. >>>> >>>> 1) You are trying to convert voxel indexes to head (CTF) >>>> coordinates. In this case, there are two mistakes in the code: >>>> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), >>>> posInt, 'homogeneous' ); >>>> ... should be done with sourceNAIInt, not mri. The >>>> transforms are different, in general; e.g. note the >>>> downsample=2. >>>> 1b) use cfg.locationcoordinates = 'head', as commented by >>>> JM in a previous post. Or remove this line, since 'head' is >>>> the default. >>>> >>>> 2) But if you are working with the same subject/grid, there >>>> is no need for interpolation at all. Simply find the grid >>>> position with highest 'pow' and take its position. >>>> [dummy,ind] = max(source.avg.pow); >>>> pos = source.pos(ind,:); >>>> >>>> 3) However, this is not possible when using different >>>> grids, e.g. in a grand average in MNI coordinates. Find the >>>> peak ('pos') in the interpolated volume, as in Cornelius' >>>> code, then find the index of the nearest grid position for >>>> a common (again, MNI) grid. This is also in JM's message. >>>> >>>> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >>>> [dummy,ind] = min(sum(dpos.^2,2)); >>>> >>>> 4) What I have been using, and strongly recommend, is an >>>> MNI grid warped to the subject's anatomy, according to this >>>> procedure: >>>> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >>>> >>>> This would give you both the benefits of working in MNI >>>> coordinates, and the ease of having a common grid across >>>> subjects (for instance, enabling solution #2). Still, some >>>> projects do call for one of the other options. >>>> >>>> Just a couple of details: >>>> - Pay utmost attention to coordinate systems and units. For >>>> instance, it is common to confuse unlabeled cm for mm, and >>>> either of these with voxels. Try to also label all >>>> structures as CTF or SPM (MNI). >>>> - Using pinv instead of inv is usually a good idea. Here, >>>> it is a not an issue, but matrix inversion in MATLAB can >>>> lead to a world of hurt to the unwary. >>>> >>>> Best, >>>> Erick >>>> >>>> >>>> >>>> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai >>>> >>> > wrote: >>>> >>>> Dear FT-ers, >>>> >>>> I found an old posting to the mailing list (see below) >>>> that never got answered so my question still holds: >>>> given a location I found in the interpolated source, >>>> how do I find back the same location in .pos of the >>>> non-interpolated data? >>>> I can try and go around it by finding the corresponding >>>> MNI coordinates in the interpolated data (which by now >>>> I have to do by hand, so not optimal anyways), and then >>>> look for those coordinates in .pos. But I was >>>> wondering, like Cornelius was in his post, whether >>>> there is a neater way to get this information. >>>> >>>> Thanks a lot for the help, >>>> Vitória >>>> >>>> >>>> >>>>>>>>>>>>>> >>>> >>>> Hi mailing list, >>>> >>>> I'm still struggling with the conversion of >>>> coordinates between source and >>>> interpolated source space. >>>> For example, if i have the position of a single >>>> grid point how do i get the >>>> corresponding voxel in the interpolated source >>>> structure. Or the other way >>>> around, how to get the grid point which corresponds >>>> to a voxel (e.g the max >>>> voxel) in the interpolated source structure. >>>> >>>> I think this should be a common problem when >>>> working with virtual >>>> electrodes, shouldn't it? >>>> >>>> To make things easier i put together a example with >>>> the data from the >>>> source tutorial where i tried to calculated the >>>> grid pos of the max voxel >>>> in the interpolated source. >>>> >>>> clear all; >>>> load sourcePost_nocon; % source structure from tutorial >>>> mri = ft_read_mri('Subject01.mri'); % mri of >>>> subject01 from tutorial >>>> >>>> sourceNAI = sourcePost_nocon; >>>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>>> sourcePost_nocon.avg.noise; >>>> sourceNAI=rmfield(sourceNAI,'freq'); % had to >>>> remove that to let >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI >>>> , mri); >>>> >>>> % Find position of max activity >>>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>>> posInt=[xi, yi, zi]; >>>> >>>> % Plot interpolated source with position of max >>>> activity >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = posInt; % location of max >>>> activity is marked >>>> correctly. >>>> figure; >>>> ft_sourceplot(cfg,sourceNAIInt); >>>> >>>> % Transform coordinate back to uninterpolated source??? >>>> dpos = warp_apply(inv(mri.transform), posInt, >>>> 'homogeneous'); >>>> >>>> >>>> % Plot uninterpolated source with position aquired >>>> from interpolated source >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = dpos; % unfortunately >>>> this coordinate is >>>> obviously wrong!!! WHY? >>>> figure; >>>> ft_sourceplot(cfg,sourceNAI); >>>> >>>> >>>> Unfortunately the solution of Jan Mathijs did not >>>> work, nor did mine :( >>>> >>>> Any ideas??? >>>> >>>> Cornelius >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > 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 erick.ortiz at med.uni-tuebingen.de Fri Mar 14 08:57:28 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Fri, 14 Mar 2014 08:57:28 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <5322A64B.1000603@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> <5322A64B.1000603@gmail.com> Message-ID: A final note: Sorry, my ad-blocker prevented me from including the picture yesterday. Here it is. Caption: Comparing grey matter tagging using atlases AFNI (all labels; blue) and Brainweb (tissue grey_matter; red). Note how the AFNI version does not fill the VCM completely, probably due to TAL to MNI transformation issues. [image: Inline image 1] Vitória, if you would like, this could be included in the FAQ to illustrate JM's comment. Best, Erick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: atlas_afni_brainweb_sourcespace.png Type: image/png Size: 480741 bytes Desc: not available URL: From virginie.van.wassenhove at gmail.com Fri Mar 14 09:39:44 2014 From: virginie.van.wassenhove at gmail.com (Virginie van Wassenhove) Date: Fri, 14 Mar 2014 09:39:44 +0100 Subject: [FieldTrip] postdoctoral position @ NeuroSpin Message-ID: Please follow the link! http://www.inria.fr/en/institute/recruitment/offers/post -doctoral-research-fellowships/post -doctoral-research-fellowships/campaign-2014/(view)/details.html?id=PNGFK026203F3VBQB6G68LOE1&ContractType=4546&LG=EN&Resultsperpage=20&nPostingID=8498&nPostingTargetID=14266&option=52&sort=DESC&nDepartmentID=19 Best, -Virginie -- Virginie van Wassenhove Exec Dir NeuroSpin MEG Group leader, Brain Dynamics CEA.DSV.I2BM.NeuroSpin - INSERM Cognitive Neuroimaging Unit Bât 145 Point Courrier 156 Gif s/ Yvette F-91191 FRANCE +33(0)1.69.08.1667 Virginie.van.Wassenhove at gmail.com https://sites.google.com/site/virginievanwassenhove/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Fri Mar 14 11:47:44 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 11:47:44 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Hi all, I've been trying to append data from two datasets that were read in and segmented into trials separately. Whenever I do so all events get mixed up, i.e., eventvalues that were not specified for ft_definetrial (and ft_redefinetrial) show up in the databrowser and the original events of interest are not aligned to 0 anymore. The warning I get is "input data comes from different datafiles; removing sampleinfo field". Is there another way to combine data from different recordings? I use Vision Recorder and subjects need to take a break during the experiment, which is why I end up with two datasets in the first place. I figured that combining the datasets before defining trials would be more efficient anyway but then I don't know how to read in all events (since ft_definetrial requires one dataset). Thanks in advance! Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Fri Mar 14 12:08:21 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 14 Mar 2014 07:08:21 -0400 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> References: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Message-ID: Hi Phyllis, I believe a trial function (see ft_trialfun_general) will solve your problem. The concatenated datasets will still lose their sampleinfo field, but the trialinfo field will retain the proper offsets, triggers, etc. as long as you put them in your trial function. Best, Raquel > On Mar 14, 2014, at 6:47 AM, "Phyllis Mania" wrote: > > Hi all, > > I’ve been trying to append data from two datasets that were read in and segmented into trials separately. > Whenever I do so all events get mixed up, i.e., eventvalues that were not specified for ft_definetrial (and ft_redefinetrial) show up in the databrowser and the original events of interest are not aligned to 0 anymore. > The warning I get is “input data comes from different datafiles; removing sampleinfo field”. > > Is there another way to combine data from different recordings? I use Vision Recorder and subjects need to take a break during the experiment, which is why I end up with two datasets in the first place. > > I figured that combining the datasets before defining trials would be more efficient anyway but then I don’t know how to read in all events (since ft_definetrial requires one dataset). > > Thanks in advance! > Phyllis > > > _______________________________________________ > 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 Fri Mar 14 12:03:52 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 14 Mar 2014 12:03:52 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> References: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Message-ID: Hi Phyllis, The way I would approach this is to segment the data for both data files separately, making sure that all relevant information is stored in the .trialinfo field. If you write your own trialfun, then any information you store in the 4th and upward column of the trl matrix will end up in data.trialinfo when doing ft_definetrial and ft_preprocessing. Then you can simply use ft_appenddata to append the data sets and all should be fine. Even though the events are removed (which they must be, as their time stamps are coded in terms of samples from the onset of recording), you still have the information in trialinfo. Would that work? Best, Eelke On 14 March 2014 11:47, Phyllis Mania wrote: > Hi all, > > > > I've been trying to append data from two datasets that were read in and > segmented into trials separately. > > Whenever I do so all events get mixed up, i.e., eventvalues that were not > specified for ft_definetrial (and ft_redefinetrial) show up in the > databrowser and the original events of interest are not aligned to 0 > anymore. > > The warning I get is "input data comes from different datafiles; removing > sampleinfo field". > > > > Is there another way to combine data from different recordings? I use Vision > Recorder and subjects need to take a break during the experiment, which is > why I end up with two datasets in the first place. > > > > I figured that combining the datasets before defining trials would be more > efficient anyway but then I don't know how to read in all events (since > ft_definetrial requires one dataset). > > > > Thanks in advance! > > Phyllis > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From juriguen at gmail.com Fri Mar 14 12:23:22 2014 From: juriguen at gmail.com (=?ISO-8859-1?Q?Jose_Antonio_Urig=FCen?=) Date: Fri, 14 Mar 2014 12:23:22 +0100 Subject: [FieldTrip] Solution to the EEG forward problem Message-ID: Dear all This may be simple to answer, since I am quite new to the area and keep struggling with the tutorials at the main website. So here we go: I want to use Fieltrip in Matlab (Windows) to: 1. Compute the leadfield at a set of electrodes positioned in the scalp based on a BEM model of the head (something along the line of http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg plus correct use of the ft_prepare_leadfield function) So, what is confusing me is that say I have a head model / volume and the set of electrodes (result of following http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg ), then if I do *pos = [0 0 0.5];* *cfg = [];* *cfg.grid.pos = pos;* *gridp = ft_prepare_sourcemodel(cfg, vol, elec_aligned);* *cfg = [];* *cfg.vol = vol;* *cfg.elec = elec_aligned;* *cfg.grid = gridp;* *grid = ft_prepare_leadfield(cfg);* *lf_openmeeg = grid.leadfield{1};* I get the leadfield at the electrode locations. However, how do I get the actual potential at the electrodes if, say, I have dipole magnitudes and moments. Is the solution simply V = *lf_openmeeg * (magnitudes * moments)* *??* 2. Can I use Fieltrip to obtain a set of simulated EEG channels with brain rhythms? I was thinking of using available waveforms from the internet of intracraneal recordings as one of the inputs, however I woudl still need dipole positions / orientations (moments). Any ideas how to do this? Thanks in advance Toni -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Fri Mar 14 13:03:13 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 13:03:13 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> Dear Eelke, Thanks for the quick response! What you're suggesting is exactly what I'm doing and the trialinfo for both the single and the appended dataset look the way they should. However, when looking at the databrowser, I see data from the beginning of the recording onwards, only with markers after a few trials (and then not aligned). The single datasets look fine in the databrowser, though. Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Mar 14 13:17:42 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 14 Mar 2014 13:17:42 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> References: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> Message-ID: Hi Phyllis, Hmm I'm not sure if I understand the problem exactly, but one thing comes to mind, namely that the input into databrowser is not entirely correct. You should not be seeing any markers anymore actually, after appended data. How are you calling ft_databrowser? For segmented data in memory (as is the case here), you should call it like so: cfg = []; cfg.continuous = 'no'; ft_databrowser(cfg, data); Is that how you are using it? If it is, and the problem is still there, then could you try doing data = rmfield(data, 'cfg') before calling ft_databrowser? (This will strip any event structures possibly still present in the cfg.previous-tree.) Best, Eelke On 14 March 2014 13:03, Phyllis Mania wrote: > Dear Eelke, > > > > Thanks for the quick response! What you're suggesting is exactly what I'm > doing and the trialinfo for both the single and the appended dataset look > the way they should. However, when looking at the databrowser, I see data > from the beginning of the recording onwards, only with markers after a few > trials (and then not aligned). The single datasets look fine in the > databrowser, though. > > > > Cheers, > Phyllis > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From phyllis.mania at uni-hamburg.de Fri Mar 14 13:52:43 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 13:52:43 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> Dear Eelke, Calling 'rmfield' helped, thank you! Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Mar 14 14:11:02 2014 From: jm.horschig at donders.ru.nl (=?windows-1252?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 14 Mar 2014 14:11:02 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> References: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> Message-ID: <5322FFE6.7000902@donders.ru.nl> Heyho, yes, I think the databrowser digs deep down in data.cfg to obtain the original event-matrix of your dataset. After the sampleinfo-field is reconstructed, the databrowser tries to relate the sampleinfo field with the original event-structure. As the two have nothing in common anymore, the output will of course be nonsense. Removing the cfg is imho the only option to prvent the databrowser from doing so. But this is clearly something that the databrowser should not do, because we want a smart databrowser, not a stupid one ;) Phyllis, could you be so kind to open up a bug on bugzilla.fcdonders.nl about this? Just shortly describe what you are doing in terms of code and describing the error would be sufficient. We will then take care that this get's solved in future versions. If you have questions about bugzilla or if you do not want to post the bug there, please let me/us know. But we'd appreciate if you could open up a bug :) Thanks in any case for your message! Best, Jörn On 3/14/2014 1:52 PM, Phyllis Mania wrote: > > Dear Eelke, > > Calling ‘rmfield’ helped, thank you! > > Cheers, > > Phyllis > > > > _______________________________________________ > 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 virginie.van.wassenhove at gmail.com Fri Mar 14 21:10:57 2014 From: virginie.van.wassenhove at gmail.com (Virginie van Wassenhove) Date: Fri, 14 Mar 2014 21:10:57 +0100 Subject: [FieldTrip] additional info Message-ID: It appears the link previously posted is dysfunctional. Additional information about the project can be found here: https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxwaGlsaXBwZWNpdWNpdXxneDoxYTI3MGUyZjMzMTg0Y2Uy All the best, -Virginie -- Virginie van Wassenhove Exec Dir NeuroSpin MEG Group leader, Brain Dynamics CEA.DSV.I2BM.NeuroSpin - INSERM Cognitive Neuroimaging Unit Bât 145 Point Courrier 156 Gif s/ Yvette F-91191 FRANCE +33(0)1.69.08.1667 Virginie.van.Wassenhove at gmail.com https://sites.google.com/site/virginievanwassenhove/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Mon Mar 17 01:20:45 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Mon, 17 Mar 2014 00:20:45 +0000 Subject: [FieldTrip] MNE covariance window and ft_plot_mesh error Message-ID: <53263FDD.1060205@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Mar 17 01:21:23 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 17 Mar 2014 00:21:23 +0000 Subject: [FieldTrip] using eeglab's ICA data with beamformer Message-ID: Hello fieldtrip, I am new to the fieltrip toolbox and Ive come from eeglab to do some beamformer and connectivity processing. Ive used the function eeglab2fieldtrip, with one of the arguments being 'componentanalysis'. I tried using the data in the beamformer tutorial and everything worked fine until I got to the ft_sourceanalysis script where it used the channel labels and positions from the original non-ICAed data. So the code crashed because the ICA labels and channels labels didnt match. I was wondering whether beamformer can be used with ICs from eeglab, and if so, where I am going wrong. We also want to do functional connectivity as I mentioned, which requires a beamformer that operates in the time domain as opposed to the frequency domain. However, there arent any tutorials on the Constrained Minimum Variance (LCMV) beamformer (which I think works in the time domain), so I am trying to make do with the one used in the tutorial. Any help will be greatly appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Mar 17 12:34:51 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 17 Mar 2014 11:34:51 +0000 Subject: [FieldTrip] using eeglab's ICA data with beamformer In-Reply-To: References: Message-ID: Dear Tyler, Beamforming is one type of inverse method and it requires the sensor data covariance matrix. It also assumes that underlying sources are uncorrelated. If you try to input data from only 1 IC, all the sensors will covary together and any underlying sources that contribute to this 1 IC will be 100% temporally correlated. You can apply beamforming to a mixture of ICs, mixed back from the 'component space' back to the 'sensor space' (see ft_rejectcomponent). This is often done for example by excluding a few components which are artefactual and keeping many remaining (presumably brain) components. Normally the 'rank' of your covariance matrix is equal to the number of sensors (rank is the number of independent rows or columns, i.e. contributions), and so by removing a few ICs from the data, you have reduced the rank. If your rank is reduced relative to number of sensors, then you should use the regularisation option (cfg.lambda). This is true for either LCMV or DICS. However, this is usually only done when the rank is still well above 1. However, if you wish to localise the underlying sources of just 1 (or a small number of mixed) ICs, then better to use a min-norm method which does not depend on the sensor covariance. In this case, you still must re-project the IC back to sensor space in FieldTrip for the labels of the data to match the labels of the leadfield. See also: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors (<- LCMV) Hope this helps; please ask again if you need further clarification, or please give a specific error message. Cheers, Johanna 2014-03-17 0:21 GMT+00:00 Tyler Grummett : > Hello fieldtrip, > > > I am new to the fieltrip toolbox and Ive come from eeglab to do some > beamformer and connectivity processing. > > > Ive used the function eeglab2fieldtrip, with one of the arguments being > 'componentanalysis'. I tried using the data in the beamformer tutorial and > everything worked fine > > until I got to the ft_sourceanalysis script where it used the channel > labels and positions from the original non-ICAed data. So the code crashed > because the ICA labels > > and channels labels didnt match. > > > I was wondering whether beamformer can be used with ICs from eeglab, and > if so, where I am going wrong. > > > We also want to do functional connectivity as I mentioned, which > requires a beamformer that operates in the time domain as opposed to the > frequency domain. > > > However, there arent any tutorials on the Constrained Minimum Variance > (LCMV) beamformer (which I think works in the time domain), so I am > trying to make do with the one used in the tutorial. > > > Any help will be greatly appreciated. > > > Tyler. > > > ************************* > > *Tyler Grummett ( BBSc, BSc(Hons I))* > *PhD Candidate* > *Brain Signals Laboratory* > *Flinders University* > *Rm 5A301* > *Ext 66124* > > _______________________________________________ > 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 yturbidesw at wit.edu Mon Mar 17 13:28:07 2014 From: yturbidesw at wit.edu (Yturbides, Walker) Date: Mon, 17 Mar 2014 12:28:07 +0000 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset Message-ID: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> Hello FieldTrip Users, I am new to the FieldTrip toolbox and I have a background in Electronics Engineering. I recently bought an EEG Neuroheadset and want to control a wheelchair with it for my senior design project. There is so much that is possible using FieldTrip that I do not know where to start. Can someone help me get started, or perhaps have any suggestions? Also, I am trying to read the raw EEG signals from the Emotiv headset into MATLAB. Does anyone have any information that would help me? Any suggestions are very much appreciated. Thank You, Walker -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 17 13:57:33 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 17 Mar 2014 13:57:33 +0100 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> Message-ID: <5326F13D.6080302@donders.ru.nl> Hi Walker, where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: http://fieldtrip.fcdonders.nl/tutorial You could start with the preprocessing tutorials and see how you can adapt them to what you want. And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': http://fieldtrip.fcdonders.nl/?do=search&id=emotiv But better start in the beginning instead of skipping important steps ;) Best, Jörn On 3/17/2014 1:28 PM, Yturbides, Walker wrote: > > Hello FieldTrip Users, > > I am new to the FieldTrip toolbox and I have a background in > Electronics Engineering. I recently bought an EEG Neuroheadset and > want to control a wheelchair with it for my senior design project. > There is so much that is possible using FieldTrip that I do not know > where to start. Can someone help me get started, or perhaps have any > suggestions? Also, I am trying to read the raw EEG signals from the > Emotiv headset into MATLAB. Does anyone have any information that > would help me? > > Any suggestions are very much appreciated. > > Thank You, > > Walker > > > > _______________________________________________ > 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 yturbidesw at wit.edu Mon Mar 17 14:11:15 2014 From: yturbidesw at wit.edu (Yturbides, Walker) Date: Mon, 17 Mar 2014 13:11:15 +0000 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <5326F13D.6080302@donders.ru.nl> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> <5326F13D.6080302@donders.ru.nl> Message-ID: <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> Hi Jörn, Thank you for your response. I am currently trying to use the applications that FieldTrip offers such as 'Emotiv2ft.exe' and the 'demo_buffer.exe' and when I try to plot the signals in real time, I am not able to. I just need to be able to import all the raw EEG signals into Matlab for now. Once I have the real-time signals in Matlab I will be processing them but as of right now that is where I am stuck at. Would you have any suggestions on how to import the signals so I am able to process them in real-time or as close as possible? Thank You, Walker -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of "Jörn M. Horschig" Sent: Monday, March 17, 2014 8:58 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset Hi Walker, where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: http://fieldtrip.fcdonders.nl/tutorial You could start with the preprocessing tutorials and see how you can adapt them to what you want. And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': http://fieldtrip.fcdonders.nl/?do=search&id=emotiv But better start in the beginning instead of skipping important steps ;) Best, Jörn On 3/17/2014 1:28 PM, Yturbides, Walker wrote: > > Hello FieldTrip Users, > > I am new to the FieldTrip toolbox and I have a background in > Electronics Engineering. I recently bought an EEG Neuroheadset and > want to control a wheelchair with it for my senior design project. > There is so much that is possible using FieldTrip that I do not know > where to start. Can someone help me get started, or perhaps have any > suggestions? Also, I am trying to read the raw EEG signals from the > Emotiv headset into MATLAB. Does anyone have any information that > would help me? > > Any suggestions are very much appreciated. > > Thank You, > > Walker > > > > _______________________________________________ > 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 -------------- A non-text attachment was scrubbed... Name: error_with_demo_buffer.PNG Type: image/png Size: 36644 bytes Desc: error_with_demo_buffer.PNG URL: From jm.horschig at donders.ru.nl Mon Mar 17 14:19:47 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 17 Mar 2014 14:19:47 +0100 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> <5326F13D.6080302@donders.ru.nl> <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> Message-ID: <5326F673.5030308@donders.ru.nl> Hi Walker, you could start here: http://fieldtrip.fcdonders.nl/faq/how_should_i_get_started_with_the_fieldtrip_realtime_buffer and then search for related pages on the wiki-page. This should get you started on how to read in the data. Additionally, there are example scripts coming with FieldTrip, i think in the realtime folder. That should point you to how to read in data ;) Best, Jörn On 3/17/2014 2:11 PM, Yturbides, Walker wrote: > Hi Jörn, > > Thank you for your response. I am currently trying to use the applications that FieldTrip offers such as 'Emotiv2ft.exe' and the 'demo_buffer.exe' and when I try to plot the signals in real time, I am not able to. I just need to be able to import all the raw EEG signals into Matlab for now. Once I have the real-time signals in Matlab I will be processing them but as of right now that is where I am stuck at. Would you have any suggestions on how to import the signals so I am able to process them in real-time or as close as possible? > > Thank You, > Walker > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of "Jörn M. Horschig" > Sent: Monday, March 17, 2014 8:58 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset > > Hi Walker, > > where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough > This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. > I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: > http://fieldtrip.fcdonders.nl/tutorial > > You could start with the preprocessing tutorials and see how you can adapt them to what you want. > And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': > http://fieldtrip.fcdonders.nl/?do=search&id=emotiv > > But better start in the beginning instead of skipping important steps ;) > > Best, > Jörn > > > On 3/17/2014 1:28 PM, Yturbides, Walker wrote: >> Hello FieldTrip Users, >> >> I am new to the FieldTrip toolbox and I have a background in >> Electronics Engineering. I recently bought an EEG Neuroheadset and >> want to control a wheelchair with it for my senior design project. >> There is so much that is possible using FieldTrip that I do not know >> where to start. Can someone help me get started, or perhaps have any >> suggestions? Also, I am trying to read the raw EEG signals from the >> Emotiv headset into MATLAB. Does anyone have any information that >> would help me? >> >> Any suggestions are very much appreciated. >> >> Thank You, >> >> Walker >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 l.verhagen at fcdonders.ru.nl Mon Mar 17 17:40:07 2014 From: l.verhagen at fcdonders.ru.nl (Lennart Verhagen) Date: Mon, 17 Mar 2014 16:40:07 +0000 Subject: [FieldTrip] comparing EEG systems for EEG-TMS and EEG-MRI Message-ID: <8EFA9DC0-5160-4F9E-8CD4-87246F88E602@fcdonders.ru.nl> Dear all, We are planning to acquire an EEG system for concurrent EEG-TMS and/or EEG-MRI. I would be very interested to hear form someone with hands-on experience in these conditions with NeuroScan and/or BrainProducts systems (and perhaps other competitors). What is your opinion about the data quality of these systems? Don’t worry, I’m not looking for a lengthy detailed review, any brief comment would be appreciated :) Thanks! Cheers, Lennart From damingwang.tongji at gmail.com Tue Mar 18 03:11:11 2014 From: damingwang.tongji at gmail.com (=?GB2312?B?zfW088P3?=) Date: Tue, 18 Mar 2014 10:11:11 +0800 Subject: [FieldTrip] Is fieldtrip software suitable for processing computational simulation data Message-ID: Dear friends: I am student from China and currently very interested in your software of fieldtrip. There is a question puzzling me: If I use integrate-and-fire or other neural models to simulate and get spike and LFP(local field potential) data, is fieldtrip still suitable for processing these data? And the main part which I concern mostly is spike and LFP data analysis. Your reply and help will be sincerely appreciated! Thank you! Best Wishes Daming Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Mar 18 12:25:21 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 18 Mar 2014 12:25:21 +0100 Subject: [FieldTrip] deleting bad channels Message-ID: Hi! I have a bad channel that I would like to delete from the data using Fieldtrip, however, I'm not sure how the commands work for deleting bad channels. Would appreciate if someone could help me on this. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Mar 18 12:33:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Mar 2014 12:33:08 +0100 Subject: [FieldTrip] deleting bad channels In-Reply-To: References: Message-ID: Hi Hweeling, Try: cfg = []; cfg.channel = {'MEG' '-MLO12'}; data = ft_selectdata(cfg, data); to remove channel MLO12 from the data, but keep all other MEG channels (adapt to whatever you need). Note that you can also use this channel syntax in many other functions directly, like ft_freqanalysis or ft_timelockanalysis. Best, Eelke On 18 March 2014 12:25, Hwee Ling Lee wrote: > Hi! > > I have a bad channel that I would like to delete from the data using > Fieldtrip, however, I'm not sure how the commands work for deleting bad > channels. > > Would appreciate if someone could help me on this. > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From vasenka at gmail.com Tue Mar 18 19:02:47 2014 From: vasenka at gmail.com (Vasily Vakorin) Date: Tue, 18 Mar 2014 14:02:47 -0400 Subject: [FieldTrip] read write MarkerFile.mrk file Message-ID: I am trying to modify file MarkerFile.mrk, using function readmarkerfile.m and writeMarkerFile.m. Function readmarkerfile.m create a structure with four fields: number_markers, number_samples, marker_names, trial_times. However, function writeMarkerFile.m requires another field: ClassGroupId (only 0 and 3 are allowed). Any suggestions on how to create the "right" structure for writeMarkerFile.m ? Thank you, Vasily -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at gmail.com Wed Mar 19 08:42:00 2014 From: michelic72 at gmail.com (Cristiano Micheli) Date: Wed, 19 Mar 2014 03:42:00 -0400 Subject: [FieldTrip] read write MarkerFile.mrk file In-Reply-To: References: Message-ID: Dear Vasily I bumped into this site after a quick internet search: https://w3.rcc.uchicago.edu/redmine/projects/cacioppo/repository/annotate/spm8_dev/external/ctf/readCTFds.m A function's header therein referes to a CTF reference document, named PN900-0088: "This format is rigid and readMarkerFile assumes that the MarkerFile has the format current in October 2006. The document lists 4 Class Groups, but only CLASSGROUPID=0 (triggers) and CLASSGROUPID=3 (Manual) are actually used. read_MArkerFile reads only these two groups, but it prints a message if the other groups are encountered. Trigger markers (CLASSGROUPID=0) have an additional 4 pieces of information supplied: BITNUMBER(int), POLARITY(+ or 1),SOURCE(text) and THRESHOLD (float). FOr CLASSGROUPID=3, these fields are left empty." I hope this helps Cristiano On Tue, Mar 18, 2014 at 2:02 PM, Vasily Vakorin wrote: > I am trying to modify file MarkerFile.mrk, using function readmarkerfile.m > and writeMarkerFile.m. > > Function readmarkerfile.m create a structure with four fields: > number_markers, number_samples, marker_names, trial_times. > > However, function writeMarkerFile.m requires another field: ClassGroupId > (only 0 and 3 are allowed). > > Any suggestions on how to create the "right" structure for > writeMarkerFile.m ? > > Thank you, > Vasily > > _______________________________________________ > 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 mbj0310 at gmail.com Wed Mar 19 11:10:08 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Wed, 19 Mar 2014 19:10:08 +0900 Subject: [FieldTrip] ft_freqstatistics for between subject design Message-ID: Hello trippers. I am trying to do* t-test* with *the power* derived from frequency analysis of two different groups. The first group has 36 subjects, and the second group has 28 subjects. I did the ft_freqanalysis with the Morlet wavelet, and made the* induced power* of gamma band. After the plotting of the results, it looks like there might be a difference in the frequency range between [38 42], at the latency between [0.5 1] approximately. So, I made a script as below. cfg = []; cfg.channel = 'PZ'; % name of the electrode cfg.latency = [0.5 1]; cfg.trials = 'all'; cfg.frequency = [38 42]; cfg.avgoverchan = 'no'; cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'analytic'; cfg.statistic = 'indepsamplesT'; cfg.alpha = 0.05; cfg.design = [ones(1,36), ones(1,28)*2] ; % N x num of observations cfg.ivar = 1; stat = ft_freqstatistics(cfg, Induced_Ctrl_14{1:36}, Induced_CHR_14{1:28}); In terms of the structure of the result, there are five values in the stat, prob, mask and freq. I think that each 5 values correspond with the frequency data point. Is that script suitable for the test for the significance, especially avgovertime option 'yes'? If I change the avgovertime option to 'no', then can I found the p-values for each frequencies(5 values), and each time point(51 values), in total 255 values that could have multiple comparison issue? And I thought the 'mask' values of 0 indicates 'statistically non-significance'. Is that right? -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimparkinson at me.com Wed Mar 19 12:40:46 2014 From: jimparkinson at me.com (Jim Parkinson) Date: Wed, 19 Mar 2014 11:40:46 +0000 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics Message-ID: Hi. i have some TFR data which has been analysed over 1 : .5 : 30 Hz using ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions Right now I'd like to compare the two conditions using ft_freqstatistics but restrain the statistics to the freq range 1:10. so I've set cfg.frequency = [1 10] But, by the time the stats are running, the analysis is over the full range produced by ft_freqanalysis (1:30 Hz), and the output stats reflects this. Somewhere in ft_freqstatistics the cfg.frequency setting seems to be overridden. Is this a bug, am i doing something wrong, or have I misunderstood what cfg,frequency is supposed to be doing? thanks for any help! -- Dr Jim Parkinson, D.Phil j.m.parkinson at sussex.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Wed Mar 19 12:52:54 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Wed, 19 Mar 2014 12:52:54 +0100 (CET) Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics In-Reply-To: Message-ID: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> Hi Jim, Without seeing all the code you used it's hard to determine where exactly the problem is. NEvertheless, two things come to mind: (1) you need to specify the frequency of interest with "cfg.foi = 1:10". To be precise, it is also good to specify the numbers of steps you wish to calculate e.g., 1:1:10. please see here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis Alternatively, prior to calling ft_freqanalysis, you can use the function ft_selectdata(cfg,freqdata) to select the frequency band of interest. Hope this gets you started! Best, Nietzsche ----- Original Message ----- > From: "Jim Parkinson" > To: fieldtrip at science.ru.nl > Sent: Wednesday, 19 March, 2014 12:40:46 PM > Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics > Hi. > > > i have some TFR data which has been analysed over 1 : .5 : 30 Hz using > ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions > > > Right now I'd like to compare the two conditions using > ft_freqstatistics but restrain the statistics to the freq range 1:10. > so I've set > > > cfg.frequency = [1 10] > > > But, by the time the stats are running, the analysis is over the full > range produced by ft_freqanalysis (1:30 Hz), and the output stats > reflects this. Somewhere in ft_freqstatistics the cfg.frequency > setting seems to be overridden. Is this a bug, am i doing something > wrong, or have I misunderstood what cfg,frequency is supposed to be > doing? > > > thanks for any help! > > > -- > > > > Dr Jim Parkinson, D.Phil > > j.m.parkinson at sussex.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From jan.schoffelen at donders.ru.nl Wed Mar 19 12:57:41 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 12:57:41 +0100 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics In-Reply-To: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> References: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <8EF7ABC9-13A3-46D7-A2AA-9569764FF4AF@donders.ru.nl> Hi Jim and Nietzsche, Let me chime in here: Where Nietzsche typed 'ft_freqanalysis' one should read 'ft_freqstatistics' probably. Also, cfg.frequency as option into ft_freqstatistics should be a 2-element array, specifying the lower and upper bound, contrary to Nietzsche's advice. I just tried this quickly, and it works for me. Jim, are you using an up to date version of FieldTrip? Also, if the problem persists, could you provide is with example code/data for us to be able to reproduce your problem. We usually do this through our bugzilla system: bugzilla.fcdonders.nl Best, Jan-Mathijs On Mar 19, 2014, at 12:52 PM, Lam, Nietzsche wrote: > Hi Jim, > > Without seeing all the code you used it's hard to determine where exactly the problem is. > NEvertheless, two things come to mind: > > (1) you need to specify the frequency of interest with "cfg.foi = 1:10". > To be precise, it is also good to specify the numbers of steps you wish to calculate e.g., 1:1:10. > please see here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis > > Alternatively, prior to calling ft_freqanalysis, you can use the function ft_selectdata(cfg,freqdata) to select the frequency band of interest. > > Hope this gets you started! > > Best, > Nietzsche > > ----- Original Message ----- >> From: "Jim Parkinson" >> To: fieldtrip at science.ru.nl >> Sent: Wednesday, 19 March, 2014 12:40:46 PM >> Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics >> Hi. >> >> >> i have some TFR data which has been analysed over 1 : .5 : 30 Hz using >> ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions >> >> >> Right now I'd like to compare the two conditions using >> ft_freqstatistics but restrain the statistics to the freq range 1:10. >> so I've set >> >> >> cfg.frequency = [1 10] >> >> >> But, by the time the stats are running, the analysis is over the full >> range produced by ft_freqanalysis (1:30 Hz), and the output stats >> reflects this. Somewhere in ft_freqstatistics the cfg.frequency >> setting seems to be overridden. Is this a bug, am i doing something >> wrong, or have I misunderstood what cfg,frequency is supposed to be >> doing? >> >> >> thanks for any help! >> >> >> -- >> >> >> >> Dr Jim Parkinson, D.Phil >> >> j.m.parkinson at sussex.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimparkinson at me.com Wed Mar 19 13:50:28 2014 From: jimparkinson at me.com (Jim Parkinson) Date: Wed, 19 Mar 2014 12:50:28 +0000 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics Message-ID: Aah, please ignore my previous message; embarrassingly, I was doing a rush-job, messy code, and found I was in fact overwriting my OWN cfg.frequency field somewhere. schoolboy error, apologies -- Dr Jim Parkinson, D.Phil Postdoctoral Research Fellow Sackler Centre For Consciousness Science School of Psychology University of Sussex Brighton BN1 9QH jimparkinson at me.com j.m.parkinson at sussex.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.passaro at gmail.com Wed Mar 19 14:15:16 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 09:15:16 -0400 Subject: [FieldTrip] Linearly indexed data for mvar connectivity Message-ID: I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. Thank you, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.passaro at gmail.com Wed Mar 19 14:22:51 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 09:22:51 -0400 Subject: [FieldTrip] Speeding up Statistics using multiple cores Message-ID: I have seen this issue come up a few times on the list-serve, especially in regards to processing the statistics for large datasets (usually analyses with several dimensions and many subjects, trials, and/or channels/sources). Typically to run even 1000 iterations of a montecarlo simulation with a cluster correction to compare two large datasets takes a long time and often times, the computer doesn't have enough memory to perform the operation. One possible solution that we found takes advantage of multi-core computers such that the number of iterations are reduced to only 50 or 100 and the process is spread across cores simultaneously. In order to compute the statistical significance of a cluster, one only needs the distribution of cluster t-values across all iterations. That being the case, one can simply save the cluster t's across iterations and cores and then compute a significance value for each cluster based on this distribution. In our experience this tends to reduce the processing time by a factor of the number of cores available on a given computer. Perhaps this is something that can be implemented in a future release of Fieldtrip? -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 19 14:38:17 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 14:38:17 +0100 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Dear Tony, I don't think that these immediate plans exist. I wasn't aware of the fact that ft_freqanalysis_mvar does not swallow the linearly indexed combinations. We may want to look into that. Could you post a bug on bugzilla for this? The fact that it is not supported for dtf and pdc actually has a reason, which is related to the fact that these measures are normalized with respect to the total inflow/outflow for a given channel, where the MVAR-model explicitly should be based on the multivariate decomposition (i.e. where multi means all channels included). The functionality of ft_mvaranalysis with cfg.channelcmb fits a separate mvar-model for each channel pair. Does this make sense? Best wishes, Jan-Mathijs On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. > > Thank you, > -Tony > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From bingshuo.li at student.uni-tuebingen.de Wed Mar 19 14:53:45 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Wed, 19 Mar 2014 14:53:45 +0100 Subject: [FieldTrip] Is fieldtrip software suitable for processing computational simulation data In-Reply-To: References: Message-ID: Dear Mr. Wang, I don't see the reason why you cannot use FieldTrip to analyze those data. Quantitatively, the simulation generated data you have should not be different than real (i.e. recorded) data. In our lab, we use FieldTrip to analyze multi-unit data. So far it's been proven that FieldTrip is fairly good! You may want to take a look at this tutorial (if you have not done so) http://fieldtrip.fcdonders.nl/tutorial/spike Good luck! ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Tue, Mar 18, 2014 at 3:11 AM, 王大明 wrote: > Dear friends: > > I am student from China and currently very interested in your software of > fieldtrip. There is a question puzzling me: > > If I use integrate-and-fire or other neural models to simulate and get > spike and LFP(local field potential) data, is fieldtrip still suitable for > processing these data? And the main part which I concern mostly is spike > and LFP data analysis. > > Your reply and help will be sincerely appreciated! Thank you! > > > Best Wishes > > > Daming Wang > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 19 15:28:04 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 19 Mar 2014 15:28:04 +0100 Subject: [FieldTrip] ft_freqstatistics for between subject design In-Reply-To: References: Message-ID: <5329A974.60708@donders.ru.nl> Hi BeomJun Min, > I think that each 5 values correspond with the frequency data point. yes, that;s correct. > > Is that script suitable for the test for the significance, especially > avgovertime option 'yes'? Yes and no. Yes, because you are testing for significance and, depending on what hypothesis you have, averaging over time is perfectly fine. Use avgovertime if you are looking for an effect independent of time, otherwise set it to 'no'. No, because you should pay attention to why selecting this time-frequency region. Now it seems that you selected frequency and time window based on eyeballing the data. If you have no apriori hypothesis about these frequencies and time window, it's a faulty approach to just select the region that shows the strongest approach and do a statistical test. You should take the whole time-window and whole freuqency spectrum (narrowed down as much as apriori hypotheses allow). If this is a real effect it is likely that a proper statistical test will show up only around that time-frequency. > > If I change the avgovertime option to 'no', then can I found the > p-values for each frequencies(5 values), and each time point(51 > values), in total 255 values that could have multiple comparison issue? Yes, you have this problem, is there a reason why you are not using the cluster-based permutation test (or any other correction for multiple comparison which is implemented by setting the cfg.correctm parameter accordingly)? > > And I thought the 'mask' values of 0 indicates 'statistically > non-significance'. Is that right? Yes, that is correct. Best, Jörn > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com , > http://bmssa.gist.ac.kr > > > _______________________________________________ > 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 antony.passaro at gmail.com Wed Mar 19 16:27:18 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 11:27:18 -0400 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Dear Jan-Mathijs, Thank you for your reply, I appreciate it. In regards to the potential bug in the ft_freqanalysis_mvar function, I see that it does indeed "swallow" linearly indexed combos, however, a reshape error is typically returned (line 146) since it tries to reshape the matrix into the incorrect number of elements. Perhaps I am doing something wrong, but I only feed the untouched output from the mvaranalysis to the freqanalysis function. I will send the "bug" to Bugzilla. In regards to your point about DTF and PDC normalization, as I understand it, one is normalized by the outflow and the other is normalized by the inflow (DTF and PDC respectively?). That being the case, it seems like a normalization to only one channel (or a subset of channels) or from only one channel (or a subset) would produce a correct normalization in one case (ie outflow) but not in the other (ie inflow). PDC and DTF taken together should then show the correct inflow but not outflow (PDC?) and the correct outflow but not inflow (DTF?), correct? I know that proposal may not be the most mathematically viable option, however, I'm not sure how else to tackle this issue. Thanks, -Tony On Wed, Mar 19, 2014 at 9:38 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Tony, > > I don't think that these immediate plans exist. I wasn't aware of the fact > that ft_freqanalysis_mvar does not swallow the linearly indexed > combinations. We may want to look into that. Could you post a bug on > bugzilla for this? The fact that it is not supported for dtf and pdc > actually has a reason, which is related to the fact that these measures are > normalized with respect to the total inflow/outflow for a given channel, > where the MVAR-model explicitly should be based on the multivariate > decomposition (i.e. where multi means all channels included). The > functionality of ft_mvaranalysis with cfg.channelcmb fits a separate > mvar-model for each channel pair. > > Does this make sense? > > Best wishes, > Jan-Mathijs > > > > On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > > I was wondering if there were any immediate plans to implement this > functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? > Linearly indexed data such as specific channel pairs (instead of all > possible channel pair combinations) seems to work fine for the > ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function > and is not fully implemented in the ft_connectivity_dtf and _pdc functions. > Any advice on how to proceed would be much appreciated. > > Thank you, > -Tony > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 19 16:37:44 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 16:37:44 +0100 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Hi Tony, > In regards to your point about DTF and PDC normalization, as I understand it, one is normalized by the outflow and the other is normalized by the inflow (DTF and PDC respectively?). That being the case, it seems like a normalization to only one channel (or a subset of channels) or from only one channel (or a subset) would produce a correct normalization in one case (ie outflow) but not in the other (ie inflow). PDC and DTF taken together should then show the correct inflow but not outflow (PDC?) and the correct outflow but not inflow (DTF?), correct? I know that proposal may not be the most mathematically viable option, however, I'm not sure how else to tackle this issue. I think the restriction is more fundamental that what you sketch. Not only there may be missing channel combinations, with the added problem of normalising with the sum of a different number of channels for different channel combinations, it is related to the fact that a full MVAR model is mandatory to get a DTF or PDC estimate that lives up to its definition (i.e. an estimate of inflow/outflow (always forget which is which) relative to the total network's in/outflow). Best, Jan-Mathijs > > Thanks, > -Tony > > > On Wed, Mar 19, 2014 at 9:38 AM, jan-mathijs schoffelen wrote: > Dear Tony, > > I don't think that these immediate plans exist. I wasn't aware of the fact that ft_freqanalysis_mvar does not swallow the linearly indexed combinations. We may want to look into that. Could you post a bug on bugzilla for this? The fact that it is not supported for dtf and pdc actually has a reason, which is related to the fact that these measures are normalized with respect to the total inflow/outflow for a given channel, where the MVAR-model explicitly should be based on the multivariate decomposition (i.e. where multi means all channels included). The functionality of ft_mvaranalysis with cfg.channelcmb fits a separate mvar-model for each channel pair. > > Does this make sense? > > Best wishes, > Jan-Mathijs > > > > On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > >> I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. >> >> Thank you, >> -Tony >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Wed Mar 19 17:17:17 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Wed, 19 Mar 2014 16:17:17 +0000 Subject: [FieldTrip] Source localizing auditory steady state responses Message-ID: <5329C30D.4090600@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Wed Mar 19 18:21:24 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Wed, 19 Mar 2014 13:21:24 -0400 Subject: [FieldTrip] Source localizing auditory steady state responses In-Reply-To: <5329C30D.4090600@glasgow.ac.uk> References: <5329C30D.4090600@glasgow.ac.uk> Message-ID: Hey May, Beamorming on correlated sources is my interest too. The problem is that most beamformers (I deal with SAM and vector beamformer) are going to suppress or/and misplace any correlated source. The way I deal with this problem is by creating a region of interest (around primary auditory cortex) and beaformer over each ROI separately. The signal correlation problem is still there but with a lesser extant (I think). Here is a great article on this topic: Beamformer reconstruction of correlated sources using a modified source model and Modified Beamformers for Coherent Source Region Suppression Also if I localize evoked responses I always prefer dipole fitting over other methods, you could try the moving dipolar fitting method and have your wave former from the dipole t-course. Let me know how it will go for you. Cheers, Inna Inna McGowin On Wed, Mar 19, 2014 at 12:17 PM, Heng-Ru May Tan < Heng-RuMay.Tan at glasgow.ac.uk> wrote: > > Hi All, > I am trying to localize frequency specific ASSR but have not been > successful in doing so with the 'mne' method in the ft_sourceanalysis. > At the sensor-level the topo plots show clear bilateral generators. > > Is it possible to localize the bilateral sources using beamforming? And > would I need to create a different forward model? > Additionally, I would also like to retrieve the source signals and ideally > comparing between 2 time periods within the same trial. > > I would appreciate if someone could advise or comment on how best to go > about doing so. > > Thanks, > May > > > -- > > > ____________________________________________________________________________________________________________________________________ > > Heng-Ru *May* Tan, PhD. > > > Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive > Neuroimaging (CCNi) ▫ College of Medical, Veterinary and Life Sciences > > University of Glasgow ▫ 58 Hillhead Street, Glasgow G12 8QB ▫ +44 > (0)141-330-5090 ▫ Heng-RuMay.Tan at glasgow.ac.uk > > _______________________________________________ > 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 mbj0310 at gmail.com Thu Mar 20 00:42:20 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Thu, 20 Mar 2014 08:42:20 +0900 Subject: [FieldTrip] ft_freqstatistics for between subject design In-Reply-To: <5329A974.60708@donders.ru.nl> References: <5329A974.60708@donders.ru.nl> Message-ID: Dear Jörn Thank you for your kind reply. Now I think I can approach for the better way. Actually I am a novice, and trying to learn about the MATLAB, and the fieldtrip. :) So far, I have processed step by step, and now I will consider the multiple comparison issue. Anyway, thank you again. With regards. 2014-03-19 23:28 GMT+09:00 "Jörn M. Horschig" : > Hi BeomJun Min, > > > > I think that each 5 values correspond with the frequency data point. >> > yes, that;s correct. > > > >> Is that script suitable for the test for the significance, especially >> avgovertime option 'yes'? >> > Yes and no. Yes, because you are testing for significance and, depending > on what hypothesis you have, averaging over time is perfectly fine. Use > avgovertime if you are looking for an effect independent of time, otherwise > set it to 'no'. No, because you should pay attention to why selecting this > time-frequency region. Now it seems that you selected frequency and time > window based on eyeballing the data. If you have no apriori hypothesis > about these frequencies and time window, it's a faulty approach to just > select the region that shows the strongest approach and do a statistical > test. You should take the whole time-window and whole freuqency spectrum > (narrowed down as much as apriori hypotheses allow). If this is a real > effect it is likely that a proper statistical test will show up only around > that time-frequency. > > > >> If I change the avgovertime option to 'no', then can I found the p-values >> for each frequencies(5 values), and each time point(51 values), in total >> 255 values that could have multiple comparison issue? >> > Yes, you have this problem, is there a reason why you are not using the > cluster-based permutation test (or any other correction for multiple > comparison which is implemented by setting the cfg.correctm parameter > accordingly)? > > > >> And I thought the 'mask' values of 0 indicates 'statistically >> non-significance'. Is that right? >> > Yes, that is correct. > > Best, > Jörn > > >> -- >> BeomJun Min, M.D. >> >> Department of Medical System Engineering (DMSE) >> Gwangju Institute of Science and Technology (GIST) >> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >> 500-712, Republic of Korea (South) >> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >> E-mail: mbj0310 at gmail.com , >> http://bmssa.gist.ac.kr >> >> >> _______________________________________________ >> 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 > -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Thu Mar 20 12:47:16 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Thu, 20 Mar 2014 11:47:16 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 40, Issue 33 In-Reply-To: References: Message-ID: <532AD544.4020908@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Thu Mar 20 14:03:52 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 20 Mar 2014 13:03:52 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 40, Issue 33 In-Reply-To: <532AD544.4020908@glasgow.ac.uk> References: <532AD544.4020908@glasgow.ac.uk> Message-ID: Hi May, Inna, everyone, I'm not sure exactly what Inna meant by the ROI, specifically whether the ROI was applied to source space or to sensors. Applying a ROI to sources will not work: the beamformer result at one location in the brain is the same irrespective of where else you also compute a beamformer result. However, perhaps Inna meant ROI over channels (e.g. left channels for the left auditory cortex). If so, then as she says, it will reduce the problem a bit but it will still be there. See cfg.supchan in ft_sourceanalysis. Indeed the method by Dalal et al. was initially implemented in the NUTMEG software (which is compatible with FieldTrip). However, it is also now implemented in FieldTrip by using the cfg.supdip option in ft_sourceanalysis, which allows you to suppress a region (e.g. right auditory cortex) so that you can estimate activity elsewhere (e.g. left auditory cortex). Cheers, Johanna 2014-03-20 11:47 GMT+00:00 Heng-Ru May Tan : > Hi Inna, > > Thanks for the suggestions re using ROI beamforming separately and > references. I'll give it a go. > > BTW, I wonder if those beamforming algorithms e.g. Dalal et al2006 (IEEE > biomed. eng.) might have already been implemented somewhere... or might it > be something that fieldtrip might/could consider adding to their > sourceanalysis options? =) > > Thanks, > May > > > ForwardedMessage.eml > Subject: > Re: [FieldTrip] Source localizing auditory steady state responses > From: > "McGowin, Inna" > Date: > 19/03/2014 17:21 > To: > FieldTrip discussion list > > Hey May, > Beamorming on correlated sources is my interest too. The problem is that > most beamformers (I deal with SAM and vector beamformer) are going to > suppress or/and misplace any correlated source. The way I deal with this > problem is by creating a region of interest (around primary auditory > cortex) and beaformer over each ROI separately. The signal correlation > problem is still there but with a lesser extant (I think). Here is a great > article on this topic: > Beamformer reconstruction of correlated sources using a modified source > model > and > Modified Beamformers for Coherent Source Region Suppression > > Also if I localize evoked responses I always prefer dipole fitting over > other methods, you could try the moving dipolar fitting method and have > your wave former from the dipole t-course. > Let me know how it will go for you. > Cheers, > Inna > > > Inna McGowin > > > On Wed, Mar 19, 2014 at 12:17 PM, Heng-Ru May Tan < > Heng-RuMay.Tan at glasgow.ac.uk> wrote: > > Hi All, > I am trying to localize frequency specific ASSR but have not been > successful in doing so with the 'mne' method in the ft_sourceanalysis. > At the sensor-level the topo plots show clear bilateral generators. > > Is it possible to localize the bilateral sources using beamforming? And > would I need to create a different forward model? > Additionally, I would also like to retrieve the source signals and ideally > comparing between 2 time periods within the same trial. > > I would appreciate if someone could advise or comment on how best to go > about doing so. > > Thanks, > May > > > > _______________________________________________ > 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 Thu Mar 20 15:08:18 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 20 Mar 2014 15:08:18 +0100 Subject: [FieldTrip] ICA plots crash Matlab Message-ID: Dear all, I'm experiencing a weird problem and was wondering if anyone might know why. In certain versions of fieldtrip (for example, the latest version on the ftp server on 20140319), the figure plot for the ICA components crashed my Matlab. This also happened when I used the fieldtrip version on 20140121. Yet, the version on 20140203 did not crash my Matlab when it plots the ICA components. What could be causing the problem? I'm using Matlab 2012b 64 bit. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Fri Mar 21 14:05:33 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 21 Mar 2014 13:05:33 +0000 Subject: [FieldTrip] Source localizing auditory steady state responses In-Reply-To: References: Message-ID: <532C391D.4010504@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Fri Mar 21 15:36:19 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Fri, 21 Mar 2014 15:36:19 +0100 Subject: [FieldTrip] Permutation statistics Message-ID: Dear all, I've got EEG datasets for 64 channels, and I would like to perform permutation statistics on the power frequency analyses to compare the two conditions (before and after resting state periods). However, I'm not sure how to operationalise the statistical analyses since most of the examples on the website are for MEG datasets. I would appreciate very much if someone could help me on this! Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 21 20:10:50 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Fri, 21 Mar 2014 20:10:50 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: References: Message-ID: <532C8EBA.2020806@gmail.com> Dear Hweeling, There is nothing inherent to the ft_freqstatistics function that makes it special for MEG, rather than for EEG data. If you've been using other FieldTrip functions, you probably have used cfg.channel before. These are the channels present in your EEG data. How you should set some of the other parameters depends only on your design, not on whether the data are from MEG or EEG. Maybe you can specify what is unclear to you when calling the function so that you can get appropriate help! Good luck, Vitoria On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: > > Dear all, > > I've got EEG datasets for 64 channels, and I would like to perform > permutation statistics on the power frequency analyses to compare the > two conditions (before and after resting state periods). > > However, I'm not sure how to operationalise the statistical analyses > since most of the examples on the website are for MEG datasets. > > I would appreciate very much if someone could help me on this! Thanks! > > Cheers, > Hweeling > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sun Mar 23 01:08:26 2014 From: russgport at gmail.com (Russell G Port) Date: Sat, 22 Mar 2014 20:08:26 -0400 Subject: [FieldTrip] Dipole fitting Message-ID: Hi All, I am currently struggling to fit dipoles to my auditory data. In short I want to 'turn off' half the channels (so I only have one hemisphere) (as can easily be done in CTF tools DipoleFit). I thought this would be easy by having the timelocked data that went into ft_dipolefitting, have cfg.channel='MR' or 'ML'. The issue I have is when I dipole fit this data, the dipole ends up in the center of the head. I definitely have only left or right channels selected (as checked in the output of ft_timelockanalysis). I thought of two ways around this. A) I use an initial guess away from the center of the head (with cfg.nonlinear ='yes') B) I have a source model with the medial - lateral space starting starting away from the center (e.g. in CTF coordinate Y = 2:1:7) [again with cfg.linear='yes']. While these approaches normally work, I have a particularly stubbon couple of datasets, that still think the the dipole is in the center of the head. When I check the topoplot of the date being fit, it appears that the 'turned off/not analyzed' side (the side not specified in ft_timelock analysis's cfg) is completely red on the topoplot, which would not be a problem but there is a small sink close to it, which is throwing off the dipole placement. Next I repeated my dipole fitting using my altered source model with cfg.nonlinear='no', but again this source and sink caused by the contralateral hemisphere is pulling the dipole to the edge of my source model space. Does anyone have any suggestions. When I try to dipole fitting this data in CTF DipoleFit I do not have this issue (presumably because the contralateral hemisphere is no contributing to the dipole fit). Thanks Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Sun Mar 23 03:14:34 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Sun, 23 Mar 2014 11:14:34 +0900 Subject: [FieldTrip] Intertrial coherence (phase locking factor) Message-ID: Hello trippers, I am confused with the 'cfg.method' for ITC. After examining the previous discussion list, I found method for ITC calculation as below. *tmpdat = freq.fourierspctrm;* *tmpdat = tmpdat./abs(tmpdat); % this will normalise each trial for its amplitude;* *itc = abs(mean(tmpdat)); % this will give the itc* In addition, for this method, the ft_freqanalysis should have configuration as below. *cfg = [];* *cfg.keeptrials = 'yes';* *cfg.keeptapers = 'yes';* *cfg.output = 'fourier';* *cfg.channel = 'all';* *cfg.method = 'mtmfft';* *cfg.foi = 20:1:60;* *cfg.toi = -0.5:0.01:1.5;* *cfg.tapsmofrq = 4;* *cfg.taper = 'hanning';* However, I use 'wavelet' for the calculation of gamma band now. Should I use 'mtmfft' for the calucation of ITC? In case of 'wavelet', the result of itc has 4-D data - trial (averaged) * channel * freq * time Meanwhile, in case of 'mtmfft' the result has 3D data - trial (averaged) * channel * freq without time. Which structure is right? And, if I want to calculate the mean value of ITC of a group, is the order of the processing below right? : preprocessed data of each individual -> time-frequency analysis -> calculate ITC -> grandaverage With regards. -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Sun Mar 23 15:19:30 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Sun, 23 Mar 2014 15:19:30 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: <532C8EBA.2020806@gmail.com> References: <532C8EBA.2020806@gmail.com> Message-ID: Dear Vitoria, Thanks for the tip. I'm trying to perform a within-trial analysis. I've got two sets of data, before and after resting state EEG activity. First set has 54 trials and second set has 51 trials. Hence, my cfg.design = [ones(1, 105); ones(1,54), ones(1,51)*2]. I've set up the statistical analysis like this: cfg = []; cfg.layout = lay; cfg.channel = 'all'; cfg.latency = 'all'; cfg.trials = 'all'; cfg.frequency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.numrandomization = 1000; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; [stat] = ft_freqstatistics(cfg, post_c200freq, pre_c200freq); However, I got an error message: Error using ft_statfun_depsamplesT (line 84) Invalid specification of the design array. Error in ft_statistics_montecarlo (line 285) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 323) [stat, cfg] = statmethod(cfg, dat, cfg.design); Can someone please tell me what parameters did I specify wrongly? Thanks. Best wishes, Hweeling On 21 March 2014 20:10, Vitória Piai wrote: > Dear Hweeling, > > There is nothing inherent to the ft_freqstatistics function that makes it > special for MEG, rather than for EEG data. If you've been using other > FieldTrip functions, you probably have used cfg.channel before. These are > the channels present in your EEG data. > How you should set some of the other parameters depends only on your > design, not on whether the data are from MEG or EEG. > Maybe you can specify what is unclear to you when calling the function so > that you can get appropriate help! > > Good luck, Vitoria > > > On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: > > > Dear all, > > I've got EEG datasets for 64 channels, and I would like to perform > permutation statistics on the power frequency analyses to compare the two > conditions (before and after resting state periods). > > However, I'm not sure how to operationalise the statistical analyses > since most of the examples on the website are for MEG datasets. > > I would appreciate very much if someone could help me on this! Thanks! > > Cheers, > Hweeling > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 tyler.grummett at flinders.edu.au Mon Mar 24 00:32:21 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sun, 23 Mar 2014 23:32:21 +0000 Subject: [FieldTrip] ft_timelockanalysis and tf_sourceanalysis Message-ID: Hello fieldtrip, I just want to discuss my processing steps and to determine if I have made any analysis errors. Firstly, I have data converted from eeglab using the following code: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); The data is 30 seconds of someone having their eyes closed. There are no trigger codes unfortunately. I then run the ft_timelockanalysis function (to be used in tf_sourceanalysis), without any configuration settings specified (I will use the defaults). % calculating the cross spectral density matrix ?cfg = []; timelock = ft_timelockanalysis(cfg, data); The code runs fine without any errors. As it calculates the data to be one trial long, has the code done anything to do the data. What has it timelocked to? I then calculate the mri_headmodel: % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); I then run the source analysis code: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; % cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost = ft_sourceanalysis( cfg, timelock); The code also runs fine. However, what I have found is that I cant plot the data using ft_sourceplot. As I am not 100% on how these functions operate and how to properly run a beamformer on continuous data, I am not sure whether the step that I have taken are appropriate, or that I am kind of making it up as I go along. I cant find anywhere how to do a beamformer on continuous data without trials of some sort. Any help will be appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 24 08:54:17 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 24 Mar 2014 08:54:17 +0100 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: References: Message-ID: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Dear Christine, I am forwarding your question to the FieldTrip discussion list. No doubt somebody with hands-on experience can give you a much better reply than I could. If you haven't subscribed to the list: this would be the time to do so ;-). Best wishes, Jan-Mathijs On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: > Dear Jan-Mathijs > > I just have a very naive question on the EEG-MRI coregistration - for source reconstruction. > > For us, we actually do concurrent EEG-MRI. I read the gold standard is to use the 3D digitalisor (fastrack) system to record the sensor space. But since we are doing concurrent recording, we can actually see most of the electrode on the T1 images (due to small signal distortion, the electrodes look like small dents on the scalp). To me, who has not done EEG before, this information should be useful for co-register EEG with MRI? and potentially be better than register everything to the three landmark. > > Does Fieldtrip have functions that might work with such configuration? I imagine we could do a first automated co-reg as a first rough estimate, and maybe manually line up the electrode with T1. > > Best regards > Christine > Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From stebollmann at gmail.com Mon Mar 24 15:34:45 2014 From: stebollmann at gmail.com (Steffen Bollmann) Date: Mon, 24 Mar 2014 15:34:45 +0100 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> References: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Message-ID: Dear Christine, I have the same problem, but haven't found a very fast and easy way to do this. However, I found a tool, which helps a lot: http://pylocator.thorstenkranz.de/ Maybe anyone else has better ways of doing it and could share his thoughts? All the best Steffen 2014-03-24 8:54 GMT+01:00 jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl>: > Dear Christine, > > I am forwarding your question to the FieldTrip discussion list. No doubt > somebody with hands-on experience can give you a much better reply than I > could. > If you haven't subscribed to the list: this would be the time to do so ;-). > > Best wishes, > Jan-Mathijs > > > On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: > > Dear Jan-Mathijs > > I just have a very naive question on the EEG-MRI coregistration - for > source reconstruction. > > For us, we actually do concurrent EEG-MRI. I read the gold standard is to > use the 3D digitalisor (fastrack) system to record the sensor space. But > since we are doing concurrent recording, we can actually see most of the > electrode on the T1 images (due to small signal distortion, the electrodes > look like small dents on the scalp). To me, who has not done EEG before, > this information should be useful for co-register EEG with MRI? and > potentially be better than register everything to the three landmark. > > Does Fieldtrip have functions that might work with such configuration? I > imagine we could do a first automated co-reg as a first rough estimate, and > maybe manually line up the electrode with T1. > > Best regards > Christine > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Tue Mar 25 09:25:12 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Tue, 25 Mar 2014 09:25:12 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: References: <532C8EBA.2020806@gmail.com> Message-ID: <53313D68.7040304@gmail.com> Hi Hweeling, I'm sorry, I don't understand exactly what you mean by "within-trial" analysis. If you mean comparing trials within the same participant, then there are two things you should change in your code: cfg.statistic = 'indepsamplesT'; %% this should be indepsamplesT rather than depsamplesT cfg.uvar = 1; %%% Remove this line from your configuration cfg.ivar = 1; %% the indep. var here should be 1, rather than 2 Maybe your design will also need some adjustment, I'm not so sure (I don't use indepsamplesT that much). In any case, it could help to have a look at: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock?s[]=indepsamplest If you want a cleaner code, you can also remove all these lines (they should be default): cfg.channel = 'all'; cfg.latency = 'all'; cfg.trials = 'all'; cfg.frequency = 'all'; I hope this works, otherwise email the list again. Good luck, Vitória On 3/23/2014 3:19 PM, Hwee Ling Lee wrote: > Dear Vitoria, > > Thanks for the tip. > > I'm trying to perform a within-trial analysis. > > I've got two sets of data, before and after resting state EEG > activity. First set has 54 trials and second set has 51 trials. Hence, > my cfg.design = [ones(1, 105); ones(1,54), ones(1,51)*2]. > > I've set up the statistical analysis like this: > > cfg = []; > cfg.layout = lay; > cfg.channel = 'all'; > cfg.latency = 'all'; > cfg.trials = 'all'; > cfg.frequency = 'all'; > cfg.avgovertime = 'no'; > cfg.avgoverfreq = 'no'; > cfg.avgoverchan = 'no'; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.numrandomization = 1000; > cfg.design = design; > cfg.uvar = 1; > cfg.ivar = 2; > [stat] = ft_freqstatistics(cfg, post_c200freq, pre_c200freq); > > However, I got an error message: > > Error using ft_statfun_depsamplesT (line 84) > Invalid specification of the design array. > > Error in ft_statistics_montecarlo (line 285) > [statobs, cfg] = statfun(cfg, dat, design); > > Error in ft_freqstatistics (line 323) > [stat, cfg] = statmethod(cfg, dat, cfg.design); > > Can someone please tell me what parameters did I specify wrongly? Thanks. > > Best wishes, > Hweeling > > > > > On 21 March 2014 20:10, Vitória Piai > wrote: > > Dear Hweeling, > > There is nothing inherent to the ft_freqstatistics function that > makes it special for MEG, rather than for EEG data. If you've been > using other FieldTrip functions, you probably have used > cfg.channel before. These are the channels present in your EEG data. > How you should set some of the other parameters depends only on > your design, not on whether the data are from MEG or EEG. > Maybe you can specify what is unclear to you when calling the > function so that you can get appropriate help! > > Good luck, Vitoria > > > On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: >> >> Dear all, >> >> I've got EEG datasets for 64 channels, and I would like to >> perform permutation statistics on the power frequency analyses to >> compare the two conditions (before and after resting state periods). >> >> However, I'm not sure how to operationalise the statistical >> analyses since most of the examples on the website are for MEG >> datasets. >> >> I would appreciate very much if someone could help me on this! >> Thanks! >> >> Cheers, >> Hweeling >> >> >> >> _______________________________________________ >> 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 e.maris at psych.ru.nl Tue Mar 25 12:01:35 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 25 Mar 2014 12:01:35 +0100 (CET) Subject: [FieldTrip] PhD position at Donders Institute Message-ID: <011401cf4819$961e3ca0$c25ab5e0$@maris@psych.ru.nl> The Donders Institute for Brain, Cognition and Behaviour has a vacancy for a PhD student on the project Characterizing phase-coupled oscillatory networks in the alpha and the theta band: their relation to perception and attention, and to individual differences in cognitive performance Research Group Neurophysiology of Active Perception The objective of our research group is to formulate and validate mechanistic explanations of cognitive phenomena, that is explanations in terms of their underlying neurophysiological mechanisms. As an integral part of this objective, our group has an important methodological component, the characterization of interactions in spatially distributed neural activity, which is the central topic of this PhD project. Project Description Phase-consistent rhythmic activity is ubiquitous in electrophysiological recordings, and it may reflect networks of phase-coupled neuronal populations oscillating at different frequencies. Because neuronal oscillations may reflect rhythmic modulations of neuronal excitability, phase-coupled oscillatory networks (PCONs) could be functional building blocks for routing information through the brain. This project focuses on PCONs involving brain rhythms that (1) are modulated by selective attention and working memory, and (2) are correlated with individual differences in cognitive performance. Using newly developed methods, we extract PCONs from magneto-encephalography (MEG) data on the basis of the patterns of phase-consistency induced by these PCONs. These methods succeed because PCONs can be separated on the basis their frequency content, the brain areas over which they can be observed, and their pattern of between-site phase relations. We will test three hypotheses with respect to the functional role of alpha and theta band PCONs, one pertaining to their behavioral relevance, one to the mechanism underlying sustained attention, and one to their relation with individual differences in cognitive performance. All hypotheses can be tested using existing data. Job Requirements This project calls for either a cognitive neuroscientist with a strong interest and skills in data analysis or a person with a computational background (machine learning, applied statistics, signal processing) with a strong interest in cognitive neuroscience. We are looking for candidates with a MSc degree who are highly motivated to conduct research. It is highly desirable to have extensive experience with a high-level programming language such as Matlab or Python. The candidate must be available at 1-10-2014. Application deadline: 14-7-2014 The Institute The Donders Institute for Brain, Cognition and Behaviour consists of three research centres, the Centre for Cognition, the Centre for Cognitive Neuroimaging and the Centre for Neuroscience. The Donders Institute focuses on state of the art cognitive neuroscience, in a multidisciplinary approach, and offers excellent lab and neuroimaging facilities. The project is embedded within the Donders research theme Brain Networks and Neuronal Communication (http://www.ru.nl/donders/research/theme-4-brain/) and will be supervised by dr. Eric Maris at the Donders Centre for Cognition (DCC). The DCC is part of the Faculty of Social Sciences, one of the largest faculties at Radboud University Nijmegen. The faculty hosts high-quality research and study programs that rank among the best in the Netherlands. Contact Information Dr. Eric Maris e.maris at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.cong at gmail.com Wed Mar 26 05:22:50 2014 From: christine.cong at gmail.com (Cong Christine Guo) Date: Wed, 26 Mar 2014 14:22:50 +1000 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: References: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Message-ID: Dear Steffen the tool you suggested is indeed very helpful. We can live with that before there is a fast automated way -- I reckon digitising the sensors during prep probably consume similar amount time. best regards Christine On Tue, Mar 25, 2014 at 12:34 AM, Steffen Bollmann wrote: > Dear Christine, > > I have the same problem, but haven't found a very fast and easy way to do > this. > > However, I found a tool, which helps a lot: > http://pylocator.thorstenkranz.de/ > > Maybe anyone else has better ways of doing it and could share his thoughts? > All the best > Steffen > > > > 2014-03-24 8:54 GMT+01:00 jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl>: > >> Dear Christine, >> >> I am forwarding your question to the FieldTrip discussion list. No doubt >> somebody with hands-on experience can give you a much better reply than I >> could. >> If you haven't subscribed to the list: this would be the time to do so >> ;-). >> >> Best wishes, >> Jan-Mathijs >> >> >> On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: >> >> Dear Jan-Mathijs >> >> I just have a very naive question on the EEG-MRI coregistration - for >> source reconstruction. >> >> For us, we actually do concurrent EEG-MRI. I read the gold standard is >> to use the 3D digitalisor (fastrack) system to record the sensor space. >> But since we are doing concurrent recording, we can actually see most of >> the electrode on the T1 images (due to small signal distortion, the >> electrodes look like small dents on the scalp). To me, who has not done >> EEG before, this information should be useful for co-register EEG with MRI? >> and potentially be better than register everything to the three landmark. >> >> Does Fieldtrip have functions that might work with such configuration? >> I imagine we could do a first automated co-reg as a first rough estimate, >> and maybe manually line up the electrode with T1. >> >> Best regards >> Christine >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 26 08:54:02 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 26 Mar 2014 08:54:02 +0100 Subject: [FieldTrip] Intertrial coherence (phase locking factor) In-Reply-To: References: Message-ID: <6D191C38-3829-45FC-8B03-654E488B7AC6@donders.ru.nl> Dear Beom Jun Min, > I am confused with the 'cfg.method' for ITC. There is currently no cfg.method that gives you ITC directly, indeed you should use the formula below, which is correct if you have a single taper per trial (which you have if you use cfg.taper = 'hanning' in ft_freqanalysis). > After examining the previous discussion list, I found method for ITC calculation as below. > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); % this will normalise each trial for its amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > > In addition, for this method, the ft_freqanalysis should have configuration as below. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.keeptapers = 'yes'; > cfg.output = 'fourier'; > cfg.channel = 'all'; > cfg.method = 'mtmfft'; > cfg.foi = 20:1:60; > cfg.toi = -0.5:0.01:1.5; > cfg.tapsmofrq = 4; > cfg.taper = 'hanning'; > > However, I use 'wavelet' for the calculation of gamma band now. > > Should I use 'mtmfft' for the calucation of ITC? > > In case of 'wavelet', the result of itc has 4-D data - trial (averaged) * channel * freq * time > Meanwhile, in case of 'mtmfft' the result has 3D data - trial (averaged) * channel * freq without time. > Which structure is right? The distinction between 'mtmfft' and 'wavelet'/'mtmconvol' is exactly whether time is taken into account. The functionality that you want to use, depends on your question. > And, if I want to calculate the mean value of ITC of a group, > is the order of the processing below right? : > preprocessed data of each individual -> time-frequency analysis -> calculate ITC -> grandaverage The order is correct. Best wishes, Jan-Mathijs > > With regards. > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.lalancette at sickkids.ca Wed Mar 26 21:33:43 2014 From: marc.lalancette at sickkids.ca (Marc Lalancette) Date: Wed, 26 Mar 2014 20:33:43 +0000 Subject: [FieldTrip] MEG lead field units Message-ID: <2A2B6A5B8C4C174CBCCE0B45E548DEB229F66CD0@SKMBXX01.sickkids.ca> Hello all, I am not (yet) a common user of Fieldtrip, but I am using it now to investigate some basic properties of our MEG system. I only needed a realistic forward solution so I chose Nolte's "singleshell" model with mostly default parameters. I just spent quite a bit of time going through the code trying to figure out the units of the lead field I obtained. As it was not too obvious, I would appreciate some confirmation/correction. By default, my volume conduction and sensor structures were in units of 'cm'. That seems to be also what Nolte's method requires. Nowhere by default are the units specified for the (meg) channels or the source dipoles when simply calling ft_prepare_leadfield, and looking at the spherical computation in Nolte's code, I concluded that it would work with the channels in T and the dipole in A*cm. Thus the lead field units would be T/(A*cm). This also seems consistent with the lead field amplitude I am getting for our system (in the order of 10^-9). Is this correct? Thanks for your help! Marc Lalancette Lab Research Project Manager The Hospital for Sick Children, Toronto, Canada ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Mar 27 08:30:59 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 27 Mar 2014 08:30:59 +0100 Subject: [FieldTrip] POSTDOCTORAL POSITION ON ANALYSIS AND MODELING OF LFP AND MEG SIGNALS Message-ID: Hi all, The Faculty of Psychology and Neuroscience at Maastricht University offers a 21-month postdoc focused on the analysis and computational modeling of Local Field Potentials (LFPs) measured invasively in monkey cortex, and Magneto-Encephalo-Graphy (MEG) data measured in human cortex. Please feel free to distribute it. *PROJECT:* Existing human MEG data as well as rhesus monkey spiking, LFP and ECoG data have been collected in V1 during grating contrast modulations. The project is focused on analyzing and modeling the spectral responses in the different existing datasets, and to build detailed neural network models at the level of columns and layers, as well as transfer models to test which aspects of network models in monkey can be generalized to the human. *CANDIDATE: *The ideal candidate would have a strong background in mathematics, physics, computer science, and/or neuroscience, or related backgrounds, and a strong interest in the analysis and modeling of oscillatory signals. Expertise is expected with the modeling of single neurons, ING/PING or Izhikevich-type networks, and related approaches. *PLACE OF PROJECT:* The project will be carried out in Nijmegen, on the campus of the Radboud University. *FUNDING:* The funding is provided through a grant awarded by the Human Brain Project. The postdoctoral position is for 21 months. Salary and benefits are according to Dutch standards and according to experience. *WE OFFER:* We offer a highly multidisciplinary, international and stimulating environment. The project is relevant and prestigious, and will be performed in an intense collaboration with Nicosia University, our partner on the HBP award. *HOW TO APPLY:* To apply, please send a CV including the names of two references, and a brief motivation statement to Prof. Peter De Weerd p.deweerd at maastrichtuniversity.nl. We aim to fill the position within the month of April. Best, Haiteng -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Thu Mar 27 11:03:41 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Thu, 27 Mar 2014 18:03:41 +0800 Subject: [FieldTrip] help about ' fieldtrip2fiff ' Message-ID: Dear all: I want to save .mat file to .fif file use fieldtrip, there are errors cfg = []; cfg.dataset = 'D:\raw_tsss.fif'; data = ft_preprocessing(cfg); data = hdr: [1x1 struct] label: {306x1 cell} time: {[1x616000 double]} trial: {[306x616000 double]} fsample: 1000 grad: [1x1 struct] cfg: [1x1 struct] sampleinfo: [1 616000] fiff_file = 'song_tsss.fif'; fieldtrip2fiff(fiff_file, data) ??? Undefined function or variable 'fsample'. Error in ==> fieldtrip2fiff at 61 info.sfreq = fsample when I let fsample=1000(from data), there are also errors, ???'dataout' is not exist what should I do? thanks xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Mar 27 11:51:48 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 27 Mar 2014 10:51:48 +0000 Subject: [FieldTrip] Time domain beamformer Message-ID: <76289E9F-A1B3-4FC8-ADD6-4B6AC4311B19@flinders.edu.au> Hello fieldtrip, I just want to discuss my processing steps and to determine if I have made any analysis errors. Firstly, I have data converted from eeglab using the following code: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); The data is 30 seconds of someone having their eyes closed. There are no trigger codes unfortunately. I then run the ft_timelockanalysis function (to be used in tf_sourceanalysis), without any configuration settings specified (I will use the defaults). % calculating the cross spectral density matrix ​cfg = []; timelock = ft_timelockanalysis(cfg, data); The code runs fine without any errors. As it calculates the data to be one trial long, has the code done anything to do the data. What has it timelocked to? I then calculate the mri_headmodel: % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); I then run the source analysis code: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; % cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost = ft_sourceanalysis( cfg, timelock); The code also runs fine. However, what I have found is that I cant plot the data using ft_sourceplot. As I am not 100% on how these functions operate and how to properly run a beamformer on continuous data, I am not sure whether the step that I have taken are appropriate, or that I am kind of making it up as I go along. I cant find anywhere how to do a beamformer on continuous data without trials of some sort. Any help will be appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Thu Mar 27 12:10:36 2014 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Thu, 27 Mar 2014 12:10:36 +0100 Subject: [FieldTrip] Research Assistant / Associate at the University of Glasgow Message-ID: Dear all, there is a position as research assistant at the University of Glasgow available (see below). Best, Andreas _________________ University of Glasgow College of Medical, Veterinary and Life Sciences Research Institute of Neuroscience and Psychology Research Assistant / Associate Ref: M00563 Grade 6/7: £26,527 - £29,837 / £32,590 - £36,661 per annum You will contribute to a project, funded by the Medical Research Council (MRC), entitled "Using Magnetoencephalography to Investigate Aberrant Neural Synchrony in Prodromal Schizophrenia". Specifically, the job requires the analysis and acquisition of MEG-data sets and implementation of novel analytic tools, contributing to the design and programming of MEG experiments, recruiting and running the participants, assisting in analysing the results, and participating in the writing up of the results. With extensive, up-to-date practical knowledge in MEG or EEG, you will have excellent knowledge of source-localization, Matlab and experimental control software. This post is initially funded for 2 years. It is anticipated that this will be extended to 3 years subject to securing additional funding. Informal enquires to Dr Peter Uhlhaas (Email: Peter.Uhlhaas at glasgow.ac.uk; Tel: 0141 330 8730) Apply online at: www.gla.ac.uk/jobs Closing date: 28 April 2014 The University has recently been awarded the Athena SWAN Institutional Bronze Award The University is committed to equality of opportunity in employment. The University of Glasgow, charity number SC004401. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gio at gpiantoni.com Thu Mar 27 14:01:47 2014 From: gio at gpiantoni.com (Gio Piantoni) Date: Thu, 27 Mar 2014 09:01:47 -0400 Subject: [FieldTrip] help about ' fieldtrip2fiff ' In-Reply-To: References: Message-ID: Hi Xiao, It seems that you are using an old (one-year old) version of Fieldtrip, https://github.com/fieldtrip/fieldtrip/blob/92c805e819a126c61bfb96a38bc1a8025c8348ba/fieldtrip2fiff.m and the function has been updated a few times since then. Do you mind downloading a new version of FieldTrip and report back if you get any error? thanks! -g On Thu, Mar 27, 2014 at 6:03 AM, tongxiao meng wrote: > Dear all: > I want to save .mat file to .fif file use fieldtrip, there are errors > > cfg = []; > cfg.dataset = 'D:\raw_tsss.fif'; > data = ft_preprocessing(cfg); > > data = > > hdr: [1x1 struct] > label: {306x1 cell} > time: {[1x616000 double]} > trial: {[306x616000 double]} > fsample: 1000 > grad: [1x1 struct] > cfg: [1x1 struct] > sampleinfo: [1 616000] > > fiff_file = 'song_tsss.fif'; > fieldtrip2fiff(fiff_file, data) > > > ??? Undefined function or variable 'fsample'. > > Error in ==> fieldtrip2fiff at 61 > info.sfreq = fsample > when I let fsample=1000(from data), there are also errors, > ???'dataout' is not exist > > what should I do? > thanks > xiao > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From v.piai.research at gmail.com Thu Mar 27 15:20:24 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Mar 2014 15:20:24 +0100 Subject: [FieldTrip] ft_sourceplot with surface method in most recent FT version Message-ID: <533433A8.2070508@gmail.com> Hi everyone, I hope someone can help me out with a seemingly very easy question. When using ft_sourceplot, I was used to defining the surffile for the surface method. I'd then plot my interpolated source-reconstructed activity. In a more recent version of FT, apparently this is no longer needed (and the surffile I was used to use ''surface_l4_both.mat' doesn't even exist anymore). The page http://fieldtrip.fcdonders.nl/template/anatomy suggests that other files should be used instead, but it's still unclear to me from the page how the new function works. The tutorials I could find also still make use of a surffile. The help of ft_sourceplot (version 2014-02-26) still mentions the use of a surffile: "The following parameters apply to surface-plotting when an interpolation is required cfg.surffile = string, file that contains the surface (default = 'single_subj_T1.mat') 'single_subj_T1.mat' contains a triangulation that corresponds with the SPM anatomical template in MNI coordinates" but if I use the default surffile with method 'surface', I get an error that the fileformat is unknown: ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information So what is the right way of plotting source-reconstructed activity using the surface method after interpolation with a more recent FT version? I'm sorry if I'm missing something obvious but all the info I could gather didn't help me to get an answer... (I can update the info on the Wiki if it's not there yet). Cheers, Vitória From v.piai.research at gmail.com Thu Mar 27 22:56:33 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Mar 2014 22:56:33 +0100 Subject: [FieldTrip] ft_sourceplot with surface method in most recent FT version In-Reply-To: <533433A8.2070508@gmail.com> References: <533433A8.2070508@gmail.com> Message-ID: <53349E91.6000403@gmail.com> (Apologies for double posting) Hi everyone, I hope someone can help me out with a seemingly very easy question. When using ft_sourceplot, I was used to defining the surffile for the surface method. I'd then plot my interpolated source-reconstructed activity. In a more recent version of FT, apparently this is no longer needed (and the surffile I was used to use ''surface_l4_both.mat' doesn't even exist anymore). The page http://fieldtrip.fcdonders.nl/template/anatomy suggests that other files should be used instead, but it's still unclear to me from the page how the new function works. The tutorials I could find also still make use of a surffile. The help of ft_sourceplot (version 2014-02-26) still mentions the use of a surffile: "The following parameters apply to surface-plotting when an interpolation is required cfg.surffile = string, file that contains the surface (default = 'single_subj_T1.mat') 'single_subj_T1.mat' contains a triangulation that corresponds with the SPM anatomical template in MNI coordinates" but if I use the default surffile with method 'surface', I get an error that the fileformat is unknown: ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information So what is the right way of plotting source-reconstructed activity using the surface method after interpolation with a more recent FT version? I'm sorry if I'm missing something obvious but all the info I could gather didn't help me to get an answer... (I can update the info on the Wiki if it's not there yet). Cheers, Vitória From paolo.belardinelli at gmail.com Fri Mar 28 19:41:21 2014 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 28 Mar 2014 19:41:21 +0100 Subject: [FieldTrip] Within-subject statistical comparison of coherent sources Message-ID: Dear Fieldtrippers, I need to make a statistical comparison of within-subject coherence source mappings. I see on the fieldtrip webpage a source statistics approach for power is illustrated. In the Maris et al.paper (Journal of Neuroscience Methods 163 (2007) ) some sensor level results are shown. Specifically, I have 5 very long trials for each of two independent conditions, with 63 tapers per trial. Therefore, using the 'rawtrials' option in ft_sourceanalysis does not give me a good estimation for single trials. How can I (1) combine them to obtain a meaningful sampling, and (2) apply ft_sourcestatistics to compare two conditions? Best. Paolo -- -- Paolo Belardinelli, PhD Functional and Restorative Neurosurgery University Hospital Tuebingen Eberhard Karls University Tuebingen Otfried-Mueller-Str.45 D-72076 Tuebingen Tel: +49 7071 / 29 8 5626 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 529609 bytes Desc: not available URL: From tyler.grummett at flinders.edu.au Mon Mar 31 05:46:27 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 03:46:27 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot Message-ID: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> I have been trying to plot my interpolated source data using the code: % interpolate sources mri = ft_read_mri('Subject01.mri'); mri = ft_volumereslice([], mri); cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceInt = ft_sourceinterpolate( cfg, source, mri); sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter % does not vary over time, therefore the time dimension is not needed. % Plot interpolated data cfg = []; %#ok cfg.method = 'ortho'; % spline cfg.funparameter = 'avg.pow'; ft_sourceplot( cfg, sourceInt); However the figure that comes up just had orange squares in the subplots. I dont know where Ive gone wrong. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 09:00:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 09:00:43 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <5339129B.1030608@donders.ru.nl> Hi Tyler, what you are describing sounds to me like the center bias of the beamformer. Did you contrast the activity with anything, or did you normalize your leadfield? Check this out: http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition Best, Jörn On 3/31/2014 5:46 AM, Tyler Grummett wrote: > I have been trying to plot my interpolated source data using the code: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow > parameter > % does not vary over time, therefore the time dimension > is not needed. > > % Plot interpolated data > cfg = []; %#ok > cfg.method = 'ortho'; % spline > cfg.funparameter = 'avg.pow'; > ft_sourceplot( cfg, sourceInt); > > However the figure that comes up just had orange squares in the subplots. > > I dont know where Ive gone wrong. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > 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 tyler.grummett at flinders.edu.au Mon Mar 31 09:41:31 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 07:41:31 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <5339129B.1030608@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> Message-ID: <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> Hey Jorn, Previously I have let ft_sourceanalysis do a lead field because if I use the following code: % compute lead field ( apparently source analysis computes % lead field anyway cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO and then calculate the source analysis: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; % cfg.grid.pos = maxpos; cfg.keepfilter = 'yes'; cfg.dics.projectnoise = 'yes'; % cfg.dics.lambda = 0; source = ft_sourceanalysis( cfg, timelock); then I get an error than says: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); I just removed the leadfield code and it successfully ran. I could also interpolate it later. Is this the correct approach. Thankyou in advance! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 5:30 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, what you are describing sounds to me like the center bias of the beamformer. Did you contrast the activity with anything, or did you normalize your leadfield? Check this out: http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition Best, Jörn On 3/31/2014 5:46 AM, Tyler Grummett wrote: > I have been trying to plot my interpolated source data using the code: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow > parameter > % does not vary over time, therefore the time dimension > is not needed. > > % Plot interpolated data > cfg = []; %#ok > cfg.method = 'ortho'; % spline > cfg.funparameter = 'avg.pow'; > ft_sourceplot( cfg, sourceInt); > > However the figure that comes up just had orange squares in the subplots. > > I dont know where Ive gone wrong. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mengtongxiao at gmail.com Mon Mar 31 10:37:07 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Mon, 31 Mar 2014 16:37:07 +0800 Subject: [FieldTrip] help about ' fieldtrip2fiff ' Message-ID: Hi all I downloading a new version of FieldTrip, but there are also have some errors, ??? Error using ==> fiff_start_file at 35 Permission denied Error in ==> fiff_start_writing_raw at 54 fid = fiff_start_file(name); Error in ==> fieldtrip2fiff at 124 [outfid, cals] = fiff_start_writing_raw(fifffile, info); Why? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 10:43:54 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 10:43:54 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <53392ACA.2030108@donders.ru.nl> Hi Tyler, hm, okay, it could be that the issue with the leadfield and with the plot are related, but it could also be that they are separate issues. I just saw that you posted the same 'problem' on bugzilla and included a picture. Maybe for next time, include a picture on the mailinglist and just create a bug on bugzilla if you are sure it is a bug in Fieldtrip and not if you are not sure. That saves us a lot of time in separating code issues from user problems ;) So, back to you problem. It seems that your reconstruction results in one voxel only. Are you sure that your grid consistents of more than just one position? So, for example check the size of the matrices in source.avg, source- and headmodel, etc. Also, you can check in Matlab the respective fields of source and sourceInt and see whether that makes sense. Lastly, a neat way to check is always to use your code on data from the tutorial, and vice versa, use code from the tutorial on your data and see whether that works. Both should give sensible results, and if one does not, you know where to start looking for a solution ;) Best, Jörn On 3/31/2014 9:41 AM, Tyler Grummett wrote: > Hey Jorn, > > Previously I have let ft_sourceanalysis do a lead field because if I use the following code: > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO > > and then calculate the source analysis: > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = maxpos; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > % cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > then I get an error than says: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * > invCy; % van Veen eqn. 23, use > PINV/SVD to cover rank deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), > optarg{:}); > > I just removed the leadfield code and it successfully ran. I could also interpolate it later. > Is this the correct approach. > > Thankyou in advance! > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 5:30 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > what you are describing sounds to me like the center bias of the > beamformer. Did you contrast the activity with anything, or did you > normalize your leadfield? > Check this out: > http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition > > Best, > Jörn > > On 3/31/2014 5:46 AM, Tyler Grummett wrote: >> I have been trying to plot my interpolated source data using the code: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >> parameter >> % does not vary over time, therefore the time dimension >> is not needed. >> >> % Plot interpolated data >> cfg = []; %#ok >> cfg.method = 'ortho'; % spline >> cfg.funparameter = 'avg.pow'; >> ft_sourceplot( cfg, sourceInt); >> >> However the figure that comes up just had orange squares in the subplots. >> >> I dont know where Ive gone wrong. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 tyler.grummett at flinders.edu.au Mon Mar 31 12:36:52 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 10:36:52 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <53392ACA.2030108@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> Message-ID: <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> Jorn, I apologise about the bugzilla report. My last two emails on this emailing list were ignored, thats all. I didnt really know how else to approach this issue. I had a look at my variables. source.avg = pow: [642x1 double] filter: {642x1 cell} sourceInt.avg = pow: [16777216x1 double] So clearly, as both variables are completely different. Something has gone wrong. The next part of my code is the following: % interpolate sources mri = ft_read_mri('Subject01.mri'); mri = ft_volumereslice([], mri); cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceInt = ft_sourceinterpolate( cfg, source, mri); sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter % does not vary over time, therefore the time dimension is not needed. mri = anatomy: [256x256x256 double] dim: [256 256 256] transform: [4x4 double] coordsys: 'ctf' unit: 'mm' cfg: [1x1 struct] I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. Ive been wrong before though, thanks for your help. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 7:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, hm, okay, it could be that the issue with the leadfield and with the plot are related, but it could also be that they are separate issues. I just saw that you posted the same 'problem' on bugzilla and included a picture. Maybe for next time, include a picture on the mailinglist and just create a bug on bugzilla if you are sure it is a bug in Fieldtrip and not if you are not sure. That saves us a lot of time in separating code issues from user problems ;) So, back to you problem. It seems that your reconstruction results in one voxel only. Are you sure that your grid consistents of more than just one position? So, for example check the size of the matrices in source.avg, source- and headmodel, etc. Also, you can check in Matlab the respective fields of source and sourceInt and see whether that makes sense. Lastly, a neat way to check is always to use your code on data from the tutorial, and vice versa, use code from the tutorial on your data and see whether that works. Both should give sensible results, and if one does not, you know where to start looking for a solution ;) Best, Jörn On 3/31/2014 9:41 AM, Tyler Grummett wrote: > Hey Jorn, > > Previously I have let ft_sourceanalysis do a lead field because if I use the following code: > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO > > and then calculate the source analysis: > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = maxpos; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > % cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > then I get an error than says: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * > invCy; % van Veen eqn. 23, use > PINV/SVD to cover rank deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), > optarg{:}); > > I just removed the leadfield code and it successfully ran. I could also interpolate it later. > Is this the correct approach. > > Thankyou in advance! > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 5:30 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > what you are describing sounds to me like the center bias of the > beamformer. Did you contrast the activity with anything, or did you > normalize your leadfield? > Check this out: > http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition > > Best, > Jörn > > On 3/31/2014 5:46 AM, Tyler Grummett wrote: >> I have been trying to plot my interpolated source data using the code: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >> parameter >> % does not vary over time, therefore the time dimension >> is not needed. >> >> % Plot interpolated data >> cfg = []; %#ok >> cfg.method = 'ortho'; % spline >> cfg.funparameter = 'avg.pow'; >> ft_sourceplot( cfg, sourceInt); >> >> However the figure that comes up just had orange squares in the subplots. >> >> I dont know where Ive gone wrong. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 31 13:54:53 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 13:54:53 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <5339578D.4050308@donders.ru.nl> Hi Tyler, there is not much inherently different between time- and freuqency-domain beamformer, at least in terms of computing the forward and the inverse solution. But I see that you are obviously confused, so let me try to help you out and shed some light on what you are actually doing ;) > I had a look at my variables. > > source.avg = > > pow: [642x1 double] > filter: {642x1 cell} > > sourceInt.avg = > > pow: [16777216x1 double] > > So clearly, as both variables are completely different. Something has gone wrong. No, that is actually how it should be. From below you can see that your MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = 16777216 elements. In line with source.avg.pow, you should see that your 'grid' consists of 642 elements, so you were computing your source activity on a grid of in total 642 elements. Then you used the original MRI to interpolate from 642 to these 16 million grid points. Actually, since you specific cfg.downsample = 2, it should have been only 8 million points, so that's where things already get a bit weird. So let's go into some sanity checks: 1. are you using the latest version (or a recent, i.e. from this year) of FielTrip? 2. sourceInt should look something like this, does it? source_diff_int = inside: [46x55x46 logical] avg: [1x1 struct] dim: [46 55 46] transform: [4x4 double] anatomy: [46x55x46 double] unit: 'mm' cfg: [1x1 struct] 3. source should look something like this: source = dim: [20 25 22] freq: 54.8287 cumtapcnt: [338x1 double] pos: [11000x3 double] inside: [1x5798 double] outside: [1x5202 double] method: 'average' avg: [1x1 struct] trialinfo: [338x1 double] cfg: [1x1 struct] 4. also check your grid, should be something like this: sourcemodel = pos: [11000x3 double] dim: [20 25 22] unit: 'cm' inside: [1x5798 double] outside: [1x5202 double] params: [1x1 struct] initial: [4x4 double] cfg: [1x1 struct] Of course, it should all look a bit different, because you are using LCMV, but essentially it should be the same. Lastly, you can check other source plotting methods, like 'ortho' or try to plot the source structure rather than the sourceInt structure. In the end, the error must be somewhere in your grid, be it in .pos or .inside, because FieldTrip thinks that there is only one voxel to be plotted. There are other things that may be the issue, but I am not sure about these. So, I would suggest that you play a bit around and see where the error might come from (e.g. follow this tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the steps that you need for LCMV, maybe also check out: http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg there, LCMV is used, but on one voxel only) Best, Jörn > > The next part of my code is the following: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter > % does not vary over time, therefore the time dimension is not needed. > > mri = > > anatomy: [256x256x256 double] > dim: [256 256 256] > transform: [4x4 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. > > Ive been wrong before though, > > thanks for your help. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 7:13 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > hm, okay, it could be that the issue with the leadfield and with the > plot are related, but it could also be that they are separate issues. I > just saw that you posted the same 'problem' on bugzilla and included a > picture. Maybe for next time, include a picture on the mailinglist and > just create a bug on bugzilla if you are sure it is a bug in Fieldtrip > and not if you are not sure. That saves us a lot of time in separating > code issues from user problems ;) > > So, back to you problem. It seems that your reconstruction results in > one voxel only. Are you sure that your grid consistents of more than > just one position? So, for example check the size of the matrices in > source.avg, source- and headmodel, etc. > > Also, you can check in Matlab the respective fields of source and > sourceInt and see whether that makes sense. > > Lastly, a neat way to check is always to use your code on data from the > tutorial, and vice versa, use code from the tutorial on your data and > see whether that works. Both should give sensible results, and if one > does not, you know where to start looking for a solution ;) > > Best, > Jörn > > > On 3/31/2014 9:41 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >> >> % compute lead field ( apparently source analysis computes >> % lead field anyway >> cfg = []; >> cfg.elec = timelock.elec; >> cfg.vol = vol; >> cfg.reducerank = 3; >> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >> cfg.grid.unit = 'cm'; >> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >> >> and then calculate the source analysis: >> >> % Source Analysis: without contrasting condition >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = grid; >> cfg.vol = vol; >> % cfg.grid.pos = maxpos; >> cfg.keepfilter = 'yes'; >> cfg.dics.projectnoise = 'yes'; >> % cfg.dics.lambda = 0; >> source = ft_sourceanalysis( cfg, timelock); >> >> then I get an error than says: >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in beamformer_lcmv (line 268) >> filt = pinv(lf' * invCy * lf) * lf' * >> invCy; % van Veen eqn. 23, use >> PINV/SVD to cover rank deficient leadfield >> >> Error in ft_sourceanalysis (line 794) >> dip(i) = beamformer_lcmv(grid, sens, vol, >> squeeze_avg, squeeze(Cy(i,:,:)), >> optarg{:}); >> >> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >> Is this the correct approach. >> >> Thankyou in advance! >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 5:30 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> what you are describing sounds to me like the center bias of the >> beamformer. Did you contrast the activity with anything, or did you >> normalize your leadfield? >> Check this out: >> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >> >> Best, >> Jörn >> >> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>> I have been trying to plot my interpolated source data using the code: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time dimension >>> is not needed. >>> >>> % Plot interpolated data >>> cfg = []; %#ok >>> cfg.method = 'ortho'; % spline >>> cfg.funparameter = 'avg.pow'; >>> ft_sourceplot( cfg, sourceInt); >>> >>> However the figure that comes up just had orange squares in the subplots. >>> >>> I dont know where Ive gone wrong. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 tyler.grummett at flinders.edu.au Mon Mar 31 15:15:19 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 13:15:19 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <5339578D.4050308@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> Message-ID: Hey Jorn, Yes I am definitely confused haha, this stuff is way out of my league as a PhD student. Anyway, I feel we are getting somewhere. timelock = avg: [121x19767 double] var: [121x19767 double] time: [1x19767 double] dof: [121x19767 double] label: {1x121 cell} dimord: 'chan_time' cov: [121x121 double] elec: [1x1 struct] cfg: [1x1 struct] source = time: [1x19767 double] pos: [642x3 double] inside: [642x1 double] outside: [] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] sourceInt = time: [1x19767 double] avg: [1x1 struct] pos: [16777216x3 double] dim: [256 256 256] inside: [1x16777216 double] outside: [1x0 double] coordsys: 'ctf' unit: 'mm' cfg: [1x1 struct] Given what I said last time, I might not comment on the differences. I hope you can see something wrong. One thing I should mention is that the data is continuous, around 30 seconds. Therefore there is only one trial, is that an issue? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 10:24 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, there is not much inherently different between time- and freuqency-domain beamformer, at least in terms of computing the forward and the inverse solution. But I see that you are obviously confused, so let me try to help you out and shed some light on what you are actually doing ;) > I had a look at my variables. > > source.avg = > > pow: [642x1 double] > filter: {642x1 cell} > > sourceInt.avg = > > pow: [16777216x1 double] > > So clearly, as both variables are completely different. Something has gone wrong. No, that is actually how it should be. From below you can see that your MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = 16777216 elements. In line with source.avg.pow, you should see that your 'grid' consists of 642 elements, so you were computing your source activity on a grid of in total 642 elements. Then you used the original MRI to interpolate from 642 to these 16 million grid points. Actually, since you specific cfg.downsample = 2, it should have been only 8 million points, so that's where things already get a bit weird. So let's go into some sanity checks: 1. are you using the latest version (or a recent, i.e. from this year) of FielTrip? 2. sourceInt should look something like this, does it? source_diff_int = inside: [46x55x46 logical] avg: [1x1 struct] dim: [46 55 46] transform: [4x4 double] anatomy: [46x55x46 double] unit: 'mm' cfg: [1x1 struct] 3. source should look something like this: source = dim: [20 25 22] freq: 54.8287 cumtapcnt: [338x1 double] pos: [11000x3 double] inside: [1x5798 double] outside: [1x5202 double] method: 'average' avg: [1x1 struct] trialinfo: [338x1 double] cfg: [1x1 struct] 4. also check your grid, should be something like this: sourcemodel = pos: [11000x3 double] dim: [20 25 22] unit: 'cm' inside: [1x5798 double] outside: [1x5202 double] params: [1x1 struct] initial: [4x4 double] cfg: [1x1 struct] Of course, it should all look a bit different, because you are using LCMV, but essentially it should be the same. Lastly, you can check other source plotting methods, like 'ortho' or try to plot the source structure rather than the sourceInt structure. In the end, the error must be somewhere in your grid, be it in .pos or .inside, because FieldTrip thinks that there is only one voxel to be plotted. There are other things that may be the issue, but I am not sure about these. So, I would suggest that you play a bit around and see where the error might come from (e.g. follow this tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the steps that you need for LCMV, maybe also check out: http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg there, LCMV is used, but on one voxel only) Best, Jörn > > The next part of my code is the following: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter > % does not vary over time, therefore the time dimension is not needed. > > mri = > > anatomy: [256x256x256 double] > dim: [256 256 256] > transform: [4x4 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. > > Ive been wrong before though, > > thanks for your help. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 7:13 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > hm, okay, it could be that the issue with the leadfield and with the > plot are related, but it could also be that they are separate issues. I > just saw that you posted the same 'problem' on bugzilla and included a > picture. Maybe for next time, include a picture on the mailinglist and > just create a bug on bugzilla if you are sure it is a bug in Fieldtrip > and not if you are not sure. That saves us a lot of time in separating > code issues from user problems ;) > > So, back to you problem. It seems that your reconstruction results in > one voxel only. Are you sure that your grid consistents of more than > just one position? So, for example check the size of the matrices in > source.avg, source- and headmodel, etc. > > Also, you can check in Matlab the respective fields of source and > sourceInt and see whether that makes sense. > > Lastly, a neat way to check is always to use your code on data from the > tutorial, and vice versa, use code from the tutorial on your data and > see whether that works. Both should give sensible results, and if one > does not, you know where to start looking for a solution ;) > > Best, > Jörn > > > On 3/31/2014 9:41 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >> >> % compute lead field ( apparently source analysis computes >> % lead field anyway >> cfg = []; >> cfg.elec = timelock.elec; >> cfg.vol = vol; >> cfg.reducerank = 3; >> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >> cfg.grid.unit = 'cm'; >> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >> >> and then calculate the source analysis: >> >> % Source Analysis: without contrasting condition >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = grid; >> cfg.vol = vol; >> % cfg.grid.pos = maxpos; >> cfg.keepfilter = 'yes'; >> cfg.dics.projectnoise = 'yes'; >> % cfg.dics.lambda = 0; >> source = ft_sourceanalysis( cfg, timelock); >> >> then I get an error than says: >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in beamformer_lcmv (line 268) >> filt = pinv(lf' * invCy * lf) * lf' * >> invCy; % van Veen eqn. 23, use >> PINV/SVD to cover rank deficient leadfield >> >> Error in ft_sourceanalysis (line 794) >> dip(i) = beamformer_lcmv(grid, sens, vol, >> squeeze_avg, squeeze(Cy(i,:,:)), >> optarg{:}); >> >> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >> Is this the correct approach. >> >> Thankyou in advance! >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 5:30 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> what you are describing sounds to me like the center bias of the >> beamformer. Did you contrast the activity with anything, or did you >> normalize your leadfield? >> Check this out: >> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >> >> Best, >> Jörn >> >> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>> I have been trying to plot my interpolated source data using the code: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time dimension >>> is not needed. >>> >>> % Plot interpolated data >>> cfg = []; %#ok >>> cfg.method = 'ortho'; % spline >>> cfg.funparameter = 'avg.pow'; >>> ft_sourceplot( cfg, sourceInt); >>> >>> However the figure that comes up just had orange squares in the subplots. >>> >>> I dont know where Ive gone wrong. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hweeling.lee at gmail.com Mon Mar 31 16:48:34 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 31 Mar 2014 16:48:34 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab Message-ID: Dear all, I'm encountering a problem with running ICA in Matlab. After ICA, when I tried to plot the components, Matlab keeps prompting an internal problem and needs to be closed. I wonder why this is the case. Could someone please tell me what went wrong? Here's part of my script for ICA: cfg = []; % if data were cleaned, then use this if sub == 5 %|| sub == 7 cfg.channel = {'all', '-AFz', '-FT7'}; elseif sub == 7 cfg.channel = {'all' '-AFz'}; else cfg.channel = {'all'}; end % cfg.runica.pca = 121; % using the rank of my data % ic_data = ft_componentanalysis(cfg,cleandata); % if data were cleaned then use this ic_data = ft_componentanalysis(cfg, cleandata); % after ICA, look for components that we want to substract from our data, % only looking at ten channels (components) at a time cfg = []; cfg.dataset = rawdatafile; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blocksize = 8; cfg.channels = 'all'; cfg.layout = 'EEG1020.lay'; ft_databrowser(cfg,ic_data); The internal problem appears even when I downsampled my data from 5000 Hz to 1000 Hz. The internal problem appears also when I have short segments of my data (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). The memory of my PC workstation is: Maximum possible array: 60253 MB (6.318e+10 bytes) * Memory available for all arrays: 60253 MB (6.318e+10 bytes) * Memory used by MATLAB: 560 MB (5.872e+08 bytes) Physical Memory (RAM): 32685 MB (3.427e+10 bytes) Interestingly, this internal problem does not occur when I ran my script on my Macbook Pro. I'm feeling very lost here. Any help is highly appreciated. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 16:56:57 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 16:56:57 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> Message-ID: <53398239.1010004@donders.ru.nl> Hi Tyler, yes, it seems like something went wrong in the computation of your forward model. Usually, your source structure should have a .dim field, specifying the dimensions of your .pos matrix. The pos-matrix has to be a regular 3D grid, i.e. be representable as a 3x3x3 matrix. I am not quite sure how the sourceinterpolate function is handeling the fact that you do not have that .dim field. Apparently, it is also confused ;) Do you want to reconstruct only some voxels? From your code it seems that you want to cover the whole brain with a 1cm resolution. If the latter is the case, maybe restart with creating your forward model by following the tutorial that I posted in my previous mail. There are some sanity checks that can help you figuring out if you are doing the correct thing. If the former one is the case, please explain again what exactly you want to achieve and how you are building your forward model. Best, Jörn btw, there's nothing wrong with being a PhD student, it's just a matter of experience in practice and theory as in all domains in life ;) On 3/31/2014 3:15 PM, Tyler Grummett wrote: > Hey Jorn, > > Yes I am definitely confused haha, this stuff is way out of my league as a PhD student. > Anyway, I feel we are getting somewhere. > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > source = > > time: [1x19767 double] > pos: [642x3 double] > inside: [642x1 double] > outside: [] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > sourceInt = > > time: [1x19767 double] > avg: [1x1 struct] > pos: [16777216x3 double] > dim: [256 256 256] > inside: [1x16777216 double] > outside: [1x0 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > Given what I said last time, I might not comment on the differences. I hope you can see something wrong. > > One thing I should mention is that the data is continuous, around 30 seconds. Therefore there is only one trial, > is that an issue? > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 10:24 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > there is not much inherently different between time- and > freuqency-domain beamformer, at least in terms of computing the forward > and the inverse solution. But I see that you are obviously confused, so > let me try to help you out and shed some light on what you are actually > doing ;) > > >> I had a look at my variables. >> >> source.avg = >> >> pow: [642x1 double] >> filter: {642x1 cell} >> >> sourceInt.avg = >> >> pow: [16777216x1 double] >> >> So clearly, as both variables are completely different. Something has gone wrong. > No, that is actually how it should be. From below you can see that your > MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = > 16777216 elements. In line with source.avg.pow, you should see that your > 'grid' consists of 642 elements, so you were computing your source > activity on a grid of in total 642 elements. Then you used the original > MRI to interpolate from 642 to these 16 million grid points. Actually, > since you specific cfg.downsample = 2, it should have been only 8 > million points, so that's where things already get a bit weird. > > So let's go into some sanity checks: > 1. are you using the latest version (or a recent, i.e. from this year) > of FielTrip? > 2. sourceInt should look something like this, does it? > > source_diff_int = > inside: [46x55x46 logical] > avg: [1x1 struct] > dim: [46 55 46] > transform: [4x4 double] > anatomy: [46x55x46 double] > unit: 'mm' > cfg: [1x1 struct] > > > > 3. source should look something like this: > > source = > dim: [20 25 22] > freq: 54.8287 > cumtapcnt: [338x1 double] > pos: [11000x3 double] > inside: [1x5798 double] > outside: [1x5202 double] > method: 'average' > avg: [1x1 struct] > trialinfo: [338x1 double] > cfg: [1x1 struct] > > 4. also check your grid, should be something like this: > > sourcemodel = > > pos: [11000x3 double] > dim: [20 25 22] > unit: 'cm' > inside: [1x5798 double] > outside: [1x5202 double] > params: [1x1 struct] > initial: [4x4 double] > cfg: [1x1 struct] > > > Of course, it should all look a bit different, because you are using > LCMV, but essentially it should be the same. Lastly, you can check other > source plotting methods, like 'ortho' or try to plot the source > structure rather than the sourceInt structure. In the end, the error > must be somewhere in your grid, be it in .pos or .inside, because > FieldTrip thinks that there is only one voxel to be plotted. There are > other things that may be the issue, but I am not sure about these. So, I > would suggest that you play a bit around and see where the error might > come from (e.g. follow this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the > steps that you need for LCMV, maybe also check out: > http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg > there, LCMV is used, but on one voxel only) > > Best, > Jörn > >> The next part of my code is the following: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter >> % does not vary over time, therefore the time dimension is not needed. >> >> mri = >> >> anatomy: [256x256x256 double] >> dim: [256 256 256] >> transform: [4x4 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. >> >> Ive been wrong before though, >> >> thanks for your help. >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 7:13 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> hm, okay, it could be that the issue with the leadfield and with the >> plot are related, but it could also be that they are separate issues. I >> just saw that you posted the same 'problem' on bugzilla and included a >> picture. Maybe for next time, include a picture on the mailinglist and >> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >> and not if you are not sure. That saves us a lot of time in separating >> code issues from user problems ;) >> >> So, back to you problem. It seems that your reconstruction results in >> one voxel only. Are you sure that your grid consistents of more than >> just one position? So, for example check the size of the matrices in >> source.avg, source- and headmodel, etc. >> >> Also, you can check in Matlab the respective fields of source and >> sourceInt and see whether that makes sense. >> >> Lastly, a neat way to check is always to use your code on data from the >> tutorial, and vice versa, use code from the tutorial on your data and >> see whether that works. Both should give sensible results, and if one >> does not, you know where to start looking for a solution ;) >> >> Best, >> Jörn >> >> >> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >>> >>> % compute lead field ( apparently source analysis computes >>> % lead field anyway >>> cfg = []; >>> cfg.elec = timelock.elec; >>> cfg.vol = vol; >>> cfg.reducerank = 3; >>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >>> cfg.grid.unit = 'cm'; >>> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >>> >>> and then calculate the source analysis: >>> >>> % Source Analysis: without contrasting condition >>> cfg = []; >>> cfg.method = 'lcmv'; >>> cfg.grid = grid; >>> cfg.vol = vol; >>> % cfg.grid.pos = maxpos; >>> cfg.keepfilter = 'yes'; >>> cfg.dics.projectnoise = 'yes'; >>> % cfg.dics.lambda = 0; >>> source = ft_sourceanalysis( cfg, timelock); >>> >>> then I get an error than says: >>> >>> Error using * >>> Inner matrix dimensions must agree. >>> >>> Error in beamformer_lcmv (line 268) >>> filt = pinv(lf' * invCy * lf) * lf' * >>> invCy; % van Veen eqn. 23, use >>> PINV/SVD to cover rank deficient leadfield >>> >>> Error in ft_sourceanalysis (line 794) >>> dip(i) = beamformer_lcmv(grid, sens, vol, >>> squeeze_avg, squeeze(Cy(i,:,:)), >>> optarg{:}); >>> >>> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >>> Is this the correct approach. >>> >>> Thankyou in advance! >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Monday, 31 March 2014 5:30 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> Hi Tyler, >>> >>> what you are describing sounds to me like the center bias of the >>> beamformer. Did you contrast the activity with anything, or did you >>> normalize your leadfield? >>> Check this out: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>> >>> Best, >>> Jörn >>> >>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>> I have been trying to plot my interpolated source data using the code: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time dimension >>>> is not needed. >>>> >>>> % Plot interpolated data >>>> cfg = []; %#ok >>>> cfg.method = 'ortho'; % spline >>>> cfg.funparameter = 'avg.pow'; >>>> ft_sourceplot( cfg, sourceInt); >>>> >>>> However the figure that comes up just had orange squares in the subplots. >>>> >>>> I dont know where Ive gone wrong. >>>> >>>> >>>> Tyler >>>> >>>> >>>> ************************* >>>> >>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>> /PhD Candidate/ >>>> /Brain Signals Laboratory/ >>>> /Flinders University/ >>>> /Rm 5A301/ >>>> /Ext 66124/ >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 gio at gpiantoni.com Mon Mar 31 17:01:41 2014 From: gio at gpiantoni.com (Gio Piantoni) Date: Mon, 31 Mar 2014 11:01:41 -0400 Subject: [FieldTrip] help about ' fieldtrip2fiff ' In-Reply-To: References: Message-ID: Hi Xiao, Nice that updating the FieldTrip version was sufficient to get rid of the initial error. The current error is related to writing permissions on your OS: https://github.com/fieldtrip/fieldtrip/blob/master/external/mne/fiff_start_file.m#L35 The command that fails is fopen (matlab built-in command). Can you try to run: [fid,message] = fopen(name,'w+','ieee-be'); where 'name' is the name of the file that you want to write in FIFF format. If that fails, please have a look at the matlab documentation for fopen and related troubleshooting. Best, -g On Mon, Mar 31, 2014 at 4:37 AM, tongxiao meng wrote: > Hi all > > I downloading a new version of FieldTrip, but there are also have some > errors, > > ??? Error using ==> fiff_start_file at 35 > Permission denied > > Error in ==> fiff_start_writing_raw at 54 > fid = fiff_start_file(name); > > Error in ==> fieldtrip2fiff at 124 > [outfid, cals] = fiff_start_writing_raw(fifffile, info); > > Why? > thanks, > xiao > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 31 17:12:24 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 17:12:24 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <53398239.1010004@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl> Message-ID: <533985D8.4080504@donders.ru.nl> just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- 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 hweeling.lee at gmail.com Mon Mar 31 17:25:10 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 31 Mar 2014 17:25:10 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: Message-ID: Hi, Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of RAM installed. In the previous month, I was able to run ICA and plot its components without any error message from Matlab. Recently, I keep experiencing the error message, and Matlab crashes completely. I have no clue what could have gone wrong. Cheers, Hweeling On 31 March 2014 17:08, Stephen Politzer-Ahles wrote: > Hello Hweeling, > > What kind of error do you get in MATLAB when you try to do ICA, is it an > "Out of memory" error? I'm asking because this is a fairly common issue in > MATLAB on Windows systems (I don't know the details of your data, but I've > experienced this issue on 32-channel, 1000-Hz epoched EEG data if the > epochs are long enough and numerous enough). For me the only solutions > (other than shortening the epochs or downsampling the data, which might not > be good options depending on your research question) were to use a > Unix-based operating system (like Mac OS) or to upgrade my Windows (I had > errors like this when using a 32-bit version of Windows with 2 GB of RAM, > but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure > if this is the issue you're having, though. > > Best, > Steve > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 7:02 PM, wrote: > >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) >> 2. Re: plotting interpolated sources with ft_sourceplot >> (J?rn M. Horschig) >> 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 31 Mar 2014 16:48:34 +0200 >> From: Hwee Ling Lee >> To: FieldTrip discussion list >> Subject: [FieldTrip] Fieldtrip ICA crashes Matlab >> Message-ID: >> > poVtb-1ApZuDQ at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Dear all, >> >> I'm encountering a problem with running ICA in Matlab. After ICA, when I >> tried to plot the components, Matlab keeps prompting an internal problem >> and needs to be closed. I wonder why this is the case. Could someone >> please >> tell me what went wrong? >> >> Here's part of my script for ICA: >> >> cfg = []; % if data were cleaned, then use this >> >> if sub == 5 %|| sub == 7 >> cfg.channel = {'all', '-AFz', '-FT7'}; >> elseif sub == 7 >> cfg.channel = {'all' '-AFz'}; >> else >> cfg.channel = {'all'}; >> end >> >> % cfg.runica.pca = 121; % using the rank of my data >> % ic_data = ft_componentanalysis(cfg,cleandata); % if data were >> cleaned then use this >> ic_data = ft_componentanalysis(cfg, cleandata); >> >> % after ICA, look for components that we want to substract from >> our >> data, >> % only looking at ten channels (components) at a time >> cfg = []; >> cfg.dataset = rawdatafile; >> cfg.viewmode = 'component'; >> cfg.continuous = 'no'; >> cfg.blocksize = 8; >> cfg.channels = 'all'; >> cfg.layout = 'EEG1020.lay'; >> ft_databrowser(cfg,ic_data); >> >> >> The internal problem appears even when I downsampled my data from 5000 Hz >> to 1000 Hz. >> >> The internal problem appears also when I have short segments of my data >> (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). >> >> The memory of my PC workstation is: >> Maximum possible array: 60253 MB (6.318e+10 bytes) * >> Memory available for all arrays: 60253 MB (6.318e+10 bytes) * >> Memory used by MATLAB: 560 MB (5.872e+08 bytes) >> Physical Memory (RAM): 32685 MB (3.427e+10 bytes) >> >> Interestingly, this internal problem does not occur when I ran my script >> on >> my Macbook Pro. >> >> I'm feeling very lost here. Any help is highly appreciated. >> >> Cheers, >> Hweeling >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html >> > >> > -- ================================================= 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 ktyler at swin.edu.au Mon Mar 31 17:32:24 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 31 Mar 2014 15:32:24 +0000 Subject: [FieldTrip] ft_volumerealign and ft_dipolefitting Message-ID: Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Mon Mar 31 17:34:03 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 31 Mar 2014 15:34:03 +0000 Subject: [FieldTrip] FW: ft_volumerealign and ft_dipolefitting In-Reply-To: References: Message-ID: Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia ________________________________ From: Kaelasha Tyler Sent: Tuesday, 1 April 2014 2:32 AM To: fieldtrip at science.ru.nl Subject: ft_volumerealign and ft_dipolefitting Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VolSens.jpg Type: image/jpeg Size: 27213 bytes Desc: VolSens.jpg URL: From r.oostenveld at donders.ru.nl Mon Mar 31 21:41:48 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 31 Mar 2014 21:41:48 +0200 Subject: [FieldTrip] Donders Summer School References: <9C7B0CAE-BE54-4F49-A444-7D1C3C98F1B1@gmail.com> Message-ID: Radboud Summer School Neural metrics: Quantitative analysis of neural organisation and function The Donders Institute for Brain, Cognition and Behaviour is organizing a summer school on neural metrics where the aim is to get participants acquainted with the quantitative analysis of neural organisation and function. We have compiled an exciting program with an excellent set of national and international speakers. Topics range from the analysis of single-neuron responses to the analysis of macroscopic brain networks. The course is designed for PhD students and starting postdoctoral researchers working at the interface between cognitive neuroscience and the application of advanced methods. Please consult the Radboud Summer School website for details on the programme, social events and registration. Further details for the Neural Metrics Summer School can be found below and on the website. Note that the early bird deadline is April 1st. Dates Monday 11 August - Friday 15 August 2014 (one week) Course leaders Dr. M. (Marcel) van Gerven, Assisstant Professor Prof. T. (Tansu) Celikel, Professor Neurophysiology Donders Institute for Brain, Cognition and Behaviour Entry level PhD students in the field of Neuroscience with an MSc in Biology, Computer Science, Psychology, Physics, Al or similar subject For whom is this course designed This course was developed for PhD students (10 local + 20 international) and early postdoctoral researchers working at the interface between cognitive neuroscience and the application of advanced methods. This includes cognitive neuroscientists and researchers with practical experience. Admission requirements As part of the admission procedure, we ask you to send us your CV and a motivation letter in which you explain your interest for our course. Course fee €400 The course fee includes the registration fee, course materials, access to library and IT facilities, coffee/tea, lunch, and a number of social activities. Accommodation is available for the course participants. For details please see http://www.ru.nl/radboudsummerschool/practical-matters/housing/ Discounts • 10% discount for early bird applicants. The early bird deadline is 1 April 2014. • 15% discount for students and PhD candidates from Radboud University and partner universities Course description The brain as a network In order to fully understand the neuronal substrate of human cognition, we need to start viewing the working brain as a network.Many neurological and mental disorders are viewed as the result of a malfunction at the network level. The growing interest in brain networks is complemented by rapid theoretical and technical developments. We will embrace these developments throughout the course to help us understand the human brain network. This will be done by examining the theoretical background and by learning the necessary measurement and data analysis techniques used to study brain connectivity. The topics will be structured according to micro, meso and macro-scale connectivity. Course contents Micro-scale connectivity involves neuron communication at the cellular and synaptic level; mesa-scale connectivity addresses communication between brain regions; and macro-scale connectivity explores the structure and dynamics of large brain networks. We will strive to include components of electrophysiology, anatomy, functional blood flow measures, computational modelling and advanced data analysis at each level. While doing so, we will focus on both the animal and human brain. The course consists of lectures and computer exercises, supplemented with in-depth discussions. Lecture slides and exercises will also be distributed among the participants. We will ensure active participation in the following way: • In the hands-on sessions you will work together in small groups (2-3 people). These sessions will include exercises aimed at promoting discussions and encouraging you to reflect on the core theoretical issues. Learning outcomes 1. Understand new techniques and approaches in the field of neuroscience networks 2. Understand the basics of new connectivity analysis tools 3. Understand new theories and computational modelling approaches 4. Identify the appropriate research methodology for answering specific research questions on brain connectivity 5. Improve your communication skills and develop research questions in a group setting Number of ECTS credits 2 ECTS credits Registration For registration, please consult the website. More information radboudsummerschool at ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From aharown at hotmail.com Mon Mar 31 21:51:51 2014 From: aharown at hotmail.com (Aaron Hanford) Date: Mon, 31 Mar 2014 14:51:51 -0500 Subject: [FieldTrip] ICA: eeglab and fieldtrip Message-ID: Hi,I'm resending this with the figures turned into jpgs so it's not oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab (although much more so to fieldtrip). I'm trying to figure out the following: On the exact same dataset, I did the following two things: 1) in eeglab, I just chose Tools -> Run ICA with default settings. Then, starting over with the original raw data: 2) In fieldtrip I ran the following: data = eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = 'runica';[comp]=ft_componentanalysis(cfg,data);layout = 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); In both cases I then plotted the 2-D component maps, attached. So my question is, why are these results so completely different? The fieldtrip results don't look right at all, in that for instance they don't obviously identify a blink component (note that in this dataset, there is only one electrode placed near the right eye, not the left). I did this a handful of times and got the same sort of big differences. Am I doing something wrong or what? I actually think the cap file seems incorrect, but I've been assured by my PI that it's correct, so .... is there another likely answer? Thanks, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip.JPG Type: image/jpeg Size: 110477 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eeglab.JPG Type: image/jpeg Size: 99185 bytes Desc: not available URL: From spa268 at nyu.edu Mon Mar 31 22:08:55 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Tue, 1 Apr 2014 00:08:55 +0400 Subject: [FieldTrip] ICA: eeglab and fieldtrip Message-ID: Hello Aaron, This doesn't, answer the rest of your questions, but... In your attached Fieldtrip image, component 1 does look like a likely blink component to me? Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ On Mon, Mar 31, 2014 at 11:52 PM, wrote: > > Message: 2 > Date: Mon, 31 Mar 2014 14:51:51 -0500 > From: Aaron Hanford > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] ICA: eeglab and fieldtrip > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi,I'm resending this with the figures turned into jpgs so it's not > oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab > (although much more so to fieldtrip). I'm trying to figure out the > following: > On the exact same dataset, I did the following two things: > 1) in eeglab, I just chose Tools -> Run ICA with default settings. > Then, starting over with the original raw data: > 2) In fieldtrip I ran the following: data = > eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = > 'runica';[comp]=ft_componentanalysis(cfg,data);layout = > 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component > = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); > In both cases I then plotted the 2-D component maps, attached. > So my question is, why are these results so completely different? The > fieldtrip results don't look right at all, in that for instance they don't > obviously identify a blink component (note that in this dataset, there is > only one electrode placed near the right eye, not the left). I did this a > handful of times and got the same sort of big differences. Am I doing > something wrong or what? > > I actually think the cap file seems incorrect, but I've been assured by my > PI that it's correct, so .... is there another likely answer? > Thanks, > Aaron > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip.JPG > Type: image/jpeg > Size: 110477 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.jpe > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: eeglab.JPG > Type: image/jpeg > Size: 99185 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment-0001.jpe > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 40, Issue 48 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Mar 31 22:10:36 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 31 Mar 2014 22:10:36 +0200 Subject: [FieldTrip] ICA: eeglab and fieldtrip In-Reply-To: References: Message-ID: Hi Aaron (i see Stephen just wrote a similar response) Those component topoplots look pretty good to me. In the FT one, I would say the first and third have a good change of being related to eyeblinks, and the fifth and twenty-fifth to eye-movements. However, you should really look at the timecourses to identify them as related to saccades and blinks, and by comparing them with your EOG recording. Although each ICA will *always* give you different results (if you don't specifiy the random seed), to make them more comparable you could add the EOG channel to the layout. Cheer, Stephen On 31 March 2014 22:08, Stephen Politzer-Ahles wrote: > Hello Aaron, > > This doesn't, answer the rest of your questions, but... In your attached > Fieldtrip image, component 1 does look like a likely blink component to me? > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 11:52 PM, wrote: > >> >> Message: 2 >> Date: Mon, 31 Mar 2014 14:51:51 -0500 >> From: Aaron Hanford >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] ICA: eeglab and fieldtrip >> Message-ID: >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi,I'm resending this with the figures turned into jpgs so it's not >> oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab >> (although much more so to fieldtrip). I'm trying to figure out the >> following: >> >> On the exact same dataset, I did the following two things: >> 1) in eeglab, I just chose Tools -> Run ICA with default settings. >> Then, starting over with the original raw data: >> 2) In fieldtrip I ran the following: data = >> eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = >> 'runica';[comp]=ft_componentanalysis(cfg,data);layout = >> 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component >> = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); >> In both cases I then plotted the 2-D component maps, attached. >> So my question is, why are these results so completely different? The >> fieldtrip results don't look right at all, in that for instance they don't >> obviously identify a blink component (note that in this dataset, there is >> only one electrode placed near the right eye, not the left). I did this a >> handful of times and got the same sort of big differences. Am I doing >> something wrong or what? >> >> I actually think the cap file seems incorrect, but I've been assured by >> my PI that it's correct, so .... is there another likely answer? >> Thanks, >> Aaron >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.html >> > >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: fieldtrip.JPG >> Type: image/jpeg >> Size: 110477 bytes >> Desc: not available >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.jpe >> > >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: eeglab.JPG >> Type: image/jpeg >> Size: 99185 bytes >> Desc: not available >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment-0001.jpe >> > >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 40, Issue 48 >> ***************************************** >> > > > _______________________________________________ > 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 Sat Mar 1 09:22:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 1 Mar 2014 09:22:44 +0100 Subject: [FieldTrip] Plotting ERP data: From topoplot to 3D brain surface plot In-Reply-To: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> References: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> Message-ID: Hi Barbara, Could you maybe post some of the code you are using to generate your plots, and examples of the plots you are getting? Best, Eelke On 27 February 2014 09:08, wrote: > Dear Fieldtripers, > > I have ERP data from a normal oddball task (low pitch tones vs. high pitch > tones) resulting in a P300. I know how to plot them with the normal > ft_topoplot command. For just visualization, this is fine, but for a > publication I would like to plot my data on a 3D brain surface. > I know how to do that with the ft_sourceplot command. I tried it with my > data, but the result is not even close to what I see when I plot it with the > ft_topoplot command (I don's see the nice big blob of activity in the > parietal cortex). > I guess the problem is that I do more analizyng steps in order to get the > data structure which is needed for sourceplotting. > > What I really just want to do is putting my topoplot on a brainsurface. Is > that possible in fieldtrip or do I need to use another software? > > Thank you very much for your help!! > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inbalots at gmail.com Sun Mar 2 08:37:51 2014 From: inbalots at gmail.com (Inbal Shapira) Date: Sun, 2 Mar 2014 09:37:51 +0200 Subject: [FieldTrip] Question regarding the meaning of cluster statistic Message-ID: Hi all. My question is: to know if I understand correctly the non parametric process using permutations, and to understand the process for the clustering part in it. I wanted to make sure I understand correctly the meaning of the results I'm getting when using the non parametric approach* for multiple subjects* and the cluster statistics. i.e. I compare an 'Active' and 'Control' data sets that each subject has (for example, for 8 subject I have 16 averages over trials) As far as I understand: Each subject has a subject-specific-average that is calculated for each condition (i.e. one vector (1X248 channels) for each condition that contains the average over selected time, freq and trials). Then, randomly permute the subject-specific averages of the two conditions, independently for every subject (i.e. in each permutation there will be one average selected from each subject) and calculate the statistic results for each channel. We repeat this step many times as to construct a "permutation distribution" from the statistics value from each permutation. finally, we look at the real "active vs control" statistics to see where their value lies in this permutation distribution, and that is the value we will save for that channel in the XXX.stat field. (we have 248 values and permutation distributions, one for each channel). When we want the "clusters" - I am not totally understand the process here. In the paper by Maris and Oostenveld , 2007 they talk about cluster in the following manner: A Cluster based permutation test, is a test in which for each partition we cluster an *adjacent time samples* that exhibit a similar difference (in sign and magnitude). This is done by selecting all samples whose t-values is larger than some threshold, cluster the selected sample in connected set *on the basis of temporal adjacency* and calculate cluster level statistics by taking the sum of t-values within a cluster. Finally, for each partition we take the largest cluster statistics as a value for the permutation distribution. This distribution will serve us for testing the observed largest cluster statistics as was explained earlier. When I use *cfg.correctm = 'cluster'; *Do we look for adjacent channels that are significant? so the clustering process is a spatial one (and not temporal?) Now for what I did: I applied the statistic test using the following definitions and [stat] = ft_freqstatistics(...): sublist = {'2','3','8','11','15','17','18','19'};% 8 subjects... cfg = []; cfg.channel = {'MEG'}; cfg.latency = [1.8 1.95]; * cfg.method = 'montecarlo';* cfg.frequency = 'all'; * cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster';* cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; cfg_neighb.method = 'distance'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb,alphaAvgSub3note2); Nsub = length(sublist); cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)];% condition number cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub];% subject number cfg.ivar = 1; cfg.uvar = 2; % cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'yes'; [stat] = ft_freqstatistics(cfg, alphaAvgSub2note3, alphaAvgSub3note3, alphaAvgSub8note3, alphaAvgSub11note3,... alphaAvgSub15note3, alphaAvgSub17note3, alphaAvgSub18note3, alphaAvgSub19note3,... alphaAvgSub2note2, alphaAvgSub3note2, alphaAvgSub8note2, ... alphaAvgSub11note2, alphaAvgSub15note2, alphaAvgSub17note2, alphaAvgSub18note2, alphaAvgSub19note2); I then plot the results using ft_clusterplot(...) Thanks a lot Inbal -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 3 08:01:39 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Mon, 3 Mar 2014 15:01:39 +0800 Subject: [FieldTrip] What's maxfilter when read .fif file Message-ID: Dear all: I use the ''ft_read_data'' code read .fif file by fieldtrip I get the following error message: ''Maxshield data has not had maxfilter applied to it - cannot be read by fieldtrip. Apply Neuromag maxfilter before converting to fieldtrip format.'' What should I do or Is there some Matlab codes to read .fif file ? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 3 09:42:19 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 3 Mar 2014 09:42:19 +0100 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: <530DEF73.3030605@ucl.ac.uk> References: <530DEF73.3030605@ucl.ac.uk> Message-ID: <146DAD29-49F2-404D-8468-A0F397C81E4C@donders.ru.nl> Dear Ian, The implementation of different filter types is a recurring issue, and we have it on our radar. I suggest you sign up on our bugzilla.fcdonders.nl bug-tracking system and add yourself in the CC for the following bugs: 2453 and 1981. That way you can see what is going on in this direction, and you may even contribute to their swift resolution ;-). As a side note, we try to avoid dependencies on the mathworks toolboxes (such as the signal processing toolbox, stats and image processing) because it allows for broader applicability of the code. In fact, for much of the filtering code we use open source drop in replacement code that has exactly the same functionality as the mathworks version of it. Best, Jan-Mathijs On Feb 26, 2014, at 2:43 PM, Ian M. Andolina wrote: > On 25/02/2014 11:51, fieldtrip-request at science.ru.nl wrote: >> Re: [FieldTrip] Band Limited Power Analysis in Fieldtrip? > Thanks Chaitanya, I get instability for the 1-4Hz band using a 4th order butterworth, but it seems to work for the higher bands (using cfg.bpinstabilityfix = 'reduce' to fix it only for the bands that need it). > > Does anyone know if integrating a chebyshev type-1 filter into fieldtrip preprocessing has been attempted, it is present in the signal processing toolbox and I could do this manually but I'd rather use existing code if possible... > > Thanks again, Ian > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Mar 3 09:55:58 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 3 Mar 2014 08:55:58 +0000 Subject: [FieldTrip] What's maxfilter when read .fif file In-Reply-To: References: Message-ID: Hi Xiao, Maxfilter is a preprocessing step / software package for data coming from MEG systems by Elekta (fif format) (see http://www.megwiki.org/images/a/aa/MaxFilter-2.0.pdf for a description). In short you need to run your data through the Maxfilter software (which should have been provided by Elekta) before you can do anything with it. Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of tongxiao meng [mengtongxiao at gmail.com] Sent: Monday, 3 March 2014 6:01 PM To: fieldtrip Subject: [FieldTrip] What's maxfilter when read .fif file Dear all: I use the ''ft_read_data'' code read .fif file by fieldtrip I get the following error message: ''Maxshield data has not had maxfilter applied to it - cannot be read by fieldtrip. Apply Neuromag maxfilter before converting to fieldtrip format.'' What should I do or Is there some Matlab codes to read .fif file ? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From vanwijk.bernadette at gmail.com Mon Mar 3 18:55:37 2014 From: vanwijk.bernadette at gmail.com (Bernadette van Wijk) Date: Mon, 3 Mar 2014 17:55:37 +0000 Subject: [FieldTrip] SPM course for MEG/EEG in London: May 12-14 Message-ID: Dear all, We are pleased to announce that our annual *SPM course for MEG/EEG* will take place this year from *Monday May 12* to *Wednesday May 14*. Hosted by University College London, the course will be held at Queen Square, a very central location in London (UK). Registration is now open. We offer a reduced rate when attending both the MEG/EEG course and the fMRI course during the second half of the week. For full details see http://www.ucl.ac.uk/ion/articles/courses/SPM2014 The course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course is suitable for both beginners and more advanced users. The topics that will be covered range from pre-processing and statistical analysis to source analysis and dynamic causal modelling. The program is listed below. Available places are limited so please register as early as possible if you would like to attend! *Monday May 12th * 9.30 - 9.45 SPM introduction and resources *Guillaume Flandin* 9.45 - 10.30 What are we measuring with M/EEG? *Saskia Helbling* 10.30 - 11.15 Data pre-processing *Vladimir Litvak* *Coffee* 11.45 - 12.30 Data pre-processing - demo *Deborah Talmi, Max-Philipp Stenner* 12.30 - 13.15 General linear model and classical inference *Christophe Phillips* *Lunch* 14.15 - 15.00 Multiple comparisons problem and solutions *Guillaume Flandin* 15.00 - 15.45 Bayesian inference *Chris Mathys* *Coffee* 16.15 - 17.45 Statistical analysis of images - demo *Rik Henson, Jason Taylor* 17.45 - ... Clinic - questions & answers session *Karl Friston* *Tuesday May 13th * 9.30 - 10.15 M/EEG source analysis *Gareth Barnes* 10.15 - 11.15 M/EEG source analysis - demo *Jose Lopez, Luzia Troebinger, Ashwini Oswal* *Coffee* 11.45 - 12.30 The principles of DCM *Jean Daunizeau* 12.30 - 13.15 DCM for evoked responses *Ryszard Auksztulewicz* *Lunch* 14.15 - 15.00 DCM for steady state responses *Rosalyn Moran* 15.00 - 15.45 DCM for time-frequency *Bernadette van Wijk* 15.45 - 16.30 DCM - demo *Martin Dietz, Andre Marreiros* *Coffee* 17.00 - 17.45 Bayesian model selection and averaging *Will Penny* 17.45 - ... Clinic - questions & answers session *All faculty members* 19.00 onwards - Social Event *Wednesday May 14th* 9.30 - 17.00 Practical hands-on session in UCL computer class rooms. Participants can either work on SPM tutorial datasets or on their own data with the help of the faculty. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Tue Mar 4 09:50:34 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Tue, 4 Mar 2014 09:50:34 +0100 Subject: [FieldTrip] one sample t-test within a group Message-ID: Hello everyonePls I need your assistance in design matrix for one sample t-test within a group of subjects with the same condition. What I want to do basically is comparing one region of the brain ( for instance frontal or by broadman area, BA) to other rest of the brain after source analysis. I will be glad for your assistance. Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From berryv.dberg at gmail.com Tue Mar 4 16:39:11 2014 From: berryv.dberg at gmail.com (berry van den berg) Date: Tue, 4 Mar 2014 10:39:11 -0500 Subject: [FieldTrip] topoplot Message-ID: Dear all, When I export my topoplots to (plot2svg) svg there is this blue square around the headplot (see figure). Does anyone has an idea what causes this? Thanks! Berry [image: Inline images 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 26136 bytes Desc: not available URL: From julian.keil at gmail.com Tue Mar 4 16:56:12 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 4 Mar 2014 16:56:12 +0100 Subject: [FieldTrip] topoplot In-Reply-To: References: Message-ID: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> Dear Berry, have you tried using the print command? That's what I usually use for topoplots and it works fine for me: print -depsc2 -painter Folder/filename.eps Note that I use the "painter" renderer instead of "opengl", as I can't ungroup the elements later on with the latter. Good Luck Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 04.03.2014 um 16:39 schrieb berry van den berg: > Dear all, > > When I export my topoplots to (plot2svg) svg there is this blue square around the headplot (see figure). Does anyone has an idea what causes this? > > Thanks! > > Berry > > > > _______________________________________________ > 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 berryv.dberg at gmail.com Tue Mar 4 17:03:46 2014 From: berryv.dberg at gmail.com (berry van den berg) Date: Tue, 4 Mar 2014 11:03:46 -0500 Subject: [FieldTrip] topoplot In-Reply-To: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> References: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> Message-ID: Thanks! That seems to work a lot better! Cheers, Berry On 4 March 2014 10:56, Julian Keil wrote: > Dear Berry, > > have you tried using the print command? > That's what I usually use for topoplots and it works fine for me: > > print -depsc2 -painter Folder/filename.eps > > Note that I use the "painter" renderer instead of "opengl", as I can't > ungroup the elements later on with the latter. > Good Luck > > Julian > > ******************** > *Dr. Julian Keil* > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 04.03.2014 um 16:39 schrieb berry van den berg: > > Dear all, > > When I export my topoplots to (plot2svg) svg there is this blue square > around the headplot (see figure). Does anyone has an idea what causes this? > > Thanks! > > Berry > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Berry van den Berg berryv.dberg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Mar 5 08:33:46 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 5 Mar 2014 08:33:46 +0100 Subject: [FieldTrip] HCP Releases Initial MEG Dataset References: <003001cf3801$f0be9ba0$d23bd2e0$@pcg.wustl.edu> Message-ID: <060788D0-95FF-4656-8739-00992B8C990D@donders.ru.nl> Dear MEG researchers, Please see the announcement below that I am forwarding on behalf of the HCP. News from the Human Connectome Project (HCP) March 4, 2014 The Human Connectome Project (HCP) WU-Minn consortium is pleased to announce our initial release of magnetoencephalography (MEG) data. What’s in the HCP MEG Initial (MEG1) data release? The MEG1 data include 10 complete, high quality datasets from 14 healthy adults collected at rest (rMEG) and during 3 tasks (tMEG) that measure sensory, motor, and cognitive task performance. For 3 subjects in this MEG release, data has already been released for the other modalities in the HCP protocol (T1w and T2w MRI, rfMRI, tfMRI, dMRI, and behavioral measures). MRI and behavioral measures for the remaining 11 subjects will be released as part of the upcoming HCP 500 Subjects Release scheduled for late spring 2014. The MEG1 release includes: · raw, unprocessed MEG data in 4D Neuroimaging format · co-registration information (in the form of transformation matrices) that allow coordinate transformations between individual subject MEG coordinate systems and the MNI coordinate system · volume conduction model of the head (in MATLAB format) · regular 3-D source models (in MATLAB format) · E-Prime log files (tab-delimited and as Excel spreadsheets) · lists of bad channels and bad segments · sets of independent components (each comprising the time course and the sensor map) together with the related classification output · cleaned channel-level processed data aligned to stimulus and response onsets (for the task data) or segmented in short pieces (2 sec epochs for the resting state data) · averaged event-related fields and time-frequency estimates of power (for the task data) · averaged power spectra (for the resting state data) Download MEG analysis software. Also available for download and use are pipeline scripts specifically written for analyzing HCP MEG data, collectively called “megconnectome software version 1.0”, and the FieldTrip MATLAB toolbox for MEG and EEG analysis. Seehttp://humanconnectome.org/documentation/MEG1/meg-pipeline.html for more information and to download the software. Access MEG1 data on the HCP website. Learn about and download the HCP MEG1 dataset (~300GB of data!) via the ConnectomeDB database. Most HCP image and behavioral data is openly accessible to investigators worldwide who register and accept a limited set of Open Access Data Use Terms. Want more information? Check out the HCP MEG1 Data Release Reference Manual for a comprehensive guide that includes details on scanning protocols, processing pipelines, and information that will help users obtain and analyze the Q3 data. If you are actively using HCP data and tools, we encourage you to join and be active in the hcp-users discussion group (http://www.humanconnectome.org/contact/#subscribe), so that you can tune in to technical discussions on issues that may be of interest. Thanks again for your interest in the HCP. Please send us your questions and comments anytime to info at humanconnectome.org. Best, The WU-Minn HCP Consortium Jennifer Elam, Ph.D. Outreach Coordinator, Human Connectome Project Washington University School of Medicine Department of Anatomy and Neurobiology, Box 8108 660 South Euclid Avenue St. Louis, MO 63110 314-362-9387 elamj at pcg.wustl.edu www.humanconnectome.org -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.png Type: image/png Size: 58922 bytes Desc: not available URL: From mengtongxiao at gmail.com Wed Mar 5 14:28:48 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Wed, 5 Mar 2014 21:28:48 +0800 Subject: [FieldTrip] =?gb2312?b?SGVscCBhYm91dCBmdF90b3BvcGxvdElDo78=?= Message-ID: Dear all, My question is: I use ICA to remove EOG artifacts, can't plot the components for visual inspection using ft_topoplotIC(). Now for what I did: cfg=[]; cfg.grad =data.grad; layout = ft_prepare_layout(cfg, data); figure cfg = []; cfg.component = [1:20]; cfg.layout = layout ; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) ??? Error using ==> surf at 78 X, Y, Z, and C cannot be complex. Error in ==> ft_plot_topo at 251 h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in ==> topoplot_common at 701 ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ==> ft_topoplotTFR at 191 [cfg] = topoplot_common(cfg, varargin{:}); Error in ==> ft_topoplotIC at 142 ft_topoplotTFR(cfg, varargin{:}); how can I do? Thanks a lot Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Mar 5 14:37:33 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Wed, 5 Mar 2014 14:37:33 +0100 (CET) Subject: [FieldTrip] =?utf-8?q?Help_about_ft=5FtopoplotIC=EF=BC=9F?= In-Reply-To: Message-ID: <957227235.5665491.1394026653690.JavaMail.root@sculptor.zimbra.ru.nl> Hi Xiao , It might be not a plotting but a ICA issue. See here: http :// fieldtrip . fcdonders . nl / faq /why_does_my_ ica _output_contain_complex_numbers If your EEG data is rank deficient (due to preprocessing steps as re-referencing, channel interpolations... before ICA computation), ICA output can contain complex number, which is not a good thing. See the above FAQ to see how to solve it. best, Diego ----- Original Message ----- > From: " tongxiao meng " < mengtongxiao @ gmail .com> > To: " fieldtrip " < fieldtrip @science. ru . nl > > Sent: Wednesday, 5 March, 2014 2:28:48 PM > Subject: [ FieldTrip ] Help about ft_ topoplotIC ? > Dear all, > My question is: I use ICA to remove EOG artifacts, can't plot the > components for visual inspection using ft_ topoplotIC (). > Now for what I did: > cfg =[]; > cfg .grad =data.grad; > layout = ft_prepare_layout( cfg , data); > figure > cfg = []; > cfg .component = [1:20]; > cfg .layout = layout ; > cfg .comment = 'no' ; > ft_ topoplotIC ( cfg , comp) > ??? Error using ==> surf at 78 > X, Y, Z, and C cannot be complex. > Error in ==> ft_plot_ topo at 251 > h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size( Zi )), Zi , 'EdgeColor' , > 'none' , 'FaceColor' , shading); > Error in ==> topoplot _common at 701 > ft_plot_ topo ( chanX , chanY , datavector , 'interpmethod' , cfg > .interpolation,... > Error in ==> ft_ topoplotTFR at 191 > [ cfg ] = topoplot _common( cfg , varargin {:}); > Error in ==> ft_ topoplotIC at 142 > ft_ topoplotTFR ( cfg , varargin {:}); > how can I do? > Thanks a lot > Xiao > _______________________________________________ > 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 mariana_b_rebelo at hotmail.com Wed Mar 5 14:37:51 2014 From: mariana_b_rebelo at hotmail.com (Mariana Rebelo) Date: Wed, 5 Mar 2014 13:37:51 +0000 Subject: [FieldTrip] Number of randomizations + 1 in clustering tests? Message-ID: Dear all I am computing some clustering tests on my MEG data and I don't understand the p-value returned in the field stat.posclusters(1).probIf I perform 1000 randomizations I get a p-value of 0.00799201I don't understand how this is possible, the p-value should be equal to integer/1000, so I should get either 0.0070 or 0.0080It seems that in fact I am not performing 1000 randomizations as I set in numrandomization, but 1001, because then: 8/1001 = 0.00799201 Is this really the case? Is the fieldtrip script adding another randomization to what is set by the user? Thanks!Mariana -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 5 14:58:28 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 05 Mar 2014 14:58:28 +0100 Subject: [FieldTrip] Number of randomizations + 1 in clustering tests? In-Reply-To: References: Message-ID: <53172D84.6010101@donders.ru.nl> Hi Mariana, yes, this is the case. You can think of it as your original data also being an observation, thus needs to be added to the number of permutations. If I remember correctly, this is for example explained here in more detail (and probably in more correct terms): http://www.statsci.org/smyth/pubs/permp.pdf Best, Jörn On 3/5/2014 2:37 PM, Mariana Rebelo wrote: > Dear all > > I am computing some clustering tests on my MEG data and I don't > understand the p-value returned in the field stat.posclusters(1).prob > If I perform 1000 randomizations I get a p-value of 0.00799201 > I don't understand how this is possible, the p-value should be equal > to integer/1000, so I should get either 0.0070 or 0.0080 > It seems that in fact I am not performing 1000 randomizations as I set > in numrandomization, but 1001, because then: 8/1001 = 0.00799201 > > Is this really the case? Is the fieldtrip script adding another > randomization to what is set by the user? > > Thanks! > Mariana > > > _______________________________________________ > 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 f.roux at bcbl.eu Wed Mar 5 16:28:58 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: <341671566.860154.1394033338749.JavaMail.root@bcbl.eu> Dear all, I am using ICA to clean my MEG-data before source analysis. My code looks as follows: cfg = []; cfg.component = [comp_idx]; meg_data = ft_rejectcomponent(cfg,comp,meg_data); However, after the call to ft_rejectcomponent there is no grad field in the meg_data structure. Rather, the grad field ist located under meg_data.hdr.grad. Is this the grad-field that I am supposed to use further downstream in the analysis pipeline, or should there be a grad-field under meg_data.grad? Any help would be much appreciated. Fred From singhharsimrat at gmail.com Wed Mar 5 17:45:07 2014 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 5 Mar 2014 16:45:07 +0000 Subject: [FieldTrip] Bipolar neonatal montage -.lay Message-ID: Hi All I was wondering how to create a .lay file for a bipolar montage e.g. the conventional banana shaped neonatal montage - something like 'FP1-T3' 'T3-O1' 'FP1-C3' 'C3-O1' 'Fz-Cz' 'Cz-Pz' 'FP2-C4' 'C4-O2' 'FP2-T4' 'T4-O2' 'T3-C3' 'C3-CZ' 'CZ-C4' 'CZ-PZ' 'C4-T4' Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Thu Mar 6 02:09:11 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Thu, 6 Mar 2014 10:09:11 +0900 Subject: [FieldTrip] ft_prepare_neighbours Message-ID: Hello I have a problem with channel repair. Firstly, I created my own layout because I cannot apply my data into the offered layout files. As far as I know, my EEG data was acquired through SynAmps 2 system with 128 electrodes, but I cannot find a suitable layout files. QuikCap_NSL_128 does not match either. Anyway, I created own customized layout, and usual preprocessing steps were done. However, there were some bad recording channels so I removed them during preprocessing. Moreover, the removed channels are different among the subjects, and now it becomes a big problem for analyzing the data. So I tried channel repair process, but encountered with errors. >>> cfg = []; cfg.method = 'template'; cfg.template = 'bj_plot.mat'; cfg.layout = lay; cfg.channel = 'T7'; % channels for which neighbours should be found cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg, data); >>> I think I have to use 'template' method because, there are some missing channels serially. And here are my question. Is it possible to assign my own layout in the cfg.template or cfg.layout? Actually at this step, I do not understand how to proceed. Also, there are many missing channels differ from each subject, but I am not sure which channels should be placed in the cfg.channel. (T7 is one of the missing channel in a subject in my case.) Finally, at 'data' field, is it possible to assign a finalized preprocessed data? And after ft_prepare_neighbours, >>> cfg = []; cfg.method = 'spline' % cfg.badchannel = 'T7'; cfg.missingchannel = 'T7'; cfg.neighbours = neighbours; cfg.trials = 'all' interpolated = ft_channelrepair(cfg, data) Is that right? -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Mar 6 09:37:18 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 6 Mar 2014 09:37:18 +0100 Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: > > Hi Fred, > I use the same code , but the updated grad is stored in the data. meg_data.hdr.grad is the grad before ICA. After ICA , grad needs to be adjusted ,which is used for the later source reconstruction . Do you have the latest FT ? Best, Haiteng > ------------------------------ > > Message: 5 > Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: [FieldTrip] MEG grad data after ICA cleaning > Message-ID: <341671566.860154.1394033338749.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I am using ICA to clean my MEG-data before source analysis. > > My code looks as follows: > > cfg = []; > cfg.component = [comp_idx]; > > meg_data = ft_rejectcomponent(cfg,comp,meg_data); > > However, after the call to ft_rejectcomponent there is no grad field in > the meg_data structure. Rather, the grad field ist located under > meg_data.hdr.grad. > > Is this the grad-field that I am supposed to use further downstream in the > analysis pipeline, or should there be a grad-field under meg_data.grad? > > Any help would be much appreciated. > > Fred > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Thu Mar 6 11:01:02 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Thu, 6 Mar 2014 11:01:02 +0100 (CET) Subject: [FieldTrip] MEG grad data after ICA cleaning In-Reply-To: Message-ID: <282581989.868311.1394100062381.JavaMail.root@bcbl.eu> Dear Haiteng, thx for your response. The reason why the grad field did not appear in my data-structure was that there was no grad field prior to the call to ft_rejectomponent. After modifying my code to: data.grad = data.hdr.grad; cfg = []; cfg.component = comp_idx; new_data = ft_rejectcomponent(cfg,comp,data); I found that new_data has a grad field which has been adjusted for the rejected components. A question related to this issue is whether it matters if I used two different fieldtrip versions for doing the ICA decomposition (fieldtrip-20131120) vs. component rejection (fieldtrip-20140304)? Does anyone know if there are any changes between these versions that could have an effect on my data? Best regards, Fred Frédéric Roux ----- Original Message ----- From: "Haiteng Jiang" To: fieldtrip at science.ru.nl Sent: Thursday, March 6, 2014 9:37:18 AM Subject: Re: [FieldTrip] MEG grad data after ICA cleaning Hi Fred, I use the same code , but the updated grad is stored in the data. meg_data.hdr.grad is the grad before ICA. After ICA , grad needs to be adjusted ,which is used for the later source reconstruction . Do you have the latest FT ? Best, Haiteng ------------------------------ Message: 5 Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) From: Fr?d?ric Roux < f.roux at bcbl.eu > To: FieldTrip discussion list < fieldtrip at science.ru.nl > Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: < 341671566.860154.1394033338749.JavaMail.root at bcbl.eu > Content-Type: text/plain; charset=utf-8 Dear all, I am using ICA to clean my MEG-data before source analysis. My code looks as follows: cfg = []; cfg.component = [comp_idx]; meg_data = ft_rejectcomponent(cfg,comp,meg_data); However, after the call to ft_rejectcomponent there is no grad field in the meg_data structure. Rather, the grad field ist located under meg_data.hdr.grad. Is this the grad-field that I am supposed to use further downstream in the analysis pipeline, or should there be a grad-field under meg_data.grad? Any help would be much appreciated. Fred -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Thu Mar 6 11:24:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 06 Mar 2014 11:24:43 +0100 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: Message-ID: <53184CEB.9050109@donders.ru.nl> Hi Beom, did your code produce an error? Generally, the 'template' method tries to look for already defined 'template' neighbours. However, as far as I understoog you only created a 'layout', which define where electrodes are placed, but not whether they are neighbours or not. I would advice you to use these settings: cfg = []; cfg.method = 'triangulation'; cfg.layout = lay; cfg.channel = 'all'; % that way you only need to run this once for *all* your subjects cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg); Then, if you are unhappy with the result, for modifcation you can use cfg = []; cfg.neighbours = neighbours; cfg.enableedit = 'yes'; neighbours = ft_neighboursplot(cfg); in that plot, you can click around to mark channels as being neighbours or not. When you are happy, save that neighbour structure and make sure to use it for all your subjects, so that there is no bias for individual subjects. Note that the data variable is used nowhere now, because that would cause missing sensors to be removed from the neighbour structure, but you probably do not want that (or if you do, then use it). And finally, yes, using preprocessed data is possible. Should you have any other questions, feel free to ask. Best, Jörn On 3/6/2014 2:09 AM, Beom Jun Min wrote: > > Hello > > I have a problem with channel repair. > > Firstly, I created my own layout because I cannot apply my data into > the offered layout files. > As far as I know, my EEG data was acquired through SynAmps 2 system > with 128 electrodes, but I cannot find a suitable layout files. > QuikCap_NSL_128 does not match either. > > Anyway, I created own customized layout, and usual preprocessing steps > were done. > However, there were some bad recording channels so I removed them > during preprocessing. > Moreover, the removed channels are different among the subjects, and > now it becomes a big problem for analyzing the data. > > So I tried channel repair process, but encountered with errors. > > >>> > cfg = []; > cfg.method = 'template'; > cfg.template = 'bj_plot.mat'; > cfg.layout = lay; > cfg.channel = 'T7'; % channels for which neighbours should be found > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg, data); > >>> > > I think I have to use 'template' method because, there are some > missing channels serially. > And here are my question. > Is it possible to assign my own layout in the cfg.template or > cfg.layout? Actually at this step, I do not understand how to proceed. > Also, there are many missing channels differ from each subject, but I > am not sure which channels should be placed in the cfg.channel. (T7 is > one of the missing channel in a subject in my case.) > Finally, at 'data' field, is it possible to assign a finalized > preprocessed data? > > And after ft_prepare_neighbours, > > >>> > cfg = []; > cfg.method = 'spline' > % cfg.badchannel = 'T7'; > cfg.missingchannel = 'T7'; > cfg.neighbours = neighbours; > cfg.trials = 'all' > interpolated = ft_channelrepair(cfg, data) > > Is that right? > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com , > http://bmssa.gist.ac.kr > > > _______________________________________________ > 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 mcantor at umich.edu Thu Mar 6 15:19:51 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 6 Mar 2014 09:19:51 -0500 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: <53184CEB.9050109@donders.ru.nl> References: <53184CEB.9050109@donders.ru.nl> Message-ID: Alternatively, you could create a .sfp file for cfg.elecfile of the ft_channelrepair. If your channels are equidistant the equation for determining the neighbours should be fairly straightforward, as long as you have at least the phi and theta coordinates. I talk about it in this thread: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html Here is the conclusion I came to: "For future reference, because I don't remember seeing anything on the fieldtrip FAQ about this and it may be useful to somebody else, the important thing is to turn the phi/theta from degrees into radians, and then applying a trigonometric function to get the X, Y, and Z coordinates. You can do all of these steps in 3 excel functions: X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) Z = =COS(RADIANS(Theta)) This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the coordinate system. I then typed up the channel name, x, y, and z coordinates in a four column notepad document saved as a .sfp file, and used that as my cfg.elecfile." I'm not sure if this is your problem, but I didn't see a cfg.elecfile parameter in your code, so hopefully this helps. On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Beom, > > did your code produce an error? > > Generally, the 'template' method tries to look for already defined > 'template' neighbours. However, as far as I understoog you only created a > 'layout', which define where electrodes are placed, but not whether they > are neighbours or not. I would advice you to use these settings: > > cfg = []; > cfg.method = 'triangulation'; > cfg.layout = lay; > cfg.channel = 'all'; % that way you only need to run this once for > *all* your subjects > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg); > > Then, if you are unhappy with the result, for modifcation you can use > cfg = []; > cfg.neighbours = neighbours; > cfg.enableedit = 'yes'; > neighbours = ft_neighboursplot(cfg); > > in that plot, you can click around to mark channels as being neighbours or > not. When you are happy, save that neighbour structure and make sure to use > it for all your subjects, so that there is no bias for individual subjects. > > Note that the data variable is used nowhere now, because that would cause > missing sensors to be removed from the neighbour structure, but you > probably do not want that (or if you do, then use it). > > And finally, yes, using preprocessed data is possible. > > Should you have any other questions, feel free to ask. > > Best, > Jörn > > > > On 3/6/2014 2:09 AM, Beom Jun Min wrote: > >> >> Hello >> >> I have a problem with channel repair. >> >> Firstly, I created my own layout because I cannot apply my data into the >> offered layout files. >> As far as I know, my EEG data was acquired through SynAmps 2 system with >> 128 electrodes, but I cannot find a suitable layout files. >> QuikCap_NSL_128 does not match either. >> >> Anyway, I created own customized layout, and usual preprocessing steps >> were done. >> However, there were some bad recording channels so I removed them during >> preprocessing. >> Moreover, the removed channels are different among the subjects, and now >> it becomes a big problem for analyzing the data. >> >> So I tried channel repair process, but encountered with errors. >> >> >>> >> cfg = []; >> cfg.method = 'template'; >> cfg.template = 'bj_plot.mat'; >> cfg.layout = lay; >> cfg.channel = 'T7'; % channels for which neighbours should be found >> cfg.feedback = 'yes'; >> neighbours = ft_prepare_neighbours(cfg, data); >> >>> >> >> I think I have to use 'template' method because, there are some missing >> channels serially. >> And here are my question. >> Is it possible to assign my own layout in the cfg.template or cfg.layout? >> Actually at this step, I do not understand how to proceed. >> Also, there are many missing channels differ from each subject, but I am >> not sure which channels should be placed in the cfg.channel. (T7 is one of >> the missing channel in a subject in my case.) >> Finally, at 'data' field, is it possible to assign a finalized >> preprocessed data? >> >> And after ft_prepare_neighbours, >> >> >>> >> cfg = []; >> cfg.method = 'spline' >> % cfg.badchannel = 'T7'; >> cfg.missingchannel = 'T7'; >> cfg.neighbours = neighbours; >> cfg.trials = 'all' >> interpolated = ft_channelrepair(cfg, data) >> >> Is that right? >> >> >> -- >> BeomJun Min, M.D. >> >> Department of Medical System Engineering (DMSE) >> Gwangju Institute of Science and Technology (GIST) >> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >> 500-712, Republic of Korea (South) >> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >> E-mail: mbj0310 at gmail.com , >> http://bmssa.gist.ac.kr >> >> >> _______________________________________________ >> 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 Heng-RuMay.Tan at glasgow.ac.uk Thu Mar 6 23:18:55 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Thu, 6 Mar 2014 22:18:55 +0000 Subject: [FieldTrip] Q: extraction of MNE source filter to reconstruct single trial source timeseries Message-ID: <5318F44F.20209@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Fri Mar 7 01:41:58 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Fri, 7 Mar 2014 09:41:58 +0900 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: <53184CEB.9050109@donders.ru.nl> Message-ID: Dear Jörn and Max Thank you for your help. However, another error occurred. >>> cfg = []; cfg.method = 'triangulation'; %'distance', 'triangulation' or 'template' (default = 'distance') cfg.layout = lay; cfg.channel = {'all', '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'}; cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg); >>> These work successfully. But >>> cfg = []; cfg.neighbours = neighbours; cfg.enableedit = 'yes'; neighbours = ft_neighbourplot(cfg); >>> ??? Error using ==> ft_fetch_sens at 179 no electrodes or gradiometers specified. Error in ==> ft_neighbourplot at 85 sens = ft_fetch_sens(cfg); In addition, >>> cfg = []; cfg.method = 'spline'; %'nearest', 'spline' or 'slap' (default='nearest') cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for details cfg.neighbours = neighbours; cfg.trials = 'all'; % cfg.lambda = % regularisation parameter (default = 1e-5, not for method 'distance') % cfg.order = % order of the polynomial interpolation (default = 4, not for method 'distance') interpolated = ft_channelrepair(cfg, final) >>> ??? Error using ==> ft_fetch_sens at 179 no electrodes or gradiometers specified. Error in ==> ft_channelrepair at 112 sens = ft_fetch_sens(cfg, data); It seems the problem is associated with position of electrode. But I do not have manufacture's file. Do I have to make the positions of electrodes manually? Actually, I do not understand the information from help* ft_datatype_sens, and ft_read_sens.* With regards 2014-03-06 23:19 GMT+09:00 Max Cantor : > Alternatively, you could create a .sfp file for cfg.elecfile of the > ft_channelrepair. If your channels are equidistant the equation for > determining the neighbours should be fairly straightforward, as long as you > have at least the phi and theta coordinates. > > I talk about it in this thread: > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html > > Here is the conclusion I came to: > > "For future reference, because I don't remember seeing anything on the > fieldtrip FAQ about this and it may be useful to somebody else, the > important thing is to turn the phi/theta from degrees into radians, and > then applying a trigonometric function to get the X, Y, and Z coordinates. > > You can do all of these steps in 3 excel functions: > > X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) > Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) > Z = =COS(RADIANS(Theta)) > > This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the > coordinate system. > > I then typed up the channel name, x, y, and z coordinates in a four column > notepad document saved as a .sfp file, and used that as my cfg.elecfile." > > I'm not sure if this is your problem, but I didn't see a cfg.elecfile > parameter in your code, so hopefully this helps. > > > On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < > jm.horschig at donders.ru.nl> wrote: > >> Hi Beom, >> >> did your code produce an error? >> >> Generally, the 'template' method tries to look for already defined >> 'template' neighbours. However, as far as I understoog you only created a >> 'layout', which define where electrodes are placed, but not whether they >> are neighbours or not. I would advice you to use these settings: >> >> cfg = []; >> cfg.method = 'triangulation'; >> cfg.layout = lay; >> cfg.channel = 'all'; % that way you only need to run this once for >> *all* your subjects >> cfg.feedback = 'yes'; >> neighbours = ft_prepare_neighbours(cfg); >> >> Then, if you are unhappy with the result, for modifcation you can use >> cfg = []; >> cfg.neighbours = neighbours; >> cfg.enableedit = 'yes'; >> neighbours = ft_neighboursplot(cfg); >> >> in that plot, you can click around to mark channels as being neighbours >> or not. When you are happy, save that neighbour structure and make sure to >> use it for all your subjects, so that there is no bias for individual >> subjects. >> >> Note that the data variable is used nowhere now, because that would cause >> missing sensors to be removed from the neighbour structure, but you >> probably do not want that (or if you do, then use it). >> >> And finally, yes, using preprocessed data is possible. >> >> Should you have any other questions, feel free to ask. >> >> Best, >> Jörn >> >> >> >> On 3/6/2014 2:09 AM, Beom Jun Min wrote: >> >>> >>> Hello >>> >>> I have a problem with channel repair. >>> >>> Firstly, I created my own layout because I cannot apply my data into the >>> offered layout files. >>> As far as I know, my EEG data was acquired through SynAmps 2 system with >>> 128 electrodes, but I cannot find a suitable layout files. >>> QuikCap_NSL_128 does not match either. >>> >>> Anyway, I created own customized layout, and usual preprocessing steps >>> were done. >>> However, there were some bad recording channels so I removed them during >>> preprocessing. >>> Moreover, the removed channels are different among the subjects, and now >>> it becomes a big problem for analyzing the data. >>> >>> So I tried channel repair process, but encountered with errors. >>> >>> >>> >>> cfg = []; >>> cfg.method = 'template'; >>> cfg.template = 'bj_plot.mat'; >>> cfg.layout = lay; >>> cfg.channel = 'T7'; % channels for which neighbours should be found >>> cfg.feedback = 'yes'; >>> neighbours = ft_prepare_neighbours(cfg, data); >>> >>> >>> >>> I think I have to use 'template' method because, there are some missing >>> channels serially. >>> And here are my question. >>> Is it possible to assign my own layout in the cfg.template or >>> cfg.layout? Actually at this step, I do not understand how to proceed. >>> Also, there are many missing channels differ from each subject, but I am >>> not sure which channels should be placed in the cfg.channel. (T7 is one of >>> the missing channel in a subject in my case.) >>> Finally, at 'data' field, is it possible to assign a finalized >>> preprocessed data? >>> >>> And after ft_prepare_neighbours, >>> >>> >>> >>> cfg = []; >>> cfg.method = 'spline' >>> % cfg.badchannel = 'T7'; >>> cfg.missingchannel = 'T7'; >>> cfg.neighbours = neighbours; >>> cfg.trials = 'all' >>> interpolated = ft_channelrepair(cfg, data) >>> >>> Is that right? >>> >>> >>> -- >>> BeomJun Min, M.D. >>> >>> Department of Medical System Engineering (DMSE) >>> Gwangju Institute of Science and Technology (GIST) >>> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >>> 500-712, Republic of Korea (South) >>> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >>> E-mail: mbj0310 at gmail.com , >>> http://bmssa.gist.ac.kr >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Fri Mar 7 04:26:24 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 6 Mar 2014 22:26:24 -0500 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: <53184CEB.9050109@donders.ru.nl> Message-ID: I think the neighborplot not working may have to do with the cfg.elec parameter not being set in ft_prepareneighbours, though I'm not sure why you don't get the error there. You should try contacting the manufacturer, otherwise you may have to make the electrode positions manually. As I mentioned, I was able to take the phi/theta coordinates provided by the manufacturer to determine the electrode positions, but if you have literally nothing to go by you may have to measure it by hand. If the electrodes are equidistant, finding the measurement between any two should be able to inform the position of all of them, otherwise I'm not sure what you could do. On Thu, Mar 6, 2014 at 7:41 PM, Beom Jun Min wrote: > Dear Jörn and Max > > Thank you for your help. > However, another error occurred. > > >>> > cfg = []; > cfg.method = 'triangulation'; %'distance', 'triangulation' or > 'template' (default = 'distance') > cfg.layout = lay; > cfg.channel = {'all', > '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'}; > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg); > >>> > These work successfully. > > But > >>> > cfg = []; > cfg.neighbours = neighbours; > cfg.enableedit = 'yes'; > neighbours = ft_neighbourplot(cfg); > >>> > ??? Error using ==> ft_fetch_sens at 179 > no electrodes or gradiometers specified. > > Error in ==> ft_neighbourplot at 85 > sens = ft_fetch_sens(cfg); > > In addition, > >>> > cfg = []; > cfg.method = 'spline'; %'nearest', 'spline' or 'slap' > (default='nearest') > cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for > details > cfg.neighbours = neighbours; > cfg.trials = 'all'; > % cfg.lambda = % regularisation parameter (default = 1e-5, not for > method 'distance') > % cfg.order = % order of the polynomial interpolation (default = > 4, not for method 'distance') > interpolated = ft_channelrepair(cfg, final) > >>> > ??? Error using ==> ft_fetch_sens at 179 > no electrodes or gradiometers specified. > > Error in ==> ft_channelrepair at 112 > sens = ft_fetch_sens(cfg, data); > > It seems the problem is associated with position of electrode. But I do > not have manufacture's file. > Do I have to make the positions of electrodes manually? > Actually, I do not understand the information from help* > ft_datatype_sens, and ft_read_sens.* > > With regards > > > > > > 2014-03-06 23:19 GMT+09:00 Max Cantor : > > Alternatively, you could create a .sfp file for cfg.elecfile of the >> ft_channelrepair. If your channels are equidistant the equation for >> determining the neighbours should be fairly straightforward, as long as you >> have at least the phi and theta coordinates. >> >> I talk about it in this thread: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html >> >> Here is the conclusion I came to: >> >> "For future reference, because I don't remember seeing anything on the >> fieldtrip FAQ about this and it may be useful to somebody else, the >> important thing is to turn the phi/theta from degrees into radians, and >> then applying a trigonometric function to get the X, Y, and Z coordinates. >> >> You can do all of these steps in 3 excel functions: >> >> X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) >> Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) >> Z = =COS(RADIANS(Theta)) >> >> This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the >> coordinate system. >> >> I then typed up the channel name, x, y, and z coordinates in a four column >> notepad document saved as a .sfp file, and used that as my cfg.elecfile." >> >> I'm not sure if this is your problem, but I didn't see a cfg.elecfile >> parameter in your code, so hopefully this helps. >> >> >> On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < >> jm.horschig at donders.ru.nl> wrote: >> >>> Hi Beom, >>> >>> did your code produce an error? >>> >>> Generally, the 'template' method tries to look for already defined >>> 'template' neighbours. However, as far as I understoog you only created a >>> 'layout', which define where electrodes are placed, but not whether they >>> are neighbours or not. I would advice you to use these settings: >>> >>> cfg = []; >>> cfg.method = 'triangulation'; >>> cfg.layout = lay; >>> cfg.channel = 'all'; % that way you only need to run this once for >>> *all* your subjects >>> cfg.feedback = 'yes'; >>> neighbours = ft_prepare_neighbours(cfg); >>> >>> Then, if you are unhappy with the result, for modifcation you can use >>> cfg = []; >>> cfg.neighbours = neighbours; >>> cfg.enableedit = 'yes'; >>> neighbours = ft_neighboursplot(cfg); >>> >>> in that plot, you can click around to mark channels as being neighbours >>> or not. When you are happy, save that neighbour structure and make sure to >>> use it for all your subjects, so that there is no bias for individual >>> subjects. >>> >>> Note that the data variable is used nowhere now, because that would >>> cause missing sensors to be removed from the neighbour structure, but you >>> probably do not want that (or if you do, then use it). >>> >>> And finally, yes, using preprocessed data is possible. >>> >>> Should you have any other questions, feel free to ask. >>> >>> Best, >>> Jörn >>> >>> >>> >>> On 3/6/2014 2:09 AM, Beom Jun Min wrote: >>> >>>> >>>> Hello >>>> >>>> I have a problem with channel repair. >>>> >>>> Firstly, I created my own layout because I cannot apply my data into >>>> the offered layout files. >>>> As far as I know, my EEG data was acquired through SynAmps 2 system >>>> with 128 electrodes, but I cannot find a suitable layout files. >>>> QuikCap_NSL_128 does not match either. >>>> >>>> Anyway, I created own customized layout, and usual preprocessing steps >>>> were done. >>>> However, there were some bad recording channels so I removed them >>>> during preprocessing. >>>> Moreover, the removed channels are different among the subjects, and >>>> now it becomes a big problem for analyzing the data. >>>> >>>> So I tried channel repair process, but encountered with errors. >>>> >>>> >>> >>>> cfg = []; >>>> cfg.method = 'template'; >>>> cfg.template = 'bj_plot.mat'; >>>> cfg.layout = lay; >>>> cfg.channel = 'T7'; % channels for which neighbours should be >>>> found >>>> cfg.feedback = 'yes'; >>>> neighbours = ft_prepare_neighbours(cfg, data); >>>> >>> >>>> >>>> I think I have to use 'template' method because, there are some missing >>>> channels serially. >>>> And here are my question. >>>> Is it possible to assign my own layout in the cfg.template or >>>> cfg.layout? Actually at this step, I do not understand how to proceed. >>>> Also, there are many missing channels differ from each subject, but I >>>> am not sure which channels should be placed in the cfg.channel. (T7 is one >>>> of the missing channel in a subject in my case.) >>>> Finally, at 'data' field, is it possible to assign a finalized >>>> preprocessed data? >>>> >>>> And after ft_prepare_neighbours, >>>> >>>> >>> >>>> cfg = []; >>>> cfg.method = 'spline' >>>> % cfg.badchannel = 'T7'; >>>> cfg.missingchannel = 'T7'; >>>> cfg.neighbours = neighbours; >>>> cfg.trials = 'all' >>>> interpolated = ft_channelrepair(cfg, data) >>>> >>>> Is that right? >>>> >>>> >>>> -- >>>> BeomJun Min, M.D. >>>> >>>> Department of Medical System Engineering (DMSE) >>>> Gwangju Institute of Science and Technology (GIST) >>>> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >>>> 500-712, Republic of Korea (South) >>>> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >>>> E-mail: mbj0310 at gmail.com , >>>> http://bmssa.gist.ac.kr >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr > > _______________________________________________ > 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 chris.day-2 at postgrad.manchester.ac.uk Fri Mar 7 16:36:28 2014 From: chris.day-2 at postgrad.manchester.ac.uk (Christopher Day) Date: Fri, 7 Mar 2014 15:36:28 +0000 Subject: [FieldTrip] Creation of MNI-aligned grids in individual gray matter? Message-ID: Hi, I'm quite new to FieldTrip, and I've been following the tutorials and example code online to perform source reconstruction on EEG data. I have had some success at creating MNI-aligned grids in individual head-space following this example: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space This is probably a stupid question, but why are some of the sources in the grid outside of the brain volume boundary in Figure 3 when the figure was plotted with the grid.inside positions? This is the plotting code copied from the example page: figure; ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; ft_plot_mesh(grid.pos(grid.inside,:)); I have also been trying to restrict my source analysis to gray matter using this FAQ: http://fieldtrip.fcdonders.nl/faq/can_i_restrict_the_source_reconstruction_to_the_grey_matter And this old conversation on the mailing list: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-March/004984.html I was wondering whether it is possible to combine these two avenues I've been pursuing and restrict the source analysis to MNI-aligned grids in individual gray matter? If so, how do you do it? And if not, can you explain why not please? Any help gratefully received. Kind regards, Chris Day PhD Student in Psychological Sciences, University of Manchester, Zochonis Building, 3rd Floor, T4. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.day-2 at postgrad.manchester.ac.uk Fri Mar 7 16:52:55 2014 From: chris.day-2 at postgrad.manchester.ac.uk (Christopher Day) Date: Fri, 7 Mar 2014 15:52:55 +0000 Subject: [FieldTrip] Source time series question Message-ID: Hi, I noticed in this old conversation on the mailing list that it is possible to extract a 3-dimensional source moment at each time point in a trial: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-August/004185.html Would anyone be able to tell me whether the direction of this moment remains relatively constant throughout the time course of the trial? And furthermore, that it is mainly the magnitude of the source along this direction that explains the variation in each source? Intuitively, it seems to me that the direction of the source would be constrained by the brain tissue orientation. Is this the case? Any help would be gratefully received. Kind regards, Chris Day PhD Student in Psychological Sciences, University of Manchester, Zochonis Building, 3rd Floor, T4. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Tue Mar 4 09:06:34 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Tue, 4 Mar 2014 16:06:34 +0800 Subject: [FieldTrip] help Message-ID: Dear all: I don't know much about maxfilter, but I have a .fif file that have done tsss. Does it mean that I can use the data to do source reconstruction or some compute (eg.plv) ? thank youi very much again. Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Mar 10 09:48:58 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 10 Mar 2014 09:48:58 +0100 Subject: [FieldTrip] help In-Reply-To: References: Message-ID: Dear Xiao, I am new to maxfilter as well, but this is what I understand; Maxfilter's SSS decomposes your data spatially, separating it into components that arise from the helmet from those that arise from outside the helmet. This results in a reduction of dimensionality of your data, typically to around 80. This should, as I understand it, be still OK for source reconstruction methods and, in fact, I think is often used in those. The tSSS method extends the SSS method to the temporal domain. I would therefor be extremely careful in using tSSS in combination with analyses of temporal correlations in the data, such as PLV. In any case you could test the effect it has on your dependent measures by applying the analysis with and without tSSS. Best of luck, Stephen On 4 March 2014 09:06, tongxiao meng wrote: > Dear all: > > I don't know much about maxfilter, but I have a .fif file that have done > tsss. > Does it mean that I can use the data to do source reconstruction or some > compute (eg.plv) ? > > thank youi very much again. > > Xiao > > _______________________________________________ > 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 maximilien.chaumon at gmail.com Mon Mar 10 13:40:44 2014 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Mon, 10 Mar 2014 13:40:44 +0100 Subject: [FieldTrip] Call for papers, Cutting-edge EEG methods Message-ID: Dear EEG community, Cutting EEG, the first symposium on Cutting-edge EEG methods for research on cognition happened in Berlin on the 19th to 21th February 2014. The success of this small event was resounding and we are now looking to raise its impact by preparing a* special issue at Journal of Neuroscience Methods for the end of this year*. By bringing together leading scientists contributing to the field in this special issue, we wish to create a landmark reference of methods for EEG research on cognition. We would like this issue to cover the most important basic aspects the EEG analysis workflow, as well as making state-of-the-art tools for signal processing, robust statistics and machine learning more accessible to our community. The submission process goes as follows: - Submission via http://ees.elsevier.com/jneumeth/ - Your paper will go through a full review process. We will be in contact through the submission system. The final decision to publish is made by Editor in Chief Vincenzo Crunelli . - There is no hard limit of page length, but we recommend 5000-7000 words. - No mandatory publication charges. Figures in color are free online. Optional charges for authors of color in print (each author will get 4 color figures in print for free but will pay 270 EUR per figure beyond that). There is also an Open Access option at your charge (1,800 USD per article). - For additional and more detailed information and guidelines: http://www.elsevier.com/journals/journal-of-neuroscience-methods/0165-0270/guide-for-authors Time schedule for this Special Issue: 31 May 2014 Deadline for submission of MSs July 2014 Reviews returned to authors October 2014 Acceptance deadline (final notifications) November 2014 Expected publication date Important note: The goal of this issue is to make your method accessible to non-expert EEG researchers. In order to make your contribution as much accessible and useful as possible, we would like to recommend the following: - Include a numbered list of steps required to implement your method - Share tips: the simple manipulations that enhance the quality of the data (e.g. normalization, re-referencing, preprocessing steps...) - Share code (e.g. through code repositories like Git, Google code or Sourceforge) Note also: manuscripts describing *known methods with a new look are also encouraged*. This means that if you think that your method has already been documented, but you have interesting tips or the current view on the topic has changed significantly over recent years, you are welcome to submit. Please *get in contact with us *with your submission inquiry. Finally, we are looking for some really *awesome looking visuals* for the cover-art of our Special Issue. Please feel free to contribute ideas or send us drafts! Please feel free to *contact us* if you have any questions. Best regards, Maximilien Chaumon, Sébastien Crouzet & Niko Busch Guest Editors, Special Issue on Cutting-edge EEG methods. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Tue Mar 11 16:04:51 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Tue, 11 Mar 2014 16:04:51 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: Message-ID: <531F2613.1040808@gmail.com> Dear FT-ers, I found an old posting to the mailing list (see below) that never got answered so my question still holds: given a location I found in the interpolated source, how do I find back the same location in .pos of the non-interpolated data? I can try and go around it by finding the corresponding MNI coordinates in the interpolated data (which by now I have to do by hand, so not optimal anyways), and then look for those coordinates in .pos. But I was wondering, like Cornelius was in his post, whether there is a neater way to get this information. Thanks a lot for the help, Vitória >>>>>>>>>>>>>> Hi mailing list, I'm still struggling with the conversion of coordinates between source and interpolated source space. For example, if i have the position of a single grid point how do i get the corresponding voxel in the interpolated source structure. Or the other way around, how to get the grid point which corresponds to a voxel (e.g the max voxel) in the interpolated source structure. I think this should be a common problem when working with virtual electrodes, shouldn't it? To make things easier i put together a example with the data from the source tutorial where i tried to calculated the grid pos of the max voxel in the interpolated source. clear all; load sourcePost_nocon; % source structure from tutorial mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial sourceNAI = sourcePost_nocon; sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ sourcePost_nocon.avg.noise; sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); % Find position of max activity [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); posInt=[xi, yi, zi]; % Plot interpolated source with position of max activity cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.locationcoordinates = 'voxel'; cfg.location = posInt; % location of max activity is marked correctly. figure; ft_sourceplot(cfg,sourceNAIInt); % Transform coordinate back to uninterpolated source??? dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); % Plot uninterpolated source with position aquired from interpolated source cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.locationcoordinates = 'voxel'; cfg.location = dpos; % unfortunately this coordinate is obviously wrong!!! WHY? figure; ft_sourceplot(cfg,sourceNAI); Unfortunately the solution of Jan Mathijs did not work, nor did mine :( Any ideas??? Cornelius -------------- next part -------------- An HTML attachment was scrubbed... URL: From erick.ortiz at med.uni-tuebingen.de Tue Mar 11 18:35:42 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Tue, 11 Mar 2014 18:35:42 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <531F2613.1040808@gmail.com> References: <531F2613.1040808@gmail.com> Message-ID: Dear Vitória and Cornelius, this is a common problem, and maybe it would be good to clarify the strategies that can be used here. I hope this can help others in a similar situation, which I have found many times. 1) You are trying to convert voxel indexes to head (CTF) coordinates. In this case, there are two mistakes in the code: 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, 'homogeneous' ); ... should be done with sourceNAIInt, not mri. The transforms are different, in general; e.g. note the downsample=2. 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous post. Or remove this line, since 'head' is the default. 2) But if you are working with the same subject/grid, there is no need for interpolation at all. Simply find the grid position with highest 'pow' and take its position. [dummy,ind] = max(source.avg.pow); pos = source.pos(ind,:); 3) However, this is not possible when using different grids, e.g. in a grand average in MNI coordinates. Find the peak ('pos') in the interpolated volume, as in Cornelius' code, then find the index of the nearest grid position for a common (again, MNI) grid. This is also in JM's message. dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); [dummy,ind] = min(sum(dpos.^2,2)); 4) What I have been using, and strongly recommend, is an MNI grid warped to the subject's anatomy, according to this procedure: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space This would give you both the benefits of working in MNI coordinates, and the ease of having a common grid across subjects (for instance, enabling solution #2). Still, some projects do call for one of the other options. Just a couple of details: - Pay utmost attention to coordinate systems and units. For instance, it is common to confuse unlabeled cm for mm, and either of these with voxels. Try to also label all structures as CTF or SPM (MNI). - Using pinv instead of inv is usually a good idea. Here, it is a not an issue, but matrix inversion in MATLAB can lead to a world of hurt to the unwary. Best, Erick On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: > Dear FT-ers, > > I found an old posting to the mailing list (see below) that never got > answered so my question still holds: given a location I found in the > interpolated source, how do I find back the same location in .pos of the > non-interpolated data? > I can try and go around it by finding the corresponding MNI coordinates in > the interpolated data (which by now I have to do by hand, so not optimal > anyways), and then look for those coordinates in .pos. But I was wondering, > like Cornelius was in his post, whether there is a neater way to get this > information. > > Thanks a lot for the help, > Vitória > > > >>>>>>>>>>>>>> >> >> Hi mailing list, >> >> I'm still struggling with the conversion of coordinates between source and >> interpolated source space. >> For example, if i have the position of a single grid point how do i get >> the >> corresponding voxel in the interpolated source structure. Or the other >> way >> around, how to get the grid point which corresponds to a voxel (e.g the >> max >> voxel) in the interpolated source structure. >> >> I think this should be a common problem when working with virtual >> electrodes, shouldn't it? >> >> To make things easier i put together a example with the data from the >> source tutorial where i tried to calculated the grid pos of the max voxel >> in the interpolated source. >> >> clear all; >> load sourcePost_nocon; % source structure from tutorial >> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >> >> sourceNAI = sourcePost_nocon; >> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >> sourcePost_nocon.avg.noise; >> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >> >> % Find position of max activity >> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >> posInt=[xi, yi, zi]; >> >> % Plot interpolated source with position of max activity >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = posInt; % location of max activity is marked >> correctly. >> figure; >> ft_sourceplot(cfg,sourceNAIInt); >> >> % Transform coordinate back to uninterpolated source??? >> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >> >> >> % Plot uninterpolated source with position aquired from interpolated >> source >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = dpos; % unfortunately this coordinate is >> obviously wrong!!! WHY? >> figure; >> ft_sourceplot(cfg,sourceNAI); >> >> >> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >> >> Any ideas??? >> >> Cornelius >> >> >> > > > > _______________________________________________ > 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 v.piai.research at gmail.com Wed Mar 12 09:24:53 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 12 Mar 2014 09:24:53 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> Message-ID: <532019D5.8040204@gmail.com> Dear Erick, Thanks for your detailed reply. I've been using individual MNI-warped grids (point 4 below) and I'm always using ft_convert_unit so those points are alright in my data. The reason why I do need to interpolate (at least, I think I need), is because I'm looking for max 'pow' in anatomically defined regions given the afni atlas. I managed to get it to work by interpolating to the mri and looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. Do you have any experience with this approach (searching within anatomical labels) without having to interpolate? Thanks once more, Vitória On 3/11/2014 6:35 PM, Erick Ortiz wrote: > Dear Vitória and Cornelius, > > this is a common problem, and maybe it would be good to clarify the > strategies that can be used here. I hope this can help others in a > similar situation, which I have found many times. > > 1) You are trying to convert voxel indexes to head (CTF) coordinates. > In this case, there are two mistakes in the code: > 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, > 'homogeneous' ); > ... should be done with sourceNAIInt, not mri. The transforms are > different, in general; e.g. note the downsample=2. > 1b) use cfg.locationcoordinates = 'head', as commented by JM in a > previous post. Or remove this line, since 'head' is the default. > > 2) But if you are working with the same subject/grid, there is no need > for interpolation at all. Simply find the grid position with highest > 'pow' and take its position. > [dummy,ind] = max(source.avg.pow); > pos = source.pos(ind,:); > > 3) However, this is not possible when using different grids, e.g. in a > grand average in MNI coordinates. Find the peak ('pos') in the > interpolated volume, as in Cornelius' code, then find the index of the > nearest grid position for a common (again, MNI) grid. This is also in > JM's message. > > dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); > [dummy,ind] = min(sum(dpos.^2,2)); > > 4) What I have been using, and strongly recommend, is an MNI grid > warped to the subject's anatomy, according to this procedure: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > This would give you both the benefits of working in MNI coordinates, > and the ease of having a common grid across subjects (for instance, > enabling solution #2). Still, some projects do call for one of the > other options. > > Just a couple of details: > - Pay utmost attention to coordinate systems and units. For instance, > it is common to confuse unlabeled cm for mm, and either of these with > voxels. Try to also label all structures as CTF or SPM (MNI). > - Using pinv instead of inv is usually a good idea. Here, it is a not > an issue, but matrix inversion in MATLAB can lead to a world of hurt > to the unwary. > > Best, > Erick > > > > On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai > > wrote: > > Dear FT-ers, > > I found an old posting to the mailing list (see below) that never > got answered so my question still holds: given a location I found > in the interpolated source, how do I find back the same location > in .pos of the non-interpolated data? > I can try and go around it by finding the corresponding MNI > coordinates in the interpolated data (which by now I have to do by > hand, so not optimal anyways), and then look for those coordinates > in .pos. But I was wondering, like Cornelius was in his post, > whether there is a neater way to get this information. > > Thanks a lot for the help, > Vitória > > > >>>>>>>>>>>>>> > > Hi mailing list, > > I'm still struggling with the conversion of coordinates > between source and > interpolated source space. > For example, if i have the position of a single grid point how > do i get the > corresponding voxel in the interpolated source structure. Or > the other way > around, how to get the grid point which corresponds to a voxel > (e.g the max > voxel) in the interpolated source structure. > > I think this should be a common problem when working with virtual > electrodes, shouldn't it? > > To make things easier i put together a example with the data > from the > source tutorial where i tried to calculated the grid pos of > the max voxel > in the interpolated source. > > clear all; > load sourcePost_nocon; % source structure from > tutorial > mri = ft_read_mri('Subject01.mri'); % mri of subject01 from > tutorial > > sourceNAI = sourcePost_nocon; > sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ > sourcePost_nocon.avg.noise; > sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); > > % Find position of max activity > [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); > [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); > posInt=[xi, yi, zi]; > > % Plot interpolated source with position of max activity > cfg = []; > cfg.method = 'ortho'; > cfg.funparameter = 'avg.pow'; > cfg.locationcoordinates = 'voxel'; > cfg.location = posInt; % location of max > activity is marked > correctly. > figure; > ft_sourceplot(cfg,sourceNAIInt); > > % Transform coordinate back to uninterpolated source??? > dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); > > > % Plot uninterpolated source with position aquired from > interpolated source > cfg = []; > cfg.method = 'ortho'; > cfg.funparameter = 'avg.pow'; > cfg.locationcoordinates = 'voxel'; > cfg.location = dpos; % unfortunately this > coordinate is > obviously wrong!!! WHY? > figure; > ft_sourceplot(cfg,sourceNAI); > > > Unfortunately the solution of Jan Mathijs did not work, nor > did mine :( > > Any ideas??? > > Cornelius > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 erick.ortiz at med.uni-tuebingen.de Wed Mar 12 11:37:19 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Wed, 12 Mar 2014 11:37:19 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <532019D5.8040204@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> Message-ID: Dear Vitoria, What I do usually, is to simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch. About the interpolation, I cannot help much more. I have been using my own tools for years, and I was not following the support of atlases in Fieldtrip.I tried it today, but had issues with coordinate system labeling when defining a ROI (I updated to the latest version by SVN): afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); cfg = []; cfg.method = 'ortho'; cfg.interactive = 'yes'; cfg.funparameter = 'coh'; cfg.atlas = afni; cfg.coordsys = 'mni'; % cfg.roi = 'Middle Temporal Gyrus'; % cfg.inputcoord = 'tal'; ft_sourceplot(cfg, interp); Also note that I had to use ft_read_atlas, because ft_prepare_atlas does not generate the brick0label/brick1label fields. It works well, but if I try to define a ROI (uncommenting the two lines), I get the error "The field cfg.inputcoord is required". There seems to be some confusion between inputcoord and coordsys. It can be because I was doing something wrong: maybe a Fieldtrip developer could comment on that? Best, Erick On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: > Dear Erick, > > Thanks for your detailed reply. > I've been using individual MNI-warped grids (point 4 below) and I'm always > using ft_convert_unit so those points are alright in my data. > > The reason why I do need to interpolate (at least, I think I need), is > because I'm looking for max 'pow' in anatomically defined regions given the > afni atlas. I managed to get it to work by interpolating to the mri and > looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using > ft_volumelookup. > Do you have any experience with this approach (searching within anatomical > labels) without having to interpolate? > > Thanks once more, Vitória > > > > > On 3/11/2014 6:35 PM, Erick Ortiz wrote: > > Dear Vitória and Cornelius, > > this is a common problem, and maybe it would be good to clarify the > strategies that can be used here. I hope this can help others in a similar > situation, which I have found many times. > > 1) You are trying to convert voxel indexes to head (CTF) coordinates. In > this case, there are two mistakes in the code: > 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, > 'homogeneous' ); > ... should be done with sourceNAIInt, not mri. The transforms are > different, in general; e.g. note the downsample=2. > 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous > post. Or remove this line, since 'head' is the default. > > 2) But if you are working with the same subject/grid, there is no need for > interpolation at all. Simply find the grid position with highest 'pow' and > take its position. > [dummy,ind] = max(source.avg.pow); > pos = source.pos(ind,:); > > 3) However, this is not possible when using different grids, e.g. in a > grand average in MNI coordinates. Find the peak ('pos') in the interpolated > volume, as in Cornelius' code, then find the index of the nearest grid > position for a common (again, MNI) grid. This is also in JM's message. > > dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); > [dummy,ind] = min(sum(dpos.^2,2)); > > 4) What I have been using, and strongly recommend, is an MNI grid warped > to the subject's anatomy, according to this procedure: > > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > This would give you both the benefits of working in MNI coordinates, and > the ease of having a common grid across subjects (for instance, enabling > solution #2). Still, some projects do call for one of the other options. > > Just a couple of details: > - Pay utmost attention to coordinate systems and units. For instance, it > is common to confuse unlabeled cm for mm, and either of these with voxels. > Try to also label all structures as CTF or SPM (MNI). > - Using pinv instead of inv is usually a good idea. Here, it is a not an > issue, but matrix inversion in MATLAB can lead to a world of hurt to the > unwary. > > Best, > Erick > > > > On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: > >> Dear FT-ers, >> >> I found an old posting to the mailing list (see below) that never got >> answered so my question still holds: given a location I found in the >> interpolated source, how do I find back the same location in .pos of the >> non-interpolated data? >> I can try and go around it by finding the corresponding MNI coordinates >> in the interpolated data (which by now I have to do by hand, so not optimal >> anyways), and then look for those coordinates in .pos. But I was wondering, >> like Cornelius was in his post, whether there is a neater way to get this >> information. >> >> Thanks a lot for the help, >> Vitória >> >> >> >>>>>>>>>>>>>> >>> >>> Hi mailing list, >>> >>> I'm still struggling with the conversion of coordinates between source >>> and >>> interpolated source space. >>> For example, if i have the position of a single grid point how do i get >>> the >>> corresponding voxel in the interpolated source structure. Or the other >>> way >>> around, how to get the grid point which corresponds to a voxel (e.g the >>> max >>> voxel) in the interpolated source structure. >>> >>> I think this should be a common problem when working with virtual >>> electrodes, shouldn't it? >>> >>> To make things easier i put together a example with the data from the >>> source tutorial where i tried to calculated the grid pos of the max voxel >>> in the interpolated source. >>> >>> clear all; >>> load sourcePost_nocon; % source structure from tutorial >>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>> >>> sourceNAI = sourcePost_nocon; >>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>> sourcePost_nocon.avg.noise; >>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>> >>> % Find position of max activity >>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>> posInt=[xi, yi, zi]; >>> >>> % Plot interpolated source with position of max activity >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = posInt; % location of max activity is marked >>> correctly. >>> figure; >>> ft_sourceplot(cfg,sourceNAIInt); >>> >>> % Transform coordinate back to uninterpolated source??? >>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>> >>> >>> % Plot uninterpolated source with position aquired from interpolated >>> source >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = dpos; % unfortunately this coordinate >>> is >>> obviously wrong!!! WHY? >>> figure; >>> ft_sourceplot(cfg,sourceNAI); >>> >>> >>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>> >>> Any ideas??? >>> >>> Cornelius >>> >>> >>> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > _______________________________________________ > 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 juriguen at gmail.com Wed Mar 12 17:48:15 2014 From: juriguen at gmail.com (=?ISO-8859-1?Q?Jose_Antonio_Urig=FCen?=) Date: Wed, 12 Mar 2014 17:48:15 +0100 Subject: [FieldTrip] Problem with "openmeeg_eeg_leadfield_example" Message-ID: Regardless of the Fieldtrip version I use, I keep getting the following error when trying to run the m file "openmeeg_eeg_leadfield_example": "Reference to non-existent field 'cond'. Error in ft_compute_leadfield (line 390) vol.cond = vol.cond(indx); Error in openmeeg_eeg_leadfield_example (line 83) lf_sphere = ft_compute_leadfield(pos, sens, vol_sphere);" I would like to be able to eventually simulate a head model and compute the forward EEG leadfield. I believe this to be a good starting point, any other suggestions? Thanks Toni -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Wed Mar 12 17:50:00 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 12 Mar 2014 17:50:00 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> Message-ID: <53209038.8010906@gmail.com> Dear Erick, "simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch" -> that sounds like a good thing to do. Is this a very complicated thing to do? Would you mind sharing a piece of code or some tips for how I could achieve it? Thanks once more, Vitória On 3/12/2014 11:37 AM, Erick Ortiz wrote: > Dear Vitoria, > > What I do usually, is to simply label and/or define my ROI in the MNI > grid. When I warp to the individuals, everything is in place without a > hitch. > > About the interpolation, I cannot help much more. I have been using my > own tools for years, and I was not following the support of atlases in > Fieldtrip.I tried it today, but had issues with coordinate system > labeling when defining a ROI (I updated to the latest version by SVN): > > afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'yes'; > cfg.funparameter = 'coh'; > cfg.atlas = afni; > cfg.coordsys = 'mni'; > % cfg.roi = 'Middle Temporal Gyrus'; > % cfg.inputcoord = 'tal'; > ft_sourceplot(cfg, interp); > > Also note that I had to use ft_read_atlas, because ft_prepare_atlas > does not generate the brick0label/brick1label fields. > > It works well, but if I try to define a ROI (uncommenting the two > lines), I get the error "The field cfg.inputcoord is required". There > seems to be some confusion between inputcoord and coordsys. > > It can be because I was doing something wrong: maybe a Fieldtrip > developer could comment on that? > > Best, > Erick > > > > On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai > > wrote: > > Dear Erick, > > Thanks for your detailed reply. > I've been using individual MNI-warped grids (point 4 below) and > I'm always using ft_convert_unit so those points are alright in my > data. > > The reason why I do need to interpolate (at least, I think I > need), is because I'm looking for max 'pow' in anatomically > defined regions given the afni atlas. I managed to get it to work > by interpolating to the mri and looking for max 'pow' given a > label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. > Do you have any experience with this approach (searching within > anatomical labels) without having to interpolate? > > Thanks once more, Vitória > > > > > On 3/11/2014 6:35 PM, Erick Ortiz wrote: >> Dear Vitória and Cornelius, >> >> this is a common problem, and maybe it would be good to clarify >> the strategies that can be used here. I hope this can help others >> in a similar situation, which I have found many times. >> >> 1) You are trying to convert voxel indexes to head (CTF) >> coordinates. In this case, there are two mistakes in the code: >> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, >> 'homogeneous' ); >> ... should be done with sourceNAIInt, not mri. The transforms are >> different, in general; e.g. note the downsample=2. >> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a >> previous post. Or remove this line, since 'head' is the default. >> >> 2) But if you are working with the same subject/grid, there is no >> need for interpolation at all. Simply find the grid position with >> highest 'pow' and take its position. >> [dummy,ind] = max(source.avg.pow); >> pos = source.pos(ind,:); >> >> 3) However, this is not possible when using different grids, e.g. >> in a grand average in MNI coordinates. Find the peak ('pos') in >> the interpolated volume, as in Cornelius' code, then find the >> index of the nearest grid position for a common (again, MNI) >> grid. This is also in JM's message. >> >> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >> [dummy,ind] = min(sum(dpos.^2,2)); >> >> 4) What I have been using, and strongly recommend, is an MNI grid >> warped to the subject's anatomy, according to this procedure: >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> This would give you both the benefits of working in MNI >> coordinates, and the ease of having a common grid across subjects >> (for instance, enabling solution #2). Still, some projects do >> call for one of the other options. >> >> Just a couple of details: >> - Pay utmost attention to coordinate systems and units. For >> instance, it is common to confuse unlabeled cm for mm, and either >> of these with voxels. Try to also label all structures as CTF or >> SPM (MNI). >> - Using pinv instead of inv is usually a good idea. Here, it is a >> not an issue, but matrix inversion in MATLAB can lead to a world >> of hurt to the unwary. >> >> Best, >> Erick >> >> >> >> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai >> > wrote: >> >> Dear FT-ers, >> >> I found an old posting to the mailing list (see below) that >> never got answered so my question still holds: given a >> location I found in the interpolated source, how do I find >> back the same location in .pos of the non-interpolated data? >> I can try and go around it by finding the corresponding MNI >> coordinates in the interpolated data (which by now I have to >> do by hand, so not optimal anyways), and then look for those >> coordinates in .pos. But I was wondering, like Cornelius was >> in his post, whether there is a neater way to get this >> information. >> >> Thanks a lot for the help, >> Vitória >> >> >> >>>>>>>>>>>>>> >> >> Hi mailing list, >> >> I'm still struggling with the conversion of coordinates >> between source and >> interpolated source space. >> For example, if i have the position of a single grid >> point how do i get the >> corresponding voxel in the interpolated source >> structure. Or the other way >> around, how to get the grid point which corresponds to a >> voxel (e.g the max >> voxel) in the interpolated source structure. >> >> I think this should be a common problem when working with >> virtual >> electrodes, shouldn't it? >> >> To make things easier i put together a example with the >> data from the >> source tutorial where i tried to calculated the grid pos >> of the max voxel >> in the interpolated source. >> >> clear all; >> load sourcePost_nocon; % source structure from tutorial >> mri = ft_read_mri('Subject01.mri'); % mri of subject01 >> from tutorial >> >> sourceNAI = sourcePost_nocon; >> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >> sourcePost_nocon.avg.noise; >> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that >> to let >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >> >> % Find position of max activity >> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >> posInt=[xi, yi, zi]; >> >> % Plot interpolated source with position of max activity >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = posInt; % location of max >> activity is marked >> correctly. >> figure; >> ft_sourceplot(cfg,sourceNAIInt); >> >> % Transform coordinate back to uninterpolated source??? >> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >> >> >> % Plot uninterpolated source with position aquired from >> interpolated source >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = dpos; % unfortunately this >> coordinate is >> obviously wrong!!! WHY? >> figure; >> ft_sourceplot(cfg,sourceNAI); >> >> >> Unfortunately the solution of Jan Mathijs did not work, >> nor did mine :( >> >> Any ideas??? >> >> Cornelius >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 jan.schoffelen at donders.ru.nl Thu Mar 13 13:00:51 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 13 Mar 2014 13:00:51 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <53209038.8010906@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> Message-ID: <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Hi Vitória, Erick, Cornelius et al, Allow me to chime in to this Brazilio-German interaction ;-). It seems to me that the discussion consists of a few separable elements. -The first one pertains to the specific question how to map source locations between two different representations (source with pos versus volumetric MRI-type image with a transform). -The other one relates to some atlas related business, i.e. mapping locations that have a specific anatomical label to specific MEG source space locations. -And then there's a third one, which is important for 2, and pertains to the usual complicated stuff of mapping between different coordinate systems. There are several ways to achieve what Vitória is looking for, and I think that Erick already solved it, but recent changes in FieldTrip make it quite straightforward. So here goes my recipe: 1 I would go along with Erick to do my beamformer source reconstruction on a subject-specific grid, which is inverse-warped from a regular grid defined on the MNI-template. 2 If we take this template grid, which can be found in ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of your choice onto this sourcemodel, using ft_sourceinterpolate. Reading in of the atlas nowadays indeed should be done with ft_read_atlas (ft_prepare_atlas will be deprecated soon), and my personal taste would be NOT to use the afni atlas, because this one is defined in Talairach space, which is slightly different from MNI-space, and although FT accounts for the differences I am not sure how accurate this is. Anyway, one could do something like atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), load the template sourcemodel with the resolution you need (i.e. the resolution you used in your beamformer grid), and call ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'tissue'; sourcemodel2 = ft_sourceinterpolate(cfg,atlas,sourcemodel); % NOTE: ensure that the units are consistent in atlas and sourcemodel, if not use ft_convert_units 3 Step 2 should have given you sourcemodel2 with a field 'tissue', that represents the anatomical labels, according to the corresponding atlas. Atlas.tissuelabel gives the labels that correspond to the numbers in the tissue field. 4 Then, without the need to call ft_sourceinterpolate, nor ft_volumenormalise on your source-reconstructed data, you can do indx = find(sourcemodel2.tissue==x), where x is the number of your choice, and you directly get the indices of the source positions in your 'source' variable, that have this particular anatomical label. 5 Then, you can do whatever you like with it, e.g. take a max or mean or whatever... I hope I was clear enough, and that someone feels inclined to make this into a FAQ on the FieldTrip wiki ;-). Best wishes, Jan-Mathijs On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > Dear Erick, > > "simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch" -> that sounds like a good thing to do. > Is this a very complicated thing to do? Would you mind sharing a piece of code or some tips for how I could achieve it? > > Thanks once more, Vitória > > On 3/12/2014 11:37 AM, Erick Ortiz wrote: >> Dear Vitoria, >> >> What I do usually, is to simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch. >> >> About the interpolation, I cannot help much more. I have been using my own tools for years, and I was not following the support of atlases in Fieldtrip.I tried it today, but had issues with coordinate system labeling when defining a ROI (I updated to the latest version by SVN): >> >> afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'yes'; >> cfg.funparameter = 'coh'; >> cfg.atlas = afni; >> cfg.coordsys = 'mni'; >> % cfg.roi = 'Middle Temporal Gyrus'; >> % cfg.inputcoord = 'tal'; >> ft_sourceplot(cfg, interp); >> >> Also note that I had to use ft_read_atlas, because ft_prepare_atlas does not generate the brick0label/brick1label fields. >> >> It works well, but if I try to define a ROI (uncommenting the two lines), I get the error "The field cfg.inputcoord is required". There seems to be some confusion between inputcoord and coordsys. >> >> It can be because I was doing something wrong: maybe a Fieldtrip developer could comment on that? >> >> Best, >> Erick >> >> >> >> On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: >> Dear Erick, >> >> Thanks for your detailed reply. >> I've been using individual MNI-warped grids (point 4 below) and I'm always using ft_convert_unit so those points are alright in my data. >> >> The reason why I do need to interpolate (at least, I think I need), is because I'm looking for max 'pow' in anatomically defined regions given the afni atlas. I managed to get it to work by interpolating to the mri and looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. >> Do you have any experience with this approach (searching within anatomical labels) without having to interpolate? >> >> Thanks once more, Vitória >> >> >> >> >> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >>> Dear Vitória and Cornelius, >>> >>> this is a common problem, and maybe it would be good to clarify the strategies that can be used here. I hope this can help others in a similar situation, which I have found many times. >>> >>> 1) You are trying to convert voxel indexes to head (CTF) coordinates. In this case, there are two mistakes in the code: >>> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, 'homogeneous' ); >>> ... should be done with sourceNAIInt, not mri. The transforms are different, in general; e.g. note the downsample=2. >>> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous post. Or remove this line, since 'head' is the default. >>> >>> 2) But if you are working with the same subject/grid, there is no need for interpolation at all. Simply find the grid position with highest 'pow' and take its position. >>> [dummy,ind] = max(source.avg.pow); >>> pos = source.pos(ind,:); >>> >>> 3) However, this is not possible when using different grids, e.g. in a grand average in MNI coordinates. Find the peak ('pos') in the interpolated volume, as in Cornelius' code, then find the index of the nearest grid position for a common (again, MNI) grid. This is also in JM's message. >>> >>> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >>> [dummy,ind] = min(sum(dpos.^2,2)); >>> >>> 4) What I have been using, and strongly recommend, is an MNI grid warped to the subject's anatomy, according to this procedure: >>> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >>> >>> This would give you both the benefits of working in MNI coordinates, and the ease of having a common grid across subjects (for instance, enabling solution #2). Still, some projects do call for one of the other options. >>> >>> Just a couple of details: >>> - Pay utmost attention to coordinate systems and units. For instance, it is common to confuse unlabeled cm for mm, and either of these with voxels. Try to also label all structures as CTF or SPM (MNI). >>> - Using pinv instead of inv is usually a good idea. Here, it is a not an issue, but matrix inversion in MATLAB can lead to a world of hurt to the unwary. >>> >>> Best, >>> Erick >>> >>> >>> >>> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: >>> Dear FT-ers, >>> >>> I found an old posting to the mailing list (see below) that never got answered so my question still holds: given a location I found in the interpolated source, how do I find back the same location in .pos of the non-interpolated data? >>> I can try and go around it by finding the corresponding MNI coordinates in the interpolated data (which by now I have to do by hand, so not optimal anyways), and then look for those coordinates in .pos. But I was wondering, like Cornelius was in his post, whether there is a neater way to get this information. >>> >>> Thanks a lot for the help, >>> Vitória >>> >>> >>> >>>>>>>>>>>>>> >>> >>> Hi mailing list, >>> >>> I'm still struggling with the conversion of coordinates between source and >>> interpolated source space. >>> For example, if i have the position of a single grid point how do i get the >>> corresponding voxel in the interpolated source structure. Or the other way >>> around, how to get the grid point which corresponds to a voxel (e.g the max >>> voxel) in the interpolated source structure. >>> >>> I think this should be a common problem when working with virtual >>> electrodes, shouldn't it? >>> >>> To make things easier i put together a example with the data from the >>> source tutorial where i tried to calculated the grid pos of the max voxel >>> in the interpolated source. >>> >>> clear all; >>> load sourcePost_nocon; % source structure from tutorial >>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>> >>> sourceNAI = sourcePost_nocon; >>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ sourcePost_nocon.avg.noise; >>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>> >>> % Find position of max activity >>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>> posInt=[xi, yi, zi]; >>> >>> % Plot interpolated source with position of max activity >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = posInt; % location of max activity is marked >>> correctly. >>> figure; >>> ft_sourceplot(cfg,sourceNAIInt); >>> >>> % Transform coordinate back to uninterpolated source??? >>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>> >>> >>> % Plot uninterpolated source with position aquired from interpolated source >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = dpos; % unfortunately this coordinate is >>> obviously wrong!!! WHY? >>> figure; >>> ft_sourceplot(cfg,sourceNAI); >>> >>> >>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>> >>> Any ideas??? >>> >>> Cornelius >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From erick.ortiz at med.uni-tuebingen.de Fri Mar 14 02:05:23 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Fri, 14 Mar 2014 02:05:23 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Message-ID: Thanks for shedding light on the issue, JM: I tested your suggestion and it worked brilliantly, far faster and more elegant than the script I wrote years ago. (in my defense, it was only run a couple of times, to label our standard grids...) The old mni2tal question creeps again into the discussion. I would like to use the AFNI atlas, but the conversion introduces too much distortion. For the others (AAL, SPM17/18, Brainweb), all is fine. See attached figure comparing AFNI (blue) with Brainweb grey_matter (red). I might get around to add this to the FAQ next week. :-) Vitória, there is a number of other atlases you can use instead of AFNI then. Either from the link below or any MNI-aligned template, using JM's procedure now it takes 3 seconds to re-label your grid. http://fieldtrip.fcdonders.nl/template/atlas Best, Erick On Thu, Mar 13, 2014 at 1:00 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Vitória, Erick, Cornelius et al, > > Allow me to chime in to this Brazilio-German interaction ;-). > It seems to me that the discussion consists of a few separable elements. > > -The first one pertains to the specific question how to map source > locations between two different representations (source with pos versus > volumetric MRI-type image with a transform). > -The other one relates to some atlas related business, i.e. mapping > locations that have a specific anatomical label to specific MEG source > space locations. > -And then there's a third one, which is important for 2, and pertains to > the usual complicated stuff of mapping between different coordinate systems. > > There are several ways to achieve what Vitória is looking for, and I think > that Erick already solved it, but recent changes in FieldTrip make it quite > straightforward. > > So here goes my recipe: > 1 I would go along with Erick to do my beamformer source reconstruction on > a subject-specific grid, which is inverse-warped from a regular grid > defined on the MNI-template. > 2 If we take this template grid, which can be found in > ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of your > choice onto this sourcemodel, using ft_sourceinterpolate. Reading in of the > atlas nowadays indeed should be done with ft_read_atlas (ft_prepare_atlas > will be deprecated soon), and my personal taste would be NOT to use the > afni atlas, because this one is defined in Talairach space, which is > slightly different from MNI-space, and although FT accounts for the > differences I am not sure how accurate this is. Anyway, one could do > something like atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), > load the template sourcemodel with the resolution you need (i.e. the > resolution you used in your beamformer grid), and call > ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter > = 'tissue'; sourcemodel2 = ft_sourceinterpolate(cfg,atlas,sourcemodel); % > NOTE: ensure that the units are consistent in atlas and sourcemodel, if not > use ft_convert_units > 3 Step 2 should have given you sourcemodel2 with a field 'tissue', that > represents the anatomical labels, according to the corresponding atlas. > Atlas.tissuelabel gives the labels that correspond to the numbers in the > tissue field. > 4 Then, without the need to call ft_sourceinterpolate, nor > ft_volumenormalise on your source-reconstructed data, you can do indx = > find(sourcemodel2.tissue==x), where x is the number of your choice, and you > directly get the indices of the source positions in your 'source' variable, > that have this particular anatomical label. > 5 Then, you can do whatever you like with it, e.g. take a max or mean or > whatever... > > I hope I was clear enough, and that someone feels inclined to make this > into a FAQ on the FieldTrip wiki ;-). > > Best wishes, > Jan-Mathijs > > > > On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > > Dear Erick, > > "simply label and/or define my ROI in the MNI grid. When I warp to the > individuals, everything is in place without a hitch" -> that sounds like a > good thing to do. > Is this a very complicated thing to do? Would you mind sharing a piece of > code or some tips for how I could achieve it? > > Thanks once more, Vitória > > On 3/12/2014 11:37 AM, Erick Ortiz wrote: > > Dear Vitoria, > > What I do usually, is to simply label and/or define my ROI in the MNI > grid. When I warp to the individuals, everything is in place without a > hitch. > > About the interpolation, I cannot help much more. I have been using my > own tools for years, and I was not following the support of atlases in > Fieldtrip.I tried it today, but had issues with coordinate system labeling > when defining a ROI (I updated to the latest version by SVN): > > afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'yes'; > cfg.funparameter = 'coh'; > cfg.atlas = afni; > cfg.coordsys = 'mni'; > % cfg.roi = 'Middle Temporal Gyrus'; > % cfg.inputcoord = 'tal'; > ft_sourceplot(cfg, interp); > > Also note that I had to use ft_read_atlas, because ft_prepare_atlas does > not generate the brick0label/brick1label fields. > > It works well, but if I try to define a ROI (uncommenting the two lines), > I get the error "The field cfg.inputcoord is required". There seems to be > some confusion between inputcoord and coordsys. > > It can be because I was doing something wrong: maybe a Fieldtrip developer > could comment on that? > > Best, > Erick > > > > On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: > >> Dear Erick, >> >> Thanks for your detailed reply. >> I've been using individual MNI-warped grids (point 4 below) and I'm >> always using ft_convert_unit so those points are alright in my data. >> >> The reason why I do need to interpolate (at least, I think I need), is >> because I'm looking for max 'pow' in anatomically defined regions given the >> afni atlas. I managed to get it to work by interpolating to the mri and >> looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using >> ft_volumelookup. >> Do you have any experience with this approach (searching within >> anatomical labels) without having to interpolate? >> >> Thanks once more, Vitória >> >> >> >> >> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >> >> Dear Vitória and Cornelius, >> >> this is a common problem, and maybe it would be good to clarify the >> strategies that can be used here. I hope this can help others in a similar >> situation, which I have found many times. >> >> 1) You are trying to convert voxel indexes to head (CTF) coordinates. In >> this case, there are two mistakes in the code: >> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, >> 'homogeneous' ); >> ... should be done with sourceNAIInt, not mri. The transforms are >> different, in general; e.g. note the downsample=2. >> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a >> previous post. Or remove this line, since 'head' is the default. >> >> 2) But if you are working with the same subject/grid, there is no need >> for interpolation at all. Simply find the grid position with highest 'pow' >> and take its position. >> [dummy,ind] = max(source.avg.pow); >> pos = source.pos(ind,:); >> >> 3) However, this is not possible when using different grids, e.g. in a >> grand average in MNI coordinates. Find the peak ('pos') in the interpolated >> volume, as in Cornelius' code, then find the index of the nearest grid >> position for a common (again, MNI) grid. This is also in JM's message. >> >> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >> [dummy,ind] = min(sum(dpos.^2,2)); >> >> 4) What I have been using, and strongly recommend, is an MNI grid warped >> to the subject's anatomy, according to this procedure: >> >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> This would give you both the benefits of working in MNI coordinates, and >> the ease of having a common grid across subjects (for instance, enabling >> solution #2). Still, some projects do call for one of the other options. >> >> Just a couple of details: >> - Pay utmost attention to coordinate systems and units. For instance, it >> is common to confuse unlabeled cm for mm, and either of these with voxels. >> Try to also label all structures as CTF or SPM (MNI). >> - Using pinv instead of inv is usually a good idea. Here, it is a not an >> issue, but matrix inversion in MATLAB can lead to a world of hurt to the >> unwary. >> >> Best, >> Erick >> >> >> >> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: >> >>> Dear FT-ers, >>> >>> I found an old posting to the mailing list (see below) that never got >>> answered so my question still holds: given a location I found in the >>> interpolated source, how do I find back the same location in .pos of the >>> non-interpolated data? >>> I can try and go around it by finding the corresponding MNI coordinates >>> in the interpolated data (which by now I have to do by hand, so not optimal >>> anyways), and then look for those coordinates in .pos. But I was wondering, >>> like Cornelius was in his post, whether there is a neater way to get this >>> information. >>> >>> Thanks a lot for the help, >>> Vitória >>> >>> >>> >>>>>>>>>>>>>> >>>> >>>> Hi mailing list, >>>> >>>> I'm still struggling with the conversion of coordinates between source >>>> and >>>> interpolated source space. >>>> For example, if i have the position of a single grid point how do i get >>>> the >>>> corresponding voxel in the interpolated source structure. Or the other >>>> way >>>> around, how to get the grid point which corresponds to a voxel (e.g the >>>> max >>>> voxel) in the interpolated source structure. >>>> >>>> I think this should be a common problem when working with virtual >>>> electrodes, shouldn't it? >>>> >>>> To make things easier i put together a example with the data from the >>>> source tutorial where i tried to calculated the grid pos of the max >>>> voxel >>>> in the interpolated source. >>>> >>>> clear all; >>>> load sourcePost_nocon; % source structure from tutorial >>>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>>> >>>> sourceNAI = sourcePost_nocon; >>>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>>> sourcePost_nocon.avg.noise; >>>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>>> >>>> % Find position of max activity >>>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>>> posInt=[xi, yi, zi]; >>>> >>>> % Plot interpolated source with position of max activity >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = posInt; % location of max activity is >>>> marked >>>> correctly. >>>> figure; >>>> ft_sourceplot(cfg,sourceNAIInt); >>>> >>>> % Transform coordinate back to uninterpolated source??? >>>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>>> >>>> >>>> % Plot uninterpolated source with position aquired from interpolated >>>> source >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = dpos; % unfortunately this coordinate >>>> is >>>> obviously wrong!!! WHY? >>>> figure; >>>> ft_sourceplot(cfg,sourceNAI); >>>> >>>> >>>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>>> >>>> Any ideas??? >>>> >>>> Cornelius >>>> >>>> >>>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> _______________________________________________ >> 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 >> > > > > _______________________________________________ > 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 > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 14 07:48:43 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 14 Mar 2014 07:48:43 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Message-ID: <5322A64B.1000603@gmail.com> Hi Erick, I already wrote a FAQ yesterday: http://fieldtrip.fcdonders.nl/faq/how_can_i_map_source_locations_between_two_different_representations Probably not as good as you or JM would have written it though (I'm no specialist), so please feel free to improve it! :) Thanks for all the feedback, Vitória On 3/14/2014 2:05 AM, Erick Ortiz wrote: > Thanks for shedding light on the issue, JM: I tested your suggestion > and it worked brilliantly, far faster and more elegant than the script > I wrote years ago. (in my defense, it was only run a couple of times, > to label our standard grids...) > > The old mni2tal question creeps again into the discussion. I would > like to use the AFNI atlas, but the conversion introduces too much > distortion. For the others (AAL, SPM17/18, Brainweb), all is fine. See > attached figure comparing AFNI (blue) with Brainweb grey_matter (red). > > I might get around to add this to the FAQ next week. :-) > > Vitória, there is a number of other atlases you can use instead of > AFNI then. Either from the link below or any MNI-aligned template, > using JM's procedure now it takes 3 seconds to re-label your grid. > http://fieldtrip.fcdonders.nl/template/atlas > > Best, > Erick > > > > On Thu, Mar 13, 2014 at 1:00 PM, jan-mathijs schoffelen > > > wrote: > > Hi Vitória, Erick, Cornelius et al, > > Allow me to chime in to this Brazilio-German interaction ;-). > It seems to me that the discussion consists of a few separable > elements. > > -The first one pertains to the specific question how to map source > locations between two different representations (source with pos > versus volumetric MRI-type image with a transform). > -The other one relates to some atlas related business, i.e. > mapping locations that have a specific anatomical label to > specific MEG source space locations. > -And then there's a third one, which is important for 2, and > pertains to the usual complicated stuff of mapping between > different coordinate systems. > > There are several ways to achieve what Vitória is looking for, and > I think that Erick already solved it, but recent changes in > FieldTrip make it quite straightforward. > > So here goes my recipe: > 1 I would go along with Erick to do my beamformer source > reconstruction on a subject-specific grid, which is inverse-warped > from a regular grid defined on the MNI-template. > 2 If we take this template grid, which can be found in > ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of > your choice onto this sourcemodel, using ft_sourceinterpolate. > Reading in of the atlas nowadays indeed should be done with > ft_read_atlas (ft_prepare_atlas will be deprecated soon), and my > personal taste would be NOT to use the afni atlas, because this > one is defined in Talairach space, which is slightly different > from MNI-space, and although FT accounts for the differences I am > not sure how accurate this is. Anyway, one could do something like > atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), load the > template sourcemodel with the resolution you need (i.e. the > resolution you used in your beamformer grid), and call > ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; > cfg.parameter = 'tissue'; sourcemodel2 = > ft_sourceinterpolate(cfg,atlas,sourcemodel); % NOTE: ensure that > the units are consistent in atlas and sourcemodel, if not use > ft_convert_units > 3 Step 2 should have given you sourcemodel2 with a field 'tissue', > that represents the anatomical labels, according to the > corresponding atlas. Atlas.tissuelabel gives the labels that > correspond to the numbers in the tissue field. > 4 Then, without the need to call ft_sourceinterpolate, nor > ft_volumenormalise on your source-reconstructed data, you can do > indx = find(sourcemodel2.tissue==x), where x is the number of your > choice, and you directly get the indices of the source positions > in your 'source' variable, that have this particular anatomical label. > 5 Then, you can do whatever you like with it, e.g. take a max or > mean or whatever... > > I hope I was clear enough, and that someone feels inclined to make > this into a FAQ on the FieldTrip wiki ;-). > > Best wishes, > Jan-Mathijs > > > > On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > >> Dear Erick, >> >> "simply label and/or define my ROI in the MNI grid. When I warp >> to the individuals, everything is in place without a hitch" -> >> that sounds like a good thing to do. >> Is this a very complicated thing to do? Would you mind sharing a >> piece of code or some tips for how I could achieve it? >> >> Thanks once more, Vitória >> >> On 3/12/2014 11:37 AM, Erick Ortiz wrote: >>> Dear Vitoria, >>> >>> What I do usually, is to simply label and/or define my ROI in >>> the MNI grid. When I warp to the individuals, everything is in >>> place without a hitch. >>> >>> About the interpolation, I cannot help much more. I have been >>> using my own tools for years, and I was not following the >>> support of atlases in Fieldtrip.I tried it today, but had issues >>> with coordinate system labeling when defining a ROI (I updated >>> to the latest version by SVN): >>> >>> afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.interactive = 'yes'; >>> cfg.funparameter = 'coh'; >>> cfg.atlas = afni; >>> cfg.coordsys = 'mni'; >>> % cfg.roi = 'Middle Temporal Gyrus'; >>> % cfg.inputcoord = 'tal'; >>> ft_sourceplot(cfg, interp); >>> >>> Also note that I had to use ft_read_atlas, because >>> ft_prepare_atlas does not generate the brick0label/brick1label >>> fields. >>> >>> It works well, but if I try to define a ROI (uncommenting the >>> two lines), I get the error "The field cfg.inputcoord is >>> required". There seems to be some confusion between inputcoord >>> and coordsys. >>> >>> It can be because I was doing something wrong: maybe a Fieldtrip >>> developer could comment on that? >>> >>> Best, >>> Erick >>> >>> >>> >>> On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai >>> > >>> wrote: >>> >>> Dear Erick, >>> >>> Thanks for your detailed reply. >>> I've been using individual MNI-warped grids (point 4 below) >>> and I'm always using ft_convert_unit so those points are >>> alright in my data. >>> >>> The reason why I do need to interpolate (at least, I think I >>> need), is because I'm looking for max 'pow' in anatomically >>> defined regions given the afni atlas. I managed to get it to >>> work by interpolating to the mri and looking for max 'pow' >>> given a label (e.g., 'Middle Temporal Gyrus') using >>> ft_volumelookup. >>> Do you have any experience with this approach (searching >>> within anatomical labels) without having to interpolate? >>> >>> Thanks once more, Vitória >>> >>> >>> >>> >>> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >>>> Dear Vitória and Cornelius, >>>> >>>> this is a common problem, and maybe it would be good to >>>> clarify the strategies that can be used here. I hope this >>>> can help others in a similar situation, which I have found >>>> many times. >>>> >>>> 1) You are trying to convert voxel indexes to head (CTF) >>>> coordinates. In this case, there are two mistakes in the code: >>>> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), >>>> posInt, 'homogeneous' ); >>>> ... should be done with sourceNAIInt, not mri. The >>>> transforms are different, in general; e.g. note the >>>> downsample=2. >>>> 1b) use cfg.locationcoordinates = 'head', as commented by >>>> JM in a previous post. Or remove this line, since 'head' is >>>> the default. >>>> >>>> 2) But if you are working with the same subject/grid, there >>>> is no need for interpolation at all. Simply find the grid >>>> position with highest 'pow' and take its position. >>>> [dummy,ind] = max(source.avg.pow); >>>> pos = source.pos(ind,:); >>>> >>>> 3) However, this is not possible when using different >>>> grids, e.g. in a grand average in MNI coordinates. Find the >>>> peak ('pos') in the interpolated volume, as in Cornelius' >>>> code, then find the index of the nearest grid position for >>>> a common (again, MNI) grid. This is also in JM's message. >>>> >>>> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >>>> [dummy,ind] = min(sum(dpos.^2,2)); >>>> >>>> 4) What I have been using, and strongly recommend, is an >>>> MNI grid warped to the subject's anatomy, according to this >>>> procedure: >>>> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >>>> >>>> This would give you both the benefits of working in MNI >>>> coordinates, and the ease of having a common grid across >>>> subjects (for instance, enabling solution #2). Still, some >>>> projects do call for one of the other options. >>>> >>>> Just a couple of details: >>>> - Pay utmost attention to coordinate systems and units. For >>>> instance, it is common to confuse unlabeled cm for mm, and >>>> either of these with voxels. Try to also label all >>>> structures as CTF or SPM (MNI). >>>> - Using pinv instead of inv is usually a good idea. Here, >>>> it is a not an issue, but matrix inversion in MATLAB can >>>> lead to a world of hurt to the unwary. >>>> >>>> Best, >>>> Erick >>>> >>>> >>>> >>>> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai >>>> >>> > wrote: >>>> >>>> Dear FT-ers, >>>> >>>> I found an old posting to the mailing list (see below) >>>> that never got answered so my question still holds: >>>> given a location I found in the interpolated source, >>>> how do I find back the same location in .pos of the >>>> non-interpolated data? >>>> I can try and go around it by finding the corresponding >>>> MNI coordinates in the interpolated data (which by now >>>> I have to do by hand, so not optimal anyways), and then >>>> look for those coordinates in .pos. But I was >>>> wondering, like Cornelius was in his post, whether >>>> there is a neater way to get this information. >>>> >>>> Thanks a lot for the help, >>>> Vitória >>>> >>>> >>>> >>>>>>>>>>>>>> >>>> >>>> Hi mailing list, >>>> >>>> I'm still struggling with the conversion of >>>> coordinates between source and >>>> interpolated source space. >>>> For example, if i have the position of a single >>>> grid point how do i get the >>>> corresponding voxel in the interpolated source >>>> structure. Or the other way >>>> around, how to get the grid point which corresponds >>>> to a voxel (e.g the max >>>> voxel) in the interpolated source structure. >>>> >>>> I think this should be a common problem when >>>> working with virtual >>>> electrodes, shouldn't it? >>>> >>>> To make things easier i put together a example with >>>> the data from the >>>> source tutorial where i tried to calculated the >>>> grid pos of the max voxel >>>> in the interpolated source. >>>> >>>> clear all; >>>> load sourcePost_nocon; % source structure from tutorial >>>> mri = ft_read_mri('Subject01.mri'); % mri of >>>> subject01 from tutorial >>>> >>>> sourceNAI = sourcePost_nocon; >>>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>>> sourcePost_nocon.avg.noise; >>>> sourceNAI=rmfield(sourceNAI,'freq'); % had to >>>> remove that to let >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI >>>> , mri); >>>> >>>> % Find position of max activity >>>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>>> posInt=[xi, yi, zi]; >>>> >>>> % Plot interpolated source with position of max >>>> activity >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = posInt; % location of max >>>> activity is marked >>>> correctly. >>>> figure; >>>> ft_sourceplot(cfg,sourceNAIInt); >>>> >>>> % Transform coordinate back to uninterpolated source??? >>>> dpos = warp_apply(inv(mri.transform), posInt, >>>> 'homogeneous'); >>>> >>>> >>>> % Plot uninterpolated source with position aquired >>>> from interpolated source >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = dpos; % unfortunately >>>> this coordinate is >>>> obviously wrong!!! WHY? >>>> figure; >>>> ft_sourceplot(cfg,sourceNAI); >>>> >>>> >>>> Unfortunately the solution of Jan Mathijs did not >>>> work, nor did mine :( >>>> >>>> Any ideas??? >>>> >>>> Cornelius >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > 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 erick.ortiz at med.uni-tuebingen.de Fri Mar 14 08:57:28 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Fri, 14 Mar 2014 08:57:28 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <5322A64B.1000603@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> <5322A64B.1000603@gmail.com> Message-ID: A final note: Sorry, my ad-blocker prevented me from including the picture yesterday. Here it is. Caption: Comparing grey matter tagging using atlases AFNI (all labels; blue) and Brainweb (tissue grey_matter; red). Note how the AFNI version does not fill the VCM completely, probably due to TAL to MNI transformation issues. [image: Inline image 1] Vitória, if you would like, this could be included in the FAQ to illustrate JM's comment. Best, Erick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: atlas_afni_brainweb_sourcespace.png Type: image/png Size: 480741 bytes Desc: not available URL: From virginie.van.wassenhove at gmail.com Fri Mar 14 09:39:44 2014 From: virginie.van.wassenhove at gmail.com (Virginie van Wassenhove) Date: Fri, 14 Mar 2014 09:39:44 +0100 Subject: [FieldTrip] postdoctoral position @ NeuroSpin Message-ID: Please follow the link! http://www.inria.fr/en/institute/recruitment/offers/post -doctoral-research-fellowships/post -doctoral-research-fellowships/campaign-2014/(view)/details.html?id=PNGFK026203F3VBQB6G68LOE1&ContractType=4546&LG=EN&Resultsperpage=20&nPostingID=8498&nPostingTargetID=14266&option=52&sort=DESC&nDepartmentID=19 Best, -Virginie -- Virginie van Wassenhove Exec Dir NeuroSpin MEG Group leader, Brain Dynamics CEA.DSV.I2BM.NeuroSpin - INSERM Cognitive Neuroimaging Unit Bât 145 Point Courrier 156 Gif s/ Yvette F-91191 FRANCE +33(0)1.69.08.1667 Virginie.van.Wassenhove at gmail.com https://sites.google.com/site/virginievanwassenhove/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Fri Mar 14 11:47:44 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 11:47:44 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Hi all, I've been trying to append data from two datasets that were read in and segmented into trials separately. Whenever I do so all events get mixed up, i.e., eventvalues that were not specified for ft_definetrial (and ft_redefinetrial) show up in the databrowser and the original events of interest are not aligned to 0 anymore. The warning I get is "input data comes from different datafiles; removing sampleinfo field". Is there another way to combine data from different recordings? I use Vision Recorder and subjects need to take a break during the experiment, which is why I end up with two datasets in the first place. I figured that combining the datasets before defining trials would be more efficient anyway but then I don't know how to read in all events (since ft_definetrial requires one dataset). Thanks in advance! Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Fri Mar 14 12:08:21 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 14 Mar 2014 07:08:21 -0400 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> References: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Message-ID: Hi Phyllis, I believe a trial function (see ft_trialfun_general) will solve your problem. The concatenated datasets will still lose their sampleinfo field, but the trialinfo field will retain the proper offsets, triggers, etc. as long as you put them in your trial function. Best, Raquel > On Mar 14, 2014, at 6:47 AM, "Phyllis Mania" wrote: > > Hi all, > > I’ve been trying to append data from two datasets that were read in and segmented into trials separately. > Whenever I do so all events get mixed up, i.e., eventvalues that were not specified for ft_definetrial (and ft_redefinetrial) show up in the databrowser and the original events of interest are not aligned to 0 anymore. > The warning I get is “input data comes from different datafiles; removing sampleinfo field”. > > Is there another way to combine data from different recordings? I use Vision Recorder and subjects need to take a break during the experiment, which is why I end up with two datasets in the first place. > > I figured that combining the datasets before defining trials would be more efficient anyway but then I don’t know how to read in all events (since ft_definetrial requires one dataset). > > Thanks in advance! > Phyllis > > > _______________________________________________ > 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 Fri Mar 14 12:03:52 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 14 Mar 2014 12:03:52 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> References: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Message-ID: Hi Phyllis, The way I would approach this is to segment the data for both data files separately, making sure that all relevant information is stored in the .trialinfo field. If you write your own trialfun, then any information you store in the 4th and upward column of the trl matrix will end up in data.trialinfo when doing ft_definetrial and ft_preprocessing. Then you can simply use ft_appenddata to append the data sets and all should be fine. Even though the events are removed (which they must be, as their time stamps are coded in terms of samples from the onset of recording), you still have the information in trialinfo. Would that work? Best, Eelke On 14 March 2014 11:47, Phyllis Mania wrote: > Hi all, > > > > I've been trying to append data from two datasets that were read in and > segmented into trials separately. > > Whenever I do so all events get mixed up, i.e., eventvalues that were not > specified for ft_definetrial (and ft_redefinetrial) show up in the > databrowser and the original events of interest are not aligned to 0 > anymore. > > The warning I get is "input data comes from different datafiles; removing > sampleinfo field". > > > > Is there another way to combine data from different recordings? I use Vision > Recorder and subjects need to take a break during the experiment, which is > why I end up with two datasets in the first place. > > > > I figured that combining the datasets before defining trials would be more > efficient anyway but then I don't know how to read in all events (since > ft_definetrial requires one dataset). > > > > Thanks in advance! > > Phyllis > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From juriguen at gmail.com Fri Mar 14 12:23:22 2014 From: juriguen at gmail.com (=?ISO-8859-1?Q?Jose_Antonio_Urig=FCen?=) Date: Fri, 14 Mar 2014 12:23:22 +0100 Subject: [FieldTrip] Solution to the EEG forward problem Message-ID: Dear all This may be simple to answer, since I am quite new to the area and keep struggling with the tutorials at the main website. So here we go: I want to use Fieltrip in Matlab (Windows) to: 1. Compute the leadfield at a set of electrodes positioned in the scalp based on a BEM model of the head (something along the line of http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg plus correct use of the ft_prepare_leadfield function) So, what is confusing me is that say I have a head model / volume and the set of electrodes (result of following http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg ), then if I do *pos = [0 0 0.5];* *cfg = [];* *cfg.grid.pos = pos;* *gridp = ft_prepare_sourcemodel(cfg, vol, elec_aligned);* *cfg = [];* *cfg.vol = vol;* *cfg.elec = elec_aligned;* *cfg.grid = gridp;* *grid = ft_prepare_leadfield(cfg);* *lf_openmeeg = grid.leadfield{1};* I get the leadfield at the electrode locations. However, how do I get the actual potential at the electrodes if, say, I have dipole magnitudes and moments. Is the solution simply V = *lf_openmeeg * (magnitudes * moments)* *??* 2. Can I use Fieltrip to obtain a set of simulated EEG channels with brain rhythms? I was thinking of using available waveforms from the internet of intracraneal recordings as one of the inputs, however I woudl still need dipole positions / orientations (moments). Any ideas how to do this? Thanks in advance Toni -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Fri Mar 14 13:03:13 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 13:03:13 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> Dear Eelke, Thanks for the quick response! What you're suggesting is exactly what I'm doing and the trialinfo for both the single and the appended dataset look the way they should. However, when looking at the databrowser, I see data from the beginning of the recording onwards, only with markers after a few trials (and then not aligned). The single datasets look fine in the databrowser, though. Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Mar 14 13:17:42 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 14 Mar 2014 13:17:42 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> References: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> Message-ID: Hi Phyllis, Hmm I'm not sure if I understand the problem exactly, but one thing comes to mind, namely that the input into databrowser is not entirely correct. You should not be seeing any markers anymore actually, after appended data. How are you calling ft_databrowser? For segmented data in memory (as is the case here), you should call it like so: cfg = []; cfg.continuous = 'no'; ft_databrowser(cfg, data); Is that how you are using it? If it is, and the problem is still there, then could you try doing data = rmfield(data, 'cfg') before calling ft_databrowser? (This will strip any event structures possibly still present in the cfg.previous-tree.) Best, Eelke On 14 March 2014 13:03, Phyllis Mania wrote: > Dear Eelke, > > > > Thanks for the quick response! What you're suggesting is exactly what I'm > doing and the trialinfo for both the single and the appended dataset look > the way they should. However, when looking at the databrowser, I see data > from the beginning of the recording onwards, only with markers after a few > trials (and then not aligned). The single datasets look fine in the > databrowser, though. > > > > Cheers, > Phyllis > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From phyllis.mania at uni-hamburg.de Fri Mar 14 13:52:43 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 13:52:43 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> Dear Eelke, Calling 'rmfield' helped, thank you! Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Mar 14 14:11:02 2014 From: jm.horschig at donders.ru.nl (=?windows-1252?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 14 Mar 2014 14:11:02 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> References: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> Message-ID: <5322FFE6.7000902@donders.ru.nl> Heyho, yes, I think the databrowser digs deep down in data.cfg to obtain the original event-matrix of your dataset. After the sampleinfo-field is reconstructed, the databrowser tries to relate the sampleinfo field with the original event-structure. As the two have nothing in common anymore, the output will of course be nonsense. Removing the cfg is imho the only option to prvent the databrowser from doing so. But this is clearly something that the databrowser should not do, because we want a smart databrowser, not a stupid one ;) Phyllis, could you be so kind to open up a bug on bugzilla.fcdonders.nl about this? Just shortly describe what you are doing in terms of code and describing the error would be sufficient. We will then take care that this get's solved in future versions. If you have questions about bugzilla or if you do not want to post the bug there, please let me/us know. But we'd appreciate if you could open up a bug :) Thanks in any case for your message! Best, Jörn On 3/14/2014 1:52 PM, Phyllis Mania wrote: > > Dear Eelke, > > Calling ‘rmfield’ helped, thank you! > > Cheers, > > Phyllis > > > > _______________________________________________ > 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 virginie.van.wassenhove at gmail.com Fri Mar 14 21:10:57 2014 From: virginie.van.wassenhove at gmail.com (Virginie van Wassenhove) Date: Fri, 14 Mar 2014 21:10:57 +0100 Subject: [FieldTrip] additional info Message-ID: It appears the link previously posted is dysfunctional. Additional information about the project can be found here: https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxwaGlsaXBwZWNpdWNpdXxneDoxYTI3MGUyZjMzMTg0Y2Uy All the best, -Virginie -- Virginie van Wassenhove Exec Dir NeuroSpin MEG Group leader, Brain Dynamics CEA.DSV.I2BM.NeuroSpin - INSERM Cognitive Neuroimaging Unit Bât 145 Point Courrier 156 Gif s/ Yvette F-91191 FRANCE +33(0)1.69.08.1667 Virginie.van.Wassenhove at gmail.com https://sites.google.com/site/virginievanwassenhove/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Mon Mar 17 01:20:45 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Mon, 17 Mar 2014 00:20:45 +0000 Subject: [FieldTrip] MNE covariance window and ft_plot_mesh error Message-ID: <53263FDD.1060205@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Mar 17 01:21:23 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 17 Mar 2014 00:21:23 +0000 Subject: [FieldTrip] using eeglab's ICA data with beamformer Message-ID: Hello fieldtrip, I am new to the fieltrip toolbox and Ive come from eeglab to do some beamformer and connectivity processing. Ive used the function eeglab2fieldtrip, with one of the arguments being 'componentanalysis'. I tried using the data in the beamformer tutorial and everything worked fine until I got to the ft_sourceanalysis script where it used the channel labels and positions from the original non-ICAed data. So the code crashed because the ICA labels and channels labels didnt match. I was wondering whether beamformer can be used with ICs from eeglab, and if so, where I am going wrong. We also want to do functional connectivity as I mentioned, which requires a beamformer that operates in the time domain as opposed to the frequency domain. However, there arent any tutorials on the Constrained Minimum Variance (LCMV) beamformer (which I think works in the time domain), so I am trying to make do with the one used in the tutorial. Any help will be greatly appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Mar 17 12:34:51 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 17 Mar 2014 11:34:51 +0000 Subject: [FieldTrip] using eeglab's ICA data with beamformer In-Reply-To: References: Message-ID: Dear Tyler, Beamforming is one type of inverse method and it requires the sensor data covariance matrix. It also assumes that underlying sources are uncorrelated. If you try to input data from only 1 IC, all the sensors will covary together and any underlying sources that contribute to this 1 IC will be 100% temporally correlated. You can apply beamforming to a mixture of ICs, mixed back from the 'component space' back to the 'sensor space' (see ft_rejectcomponent). This is often done for example by excluding a few components which are artefactual and keeping many remaining (presumably brain) components. Normally the 'rank' of your covariance matrix is equal to the number of sensors (rank is the number of independent rows or columns, i.e. contributions), and so by removing a few ICs from the data, you have reduced the rank. If your rank is reduced relative to number of sensors, then you should use the regularisation option (cfg.lambda). This is true for either LCMV or DICS. However, this is usually only done when the rank is still well above 1. However, if you wish to localise the underlying sources of just 1 (or a small number of mixed) ICs, then better to use a min-norm method which does not depend on the sensor covariance. In this case, you still must re-project the IC back to sensor space in FieldTrip for the labels of the data to match the labels of the leadfield. See also: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors (<- LCMV) Hope this helps; please ask again if you need further clarification, or please give a specific error message. Cheers, Johanna 2014-03-17 0:21 GMT+00:00 Tyler Grummett : > Hello fieldtrip, > > > I am new to the fieltrip toolbox and Ive come from eeglab to do some > beamformer and connectivity processing. > > > Ive used the function eeglab2fieldtrip, with one of the arguments being > 'componentanalysis'. I tried using the data in the beamformer tutorial and > everything worked fine > > until I got to the ft_sourceanalysis script where it used the channel > labels and positions from the original non-ICAed data. So the code crashed > because the ICA labels > > and channels labels didnt match. > > > I was wondering whether beamformer can be used with ICs from eeglab, and > if so, where I am going wrong. > > > We also want to do functional connectivity as I mentioned, which > requires a beamformer that operates in the time domain as opposed to the > frequency domain. > > > However, there arent any tutorials on the Constrained Minimum Variance > (LCMV) beamformer (which I think works in the time domain), so I am > trying to make do with the one used in the tutorial. > > > Any help will be greatly appreciated. > > > Tyler. > > > ************************* > > *Tyler Grummett ( BBSc, BSc(Hons I))* > *PhD Candidate* > *Brain Signals Laboratory* > *Flinders University* > *Rm 5A301* > *Ext 66124* > > _______________________________________________ > 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 yturbidesw at wit.edu Mon Mar 17 13:28:07 2014 From: yturbidesw at wit.edu (Yturbides, Walker) Date: Mon, 17 Mar 2014 12:28:07 +0000 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset Message-ID: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> Hello FieldTrip Users, I am new to the FieldTrip toolbox and I have a background in Electronics Engineering. I recently bought an EEG Neuroheadset and want to control a wheelchair with it for my senior design project. There is so much that is possible using FieldTrip that I do not know where to start. Can someone help me get started, or perhaps have any suggestions? Also, I am trying to read the raw EEG signals from the Emotiv headset into MATLAB. Does anyone have any information that would help me? Any suggestions are very much appreciated. Thank You, Walker -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 17 13:57:33 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 17 Mar 2014 13:57:33 +0100 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> Message-ID: <5326F13D.6080302@donders.ru.nl> Hi Walker, where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: http://fieldtrip.fcdonders.nl/tutorial You could start with the preprocessing tutorials and see how you can adapt them to what you want. And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': http://fieldtrip.fcdonders.nl/?do=search&id=emotiv But better start in the beginning instead of skipping important steps ;) Best, Jörn On 3/17/2014 1:28 PM, Yturbides, Walker wrote: > > Hello FieldTrip Users, > > I am new to the FieldTrip toolbox and I have a background in > Electronics Engineering. I recently bought an EEG Neuroheadset and > want to control a wheelchair with it for my senior design project. > There is so much that is possible using FieldTrip that I do not know > where to start. Can someone help me get started, or perhaps have any > suggestions? Also, I am trying to read the raw EEG signals from the > Emotiv headset into MATLAB. Does anyone have any information that > would help me? > > Any suggestions are very much appreciated. > > Thank You, > > Walker > > > > _______________________________________________ > 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 yturbidesw at wit.edu Mon Mar 17 14:11:15 2014 From: yturbidesw at wit.edu (Yturbides, Walker) Date: Mon, 17 Mar 2014 13:11:15 +0000 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <5326F13D.6080302@donders.ru.nl> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> <5326F13D.6080302@donders.ru.nl> Message-ID: <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> Hi Jörn, Thank you for your response. I am currently trying to use the applications that FieldTrip offers such as 'Emotiv2ft.exe' and the 'demo_buffer.exe' and when I try to plot the signals in real time, I am not able to. I just need to be able to import all the raw EEG signals into Matlab for now. Once I have the real-time signals in Matlab I will be processing them but as of right now that is where I am stuck at. Would you have any suggestions on how to import the signals so I am able to process them in real-time or as close as possible? Thank You, Walker -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of "Jörn M. Horschig" Sent: Monday, March 17, 2014 8:58 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset Hi Walker, where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: http://fieldtrip.fcdonders.nl/tutorial You could start with the preprocessing tutorials and see how you can adapt them to what you want. And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': http://fieldtrip.fcdonders.nl/?do=search&id=emotiv But better start in the beginning instead of skipping important steps ;) Best, Jörn On 3/17/2014 1:28 PM, Yturbides, Walker wrote: > > Hello FieldTrip Users, > > I am new to the FieldTrip toolbox and I have a background in > Electronics Engineering. I recently bought an EEG Neuroheadset and > want to control a wheelchair with it for my senior design project. > There is so much that is possible using FieldTrip that I do not know > where to start. Can someone help me get started, or perhaps have any > suggestions? Also, I am trying to read the raw EEG signals from the > Emotiv headset into MATLAB. Does anyone have any information that > would help me? > > Any suggestions are very much appreciated. > > Thank You, > > Walker > > > > _______________________________________________ > 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 -------------- A non-text attachment was scrubbed... Name: error_with_demo_buffer.PNG Type: image/png Size: 36644 bytes Desc: error_with_demo_buffer.PNG URL: From jm.horschig at donders.ru.nl Mon Mar 17 14:19:47 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 17 Mar 2014 14:19:47 +0100 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> <5326F13D.6080302@donders.ru.nl> <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> Message-ID: <5326F673.5030308@donders.ru.nl> Hi Walker, you could start here: http://fieldtrip.fcdonders.nl/faq/how_should_i_get_started_with_the_fieldtrip_realtime_buffer and then search for related pages on the wiki-page. This should get you started on how to read in the data. Additionally, there are example scripts coming with FieldTrip, i think in the realtime folder. That should point you to how to read in data ;) Best, Jörn On 3/17/2014 2:11 PM, Yturbides, Walker wrote: > Hi Jörn, > > Thank you for your response. I am currently trying to use the applications that FieldTrip offers such as 'Emotiv2ft.exe' and the 'demo_buffer.exe' and when I try to plot the signals in real time, I am not able to. I just need to be able to import all the raw EEG signals into Matlab for now. Once I have the real-time signals in Matlab I will be processing them but as of right now that is where I am stuck at. Would you have any suggestions on how to import the signals so I am able to process them in real-time or as close as possible? > > Thank You, > Walker > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of "Jörn M. Horschig" > Sent: Monday, March 17, 2014 8:58 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset > > Hi Walker, > > where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough > This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. > I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: > http://fieldtrip.fcdonders.nl/tutorial > > You could start with the preprocessing tutorials and see how you can adapt them to what you want. > And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': > http://fieldtrip.fcdonders.nl/?do=search&id=emotiv > > But better start in the beginning instead of skipping important steps ;) > > Best, > Jörn > > > On 3/17/2014 1:28 PM, Yturbides, Walker wrote: >> Hello FieldTrip Users, >> >> I am new to the FieldTrip toolbox and I have a background in >> Electronics Engineering. I recently bought an EEG Neuroheadset and >> want to control a wheelchair with it for my senior design project. >> There is so much that is possible using FieldTrip that I do not know >> where to start. Can someone help me get started, or perhaps have any >> suggestions? Also, I am trying to read the raw EEG signals from the >> Emotiv headset into MATLAB. Does anyone have any information that >> would help me? >> >> Any suggestions are very much appreciated. >> >> Thank You, >> >> Walker >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 l.verhagen at fcdonders.ru.nl Mon Mar 17 17:40:07 2014 From: l.verhagen at fcdonders.ru.nl (Lennart Verhagen) Date: Mon, 17 Mar 2014 16:40:07 +0000 Subject: [FieldTrip] comparing EEG systems for EEG-TMS and EEG-MRI Message-ID: <8EFA9DC0-5160-4F9E-8CD4-87246F88E602@fcdonders.ru.nl> Dear all, We are planning to acquire an EEG system for concurrent EEG-TMS and/or EEG-MRI. I would be very interested to hear form someone with hands-on experience in these conditions with NeuroScan and/or BrainProducts systems (and perhaps other competitors). What is your opinion about the data quality of these systems? Don’t worry, I’m not looking for a lengthy detailed review, any brief comment would be appreciated :) Thanks! Cheers, Lennart From damingwang.tongji at gmail.com Tue Mar 18 03:11:11 2014 From: damingwang.tongji at gmail.com (=?GB2312?B?zfW088P3?=) Date: Tue, 18 Mar 2014 10:11:11 +0800 Subject: [FieldTrip] Is fieldtrip software suitable for processing computational simulation data Message-ID: Dear friends: I am student from China and currently very interested in your software of fieldtrip. There is a question puzzling me: If I use integrate-and-fire or other neural models to simulate and get spike and LFP(local field potential) data, is fieldtrip still suitable for processing these data? And the main part which I concern mostly is spike and LFP data analysis. Your reply and help will be sincerely appreciated! Thank you! Best Wishes Daming Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Mar 18 12:25:21 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 18 Mar 2014 12:25:21 +0100 Subject: [FieldTrip] deleting bad channels Message-ID: Hi! I have a bad channel that I would like to delete from the data using Fieldtrip, however, I'm not sure how the commands work for deleting bad channels. Would appreciate if someone could help me on this. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Mar 18 12:33:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Mar 2014 12:33:08 +0100 Subject: [FieldTrip] deleting bad channels In-Reply-To: References: Message-ID: Hi Hweeling, Try: cfg = []; cfg.channel = {'MEG' '-MLO12'}; data = ft_selectdata(cfg, data); to remove channel MLO12 from the data, but keep all other MEG channels (adapt to whatever you need). Note that you can also use this channel syntax in many other functions directly, like ft_freqanalysis or ft_timelockanalysis. Best, Eelke On 18 March 2014 12:25, Hwee Ling Lee wrote: > Hi! > > I have a bad channel that I would like to delete from the data using > Fieldtrip, however, I'm not sure how the commands work for deleting bad > channels. > > Would appreciate if someone could help me on this. > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From vasenka at gmail.com Tue Mar 18 19:02:47 2014 From: vasenka at gmail.com (Vasily Vakorin) Date: Tue, 18 Mar 2014 14:02:47 -0400 Subject: [FieldTrip] read write MarkerFile.mrk file Message-ID: I am trying to modify file MarkerFile.mrk, using function readmarkerfile.m and writeMarkerFile.m. Function readmarkerfile.m create a structure with four fields: number_markers, number_samples, marker_names, trial_times. However, function writeMarkerFile.m requires another field: ClassGroupId (only 0 and 3 are allowed). Any suggestions on how to create the "right" structure for writeMarkerFile.m ? Thank you, Vasily -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at gmail.com Wed Mar 19 08:42:00 2014 From: michelic72 at gmail.com (Cristiano Micheli) Date: Wed, 19 Mar 2014 03:42:00 -0400 Subject: [FieldTrip] read write MarkerFile.mrk file In-Reply-To: References: Message-ID: Dear Vasily I bumped into this site after a quick internet search: https://w3.rcc.uchicago.edu/redmine/projects/cacioppo/repository/annotate/spm8_dev/external/ctf/readCTFds.m A function's header therein referes to a CTF reference document, named PN900-0088: "This format is rigid and readMarkerFile assumes that the MarkerFile has the format current in October 2006. The document lists 4 Class Groups, but only CLASSGROUPID=0 (triggers) and CLASSGROUPID=3 (Manual) are actually used. read_MArkerFile reads only these two groups, but it prints a message if the other groups are encountered. Trigger markers (CLASSGROUPID=0) have an additional 4 pieces of information supplied: BITNUMBER(int), POLARITY(+ or 1),SOURCE(text) and THRESHOLD (float). FOr CLASSGROUPID=3, these fields are left empty." I hope this helps Cristiano On Tue, Mar 18, 2014 at 2:02 PM, Vasily Vakorin wrote: > I am trying to modify file MarkerFile.mrk, using function readmarkerfile.m > and writeMarkerFile.m. > > Function readmarkerfile.m create a structure with four fields: > number_markers, number_samples, marker_names, trial_times. > > However, function writeMarkerFile.m requires another field: ClassGroupId > (only 0 and 3 are allowed). > > Any suggestions on how to create the "right" structure for > writeMarkerFile.m ? > > Thank you, > Vasily > > _______________________________________________ > 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 mbj0310 at gmail.com Wed Mar 19 11:10:08 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Wed, 19 Mar 2014 19:10:08 +0900 Subject: [FieldTrip] ft_freqstatistics for between subject design Message-ID: Hello trippers. I am trying to do* t-test* with *the power* derived from frequency analysis of two different groups. The first group has 36 subjects, and the second group has 28 subjects. I did the ft_freqanalysis with the Morlet wavelet, and made the* induced power* of gamma band. After the plotting of the results, it looks like there might be a difference in the frequency range between [38 42], at the latency between [0.5 1] approximately. So, I made a script as below. cfg = []; cfg.channel = 'PZ'; % name of the electrode cfg.latency = [0.5 1]; cfg.trials = 'all'; cfg.frequency = [38 42]; cfg.avgoverchan = 'no'; cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'analytic'; cfg.statistic = 'indepsamplesT'; cfg.alpha = 0.05; cfg.design = [ones(1,36), ones(1,28)*2] ; % N x num of observations cfg.ivar = 1; stat = ft_freqstatistics(cfg, Induced_Ctrl_14{1:36}, Induced_CHR_14{1:28}); In terms of the structure of the result, there are five values in the stat, prob, mask and freq. I think that each 5 values correspond with the frequency data point. Is that script suitable for the test for the significance, especially avgovertime option 'yes'? If I change the avgovertime option to 'no', then can I found the p-values for each frequencies(5 values), and each time point(51 values), in total 255 values that could have multiple comparison issue? And I thought the 'mask' values of 0 indicates 'statistically non-significance'. Is that right? -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimparkinson at me.com Wed Mar 19 12:40:46 2014 From: jimparkinson at me.com (Jim Parkinson) Date: Wed, 19 Mar 2014 11:40:46 +0000 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics Message-ID: Hi. i have some TFR data which has been analysed over 1 : .5 : 30 Hz using ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions Right now I'd like to compare the two conditions using ft_freqstatistics but restrain the statistics to the freq range 1:10. so I've set cfg.frequency = [1 10] But, by the time the stats are running, the analysis is over the full range produced by ft_freqanalysis (1:30 Hz), and the output stats reflects this. Somewhere in ft_freqstatistics the cfg.frequency setting seems to be overridden. Is this a bug, am i doing something wrong, or have I misunderstood what cfg,frequency is supposed to be doing? thanks for any help! -- Dr Jim Parkinson, D.Phil j.m.parkinson at sussex.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Wed Mar 19 12:52:54 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Wed, 19 Mar 2014 12:52:54 +0100 (CET) Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics In-Reply-To: Message-ID: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> Hi Jim, Without seeing all the code you used it's hard to determine where exactly the problem is. NEvertheless, two things come to mind: (1) you need to specify the frequency of interest with "cfg.foi = 1:10". To be precise, it is also good to specify the numbers of steps you wish to calculate e.g., 1:1:10. please see here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis Alternatively, prior to calling ft_freqanalysis, you can use the function ft_selectdata(cfg,freqdata) to select the frequency band of interest. Hope this gets you started! Best, Nietzsche ----- Original Message ----- > From: "Jim Parkinson" > To: fieldtrip at science.ru.nl > Sent: Wednesday, 19 March, 2014 12:40:46 PM > Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics > Hi. > > > i have some TFR data which has been analysed over 1 : .5 : 30 Hz using > ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions > > > Right now I'd like to compare the two conditions using > ft_freqstatistics but restrain the statistics to the freq range 1:10. > so I've set > > > cfg.frequency = [1 10] > > > But, by the time the stats are running, the analysis is over the full > range produced by ft_freqanalysis (1:30 Hz), and the output stats > reflects this. Somewhere in ft_freqstatistics the cfg.frequency > setting seems to be overridden. Is this a bug, am i doing something > wrong, or have I misunderstood what cfg,frequency is supposed to be > doing? > > > thanks for any help! > > > -- > > > > Dr Jim Parkinson, D.Phil > > j.m.parkinson at sussex.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From jan.schoffelen at donders.ru.nl Wed Mar 19 12:57:41 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 12:57:41 +0100 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics In-Reply-To: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> References: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <8EF7ABC9-13A3-46D7-A2AA-9569764FF4AF@donders.ru.nl> Hi Jim and Nietzsche, Let me chime in here: Where Nietzsche typed 'ft_freqanalysis' one should read 'ft_freqstatistics' probably. Also, cfg.frequency as option into ft_freqstatistics should be a 2-element array, specifying the lower and upper bound, contrary to Nietzsche's advice. I just tried this quickly, and it works for me. Jim, are you using an up to date version of FieldTrip? Also, if the problem persists, could you provide is with example code/data for us to be able to reproduce your problem. We usually do this through our bugzilla system: bugzilla.fcdonders.nl Best, Jan-Mathijs On Mar 19, 2014, at 12:52 PM, Lam, Nietzsche wrote: > Hi Jim, > > Without seeing all the code you used it's hard to determine where exactly the problem is. > NEvertheless, two things come to mind: > > (1) you need to specify the frequency of interest with "cfg.foi = 1:10". > To be precise, it is also good to specify the numbers of steps you wish to calculate e.g., 1:1:10. > please see here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis > > Alternatively, prior to calling ft_freqanalysis, you can use the function ft_selectdata(cfg,freqdata) to select the frequency band of interest. > > Hope this gets you started! > > Best, > Nietzsche > > ----- Original Message ----- >> From: "Jim Parkinson" >> To: fieldtrip at science.ru.nl >> Sent: Wednesday, 19 March, 2014 12:40:46 PM >> Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics >> Hi. >> >> >> i have some TFR data which has been analysed over 1 : .5 : 30 Hz using >> ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions >> >> >> Right now I'd like to compare the two conditions using >> ft_freqstatistics but restrain the statistics to the freq range 1:10. >> so I've set >> >> >> cfg.frequency = [1 10] >> >> >> But, by the time the stats are running, the analysis is over the full >> range produced by ft_freqanalysis (1:30 Hz), and the output stats >> reflects this. Somewhere in ft_freqstatistics the cfg.frequency >> setting seems to be overridden. Is this a bug, am i doing something >> wrong, or have I misunderstood what cfg,frequency is supposed to be >> doing? >> >> >> thanks for any help! >> >> >> -- >> >> >> >> Dr Jim Parkinson, D.Phil >> >> j.m.parkinson at sussex.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimparkinson at me.com Wed Mar 19 13:50:28 2014 From: jimparkinson at me.com (Jim Parkinson) Date: Wed, 19 Mar 2014 12:50:28 +0000 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics Message-ID: Aah, please ignore my previous message; embarrassingly, I was doing a rush-job, messy code, and found I was in fact overwriting my OWN cfg.frequency field somewhere. schoolboy error, apologies -- Dr Jim Parkinson, D.Phil Postdoctoral Research Fellow Sackler Centre For Consciousness Science School of Psychology University of Sussex Brighton BN1 9QH jimparkinson at me.com j.m.parkinson at sussex.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.passaro at gmail.com Wed Mar 19 14:15:16 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 09:15:16 -0400 Subject: [FieldTrip] Linearly indexed data for mvar connectivity Message-ID: I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. Thank you, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.passaro at gmail.com Wed Mar 19 14:22:51 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 09:22:51 -0400 Subject: [FieldTrip] Speeding up Statistics using multiple cores Message-ID: I have seen this issue come up a few times on the list-serve, especially in regards to processing the statistics for large datasets (usually analyses with several dimensions and many subjects, trials, and/or channels/sources). Typically to run even 1000 iterations of a montecarlo simulation with a cluster correction to compare two large datasets takes a long time and often times, the computer doesn't have enough memory to perform the operation. One possible solution that we found takes advantage of multi-core computers such that the number of iterations are reduced to only 50 or 100 and the process is spread across cores simultaneously. In order to compute the statistical significance of a cluster, one only needs the distribution of cluster t-values across all iterations. That being the case, one can simply save the cluster t's across iterations and cores and then compute a significance value for each cluster based on this distribution. In our experience this tends to reduce the processing time by a factor of the number of cores available on a given computer. Perhaps this is something that can be implemented in a future release of Fieldtrip? -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 19 14:38:17 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 14:38:17 +0100 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Dear Tony, I don't think that these immediate plans exist. I wasn't aware of the fact that ft_freqanalysis_mvar does not swallow the linearly indexed combinations. We may want to look into that. Could you post a bug on bugzilla for this? The fact that it is not supported for dtf and pdc actually has a reason, which is related to the fact that these measures are normalized with respect to the total inflow/outflow for a given channel, where the MVAR-model explicitly should be based on the multivariate decomposition (i.e. where multi means all channels included). The functionality of ft_mvaranalysis with cfg.channelcmb fits a separate mvar-model for each channel pair. Does this make sense? Best wishes, Jan-Mathijs On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. > > Thank you, > -Tony > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From bingshuo.li at student.uni-tuebingen.de Wed Mar 19 14:53:45 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Wed, 19 Mar 2014 14:53:45 +0100 Subject: [FieldTrip] Is fieldtrip software suitable for processing computational simulation data In-Reply-To: References: Message-ID: Dear Mr. Wang, I don't see the reason why you cannot use FieldTrip to analyze those data. Quantitatively, the simulation generated data you have should not be different than real (i.e. recorded) data. In our lab, we use FieldTrip to analyze multi-unit data. So far it's been proven that FieldTrip is fairly good! You may want to take a look at this tutorial (if you have not done so) http://fieldtrip.fcdonders.nl/tutorial/spike Good luck! ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Tue, Mar 18, 2014 at 3:11 AM, 王大明 wrote: > Dear friends: > > I am student from China and currently very interested in your software of > fieldtrip. There is a question puzzling me: > > If I use integrate-and-fire or other neural models to simulate and get > spike and LFP(local field potential) data, is fieldtrip still suitable for > processing these data? And the main part which I concern mostly is spike > and LFP data analysis. > > Your reply and help will be sincerely appreciated! Thank you! > > > Best Wishes > > > Daming Wang > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 19 15:28:04 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 19 Mar 2014 15:28:04 +0100 Subject: [FieldTrip] ft_freqstatistics for between subject design In-Reply-To: References: Message-ID: <5329A974.60708@donders.ru.nl> Hi BeomJun Min, > I think that each 5 values correspond with the frequency data point. yes, that;s correct. > > Is that script suitable for the test for the significance, especially > avgovertime option 'yes'? Yes and no. Yes, because you are testing for significance and, depending on what hypothesis you have, averaging over time is perfectly fine. Use avgovertime if you are looking for an effect independent of time, otherwise set it to 'no'. No, because you should pay attention to why selecting this time-frequency region. Now it seems that you selected frequency and time window based on eyeballing the data. If you have no apriori hypothesis about these frequencies and time window, it's a faulty approach to just select the region that shows the strongest approach and do a statistical test. You should take the whole time-window and whole freuqency spectrum (narrowed down as much as apriori hypotheses allow). If this is a real effect it is likely that a proper statistical test will show up only around that time-frequency. > > If I change the avgovertime option to 'no', then can I found the > p-values for each frequencies(5 values), and each time point(51 > values), in total 255 values that could have multiple comparison issue? Yes, you have this problem, is there a reason why you are not using the cluster-based permutation test (or any other correction for multiple comparison which is implemented by setting the cfg.correctm parameter accordingly)? > > And I thought the 'mask' values of 0 indicates 'statistically > non-significance'. Is that right? Yes, that is correct. Best, Jörn > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com , > http://bmssa.gist.ac.kr > > > _______________________________________________ > 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 antony.passaro at gmail.com Wed Mar 19 16:27:18 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 11:27:18 -0400 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Dear Jan-Mathijs, Thank you for your reply, I appreciate it. In regards to the potential bug in the ft_freqanalysis_mvar function, I see that it does indeed "swallow" linearly indexed combos, however, a reshape error is typically returned (line 146) since it tries to reshape the matrix into the incorrect number of elements. Perhaps I am doing something wrong, but I only feed the untouched output from the mvaranalysis to the freqanalysis function. I will send the "bug" to Bugzilla. In regards to your point about DTF and PDC normalization, as I understand it, one is normalized by the outflow and the other is normalized by the inflow (DTF and PDC respectively?). That being the case, it seems like a normalization to only one channel (or a subset of channels) or from only one channel (or a subset) would produce a correct normalization in one case (ie outflow) but not in the other (ie inflow). PDC and DTF taken together should then show the correct inflow but not outflow (PDC?) and the correct outflow but not inflow (DTF?), correct? I know that proposal may not be the most mathematically viable option, however, I'm not sure how else to tackle this issue. Thanks, -Tony On Wed, Mar 19, 2014 at 9:38 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Tony, > > I don't think that these immediate plans exist. I wasn't aware of the fact > that ft_freqanalysis_mvar does not swallow the linearly indexed > combinations. We may want to look into that. Could you post a bug on > bugzilla for this? The fact that it is not supported for dtf and pdc > actually has a reason, which is related to the fact that these measures are > normalized with respect to the total inflow/outflow for a given channel, > where the MVAR-model explicitly should be based on the multivariate > decomposition (i.e. where multi means all channels included). The > functionality of ft_mvaranalysis with cfg.channelcmb fits a separate > mvar-model for each channel pair. > > Does this make sense? > > Best wishes, > Jan-Mathijs > > > > On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > > I was wondering if there were any immediate plans to implement this > functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? > Linearly indexed data such as specific channel pairs (instead of all > possible channel pair combinations) seems to work fine for the > ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function > and is not fully implemented in the ft_connectivity_dtf and _pdc functions. > Any advice on how to proceed would be much appreciated. > > Thank you, > -Tony > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 19 16:37:44 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 16:37:44 +0100 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Hi Tony, > In regards to your point about DTF and PDC normalization, as I understand it, one is normalized by the outflow and the other is normalized by the inflow (DTF and PDC respectively?). That being the case, it seems like a normalization to only one channel (or a subset of channels) or from only one channel (or a subset) would produce a correct normalization in one case (ie outflow) but not in the other (ie inflow). PDC and DTF taken together should then show the correct inflow but not outflow (PDC?) and the correct outflow but not inflow (DTF?), correct? I know that proposal may not be the most mathematically viable option, however, I'm not sure how else to tackle this issue. I think the restriction is more fundamental that what you sketch. Not only there may be missing channel combinations, with the added problem of normalising with the sum of a different number of channels for different channel combinations, it is related to the fact that a full MVAR model is mandatory to get a DTF or PDC estimate that lives up to its definition (i.e. an estimate of inflow/outflow (always forget which is which) relative to the total network's in/outflow). Best, Jan-Mathijs > > Thanks, > -Tony > > > On Wed, Mar 19, 2014 at 9:38 AM, jan-mathijs schoffelen wrote: > Dear Tony, > > I don't think that these immediate plans exist. I wasn't aware of the fact that ft_freqanalysis_mvar does not swallow the linearly indexed combinations. We may want to look into that. Could you post a bug on bugzilla for this? The fact that it is not supported for dtf and pdc actually has a reason, which is related to the fact that these measures are normalized with respect to the total inflow/outflow for a given channel, where the MVAR-model explicitly should be based on the multivariate decomposition (i.e. where multi means all channels included). The functionality of ft_mvaranalysis with cfg.channelcmb fits a separate mvar-model for each channel pair. > > Does this make sense? > > Best wishes, > Jan-Mathijs > > > > On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > >> I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. >> >> Thank you, >> -Tony >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Wed Mar 19 17:17:17 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Wed, 19 Mar 2014 16:17:17 +0000 Subject: [FieldTrip] Source localizing auditory steady state responses Message-ID: <5329C30D.4090600@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Wed Mar 19 18:21:24 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Wed, 19 Mar 2014 13:21:24 -0400 Subject: [FieldTrip] Source localizing auditory steady state responses In-Reply-To: <5329C30D.4090600@glasgow.ac.uk> References: <5329C30D.4090600@glasgow.ac.uk> Message-ID: Hey May, Beamorming on correlated sources is my interest too. The problem is that most beamformers (I deal with SAM and vector beamformer) are going to suppress or/and misplace any correlated source. The way I deal with this problem is by creating a region of interest (around primary auditory cortex) and beaformer over each ROI separately. The signal correlation problem is still there but with a lesser extant (I think). Here is a great article on this topic: Beamformer reconstruction of correlated sources using a modified source model and Modified Beamformers for Coherent Source Region Suppression Also if I localize evoked responses I always prefer dipole fitting over other methods, you could try the moving dipolar fitting method and have your wave former from the dipole t-course. Let me know how it will go for you. Cheers, Inna Inna McGowin On Wed, Mar 19, 2014 at 12:17 PM, Heng-Ru May Tan < Heng-RuMay.Tan at glasgow.ac.uk> wrote: > > Hi All, > I am trying to localize frequency specific ASSR but have not been > successful in doing so with the 'mne' method in the ft_sourceanalysis. > At the sensor-level the topo plots show clear bilateral generators. > > Is it possible to localize the bilateral sources using beamforming? And > would I need to create a different forward model? > Additionally, I would also like to retrieve the source signals and ideally > comparing between 2 time periods within the same trial. > > I would appreciate if someone could advise or comment on how best to go > about doing so. > > Thanks, > May > > > -- > > > ____________________________________________________________________________________________________________________________________ > > Heng-Ru *May* Tan, PhD. > > > Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive > Neuroimaging (CCNi) ▫ College of Medical, Veterinary and Life Sciences > > University of Glasgow ▫ 58 Hillhead Street, Glasgow G12 8QB ▫ +44 > (0)141-330-5090 ▫ Heng-RuMay.Tan at glasgow.ac.uk > > _______________________________________________ > 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 mbj0310 at gmail.com Thu Mar 20 00:42:20 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Thu, 20 Mar 2014 08:42:20 +0900 Subject: [FieldTrip] ft_freqstatistics for between subject design In-Reply-To: <5329A974.60708@donders.ru.nl> References: <5329A974.60708@donders.ru.nl> Message-ID: Dear Jörn Thank you for your kind reply. Now I think I can approach for the better way. Actually I am a novice, and trying to learn about the MATLAB, and the fieldtrip. :) So far, I have processed step by step, and now I will consider the multiple comparison issue. Anyway, thank you again. With regards. 2014-03-19 23:28 GMT+09:00 "Jörn M. Horschig" : > Hi BeomJun Min, > > > > I think that each 5 values correspond with the frequency data point. >> > yes, that;s correct. > > > >> Is that script suitable for the test for the significance, especially >> avgovertime option 'yes'? >> > Yes and no. Yes, because you are testing for significance and, depending > on what hypothesis you have, averaging over time is perfectly fine. Use > avgovertime if you are looking for an effect independent of time, otherwise > set it to 'no'. No, because you should pay attention to why selecting this > time-frequency region. Now it seems that you selected frequency and time > window based on eyeballing the data. If you have no apriori hypothesis > about these frequencies and time window, it's a faulty approach to just > select the region that shows the strongest approach and do a statistical > test. You should take the whole time-window and whole freuqency spectrum > (narrowed down as much as apriori hypotheses allow). If this is a real > effect it is likely that a proper statistical test will show up only around > that time-frequency. > > > >> If I change the avgovertime option to 'no', then can I found the p-values >> for each frequencies(5 values), and each time point(51 values), in total >> 255 values that could have multiple comparison issue? >> > Yes, you have this problem, is there a reason why you are not using the > cluster-based permutation test (or any other correction for multiple > comparison which is implemented by setting the cfg.correctm parameter > accordingly)? > > > >> And I thought the 'mask' values of 0 indicates 'statistically >> non-significance'. Is that right? >> > Yes, that is correct. > > Best, > Jörn > > >> -- >> BeomJun Min, M.D. >> >> Department of Medical System Engineering (DMSE) >> Gwangju Institute of Science and Technology (GIST) >> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >> 500-712, Republic of Korea (South) >> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >> E-mail: mbj0310 at gmail.com , >> http://bmssa.gist.ac.kr >> >> >> _______________________________________________ >> 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 > -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Thu Mar 20 12:47:16 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Thu, 20 Mar 2014 11:47:16 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 40, Issue 33 In-Reply-To: References: Message-ID: <532AD544.4020908@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Thu Mar 20 14:03:52 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 20 Mar 2014 13:03:52 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 40, Issue 33 In-Reply-To: <532AD544.4020908@glasgow.ac.uk> References: <532AD544.4020908@glasgow.ac.uk> Message-ID: Hi May, Inna, everyone, I'm not sure exactly what Inna meant by the ROI, specifically whether the ROI was applied to source space or to sensors. Applying a ROI to sources will not work: the beamformer result at one location in the brain is the same irrespective of where else you also compute a beamformer result. However, perhaps Inna meant ROI over channels (e.g. left channels for the left auditory cortex). If so, then as she says, it will reduce the problem a bit but it will still be there. See cfg.supchan in ft_sourceanalysis. Indeed the method by Dalal et al. was initially implemented in the NUTMEG software (which is compatible with FieldTrip). However, it is also now implemented in FieldTrip by using the cfg.supdip option in ft_sourceanalysis, which allows you to suppress a region (e.g. right auditory cortex) so that you can estimate activity elsewhere (e.g. left auditory cortex). Cheers, Johanna 2014-03-20 11:47 GMT+00:00 Heng-Ru May Tan : > Hi Inna, > > Thanks for the suggestions re using ROI beamforming separately and > references. I'll give it a go. > > BTW, I wonder if those beamforming algorithms e.g. Dalal et al2006 (IEEE > biomed. eng.) might have already been implemented somewhere... or might it > be something that fieldtrip might/could consider adding to their > sourceanalysis options? =) > > Thanks, > May > > > ForwardedMessage.eml > Subject: > Re: [FieldTrip] Source localizing auditory steady state responses > From: > "McGowin, Inna" > Date: > 19/03/2014 17:21 > To: > FieldTrip discussion list > > Hey May, > Beamorming on correlated sources is my interest too. The problem is that > most beamformers (I deal with SAM and vector beamformer) are going to > suppress or/and misplace any correlated source. The way I deal with this > problem is by creating a region of interest (around primary auditory > cortex) and beaformer over each ROI separately. The signal correlation > problem is still there but with a lesser extant (I think). Here is a great > article on this topic: > Beamformer reconstruction of correlated sources using a modified source > model > and > Modified Beamformers for Coherent Source Region Suppression > > Also if I localize evoked responses I always prefer dipole fitting over > other methods, you could try the moving dipolar fitting method and have > your wave former from the dipole t-course. > Let me know how it will go for you. > Cheers, > Inna > > > Inna McGowin > > > On Wed, Mar 19, 2014 at 12:17 PM, Heng-Ru May Tan < > Heng-RuMay.Tan at glasgow.ac.uk> wrote: > > Hi All, > I am trying to localize frequency specific ASSR but have not been > successful in doing so with the 'mne' method in the ft_sourceanalysis. > At the sensor-level the topo plots show clear bilateral generators. > > Is it possible to localize the bilateral sources using beamforming? And > would I need to create a different forward model? > Additionally, I would also like to retrieve the source signals and ideally > comparing between 2 time periods within the same trial. > > I would appreciate if someone could advise or comment on how best to go > about doing so. > > Thanks, > May > > > > _______________________________________________ > 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 Thu Mar 20 15:08:18 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 20 Mar 2014 15:08:18 +0100 Subject: [FieldTrip] ICA plots crash Matlab Message-ID: Dear all, I'm experiencing a weird problem and was wondering if anyone might know why. In certain versions of fieldtrip (for example, the latest version on the ftp server on 20140319), the figure plot for the ICA components crashed my Matlab. This also happened when I used the fieldtrip version on 20140121. Yet, the version on 20140203 did not crash my Matlab when it plots the ICA components. What could be causing the problem? I'm using Matlab 2012b 64 bit. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Fri Mar 21 14:05:33 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 21 Mar 2014 13:05:33 +0000 Subject: [FieldTrip] Source localizing auditory steady state responses In-Reply-To: References: Message-ID: <532C391D.4010504@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Fri Mar 21 15:36:19 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Fri, 21 Mar 2014 15:36:19 +0100 Subject: [FieldTrip] Permutation statistics Message-ID: Dear all, I've got EEG datasets for 64 channels, and I would like to perform permutation statistics on the power frequency analyses to compare the two conditions (before and after resting state periods). However, I'm not sure how to operationalise the statistical analyses since most of the examples on the website are for MEG datasets. I would appreciate very much if someone could help me on this! Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 21 20:10:50 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Fri, 21 Mar 2014 20:10:50 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: References: Message-ID: <532C8EBA.2020806@gmail.com> Dear Hweeling, There is nothing inherent to the ft_freqstatistics function that makes it special for MEG, rather than for EEG data. If you've been using other FieldTrip functions, you probably have used cfg.channel before. These are the channels present in your EEG data. How you should set some of the other parameters depends only on your design, not on whether the data are from MEG or EEG. Maybe you can specify what is unclear to you when calling the function so that you can get appropriate help! Good luck, Vitoria On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: > > Dear all, > > I've got EEG datasets for 64 channels, and I would like to perform > permutation statistics on the power frequency analyses to compare the > two conditions (before and after resting state periods). > > However, I'm not sure how to operationalise the statistical analyses > since most of the examples on the website are for MEG datasets. > > I would appreciate very much if someone could help me on this! Thanks! > > Cheers, > Hweeling > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sun Mar 23 01:08:26 2014 From: russgport at gmail.com (Russell G Port) Date: Sat, 22 Mar 2014 20:08:26 -0400 Subject: [FieldTrip] Dipole fitting Message-ID: Hi All, I am currently struggling to fit dipoles to my auditory data. In short I want to 'turn off' half the channels (so I only have one hemisphere) (as can easily be done in CTF tools DipoleFit). I thought this would be easy by having the timelocked data that went into ft_dipolefitting, have cfg.channel='MR' or 'ML'. The issue I have is when I dipole fit this data, the dipole ends up in the center of the head. I definitely have only left or right channels selected (as checked in the output of ft_timelockanalysis). I thought of two ways around this. A) I use an initial guess away from the center of the head (with cfg.nonlinear ='yes') B) I have a source model with the medial - lateral space starting starting away from the center (e.g. in CTF coordinate Y = 2:1:7) [again with cfg.linear='yes']. While these approaches normally work, I have a particularly stubbon couple of datasets, that still think the the dipole is in the center of the head. When I check the topoplot of the date being fit, it appears that the 'turned off/not analyzed' side (the side not specified in ft_timelock analysis's cfg) is completely red on the topoplot, which would not be a problem but there is a small sink close to it, which is throwing off the dipole placement. Next I repeated my dipole fitting using my altered source model with cfg.nonlinear='no', but again this source and sink caused by the contralateral hemisphere is pulling the dipole to the edge of my source model space. Does anyone have any suggestions. When I try to dipole fitting this data in CTF DipoleFit I do not have this issue (presumably because the contralateral hemisphere is no contributing to the dipole fit). Thanks Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Sun Mar 23 03:14:34 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Sun, 23 Mar 2014 11:14:34 +0900 Subject: [FieldTrip] Intertrial coherence (phase locking factor) Message-ID: Hello trippers, I am confused with the 'cfg.method' for ITC. After examining the previous discussion list, I found method for ITC calculation as below. *tmpdat = freq.fourierspctrm;* *tmpdat = tmpdat./abs(tmpdat); % this will normalise each trial for its amplitude;* *itc = abs(mean(tmpdat)); % this will give the itc* In addition, for this method, the ft_freqanalysis should have configuration as below. *cfg = [];* *cfg.keeptrials = 'yes';* *cfg.keeptapers = 'yes';* *cfg.output = 'fourier';* *cfg.channel = 'all';* *cfg.method = 'mtmfft';* *cfg.foi = 20:1:60;* *cfg.toi = -0.5:0.01:1.5;* *cfg.tapsmofrq = 4;* *cfg.taper = 'hanning';* However, I use 'wavelet' for the calculation of gamma band now. Should I use 'mtmfft' for the calucation of ITC? In case of 'wavelet', the result of itc has 4-D data - trial (averaged) * channel * freq * time Meanwhile, in case of 'mtmfft' the result has 3D data - trial (averaged) * channel * freq without time. Which structure is right? And, if I want to calculate the mean value of ITC of a group, is the order of the processing below right? : preprocessed data of each individual -> time-frequency analysis -> calculate ITC -> grandaverage With regards. -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Sun Mar 23 15:19:30 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Sun, 23 Mar 2014 15:19:30 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: <532C8EBA.2020806@gmail.com> References: <532C8EBA.2020806@gmail.com> Message-ID: Dear Vitoria, Thanks for the tip. I'm trying to perform a within-trial analysis. I've got two sets of data, before and after resting state EEG activity. First set has 54 trials and second set has 51 trials. Hence, my cfg.design = [ones(1, 105); ones(1,54), ones(1,51)*2]. I've set up the statistical analysis like this: cfg = []; cfg.layout = lay; cfg.channel = 'all'; cfg.latency = 'all'; cfg.trials = 'all'; cfg.frequency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.numrandomization = 1000; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; [stat] = ft_freqstatistics(cfg, post_c200freq, pre_c200freq); However, I got an error message: Error using ft_statfun_depsamplesT (line 84) Invalid specification of the design array. Error in ft_statistics_montecarlo (line 285) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 323) [stat, cfg] = statmethod(cfg, dat, cfg.design); Can someone please tell me what parameters did I specify wrongly? Thanks. Best wishes, Hweeling On 21 March 2014 20:10, Vitória Piai wrote: > Dear Hweeling, > > There is nothing inherent to the ft_freqstatistics function that makes it > special for MEG, rather than for EEG data. If you've been using other > FieldTrip functions, you probably have used cfg.channel before. These are > the channels present in your EEG data. > How you should set some of the other parameters depends only on your > design, not on whether the data are from MEG or EEG. > Maybe you can specify what is unclear to you when calling the function so > that you can get appropriate help! > > Good luck, Vitoria > > > On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: > > > Dear all, > > I've got EEG datasets for 64 channels, and I would like to perform > permutation statistics on the power frequency analyses to compare the two > conditions (before and after resting state periods). > > However, I'm not sure how to operationalise the statistical analyses > since most of the examples on the website are for MEG datasets. > > I would appreciate very much if someone could help me on this! Thanks! > > Cheers, > Hweeling > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 tyler.grummett at flinders.edu.au Mon Mar 24 00:32:21 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sun, 23 Mar 2014 23:32:21 +0000 Subject: [FieldTrip] ft_timelockanalysis and tf_sourceanalysis Message-ID: Hello fieldtrip, I just want to discuss my processing steps and to determine if I have made any analysis errors. Firstly, I have data converted from eeglab using the following code: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); The data is 30 seconds of someone having their eyes closed. There are no trigger codes unfortunately. I then run the ft_timelockanalysis function (to be used in tf_sourceanalysis), without any configuration settings specified (I will use the defaults). % calculating the cross spectral density matrix ?cfg = []; timelock = ft_timelockanalysis(cfg, data); The code runs fine without any errors. As it calculates the data to be one trial long, has the code done anything to do the data. What has it timelocked to? I then calculate the mri_headmodel: % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); I then run the source analysis code: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; % cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost = ft_sourceanalysis( cfg, timelock); The code also runs fine. However, what I have found is that I cant plot the data using ft_sourceplot. As I am not 100% on how these functions operate and how to properly run a beamformer on continuous data, I am not sure whether the step that I have taken are appropriate, or that I am kind of making it up as I go along. I cant find anywhere how to do a beamformer on continuous data without trials of some sort. Any help will be appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 24 08:54:17 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 24 Mar 2014 08:54:17 +0100 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: References: Message-ID: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Dear Christine, I am forwarding your question to the FieldTrip discussion list. No doubt somebody with hands-on experience can give you a much better reply than I could. If you haven't subscribed to the list: this would be the time to do so ;-). Best wishes, Jan-Mathijs On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: > Dear Jan-Mathijs > > I just have a very naive question on the EEG-MRI coregistration - for source reconstruction. > > For us, we actually do concurrent EEG-MRI. I read the gold standard is to use the 3D digitalisor (fastrack) system to record the sensor space. But since we are doing concurrent recording, we can actually see most of the electrode on the T1 images (due to small signal distortion, the electrodes look like small dents on the scalp). To me, who has not done EEG before, this information should be useful for co-register EEG with MRI? and potentially be better than register everything to the three landmark. > > Does Fieldtrip have functions that might work with such configuration? I imagine we could do a first automated co-reg as a first rough estimate, and maybe manually line up the electrode with T1. > > Best regards > Christine > Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From stebollmann at gmail.com Mon Mar 24 15:34:45 2014 From: stebollmann at gmail.com (Steffen Bollmann) Date: Mon, 24 Mar 2014 15:34:45 +0100 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> References: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Message-ID: Dear Christine, I have the same problem, but haven't found a very fast and easy way to do this. However, I found a tool, which helps a lot: http://pylocator.thorstenkranz.de/ Maybe anyone else has better ways of doing it and could share his thoughts? All the best Steffen 2014-03-24 8:54 GMT+01:00 jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl>: > Dear Christine, > > I am forwarding your question to the FieldTrip discussion list. No doubt > somebody with hands-on experience can give you a much better reply than I > could. > If you haven't subscribed to the list: this would be the time to do so ;-). > > Best wishes, > Jan-Mathijs > > > On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: > > Dear Jan-Mathijs > > I just have a very naive question on the EEG-MRI coregistration - for > source reconstruction. > > For us, we actually do concurrent EEG-MRI. I read the gold standard is to > use the 3D digitalisor (fastrack) system to record the sensor space. But > since we are doing concurrent recording, we can actually see most of the > electrode on the T1 images (due to small signal distortion, the electrodes > look like small dents on the scalp). To me, who has not done EEG before, > this information should be useful for co-register EEG with MRI? and > potentially be better than register everything to the three landmark. > > Does Fieldtrip have functions that might work with such configuration? I > imagine we could do a first automated co-reg as a first rough estimate, and > maybe manually line up the electrode with T1. > > Best regards > Christine > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Tue Mar 25 09:25:12 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Tue, 25 Mar 2014 09:25:12 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: References: <532C8EBA.2020806@gmail.com> Message-ID: <53313D68.7040304@gmail.com> Hi Hweeling, I'm sorry, I don't understand exactly what you mean by "within-trial" analysis. If you mean comparing trials within the same participant, then there are two things you should change in your code: cfg.statistic = 'indepsamplesT'; %% this should be indepsamplesT rather than depsamplesT cfg.uvar = 1; %%% Remove this line from your configuration cfg.ivar = 1; %% the indep. var here should be 1, rather than 2 Maybe your design will also need some adjustment, I'm not so sure (I don't use indepsamplesT that much). In any case, it could help to have a look at: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock?s[]=indepsamplest If you want a cleaner code, you can also remove all these lines (they should be default): cfg.channel = 'all'; cfg.latency = 'all'; cfg.trials = 'all'; cfg.frequency = 'all'; I hope this works, otherwise email the list again. Good luck, Vitória On 3/23/2014 3:19 PM, Hwee Ling Lee wrote: > Dear Vitoria, > > Thanks for the tip. > > I'm trying to perform a within-trial analysis. > > I've got two sets of data, before and after resting state EEG > activity. First set has 54 trials and second set has 51 trials. Hence, > my cfg.design = [ones(1, 105); ones(1,54), ones(1,51)*2]. > > I've set up the statistical analysis like this: > > cfg = []; > cfg.layout = lay; > cfg.channel = 'all'; > cfg.latency = 'all'; > cfg.trials = 'all'; > cfg.frequency = 'all'; > cfg.avgovertime = 'no'; > cfg.avgoverfreq = 'no'; > cfg.avgoverchan = 'no'; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.numrandomization = 1000; > cfg.design = design; > cfg.uvar = 1; > cfg.ivar = 2; > [stat] = ft_freqstatistics(cfg, post_c200freq, pre_c200freq); > > However, I got an error message: > > Error using ft_statfun_depsamplesT (line 84) > Invalid specification of the design array. > > Error in ft_statistics_montecarlo (line 285) > [statobs, cfg] = statfun(cfg, dat, design); > > Error in ft_freqstatistics (line 323) > [stat, cfg] = statmethod(cfg, dat, cfg.design); > > Can someone please tell me what parameters did I specify wrongly? Thanks. > > Best wishes, > Hweeling > > > > > On 21 March 2014 20:10, Vitória Piai > wrote: > > Dear Hweeling, > > There is nothing inherent to the ft_freqstatistics function that > makes it special for MEG, rather than for EEG data. If you've been > using other FieldTrip functions, you probably have used > cfg.channel before. These are the channels present in your EEG data. > How you should set some of the other parameters depends only on > your design, not on whether the data are from MEG or EEG. > Maybe you can specify what is unclear to you when calling the > function so that you can get appropriate help! > > Good luck, Vitoria > > > On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: >> >> Dear all, >> >> I've got EEG datasets for 64 channels, and I would like to >> perform permutation statistics on the power frequency analyses to >> compare the two conditions (before and after resting state periods). >> >> However, I'm not sure how to operationalise the statistical >> analyses since most of the examples on the website are for MEG >> datasets. >> >> I would appreciate very much if someone could help me on this! >> Thanks! >> >> Cheers, >> Hweeling >> >> >> >> _______________________________________________ >> 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 e.maris at psych.ru.nl Tue Mar 25 12:01:35 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 25 Mar 2014 12:01:35 +0100 (CET) Subject: [FieldTrip] PhD position at Donders Institute Message-ID: <011401cf4819$961e3ca0$c25ab5e0$@maris@psych.ru.nl> The Donders Institute for Brain, Cognition and Behaviour has a vacancy for a PhD student on the project Characterizing phase-coupled oscillatory networks in the alpha and the theta band: their relation to perception and attention, and to individual differences in cognitive performance Research Group Neurophysiology of Active Perception The objective of our research group is to formulate and validate mechanistic explanations of cognitive phenomena, that is explanations in terms of their underlying neurophysiological mechanisms. As an integral part of this objective, our group has an important methodological component, the characterization of interactions in spatially distributed neural activity, which is the central topic of this PhD project. Project Description Phase-consistent rhythmic activity is ubiquitous in electrophysiological recordings, and it may reflect networks of phase-coupled neuronal populations oscillating at different frequencies. Because neuronal oscillations may reflect rhythmic modulations of neuronal excitability, phase-coupled oscillatory networks (PCONs) could be functional building blocks for routing information through the brain. This project focuses on PCONs involving brain rhythms that (1) are modulated by selective attention and working memory, and (2) are correlated with individual differences in cognitive performance. Using newly developed methods, we extract PCONs from magneto-encephalography (MEG) data on the basis of the patterns of phase-consistency induced by these PCONs. These methods succeed because PCONs can be separated on the basis their frequency content, the brain areas over which they can be observed, and their pattern of between-site phase relations. We will test three hypotheses with respect to the functional role of alpha and theta band PCONs, one pertaining to their behavioral relevance, one to the mechanism underlying sustained attention, and one to their relation with individual differences in cognitive performance. All hypotheses can be tested using existing data. Job Requirements This project calls for either a cognitive neuroscientist with a strong interest and skills in data analysis or a person with a computational background (machine learning, applied statistics, signal processing) with a strong interest in cognitive neuroscience. We are looking for candidates with a MSc degree who are highly motivated to conduct research. It is highly desirable to have extensive experience with a high-level programming language such as Matlab or Python. The candidate must be available at 1-10-2014. Application deadline: 14-7-2014 The Institute The Donders Institute for Brain, Cognition and Behaviour consists of three research centres, the Centre for Cognition, the Centre for Cognitive Neuroimaging and the Centre for Neuroscience. The Donders Institute focuses on state of the art cognitive neuroscience, in a multidisciplinary approach, and offers excellent lab and neuroimaging facilities. The project is embedded within the Donders research theme Brain Networks and Neuronal Communication (http://www.ru.nl/donders/research/theme-4-brain/) and will be supervised by dr. Eric Maris at the Donders Centre for Cognition (DCC). The DCC is part of the Faculty of Social Sciences, one of the largest faculties at Radboud University Nijmegen. The faculty hosts high-quality research and study programs that rank among the best in the Netherlands. Contact Information Dr. Eric Maris e.maris at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.cong at gmail.com Wed Mar 26 05:22:50 2014 From: christine.cong at gmail.com (Cong Christine Guo) Date: Wed, 26 Mar 2014 14:22:50 +1000 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: References: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Message-ID: Dear Steffen the tool you suggested is indeed very helpful. We can live with that before there is a fast automated way -- I reckon digitising the sensors during prep probably consume similar amount time. best regards Christine On Tue, Mar 25, 2014 at 12:34 AM, Steffen Bollmann wrote: > Dear Christine, > > I have the same problem, but haven't found a very fast and easy way to do > this. > > However, I found a tool, which helps a lot: > http://pylocator.thorstenkranz.de/ > > Maybe anyone else has better ways of doing it and could share his thoughts? > All the best > Steffen > > > > 2014-03-24 8:54 GMT+01:00 jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl>: > >> Dear Christine, >> >> I am forwarding your question to the FieldTrip discussion list. No doubt >> somebody with hands-on experience can give you a much better reply than I >> could. >> If you haven't subscribed to the list: this would be the time to do so >> ;-). >> >> Best wishes, >> Jan-Mathijs >> >> >> On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: >> >> Dear Jan-Mathijs >> >> I just have a very naive question on the EEG-MRI coregistration - for >> source reconstruction. >> >> For us, we actually do concurrent EEG-MRI. I read the gold standard is >> to use the 3D digitalisor (fastrack) system to record the sensor space. >> But since we are doing concurrent recording, we can actually see most of >> the electrode on the T1 images (due to small signal distortion, the >> electrodes look like small dents on the scalp). To me, who has not done >> EEG before, this information should be useful for co-register EEG with MRI? >> and potentially be better than register everything to the three landmark. >> >> Does Fieldtrip have functions that might work with such configuration? >> I imagine we could do a first automated co-reg as a first rough estimate, >> and maybe manually line up the electrode with T1. >> >> Best regards >> Christine >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 26 08:54:02 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 26 Mar 2014 08:54:02 +0100 Subject: [FieldTrip] Intertrial coherence (phase locking factor) In-Reply-To: References: Message-ID: <6D191C38-3829-45FC-8B03-654E488B7AC6@donders.ru.nl> Dear Beom Jun Min, > I am confused with the 'cfg.method' for ITC. There is currently no cfg.method that gives you ITC directly, indeed you should use the formula below, which is correct if you have a single taper per trial (which you have if you use cfg.taper = 'hanning' in ft_freqanalysis). > After examining the previous discussion list, I found method for ITC calculation as below. > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); % this will normalise each trial for its amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > > In addition, for this method, the ft_freqanalysis should have configuration as below. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.keeptapers = 'yes'; > cfg.output = 'fourier'; > cfg.channel = 'all'; > cfg.method = 'mtmfft'; > cfg.foi = 20:1:60; > cfg.toi = -0.5:0.01:1.5; > cfg.tapsmofrq = 4; > cfg.taper = 'hanning'; > > However, I use 'wavelet' for the calculation of gamma band now. > > Should I use 'mtmfft' for the calucation of ITC? > > In case of 'wavelet', the result of itc has 4-D data - trial (averaged) * channel * freq * time > Meanwhile, in case of 'mtmfft' the result has 3D data - trial (averaged) * channel * freq without time. > Which structure is right? The distinction between 'mtmfft' and 'wavelet'/'mtmconvol' is exactly whether time is taken into account. The functionality that you want to use, depends on your question. > And, if I want to calculate the mean value of ITC of a group, > is the order of the processing below right? : > preprocessed data of each individual -> time-frequency analysis -> calculate ITC -> grandaverage The order is correct. Best wishes, Jan-Mathijs > > With regards. > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.lalancette at sickkids.ca Wed Mar 26 21:33:43 2014 From: marc.lalancette at sickkids.ca (Marc Lalancette) Date: Wed, 26 Mar 2014 20:33:43 +0000 Subject: [FieldTrip] MEG lead field units Message-ID: <2A2B6A5B8C4C174CBCCE0B45E548DEB229F66CD0@SKMBXX01.sickkids.ca> Hello all, I am not (yet) a common user of Fieldtrip, but I am using it now to investigate some basic properties of our MEG system. I only needed a realistic forward solution so I chose Nolte's "singleshell" model with mostly default parameters. I just spent quite a bit of time going through the code trying to figure out the units of the lead field I obtained. As it was not too obvious, I would appreciate some confirmation/correction. By default, my volume conduction and sensor structures were in units of 'cm'. That seems to be also what Nolte's method requires. Nowhere by default are the units specified for the (meg) channels or the source dipoles when simply calling ft_prepare_leadfield, and looking at the spherical computation in Nolte's code, I concluded that it would work with the channels in T and the dipole in A*cm. Thus the lead field units would be T/(A*cm). This also seems consistent with the lead field amplitude I am getting for our system (in the order of 10^-9). Is this correct? Thanks for your help! Marc Lalancette Lab Research Project Manager The Hospital for Sick Children, Toronto, Canada ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Mar 27 08:30:59 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 27 Mar 2014 08:30:59 +0100 Subject: [FieldTrip] POSTDOCTORAL POSITION ON ANALYSIS AND MODELING OF LFP AND MEG SIGNALS Message-ID: Hi all, The Faculty of Psychology and Neuroscience at Maastricht University offers a 21-month postdoc focused on the analysis and computational modeling of Local Field Potentials (LFPs) measured invasively in monkey cortex, and Magneto-Encephalo-Graphy (MEG) data measured in human cortex. Please feel free to distribute it. *PROJECT:* Existing human MEG data as well as rhesus monkey spiking, LFP and ECoG data have been collected in V1 during grating contrast modulations. The project is focused on analyzing and modeling the spectral responses in the different existing datasets, and to build detailed neural network models at the level of columns and layers, as well as transfer models to test which aspects of network models in monkey can be generalized to the human. *CANDIDATE: *The ideal candidate would have a strong background in mathematics, physics, computer science, and/or neuroscience, or related backgrounds, and a strong interest in the analysis and modeling of oscillatory signals. Expertise is expected with the modeling of single neurons, ING/PING or Izhikevich-type networks, and related approaches. *PLACE OF PROJECT:* The project will be carried out in Nijmegen, on the campus of the Radboud University. *FUNDING:* The funding is provided through a grant awarded by the Human Brain Project. The postdoctoral position is for 21 months. Salary and benefits are according to Dutch standards and according to experience. *WE OFFER:* We offer a highly multidisciplinary, international and stimulating environment. The project is relevant and prestigious, and will be performed in an intense collaboration with Nicosia University, our partner on the HBP award. *HOW TO APPLY:* To apply, please send a CV including the names of two references, and a brief motivation statement to Prof. Peter De Weerd p.deweerd at maastrichtuniversity.nl. We aim to fill the position within the month of April. Best, Haiteng -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Thu Mar 27 11:03:41 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Thu, 27 Mar 2014 18:03:41 +0800 Subject: [FieldTrip] help about ' fieldtrip2fiff ' Message-ID: Dear all: I want to save .mat file to .fif file use fieldtrip, there are errors cfg = []; cfg.dataset = 'D:\raw_tsss.fif'; data = ft_preprocessing(cfg); data = hdr: [1x1 struct] label: {306x1 cell} time: {[1x616000 double]} trial: {[306x616000 double]} fsample: 1000 grad: [1x1 struct] cfg: [1x1 struct] sampleinfo: [1 616000] fiff_file = 'song_tsss.fif'; fieldtrip2fiff(fiff_file, data) ??? Undefined function or variable 'fsample'. Error in ==> fieldtrip2fiff at 61 info.sfreq = fsample when I let fsample=1000(from data), there are also errors, ???'dataout' is not exist what should I do? thanks xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Mar 27 11:51:48 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 27 Mar 2014 10:51:48 +0000 Subject: [FieldTrip] Time domain beamformer Message-ID: <76289E9F-A1B3-4FC8-ADD6-4B6AC4311B19@flinders.edu.au> Hello fieldtrip, I just want to discuss my processing steps and to determine if I have made any analysis errors. Firstly, I have data converted from eeglab using the following code: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); The data is 30 seconds of someone having their eyes closed. There are no trigger codes unfortunately. I then run the ft_timelockanalysis function (to be used in tf_sourceanalysis), without any configuration settings specified (I will use the defaults). % calculating the cross spectral density matrix ​cfg = []; timelock = ft_timelockanalysis(cfg, data); The code runs fine without any errors. As it calculates the data to be one trial long, has the code done anything to do the data. What has it timelocked to? I then calculate the mri_headmodel: % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); I then run the source analysis code: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; % cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost = ft_sourceanalysis( cfg, timelock); The code also runs fine. However, what I have found is that I cant plot the data using ft_sourceplot. As I am not 100% on how these functions operate and how to properly run a beamformer on continuous data, I am not sure whether the step that I have taken are appropriate, or that I am kind of making it up as I go along. I cant find anywhere how to do a beamformer on continuous data without trials of some sort. Any help will be appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Thu Mar 27 12:10:36 2014 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Thu, 27 Mar 2014 12:10:36 +0100 Subject: [FieldTrip] Research Assistant / Associate at the University of Glasgow Message-ID: Dear all, there is a position as research assistant at the University of Glasgow available (see below). Best, Andreas _________________ University of Glasgow College of Medical, Veterinary and Life Sciences Research Institute of Neuroscience and Psychology Research Assistant / Associate Ref: M00563 Grade 6/7: £26,527 - £29,837 / £32,590 - £36,661 per annum You will contribute to a project, funded by the Medical Research Council (MRC), entitled "Using Magnetoencephalography to Investigate Aberrant Neural Synchrony in Prodromal Schizophrenia". Specifically, the job requires the analysis and acquisition of MEG-data sets and implementation of novel analytic tools, contributing to the design and programming of MEG experiments, recruiting and running the participants, assisting in analysing the results, and participating in the writing up of the results. With extensive, up-to-date practical knowledge in MEG or EEG, you will have excellent knowledge of source-localization, Matlab and experimental control software. This post is initially funded for 2 years. It is anticipated that this will be extended to 3 years subject to securing additional funding. Informal enquires to Dr Peter Uhlhaas (Email: Peter.Uhlhaas at glasgow.ac.uk; Tel: 0141 330 8730) Apply online at: www.gla.ac.uk/jobs Closing date: 28 April 2014 The University has recently been awarded the Athena SWAN Institutional Bronze Award The University is committed to equality of opportunity in employment. The University of Glasgow, charity number SC004401. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gio at gpiantoni.com Thu Mar 27 14:01:47 2014 From: gio at gpiantoni.com (Gio Piantoni) Date: Thu, 27 Mar 2014 09:01:47 -0400 Subject: [FieldTrip] help about ' fieldtrip2fiff ' In-Reply-To: References: Message-ID: Hi Xiao, It seems that you are using an old (one-year old) version of Fieldtrip, https://github.com/fieldtrip/fieldtrip/blob/92c805e819a126c61bfb96a38bc1a8025c8348ba/fieldtrip2fiff.m and the function has been updated a few times since then. Do you mind downloading a new version of FieldTrip and report back if you get any error? thanks! -g On Thu, Mar 27, 2014 at 6:03 AM, tongxiao meng wrote: > Dear all: > I want to save .mat file to .fif file use fieldtrip, there are errors > > cfg = []; > cfg.dataset = 'D:\raw_tsss.fif'; > data = ft_preprocessing(cfg); > > data = > > hdr: [1x1 struct] > label: {306x1 cell} > time: {[1x616000 double]} > trial: {[306x616000 double]} > fsample: 1000 > grad: [1x1 struct] > cfg: [1x1 struct] > sampleinfo: [1 616000] > > fiff_file = 'song_tsss.fif'; > fieldtrip2fiff(fiff_file, data) > > > ??? Undefined function or variable 'fsample'. > > Error in ==> fieldtrip2fiff at 61 > info.sfreq = fsample > when I let fsample=1000(from data), there are also errors, > ???'dataout' is not exist > > what should I do? > thanks > xiao > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From v.piai.research at gmail.com Thu Mar 27 15:20:24 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Mar 2014 15:20:24 +0100 Subject: [FieldTrip] ft_sourceplot with surface method in most recent FT version Message-ID: <533433A8.2070508@gmail.com> Hi everyone, I hope someone can help me out with a seemingly very easy question. When using ft_sourceplot, I was used to defining the surffile for the surface method. I'd then plot my interpolated source-reconstructed activity. In a more recent version of FT, apparently this is no longer needed (and the surffile I was used to use ''surface_l4_both.mat' doesn't even exist anymore). The page http://fieldtrip.fcdonders.nl/template/anatomy suggests that other files should be used instead, but it's still unclear to me from the page how the new function works. The tutorials I could find also still make use of a surffile. The help of ft_sourceplot (version 2014-02-26) still mentions the use of a surffile: "The following parameters apply to surface-plotting when an interpolation is required cfg.surffile = string, file that contains the surface (default = 'single_subj_T1.mat') 'single_subj_T1.mat' contains a triangulation that corresponds with the SPM anatomical template in MNI coordinates" but if I use the default surffile with method 'surface', I get an error that the fileformat is unknown: ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information So what is the right way of plotting source-reconstructed activity using the surface method after interpolation with a more recent FT version? I'm sorry if I'm missing something obvious but all the info I could gather didn't help me to get an answer... (I can update the info on the Wiki if it's not there yet). Cheers, Vitória From v.piai.research at gmail.com Thu Mar 27 22:56:33 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Mar 2014 22:56:33 +0100 Subject: [FieldTrip] ft_sourceplot with surface method in most recent FT version In-Reply-To: <533433A8.2070508@gmail.com> References: <533433A8.2070508@gmail.com> Message-ID: <53349E91.6000403@gmail.com> (Apologies for double posting) Hi everyone, I hope someone can help me out with a seemingly very easy question. When using ft_sourceplot, I was used to defining the surffile for the surface method. I'd then plot my interpolated source-reconstructed activity. In a more recent version of FT, apparently this is no longer needed (and the surffile I was used to use ''surface_l4_both.mat' doesn't even exist anymore). The page http://fieldtrip.fcdonders.nl/template/anatomy suggests that other files should be used instead, but it's still unclear to me from the page how the new function works. The tutorials I could find also still make use of a surffile. The help of ft_sourceplot (version 2014-02-26) still mentions the use of a surffile: "The following parameters apply to surface-plotting when an interpolation is required cfg.surffile = string, file that contains the surface (default = 'single_subj_T1.mat') 'single_subj_T1.mat' contains a triangulation that corresponds with the SPM anatomical template in MNI coordinates" but if I use the default surffile with method 'surface', I get an error that the fileformat is unknown: ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information So what is the right way of plotting source-reconstructed activity using the surface method after interpolation with a more recent FT version? I'm sorry if I'm missing something obvious but all the info I could gather didn't help me to get an answer... (I can update the info on the Wiki if it's not there yet). Cheers, Vitória From paolo.belardinelli at gmail.com Fri Mar 28 19:41:21 2014 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 28 Mar 2014 19:41:21 +0100 Subject: [FieldTrip] Within-subject statistical comparison of coherent sources Message-ID: Dear Fieldtrippers, I need to make a statistical comparison of within-subject coherence source mappings. I see on the fieldtrip webpage a source statistics approach for power is illustrated. In the Maris et al.paper (Journal of Neuroscience Methods 163 (2007) ) some sensor level results are shown. Specifically, I have 5 very long trials for each of two independent conditions, with 63 tapers per trial. Therefore, using the 'rawtrials' option in ft_sourceanalysis does not give me a good estimation for single trials. How can I (1) combine them to obtain a meaningful sampling, and (2) apply ft_sourcestatistics to compare two conditions? Best. Paolo -- -- Paolo Belardinelli, PhD Functional and Restorative Neurosurgery University Hospital Tuebingen Eberhard Karls University Tuebingen Otfried-Mueller-Str.45 D-72076 Tuebingen Tel: +49 7071 / 29 8 5626 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 529609 bytes Desc: not available URL: From tyler.grummett at flinders.edu.au Mon Mar 31 05:46:27 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 03:46:27 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot Message-ID: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> I have been trying to plot my interpolated source data using the code: % interpolate sources mri = ft_read_mri('Subject01.mri'); mri = ft_volumereslice([], mri); cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceInt = ft_sourceinterpolate( cfg, source, mri); sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter % does not vary over time, therefore the time dimension is not needed. % Plot interpolated data cfg = []; %#ok cfg.method = 'ortho'; % spline cfg.funparameter = 'avg.pow'; ft_sourceplot( cfg, sourceInt); However the figure that comes up just had orange squares in the subplots. I dont know where Ive gone wrong. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 09:00:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 09:00:43 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <5339129B.1030608@donders.ru.nl> Hi Tyler, what you are describing sounds to me like the center bias of the beamformer. Did you contrast the activity with anything, or did you normalize your leadfield? Check this out: http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition Best, Jörn On 3/31/2014 5:46 AM, Tyler Grummett wrote: > I have been trying to plot my interpolated source data using the code: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow > parameter > % does not vary over time, therefore the time dimension > is not needed. > > % Plot interpolated data > cfg = []; %#ok > cfg.method = 'ortho'; % spline > cfg.funparameter = 'avg.pow'; > ft_sourceplot( cfg, sourceInt); > > However the figure that comes up just had orange squares in the subplots. > > I dont know where Ive gone wrong. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > 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 tyler.grummett at flinders.edu.au Mon Mar 31 09:41:31 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 07:41:31 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <5339129B.1030608@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> Message-ID: <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> Hey Jorn, Previously I have let ft_sourceanalysis do a lead field because if I use the following code: % compute lead field ( apparently source analysis computes % lead field anyway cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO and then calculate the source analysis: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; % cfg.grid.pos = maxpos; cfg.keepfilter = 'yes'; cfg.dics.projectnoise = 'yes'; % cfg.dics.lambda = 0; source = ft_sourceanalysis( cfg, timelock); then I get an error than says: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); I just removed the leadfield code and it successfully ran. I could also interpolate it later. Is this the correct approach. Thankyou in advance! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 5:30 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, what you are describing sounds to me like the center bias of the beamformer. Did you contrast the activity with anything, or did you normalize your leadfield? Check this out: http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition Best, Jörn On 3/31/2014 5:46 AM, Tyler Grummett wrote: > I have been trying to plot my interpolated source data using the code: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow > parameter > % does not vary over time, therefore the time dimension > is not needed. > > % Plot interpolated data > cfg = []; %#ok > cfg.method = 'ortho'; % spline > cfg.funparameter = 'avg.pow'; > ft_sourceplot( cfg, sourceInt); > > However the figure that comes up just had orange squares in the subplots. > > I dont know where Ive gone wrong. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mengtongxiao at gmail.com Mon Mar 31 10:37:07 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Mon, 31 Mar 2014 16:37:07 +0800 Subject: [FieldTrip] help about ' fieldtrip2fiff ' Message-ID: Hi all I downloading a new version of FieldTrip, but there are also have some errors, ??? Error using ==> fiff_start_file at 35 Permission denied Error in ==> fiff_start_writing_raw at 54 fid = fiff_start_file(name); Error in ==> fieldtrip2fiff at 124 [outfid, cals] = fiff_start_writing_raw(fifffile, info); Why? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 10:43:54 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 10:43:54 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <53392ACA.2030108@donders.ru.nl> Hi Tyler, hm, okay, it could be that the issue with the leadfield and with the plot are related, but it could also be that they are separate issues. I just saw that you posted the same 'problem' on bugzilla and included a picture. Maybe for next time, include a picture on the mailinglist and just create a bug on bugzilla if you are sure it is a bug in Fieldtrip and not if you are not sure. That saves us a lot of time in separating code issues from user problems ;) So, back to you problem. It seems that your reconstruction results in one voxel only. Are you sure that your grid consistents of more than just one position? So, for example check the size of the matrices in source.avg, source- and headmodel, etc. Also, you can check in Matlab the respective fields of source and sourceInt and see whether that makes sense. Lastly, a neat way to check is always to use your code on data from the tutorial, and vice versa, use code from the tutorial on your data and see whether that works. Both should give sensible results, and if one does not, you know where to start looking for a solution ;) Best, Jörn On 3/31/2014 9:41 AM, Tyler Grummett wrote: > Hey Jorn, > > Previously I have let ft_sourceanalysis do a lead field because if I use the following code: > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO > > and then calculate the source analysis: > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = maxpos; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > % cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > then I get an error than says: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * > invCy; % van Veen eqn. 23, use > PINV/SVD to cover rank deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), > optarg{:}); > > I just removed the leadfield code and it successfully ran. I could also interpolate it later. > Is this the correct approach. > > Thankyou in advance! > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 5:30 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > what you are describing sounds to me like the center bias of the > beamformer. Did you contrast the activity with anything, or did you > normalize your leadfield? > Check this out: > http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition > > Best, > Jörn > > On 3/31/2014 5:46 AM, Tyler Grummett wrote: >> I have been trying to plot my interpolated source data using the code: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >> parameter >> % does not vary over time, therefore the time dimension >> is not needed. >> >> % Plot interpolated data >> cfg = []; %#ok >> cfg.method = 'ortho'; % spline >> cfg.funparameter = 'avg.pow'; >> ft_sourceplot( cfg, sourceInt); >> >> However the figure that comes up just had orange squares in the subplots. >> >> I dont know where Ive gone wrong. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 tyler.grummett at flinders.edu.au Mon Mar 31 12:36:52 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 10:36:52 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <53392ACA.2030108@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> Message-ID: <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> Jorn, I apologise about the bugzilla report. My last two emails on this emailing list were ignored, thats all. I didnt really know how else to approach this issue. I had a look at my variables. source.avg = pow: [642x1 double] filter: {642x1 cell} sourceInt.avg = pow: [16777216x1 double] So clearly, as both variables are completely different. Something has gone wrong. The next part of my code is the following: % interpolate sources mri = ft_read_mri('Subject01.mri'); mri = ft_volumereslice([], mri); cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceInt = ft_sourceinterpolate( cfg, source, mri); sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter % does not vary over time, therefore the time dimension is not needed. mri = anatomy: [256x256x256 double] dim: [256 256 256] transform: [4x4 double] coordsys: 'ctf' unit: 'mm' cfg: [1x1 struct] I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. Ive been wrong before though, thanks for your help. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 7:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, hm, okay, it could be that the issue with the leadfield and with the plot are related, but it could also be that they are separate issues. I just saw that you posted the same 'problem' on bugzilla and included a picture. Maybe for next time, include a picture on the mailinglist and just create a bug on bugzilla if you are sure it is a bug in Fieldtrip and not if you are not sure. That saves us a lot of time in separating code issues from user problems ;) So, back to you problem. It seems that your reconstruction results in one voxel only. Are you sure that your grid consistents of more than just one position? So, for example check the size of the matrices in source.avg, source- and headmodel, etc. Also, you can check in Matlab the respective fields of source and sourceInt and see whether that makes sense. Lastly, a neat way to check is always to use your code on data from the tutorial, and vice versa, use code from the tutorial on your data and see whether that works. Both should give sensible results, and if one does not, you know where to start looking for a solution ;) Best, Jörn On 3/31/2014 9:41 AM, Tyler Grummett wrote: > Hey Jorn, > > Previously I have let ft_sourceanalysis do a lead field because if I use the following code: > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO > > and then calculate the source analysis: > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = maxpos; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > % cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > then I get an error than says: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * > invCy; % van Veen eqn. 23, use > PINV/SVD to cover rank deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), > optarg{:}); > > I just removed the leadfield code and it successfully ran. I could also interpolate it later. > Is this the correct approach. > > Thankyou in advance! > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 5:30 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > what you are describing sounds to me like the center bias of the > beamformer. Did you contrast the activity with anything, or did you > normalize your leadfield? > Check this out: > http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition > > Best, > Jörn > > On 3/31/2014 5:46 AM, Tyler Grummett wrote: >> I have been trying to plot my interpolated source data using the code: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >> parameter >> % does not vary over time, therefore the time dimension >> is not needed. >> >> % Plot interpolated data >> cfg = []; %#ok >> cfg.method = 'ortho'; % spline >> cfg.funparameter = 'avg.pow'; >> ft_sourceplot( cfg, sourceInt); >> >> However the figure that comes up just had orange squares in the subplots. >> >> I dont know where Ive gone wrong. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 31 13:54:53 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 13:54:53 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <5339578D.4050308@donders.ru.nl> Hi Tyler, there is not much inherently different between time- and freuqency-domain beamformer, at least in terms of computing the forward and the inverse solution. But I see that you are obviously confused, so let me try to help you out and shed some light on what you are actually doing ;) > I had a look at my variables. > > source.avg = > > pow: [642x1 double] > filter: {642x1 cell} > > sourceInt.avg = > > pow: [16777216x1 double] > > So clearly, as both variables are completely different. Something has gone wrong. No, that is actually how it should be. From below you can see that your MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = 16777216 elements. In line with source.avg.pow, you should see that your 'grid' consists of 642 elements, so you were computing your source activity on a grid of in total 642 elements. Then you used the original MRI to interpolate from 642 to these 16 million grid points. Actually, since you specific cfg.downsample = 2, it should have been only 8 million points, so that's where things already get a bit weird. So let's go into some sanity checks: 1. are you using the latest version (or a recent, i.e. from this year) of FielTrip? 2. sourceInt should look something like this, does it? source_diff_int = inside: [46x55x46 logical] avg: [1x1 struct] dim: [46 55 46] transform: [4x4 double] anatomy: [46x55x46 double] unit: 'mm' cfg: [1x1 struct] 3. source should look something like this: source = dim: [20 25 22] freq: 54.8287 cumtapcnt: [338x1 double] pos: [11000x3 double] inside: [1x5798 double] outside: [1x5202 double] method: 'average' avg: [1x1 struct] trialinfo: [338x1 double] cfg: [1x1 struct] 4. also check your grid, should be something like this: sourcemodel = pos: [11000x3 double] dim: [20 25 22] unit: 'cm' inside: [1x5798 double] outside: [1x5202 double] params: [1x1 struct] initial: [4x4 double] cfg: [1x1 struct] Of course, it should all look a bit different, because you are using LCMV, but essentially it should be the same. Lastly, you can check other source plotting methods, like 'ortho' or try to plot the source structure rather than the sourceInt structure. In the end, the error must be somewhere in your grid, be it in .pos or .inside, because FieldTrip thinks that there is only one voxel to be plotted. There are other things that may be the issue, but I am not sure about these. So, I would suggest that you play a bit around and see where the error might come from (e.g. follow this tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the steps that you need for LCMV, maybe also check out: http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg there, LCMV is used, but on one voxel only) Best, Jörn > > The next part of my code is the following: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter > % does not vary over time, therefore the time dimension is not needed. > > mri = > > anatomy: [256x256x256 double] > dim: [256 256 256] > transform: [4x4 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. > > Ive been wrong before though, > > thanks for your help. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 7:13 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > hm, okay, it could be that the issue with the leadfield and with the > plot are related, but it could also be that they are separate issues. I > just saw that you posted the same 'problem' on bugzilla and included a > picture. Maybe for next time, include a picture on the mailinglist and > just create a bug on bugzilla if you are sure it is a bug in Fieldtrip > and not if you are not sure. That saves us a lot of time in separating > code issues from user problems ;) > > So, back to you problem. It seems that your reconstruction results in > one voxel only. Are you sure that your grid consistents of more than > just one position? So, for example check the size of the matrices in > source.avg, source- and headmodel, etc. > > Also, you can check in Matlab the respective fields of source and > sourceInt and see whether that makes sense. > > Lastly, a neat way to check is always to use your code on data from the > tutorial, and vice versa, use code from the tutorial on your data and > see whether that works. Both should give sensible results, and if one > does not, you know where to start looking for a solution ;) > > Best, > Jörn > > > On 3/31/2014 9:41 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >> >> % compute lead field ( apparently source analysis computes >> % lead field anyway >> cfg = []; >> cfg.elec = timelock.elec; >> cfg.vol = vol; >> cfg.reducerank = 3; >> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >> cfg.grid.unit = 'cm'; >> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >> >> and then calculate the source analysis: >> >> % Source Analysis: without contrasting condition >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = grid; >> cfg.vol = vol; >> % cfg.grid.pos = maxpos; >> cfg.keepfilter = 'yes'; >> cfg.dics.projectnoise = 'yes'; >> % cfg.dics.lambda = 0; >> source = ft_sourceanalysis( cfg, timelock); >> >> then I get an error than says: >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in beamformer_lcmv (line 268) >> filt = pinv(lf' * invCy * lf) * lf' * >> invCy; % van Veen eqn. 23, use >> PINV/SVD to cover rank deficient leadfield >> >> Error in ft_sourceanalysis (line 794) >> dip(i) = beamformer_lcmv(grid, sens, vol, >> squeeze_avg, squeeze(Cy(i,:,:)), >> optarg{:}); >> >> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >> Is this the correct approach. >> >> Thankyou in advance! >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 5:30 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> what you are describing sounds to me like the center bias of the >> beamformer. Did you contrast the activity with anything, or did you >> normalize your leadfield? >> Check this out: >> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >> >> Best, >> Jörn >> >> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>> I have been trying to plot my interpolated source data using the code: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time dimension >>> is not needed. >>> >>> % Plot interpolated data >>> cfg = []; %#ok >>> cfg.method = 'ortho'; % spline >>> cfg.funparameter = 'avg.pow'; >>> ft_sourceplot( cfg, sourceInt); >>> >>> However the figure that comes up just had orange squares in the subplots. >>> >>> I dont know where Ive gone wrong. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 tyler.grummett at flinders.edu.au Mon Mar 31 15:15:19 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 13:15:19 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <5339578D.4050308@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> Message-ID: Hey Jorn, Yes I am definitely confused haha, this stuff is way out of my league as a PhD student. Anyway, I feel we are getting somewhere. timelock = avg: [121x19767 double] var: [121x19767 double] time: [1x19767 double] dof: [121x19767 double] label: {1x121 cell} dimord: 'chan_time' cov: [121x121 double] elec: [1x1 struct] cfg: [1x1 struct] source = time: [1x19767 double] pos: [642x3 double] inside: [642x1 double] outside: [] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] sourceInt = time: [1x19767 double] avg: [1x1 struct] pos: [16777216x3 double] dim: [256 256 256] inside: [1x16777216 double] outside: [1x0 double] coordsys: 'ctf' unit: 'mm' cfg: [1x1 struct] Given what I said last time, I might not comment on the differences. I hope you can see something wrong. One thing I should mention is that the data is continuous, around 30 seconds. Therefore there is only one trial, is that an issue? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 10:24 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, there is not much inherently different between time- and freuqency-domain beamformer, at least in terms of computing the forward and the inverse solution. But I see that you are obviously confused, so let me try to help you out and shed some light on what you are actually doing ;) > I had a look at my variables. > > source.avg = > > pow: [642x1 double] > filter: {642x1 cell} > > sourceInt.avg = > > pow: [16777216x1 double] > > So clearly, as both variables are completely different. Something has gone wrong. No, that is actually how it should be. From below you can see that your MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = 16777216 elements. In line with source.avg.pow, you should see that your 'grid' consists of 642 elements, so you were computing your source activity on a grid of in total 642 elements. Then you used the original MRI to interpolate from 642 to these 16 million grid points. Actually, since you specific cfg.downsample = 2, it should have been only 8 million points, so that's where things already get a bit weird. So let's go into some sanity checks: 1. are you using the latest version (or a recent, i.e. from this year) of FielTrip? 2. sourceInt should look something like this, does it? source_diff_int = inside: [46x55x46 logical] avg: [1x1 struct] dim: [46 55 46] transform: [4x4 double] anatomy: [46x55x46 double] unit: 'mm' cfg: [1x1 struct] 3. source should look something like this: source = dim: [20 25 22] freq: 54.8287 cumtapcnt: [338x1 double] pos: [11000x3 double] inside: [1x5798 double] outside: [1x5202 double] method: 'average' avg: [1x1 struct] trialinfo: [338x1 double] cfg: [1x1 struct] 4. also check your grid, should be something like this: sourcemodel = pos: [11000x3 double] dim: [20 25 22] unit: 'cm' inside: [1x5798 double] outside: [1x5202 double] params: [1x1 struct] initial: [4x4 double] cfg: [1x1 struct] Of course, it should all look a bit different, because you are using LCMV, but essentially it should be the same. Lastly, you can check other source plotting methods, like 'ortho' or try to plot the source structure rather than the sourceInt structure. In the end, the error must be somewhere in your grid, be it in .pos or .inside, because FieldTrip thinks that there is only one voxel to be plotted. There are other things that may be the issue, but I am not sure about these. So, I would suggest that you play a bit around and see where the error might come from (e.g. follow this tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the steps that you need for LCMV, maybe also check out: http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg there, LCMV is used, but on one voxel only) Best, Jörn > > The next part of my code is the following: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter > % does not vary over time, therefore the time dimension is not needed. > > mri = > > anatomy: [256x256x256 double] > dim: [256 256 256] > transform: [4x4 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. > > Ive been wrong before though, > > thanks for your help. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 7:13 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > hm, okay, it could be that the issue with the leadfield and with the > plot are related, but it could also be that they are separate issues. I > just saw that you posted the same 'problem' on bugzilla and included a > picture. Maybe for next time, include a picture on the mailinglist and > just create a bug on bugzilla if you are sure it is a bug in Fieldtrip > and not if you are not sure. That saves us a lot of time in separating > code issues from user problems ;) > > So, back to you problem. It seems that your reconstruction results in > one voxel only. Are you sure that your grid consistents of more than > just one position? So, for example check the size of the matrices in > source.avg, source- and headmodel, etc. > > Also, you can check in Matlab the respective fields of source and > sourceInt and see whether that makes sense. > > Lastly, a neat way to check is always to use your code on data from the > tutorial, and vice versa, use code from the tutorial on your data and > see whether that works. Both should give sensible results, and if one > does not, you know where to start looking for a solution ;) > > Best, > Jörn > > > On 3/31/2014 9:41 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >> >> % compute lead field ( apparently source analysis computes >> % lead field anyway >> cfg = []; >> cfg.elec = timelock.elec; >> cfg.vol = vol; >> cfg.reducerank = 3; >> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >> cfg.grid.unit = 'cm'; >> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >> >> and then calculate the source analysis: >> >> % Source Analysis: without contrasting condition >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = grid; >> cfg.vol = vol; >> % cfg.grid.pos = maxpos; >> cfg.keepfilter = 'yes'; >> cfg.dics.projectnoise = 'yes'; >> % cfg.dics.lambda = 0; >> source = ft_sourceanalysis( cfg, timelock); >> >> then I get an error than says: >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in beamformer_lcmv (line 268) >> filt = pinv(lf' * invCy * lf) * lf' * >> invCy; % van Veen eqn. 23, use >> PINV/SVD to cover rank deficient leadfield >> >> Error in ft_sourceanalysis (line 794) >> dip(i) = beamformer_lcmv(grid, sens, vol, >> squeeze_avg, squeeze(Cy(i,:,:)), >> optarg{:}); >> >> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >> Is this the correct approach. >> >> Thankyou in advance! >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 5:30 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> what you are describing sounds to me like the center bias of the >> beamformer. Did you contrast the activity with anything, or did you >> normalize your leadfield? >> Check this out: >> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >> >> Best, >> Jörn >> >> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>> I have been trying to plot my interpolated source data using the code: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time dimension >>> is not needed. >>> >>> % Plot interpolated data >>> cfg = []; %#ok >>> cfg.method = 'ortho'; % spline >>> cfg.funparameter = 'avg.pow'; >>> ft_sourceplot( cfg, sourceInt); >>> >>> However the figure that comes up just had orange squares in the subplots. >>> >>> I dont know where Ive gone wrong. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hweeling.lee at gmail.com Mon Mar 31 16:48:34 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 31 Mar 2014 16:48:34 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab Message-ID: Dear all, I'm encountering a problem with running ICA in Matlab. After ICA, when I tried to plot the components, Matlab keeps prompting an internal problem and needs to be closed. I wonder why this is the case. Could someone please tell me what went wrong? Here's part of my script for ICA: cfg = []; % if data were cleaned, then use this if sub == 5 %|| sub == 7 cfg.channel = {'all', '-AFz', '-FT7'}; elseif sub == 7 cfg.channel = {'all' '-AFz'}; else cfg.channel = {'all'}; end % cfg.runica.pca = 121; % using the rank of my data % ic_data = ft_componentanalysis(cfg,cleandata); % if data were cleaned then use this ic_data = ft_componentanalysis(cfg, cleandata); % after ICA, look for components that we want to substract from our data, % only looking at ten channels (components) at a time cfg = []; cfg.dataset = rawdatafile; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blocksize = 8; cfg.channels = 'all'; cfg.layout = 'EEG1020.lay'; ft_databrowser(cfg,ic_data); The internal problem appears even when I downsampled my data from 5000 Hz to 1000 Hz. The internal problem appears also when I have short segments of my data (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). The memory of my PC workstation is: Maximum possible array: 60253 MB (6.318e+10 bytes) * Memory available for all arrays: 60253 MB (6.318e+10 bytes) * Memory used by MATLAB: 560 MB (5.872e+08 bytes) Physical Memory (RAM): 32685 MB (3.427e+10 bytes) Interestingly, this internal problem does not occur when I ran my script on my Macbook Pro. I'm feeling very lost here. Any help is highly appreciated. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 16:56:57 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 16:56:57 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> Message-ID: <53398239.1010004@donders.ru.nl> Hi Tyler, yes, it seems like something went wrong in the computation of your forward model. Usually, your source structure should have a .dim field, specifying the dimensions of your .pos matrix. The pos-matrix has to be a regular 3D grid, i.e. be representable as a 3x3x3 matrix. I am not quite sure how the sourceinterpolate function is handeling the fact that you do not have that .dim field. Apparently, it is also confused ;) Do you want to reconstruct only some voxels? From your code it seems that you want to cover the whole brain with a 1cm resolution. If the latter is the case, maybe restart with creating your forward model by following the tutorial that I posted in my previous mail. There are some sanity checks that can help you figuring out if you are doing the correct thing. If the former one is the case, please explain again what exactly you want to achieve and how you are building your forward model. Best, Jörn btw, there's nothing wrong with being a PhD student, it's just a matter of experience in practice and theory as in all domains in life ;) On 3/31/2014 3:15 PM, Tyler Grummett wrote: > Hey Jorn, > > Yes I am definitely confused haha, this stuff is way out of my league as a PhD student. > Anyway, I feel we are getting somewhere. > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > source = > > time: [1x19767 double] > pos: [642x3 double] > inside: [642x1 double] > outside: [] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > sourceInt = > > time: [1x19767 double] > avg: [1x1 struct] > pos: [16777216x3 double] > dim: [256 256 256] > inside: [1x16777216 double] > outside: [1x0 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > Given what I said last time, I might not comment on the differences. I hope you can see something wrong. > > One thing I should mention is that the data is continuous, around 30 seconds. Therefore there is only one trial, > is that an issue? > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 10:24 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > there is not much inherently different between time- and > freuqency-domain beamformer, at least in terms of computing the forward > and the inverse solution. But I see that you are obviously confused, so > let me try to help you out and shed some light on what you are actually > doing ;) > > >> I had a look at my variables. >> >> source.avg = >> >> pow: [642x1 double] >> filter: {642x1 cell} >> >> sourceInt.avg = >> >> pow: [16777216x1 double] >> >> So clearly, as both variables are completely different. Something has gone wrong. > No, that is actually how it should be. From below you can see that your > MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = > 16777216 elements. In line with source.avg.pow, you should see that your > 'grid' consists of 642 elements, so you were computing your source > activity on a grid of in total 642 elements. Then you used the original > MRI to interpolate from 642 to these 16 million grid points. Actually, > since you specific cfg.downsample = 2, it should have been only 8 > million points, so that's where things already get a bit weird. > > So let's go into some sanity checks: > 1. are you using the latest version (or a recent, i.e. from this year) > of FielTrip? > 2. sourceInt should look something like this, does it? > > source_diff_int = > inside: [46x55x46 logical] > avg: [1x1 struct] > dim: [46 55 46] > transform: [4x4 double] > anatomy: [46x55x46 double] > unit: 'mm' > cfg: [1x1 struct] > > > > 3. source should look something like this: > > source = > dim: [20 25 22] > freq: 54.8287 > cumtapcnt: [338x1 double] > pos: [11000x3 double] > inside: [1x5798 double] > outside: [1x5202 double] > method: 'average' > avg: [1x1 struct] > trialinfo: [338x1 double] > cfg: [1x1 struct] > > 4. also check your grid, should be something like this: > > sourcemodel = > > pos: [11000x3 double] > dim: [20 25 22] > unit: 'cm' > inside: [1x5798 double] > outside: [1x5202 double] > params: [1x1 struct] > initial: [4x4 double] > cfg: [1x1 struct] > > > Of course, it should all look a bit different, because you are using > LCMV, but essentially it should be the same. Lastly, you can check other > source plotting methods, like 'ortho' or try to plot the source > structure rather than the sourceInt structure. In the end, the error > must be somewhere in your grid, be it in .pos or .inside, because > FieldTrip thinks that there is only one voxel to be plotted. There are > other things that may be the issue, but I am not sure about these. So, I > would suggest that you play a bit around and see where the error might > come from (e.g. follow this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the > steps that you need for LCMV, maybe also check out: > http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg > there, LCMV is used, but on one voxel only) > > Best, > Jörn > >> The next part of my code is the following: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter >> % does not vary over time, therefore the time dimension is not needed. >> >> mri = >> >> anatomy: [256x256x256 double] >> dim: [256 256 256] >> transform: [4x4 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. >> >> Ive been wrong before though, >> >> thanks for your help. >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 7:13 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> hm, okay, it could be that the issue with the leadfield and with the >> plot are related, but it could also be that they are separate issues. I >> just saw that you posted the same 'problem' on bugzilla and included a >> picture. Maybe for next time, include a picture on the mailinglist and >> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >> and not if you are not sure. That saves us a lot of time in separating >> code issues from user problems ;) >> >> So, back to you problem. It seems that your reconstruction results in >> one voxel only. Are you sure that your grid consistents of more than >> just one position? So, for example check the size of the matrices in >> source.avg, source- and headmodel, etc. >> >> Also, you can check in Matlab the respective fields of source and >> sourceInt and see whether that makes sense. >> >> Lastly, a neat way to check is always to use your code on data from the >> tutorial, and vice versa, use code from the tutorial on your data and >> see whether that works. Both should give sensible results, and if one >> does not, you know where to start looking for a solution ;) >> >> Best, >> Jörn >> >> >> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >>> >>> % compute lead field ( apparently source analysis computes >>> % lead field anyway >>> cfg = []; >>> cfg.elec = timelock.elec; >>> cfg.vol = vol; >>> cfg.reducerank = 3; >>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >>> cfg.grid.unit = 'cm'; >>> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >>> >>> and then calculate the source analysis: >>> >>> % Source Analysis: without contrasting condition >>> cfg = []; >>> cfg.method = 'lcmv'; >>> cfg.grid = grid; >>> cfg.vol = vol; >>> % cfg.grid.pos = maxpos; >>> cfg.keepfilter = 'yes'; >>> cfg.dics.projectnoise = 'yes'; >>> % cfg.dics.lambda = 0; >>> source = ft_sourceanalysis( cfg, timelock); >>> >>> then I get an error than says: >>> >>> Error using * >>> Inner matrix dimensions must agree. >>> >>> Error in beamformer_lcmv (line 268) >>> filt = pinv(lf' * invCy * lf) * lf' * >>> invCy; % van Veen eqn. 23, use >>> PINV/SVD to cover rank deficient leadfield >>> >>> Error in ft_sourceanalysis (line 794) >>> dip(i) = beamformer_lcmv(grid, sens, vol, >>> squeeze_avg, squeeze(Cy(i,:,:)), >>> optarg{:}); >>> >>> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >>> Is this the correct approach. >>> >>> Thankyou in advance! >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Monday, 31 March 2014 5:30 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> Hi Tyler, >>> >>> what you are describing sounds to me like the center bias of the >>> beamformer. Did you contrast the activity with anything, or did you >>> normalize your leadfield? >>> Check this out: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>> >>> Best, >>> Jörn >>> >>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>> I have been trying to plot my interpolated source data using the code: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time dimension >>>> is not needed. >>>> >>>> % Plot interpolated data >>>> cfg = []; %#ok >>>> cfg.method = 'ortho'; % spline >>>> cfg.funparameter = 'avg.pow'; >>>> ft_sourceplot( cfg, sourceInt); >>>> >>>> However the figure that comes up just had orange squares in the subplots. >>>> >>>> I dont know where Ive gone wrong. >>>> >>>> >>>> Tyler >>>> >>>> >>>> ************************* >>>> >>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>> /PhD Candidate/ >>>> /Brain Signals Laboratory/ >>>> /Flinders University/ >>>> /Rm 5A301/ >>>> /Ext 66124/ >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 gio at gpiantoni.com Mon Mar 31 17:01:41 2014 From: gio at gpiantoni.com (Gio Piantoni) Date: Mon, 31 Mar 2014 11:01:41 -0400 Subject: [FieldTrip] help about ' fieldtrip2fiff ' In-Reply-To: References: Message-ID: Hi Xiao, Nice that updating the FieldTrip version was sufficient to get rid of the initial error. The current error is related to writing permissions on your OS: https://github.com/fieldtrip/fieldtrip/blob/master/external/mne/fiff_start_file.m#L35 The command that fails is fopen (matlab built-in command). Can you try to run: [fid,message] = fopen(name,'w+','ieee-be'); where 'name' is the name of the file that you want to write in FIFF format. If that fails, please have a look at the matlab documentation for fopen and related troubleshooting. Best, -g On Mon, Mar 31, 2014 at 4:37 AM, tongxiao meng wrote: > Hi all > > I downloading a new version of FieldTrip, but there are also have some > errors, > > ??? Error using ==> fiff_start_file at 35 > Permission denied > > Error in ==> fiff_start_writing_raw at 54 > fid = fiff_start_file(name); > > Error in ==> fieldtrip2fiff at 124 > [outfid, cals] = fiff_start_writing_raw(fifffile, info); > > Why? > thanks, > xiao > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 31 17:12:24 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 17:12:24 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <53398239.1010004@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl> Message-ID: <533985D8.4080504@donders.ru.nl> just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- 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 hweeling.lee at gmail.com Mon Mar 31 17:25:10 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 31 Mar 2014 17:25:10 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: Message-ID: Hi, Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of RAM installed. In the previous month, I was able to run ICA and plot its components without any error message from Matlab. Recently, I keep experiencing the error message, and Matlab crashes completely. I have no clue what could have gone wrong. Cheers, Hweeling On 31 March 2014 17:08, Stephen Politzer-Ahles wrote: > Hello Hweeling, > > What kind of error do you get in MATLAB when you try to do ICA, is it an > "Out of memory" error? I'm asking because this is a fairly common issue in > MATLAB on Windows systems (I don't know the details of your data, but I've > experienced this issue on 32-channel, 1000-Hz epoched EEG data if the > epochs are long enough and numerous enough). For me the only solutions > (other than shortening the epochs or downsampling the data, which might not > be good options depending on your research question) were to use a > Unix-based operating system (like Mac OS) or to upgrade my Windows (I had > errors like this when using a 32-bit version of Windows with 2 GB of RAM, > but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure > if this is the issue you're having, though. > > Best, > Steve > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 7:02 PM, wrote: > >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) >> 2. Re: plotting interpolated sources with ft_sourceplot >> (J?rn M. Horschig) >> 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 31 Mar 2014 16:48:34 +0200 >> From: Hwee Ling Lee >> To: FieldTrip discussion list >> Subject: [FieldTrip] Fieldtrip ICA crashes Matlab >> Message-ID: >> > poVtb-1ApZuDQ at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Dear all, >> >> I'm encountering a problem with running ICA in Matlab. After ICA, when I >> tried to plot the components, Matlab keeps prompting an internal problem >> and needs to be closed. I wonder why this is the case. Could someone >> please >> tell me what went wrong? >> >> Here's part of my script for ICA: >> >> cfg = []; % if data were cleaned, then use this >> >> if sub == 5 %|| sub == 7 >> cfg.channel = {'all', '-AFz', '-FT7'}; >> elseif sub == 7 >> cfg.channel = {'all' '-AFz'}; >> else >> cfg.channel = {'all'}; >> end >> >> % cfg.runica.pca = 121; % using the rank of my data >> % ic_data = ft_componentanalysis(cfg,cleandata); % if data were >> cleaned then use this >> ic_data = ft_componentanalysis(cfg, cleandata); >> >> % after ICA, look for components that we want to substract from >> our >> data, >> % only looking at ten channels (components) at a time >> cfg = []; >> cfg.dataset = rawdatafile; >> cfg.viewmode = 'component'; >> cfg.continuous = 'no'; >> cfg.blocksize = 8; >> cfg.channels = 'all'; >> cfg.layout = 'EEG1020.lay'; >> ft_databrowser(cfg,ic_data); >> >> >> The internal problem appears even when I downsampled my data from 5000 Hz >> to 1000 Hz. >> >> The internal problem appears also when I have short segments of my data >> (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). >> >> The memory of my PC workstation is: >> Maximum possible array: 60253 MB (6.318e+10 bytes) * >> Memory available for all arrays: 60253 MB (6.318e+10 bytes) * >> Memory used by MATLAB: 560 MB (5.872e+08 bytes) >> Physical Memory (RAM): 32685 MB (3.427e+10 bytes) >> >> Interestingly, this internal problem does not occur when I ran my script >> on >> my Macbook Pro. >> >> I'm feeling very lost here. Any help is highly appreciated. >> >> Cheers, >> Hweeling >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html >> > >> > -- ================================================= 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 ktyler at swin.edu.au Mon Mar 31 17:32:24 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 31 Mar 2014 15:32:24 +0000 Subject: [FieldTrip] ft_volumerealign and ft_dipolefitting Message-ID: Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Mon Mar 31 17:34:03 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 31 Mar 2014 15:34:03 +0000 Subject: [FieldTrip] FW: ft_volumerealign and ft_dipolefitting In-Reply-To: References: Message-ID: Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia ________________________________ From: Kaelasha Tyler Sent: Tuesday, 1 April 2014 2:32 AM To: fieldtrip at science.ru.nl Subject: ft_volumerealign and ft_dipolefitting Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VolSens.jpg Type: image/jpeg Size: 27213 bytes Desc: VolSens.jpg URL: From r.oostenveld at donders.ru.nl Mon Mar 31 21:41:48 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 31 Mar 2014 21:41:48 +0200 Subject: [FieldTrip] Donders Summer School References: <9C7B0CAE-BE54-4F49-A444-7D1C3C98F1B1@gmail.com> Message-ID: Radboud Summer School Neural metrics: Quantitative analysis of neural organisation and function The Donders Institute for Brain, Cognition and Behaviour is organizing a summer school on neural metrics where the aim is to get participants acquainted with the quantitative analysis of neural organisation and function. We have compiled an exciting program with an excellent set of national and international speakers. Topics range from the analysis of single-neuron responses to the analysis of macroscopic brain networks. The course is designed for PhD students and starting postdoctoral researchers working at the interface between cognitive neuroscience and the application of advanced methods. Please consult the Radboud Summer School website for details on the programme, social events and registration. Further details for the Neural Metrics Summer School can be found below and on the website. Note that the early bird deadline is April 1st. Dates Monday 11 August - Friday 15 August 2014 (one week) Course leaders Dr. M. (Marcel) van Gerven, Assisstant Professor Prof. T. (Tansu) Celikel, Professor Neurophysiology Donders Institute for Brain, Cognition and Behaviour Entry level PhD students in the field of Neuroscience with an MSc in Biology, Computer Science, Psychology, Physics, Al or similar subject For whom is this course designed This course was developed for PhD students (10 local + 20 international) and early postdoctoral researchers working at the interface between cognitive neuroscience and the application of advanced methods. This includes cognitive neuroscientists and researchers with practical experience. Admission requirements As part of the admission procedure, we ask you to send us your CV and a motivation letter in which you explain your interest for our course. Course fee €400 The course fee includes the registration fee, course materials, access to library and IT facilities, coffee/tea, lunch, and a number of social activities. Accommodation is available for the course participants. For details please see http://www.ru.nl/radboudsummerschool/practical-matters/housing/ Discounts • 10% discount for early bird applicants. The early bird deadline is 1 April 2014. • 15% discount for students and PhD candidates from Radboud University and partner universities Course description The brain as a network In order to fully understand the neuronal substrate of human cognition, we need to start viewing the working brain as a network.Many neurological and mental disorders are viewed as the result of a malfunction at the network level. The growing interest in brain networks is complemented by rapid theoretical and technical developments. We will embrace these developments throughout the course to help us understand the human brain network. This will be done by examining the theoretical background and by learning the necessary measurement and data analysis techniques used to study brain connectivity. The topics will be structured according to micro, meso and macro-scale connectivity. Course contents Micro-scale connectivity involves neuron communication at the cellular and synaptic level; mesa-scale connectivity addresses communication between brain regions; and macro-scale connectivity explores the structure and dynamics of large brain networks. We will strive to include components of electrophysiology, anatomy, functional blood flow measures, computational modelling and advanced data analysis at each level. While doing so, we will focus on both the animal and human brain. The course consists of lectures and computer exercises, supplemented with in-depth discussions. Lecture slides and exercises will also be distributed among the participants. We will ensure active participation in the following way: • In the hands-on sessions you will work together in small groups (2-3 people). These sessions will include exercises aimed at promoting discussions and encouraging you to reflect on the core theoretical issues. Learning outcomes 1. Understand new techniques and approaches in the field of neuroscience networks 2. Understand the basics of new connectivity analysis tools 3. Understand new theories and computational modelling approaches 4. Identify the appropriate research methodology for answering specific research questions on brain connectivity 5. Improve your communication skills and develop research questions in a group setting Number of ECTS credits 2 ECTS credits Registration For registration, please consult the website. More information radboudsummerschool at ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From aharown at hotmail.com Mon Mar 31 21:51:51 2014 From: aharown at hotmail.com (Aaron Hanford) Date: Mon, 31 Mar 2014 14:51:51 -0500 Subject: [FieldTrip] ICA: eeglab and fieldtrip Message-ID: Hi,I'm resending this with the figures turned into jpgs so it's not oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab (although much more so to fieldtrip). I'm trying to figure out the following: On the exact same dataset, I did the following two things: 1) in eeglab, I just chose Tools -> Run ICA with default settings. Then, starting over with the original raw data: 2) In fieldtrip I ran the following: data = eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = 'runica';[comp]=ft_componentanalysis(cfg,data);layout = 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); In both cases I then plotted the 2-D component maps, attached. So my question is, why are these results so completely different? The fieldtrip results don't look right at all, in that for instance they don't obviously identify a blink component (note that in this dataset, there is only one electrode placed near the right eye, not the left). I did this a handful of times and got the same sort of big differences. Am I doing something wrong or what? I actually think the cap file seems incorrect, but I've been assured by my PI that it's correct, so .... is there another likely answer? Thanks, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip.JPG Type: image/jpeg Size: 110477 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eeglab.JPG Type: image/jpeg Size: 99185 bytes Desc: not available URL: From spa268 at nyu.edu Mon Mar 31 22:08:55 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Tue, 1 Apr 2014 00:08:55 +0400 Subject: [FieldTrip] ICA: eeglab and fieldtrip Message-ID: Hello Aaron, This doesn't, answer the rest of your questions, but... In your attached Fieldtrip image, component 1 does look like a likely blink component to me? Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ On Mon, Mar 31, 2014 at 11:52 PM, wrote: > > Message: 2 > Date: Mon, 31 Mar 2014 14:51:51 -0500 > From: Aaron Hanford > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] ICA: eeglab and fieldtrip > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi,I'm resending this with the figures turned into jpgs so it's not > oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab > (although much more so to fieldtrip). I'm trying to figure out the > following: > On the exact same dataset, I did the following two things: > 1) in eeglab, I just chose Tools -> Run ICA with default settings. > Then, starting over with the original raw data: > 2) In fieldtrip I ran the following: data = > eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = > 'runica';[comp]=ft_componentanalysis(cfg,data);layout = > 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component > = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); > In both cases I then plotted the 2-D component maps, attached. > So my question is, why are these results so completely different? The > fieldtrip results don't look right at all, in that for instance they don't > obviously identify a blink component (note that in this dataset, there is > only one electrode placed near the right eye, not the left). I did this a > handful of times and got the same sort of big differences. Am I doing > something wrong or what? > > I actually think the cap file seems incorrect, but I've been assured by my > PI that it's correct, so .... is there another likely answer? > Thanks, > Aaron > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip.JPG > Type: image/jpeg > Size: 110477 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.jpe > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: eeglab.JPG > Type: image/jpeg > Size: 99185 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment-0001.jpe > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 40, Issue 48 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Mar 31 22:10:36 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 31 Mar 2014 22:10:36 +0200 Subject: [FieldTrip] ICA: eeglab and fieldtrip In-Reply-To: References: Message-ID: Hi Aaron (i see Stephen just wrote a similar response) Those component topoplots look pretty good to me. In the FT one, I would say the first and third have a good change of being related to eyeblinks, and the fifth and twenty-fifth to eye-movements. However, you should really look at the timecourses to identify them as related to saccades and blinks, and by comparing them with your EOG recording. Although each ICA will *always* give you different results (if you don't specifiy the random seed), to make them more comparable you could add the EOG channel to the layout. Cheer, Stephen On 31 March 2014 22:08, Stephen Politzer-Ahles wrote: > Hello Aaron, > > This doesn't, answer the rest of your questions, but... In your attached > Fieldtrip image, component 1 does look like a likely blink component to me? > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 11:52 PM, wrote: > >> >> Message: 2 >> Date: Mon, 31 Mar 2014 14:51:51 -0500 >> From: Aaron Hanford >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] ICA: eeglab and fieldtrip >> Message-ID: >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi,I'm resending this with the figures turned into jpgs so it's not >> oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab >> (although much more so to fieldtrip). I'm trying to figure out the >> following: >> >> On the exact same dataset, I did the following two things: >> 1) in eeglab, I just chose Tools -> Run ICA with default settings. >> Then, starting over with the original raw data: >> 2) In fieldtrip I ran the following: data = >> eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = >> 'runica';[comp]=ft_componentanalysis(cfg,data);layout = >> 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component >> = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); >> In both cases I then plotted the 2-D component maps, attached. >> So my question is, why are these results so completely different? The >> fieldtrip results don't look right at all, in that for instance they don't >> obviously identify a blink component (note that in this dataset, there is >> only one electrode placed near the right eye, not the left). I did this a >> handful of times and got the same sort of big differences. Am I doing >> something wrong or what? >> >> I actually think the cap file seems incorrect, but I've been assured by >> my PI that it's correct, so .... is there another likely answer? >> Thanks, >> Aaron >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.html >> > >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: fieldtrip.JPG >> Type: image/jpeg >> Size: 110477 bytes >> Desc: not available >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.jpe >> > >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: eeglab.JPG >> Type: image/jpeg >> Size: 99185 bytes >> Desc: not available >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment-0001.jpe >> > >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 40, Issue 48 >> ***************************************** >> > > > _______________________________________________ > 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 Sat Mar 1 09:22:44 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Sat, 1 Mar 2014 09:22:44 +0100 Subject: [FieldTrip] Plotting ERP data: From topoplot to 3D brain surface plot In-Reply-To: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> References: <20140227090824.dh9l8fqvkc4cg844@imap.uni-ulm.de> Message-ID: Hi Barbara, Could you maybe post some of the code you are using to generate your plots, and examples of the plots you are getting? Best, Eelke On 27 February 2014 09:08, wrote: > Dear Fieldtripers, > > I have ERP data from a normal oddball task (low pitch tones vs. high pitch > tones) resulting in a P300. I know how to plot them with the normal > ft_topoplot command. For just visualization, this is fine, but for a > publication I would like to plot my data on a 3D brain surface. > I know how to do that with the ft_sourceplot command. I tried it with my > data, but the result is not even close to what I see when I plot it with the > ft_topoplot command (I don's see the nice big blob of activity in the > parietal cortex). > I guess the problem is that I do more analizyng steps in order to get the > data structure which is needed for sourceplotting. > > What I really just want to do is putting my topoplot on a brainsurface. Is > that possible in fieldtrip or do I need to use another software? > > Thank you very much for your help!! > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From inbalots at gmail.com Sun Mar 2 08:37:51 2014 From: inbalots at gmail.com (Inbal Shapira) Date: Sun, 2 Mar 2014 09:37:51 +0200 Subject: [FieldTrip] Question regarding the meaning of cluster statistic Message-ID: Hi all. My question is: to know if I understand correctly the non parametric process using permutations, and to understand the process for the clustering part in it. I wanted to make sure I understand correctly the meaning of the results I'm getting when using the non parametric approach* for multiple subjects* and the cluster statistics. i.e. I compare an 'Active' and 'Control' data sets that each subject has (for example, for 8 subject I have 16 averages over trials) As far as I understand: Each subject has a subject-specific-average that is calculated for each condition (i.e. one vector (1X248 channels) for each condition that contains the average over selected time, freq and trials). Then, randomly permute the subject-specific averages of the two conditions, independently for every subject (i.e. in each permutation there will be one average selected from each subject) and calculate the statistic results for each channel. We repeat this step many times as to construct a "permutation distribution" from the statistics value from each permutation. finally, we look at the real "active vs control" statistics to see where their value lies in this permutation distribution, and that is the value we will save for that channel in the XXX.stat field. (we have 248 values and permutation distributions, one for each channel). When we want the "clusters" - I am not totally understand the process here. In the paper by Maris and Oostenveld , 2007 they talk about cluster in the following manner: A Cluster based permutation test, is a test in which for each partition we cluster an *adjacent time samples* that exhibit a similar difference (in sign and magnitude). This is done by selecting all samples whose t-values is larger than some threshold, cluster the selected sample in connected set *on the basis of temporal adjacency* and calculate cluster level statistics by taking the sum of t-values within a cluster. Finally, for each partition we take the largest cluster statistics as a value for the permutation distribution. This distribution will serve us for testing the observed largest cluster statistics as was explained earlier. When I use *cfg.correctm = 'cluster'; *Do we look for adjacent channels that are significant? so the clustering process is a spatial one (and not temporal?) Now for what I did: I applied the statistic test using the following definitions and [stat] = ft_freqstatistics(...): sublist = {'2','3','8','11','15','17','18','19'};% 8 subjects... cfg = []; cfg.channel = {'MEG'}; cfg.latency = [1.8 1.95]; * cfg.method = 'montecarlo';* cfg.frequency = 'all'; * cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster';* cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.025; cfg.numrandomization = 500; cfg_neighb.method = 'distance'; cfg.neighbours = ft_prepare_neighbours(cfg_neighb,alphaAvgSub3note2); Nsub = length(sublist); cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)];% condition number cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub];% subject number cfg.ivar = 1; cfg.uvar = 2; % cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'yes'; [stat] = ft_freqstatistics(cfg, alphaAvgSub2note3, alphaAvgSub3note3, alphaAvgSub8note3, alphaAvgSub11note3,... alphaAvgSub15note3, alphaAvgSub17note3, alphaAvgSub18note3, alphaAvgSub19note3,... alphaAvgSub2note2, alphaAvgSub3note2, alphaAvgSub8note2, ... alphaAvgSub11note2, alphaAvgSub15note2, alphaAvgSub17note2, alphaAvgSub18note2, alphaAvgSub19note2); I then plot the results using ft_clusterplot(...) Thanks a lot Inbal -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Mon Mar 3 08:01:39 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Mon, 3 Mar 2014 15:01:39 +0800 Subject: [FieldTrip] What's maxfilter when read .fif file Message-ID: Dear all: I use the ''ft_read_data'' code read .fif file by fieldtrip I get the following error message: ''Maxshield data has not had maxfilter applied to it - cannot be read by fieldtrip. Apply Neuromag maxfilter before converting to fieldtrip format.'' What should I do or Is there some Matlab codes to read .fif file ? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 3 09:42:19 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 3 Mar 2014 09:42:19 +0100 Subject: [FieldTrip] Band Limited Power Analysis in Fieldtrip? In-Reply-To: <530DEF73.3030605@ucl.ac.uk> References: <530DEF73.3030605@ucl.ac.uk> Message-ID: <146DAD29-49F2-404D-8468-A0F397C81E4C@donders.ru.nl> Dear Ian, The implementation of different filter types is a recurring issue, and we have it on our radar. I suggest you sign up on our bugzilla.fcdonders.nl bug-tracking system and add yourself in the CC for the following bugs: 2453 and 1981. That way you can see what is going on in this direction, and you may even contribute to their swift resolution ;-). As a side note, we try to avoid dependencies on the mathworks toolboxes (such as the signal processing toolbox, stats and image processing) because it allows for broader applicability of the code. In fact, for much of the filtering code we use open source drop in replacement code that has exactly the same functionality as the mathworks version of it. Best, Jan-Mathijs On Feb 26, 2014, at 2:43 PM, Ian M. Andolina wrote: > On 25/02/2014 11:51, fieldtrip-request at science.ru.nl wrote: >> Re: [FieldTrip] Band Limited Power Analysis in Fieldtrip? > Thanks Chaitanya, I get instability for the 1-4Hz band using a 4th order butterworth, but it seems to work for the higher bands (using cfg.bpinstabilityfix = 'reduce' to fix it only for the bands that need it). > > Does anyone know if integrating a chebyshev type-1 filter into fieldtrip preprocessing has been attempted, it is present in the signal processing toolbox and I could do this manually but I'd rather use existing code if possible... > > Thanks again, Ian > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Mar 3 09:55:58 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 3 Mar 2014 08:55:58 +0000 Subject: [FieldTrip] What's maxfilter when read .fif file In-Reply-To: References: Message-ID: Hi Xiao, Maxfilter is a preprocessing step / software package for data coming from MEG systems by Elekta (fif format) (see http://www.megwiki.org/images/a/aa/MaxFilter-2.0.pdf for a description). In short you need to run your data through the Maxfilter software (which should have been provided by Elekta) before you can do anything with it. Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of tongxiao meng [mengtongxiao at gmail.com] Sent: Monday, 3 March 2014 6:01 PM To: fieldtrip Subject: [FieldTrip] What's maxfilter when read .fif file Dear all: I use the ''ft_read_data'' code read .fif file by fieldtrip I get the following error message: ''Maxshield data has not had maxfilter applied to it - cannot be read by fieldtrip. Apply Neuromag maxfilter before converting to fieldtrip format.'' What should I do or Is there some Matlab codes to read .fif file ? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From vanwijk.bernadette at gmail.com Mon Mar 3 18:55:37 2014 From: vanwijk.bernadette at gmail.com (Bernadette van Wijk) Date: Mon, 3 Mar 2014 17:55:37 +0000 Subject: [FieldTrip] SPM course for MEG/EEG in London: May 12-14 Message-ID: Dear all, We are pleased to announce that our annual *SPM course for MEG/EEG* will take place this year from *Monday May 12* to *Wednesday May 14*. Hosted by University College London, the course will be held at Queen Square, a very central location in London (UK). Registration is now open. We offer a reduced rate when attending both the MEG/EEG course and the fMRI course during the second half of the week. For full details see http://www.ucl.ac.uk/ion/articles/courses/SPM2014 The course will present instruction on the analysis of EEG and MEG data. The first two days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day participants will have the opportunity to work on SPM tutorial data sets under the supervision of the course faculty. We also invite students to bring their own data for analysis. The course is suitable for both beginners and more advanced users. The topics that will be covered range from pre-processing and statistical analysis to source analysis and dynamic causal modelling. The program is listed below. Available places are limited so please register as early as possible if you would like to attend! *Monday May 12th * 9.30 - 9.45 SPM introduction and resources *Guillaume Flandin* 9.45 - 10.30 What are we measuring with M/EEG? *Saskia Helbling* 10.30 - 11.15 Data pre-processing *Vladimir Litvak* *Coffee* 11.45 - 12.30 Data pre-processing - demo *Deborah Talmi, Max-Philipp Stenner* 12.30 - 13.15 General linear model and classical inference *Christophe Phillips* *Lunch* 14.15 - 15.00 Multiple comparisons problem and solutions *Guillaume Flandin* 15.00 - 15.45 Bayesian inference *Chris Mathys* *Coffee* 16.15 - 17.45 Statistical analysis of images - demo *Rik Henson, Jason Taylor* 17.45 - ... Clinic - questions & answers session *Karl Friston* *Tuesday May 13th * 9.30 - 10.15 M/EEG source analysis *Gareth Barnes* 10.15 - 11.15 M/EEG source analysis - demo *Jose Lopez, Luzia Troebinger, Ashwini Oswal* *Coffee* 11.45 - 12.30 The principles of DCM *Jean Daunizeau* 12.30 - 13.15 DCM for evoked responses *Ryszard Auksztulewicz* *Lunch* 14.15 - 15.00 DCM for steady state responses *Rosalyn Moran* 15.00 - 15.45 DCM for time-frequency *Bernadette van Wijk* 15.45 - 16.30 DCM - demo *Martin Dietz, Andre Marreiros* *Coffee* 17.00 - 17.45 Bayesian model selection and averaging *Will Penny* 17.45 - ... Clinic - questions & answers session *All faculty members* 19.00 onwards - Social Event *Wednesday May 14th* 9.30 - 17.00 Practical hands-on session in UCL computer class rooms. Participants can either work on SPM tutorial datasets or on their own data with the help of the faculty. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Tue Mar 4 09:50:34 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Tue, 4 Mar 2014 09:50:34 +0100 Subject: [FieldTrip] one sample t-test within a group Message-ID: Hello everyonePls I need your assistance in design matrix for one sample t-test within a group of subjects with the same condition. What I want to do basically is comparing one region of the brain ( for instance frontal or by broadman area, BA) to other rest of the brain after source analysis. I will be glad for your assistance. Azeez Adebimpe -------------- next part -------------- An HTML attachment was scrubbed... URL: From berryv.dberg at gmail.com Tue Mar 4 16:39:11 2014 From: berryv.dberg at gmail.com (berry van den berg) Date: Tue, 4 Mar 2014 10:39:11 -0500 Subject: [FieldTrip] topoplot Message-ID: Dear all, When I export my topoplots to (plot2svg) svg there is this blue square around the headplot (see figure). Does anyone has an idea what causes this? Thanks! Berry [image: Inline images 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 26136 bytes Desc: not available URL: From julian.keil at gmail.com Tue Mar 4 16:56:12 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 4 Mar 2014 16:56:12 +0100 Subject: [FieldTrip] topoplot In-Reply-To: References: Message-ID: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> Dear Berry, have you tried using the print command? That's what I usually use for topoplots and it works fine for me: print -depsc2 -painter Folder/filename.eps Note that I use the "painter" renderer instead of "opengl", as I can't ungroup the elements later on with the latter. Good Luck Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 04.03.2014 um 16:39 schrieb berry van den berg: > Dear all, > > When I export my topoplots to (plot2svg) svg there is this blue square around the headplot (see figure). Does anyone has an idea what causes this? > > Thanks! > > Berry > > > > _______________________________________________ > 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 berryv.dberg at gmail.com Tue Mar 4 17:03:46 2014 From: berryv.dberg at gmail.com (berry van den berg) Date: Tue, 4 Mar 2014 11:03:46 -0500 Subject: [FieldTrip] topoplot In-Reply-To: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> References: <2F4F8578-CFD4-41DD-BC2E-C2719E313E20@gmail.com> Message-ID: Thanks! That seems to work a lot better! Cheers, Berry On 4 March 2014 10:56, Julian Keil wrote: > Dear Berry, > > have you tried using the print command? > That's what I usually use for topoplots and it works fine for me: > > print -depsc2 -painter Folder/filename.eps > > Note that I use the "painter" renderer instead of "opengl", as I can't > ungroup the elements later on with the latter. > Good Luck > > Julian > > ******************** > *Dr. Julian Keil* > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 04.03.2014 um 16:39 schrieb berry van den berg: > > Dear all, > > When I export my topoplots to (plot2svg) svg there is this blue square > around the headplot (see figure). Does anyone has an idea what causes this? > > Thanks! > > Berry > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Berry van den Berg berryv.dberg at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Mar 5 08:33:46 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 5 Mar 2014 08:33:46 +0100 Subject: [FieldTrip] HCP Releases Initial MEG Dataset References: <003001cf3801$f0be9ba0$d23bd2e0$@pcg.wustl.edu> Message-ID: <060788D0-95FF-4656-8739-00992B8C990D@donders.ru.nl> Dear MEG researchers, Please see the announcement below that I am forwarding on behalf of the HCP. News from the Human Connectome Project (HCP) March 4, 2014 The Human Connectome Project (HCP) WU-Minn consortium is pleased to announce our initial release of magnetoencephalography (MEG) data. What’s in the HCP MEG Initial (MEG1) data release? The MEG1 data include 10 complete, high quality datasets from 14 healthy adults collected at rest (rMEG) and during 3 tasks (tMEG) that measure sensory, motor, and cognitive task performance. For 3 subjects in this MEG release, data has already been released for the other modalities in the HCP protocol (T1w and T2w MRI, rfMRI, tfMRI, dMRI, and behavioral measures). MRI and behavioral measures for the remaining 11 subjects will be released as part of the upcoming HCP 500 Subjects Release scheduled for late spring 2014. The MEG1 release includes: · raw, unprocessed MEG data in 4D Neuroimaging format · co-registration information (in the form of transformation matrices) that allow coordinate transformations between individual subject MEG coordinate systems and the MNI coordinate system · volume conduction model of the head (in MATLAB format) · regular 3-D source models (in MATLAB format) · E-Prime log files (tab-delimited and as Excel spreadsheets) · lists of bad channels and bad segments · sets of independent components (each comprising the time course and the sensor map) together with the related classification output · cleaned channel-level processed data aligned to stimulus and response onsets (for the task data) or segmented in short pieces (2 sec epochs for the resting state data) · averaged event-related fields and time-frequency estimates of power (for the task data) · averaged power spectra (for the resting state data) Download MEG analysis software. Also available for download and use are pipeline scripts specifically written for analyzing HCP MEG data, collectively called “megconnectome software version 1.0”, and the FieldTrip MATLAB toolbox for MEG and EEG analysis. Seehttp://humanconnectome.org/documentation/MEG1/meg-pipeline.html for more information and to download the software. Access MEG1 data on the HCP website. Learn about and download the HCP MEG1 dataset (~300GB of data!) via the ConnectomeDB database. Most HCP image and behavioral data is openly accessible to investigators worldwide who register and accept a limited set of Open Access Data Use Terms. Want more information? Check out the HCP MEG1 Data Release Reference Manual for a comprehensive guide that includes details on scanning protocols, processing pipelines, and information that will help users obtain and analyze the Q3 data. If you are actively using HCP data and tools, we encourage you to join and be active in the hcp-users discussion group (http://www.humanconnectome.org/contact/#subscribe), so that you can tune in to technical discussions on issues that may be of interest. Thanks again for your interest in the HCP. Please send us your questions and comments anytime to info at humanconnectome.org. Best, The WU-Minn HCP Consortium Jennifer Elam, Ph.D. Outreach Coordinator, Human Connectome Project Washington University School of Medicine Department of Anatomy and Neurobiology, Box 8108 660 South Euclid Avenue St. Louis, MO 63110 314-362-9387 elamj at pcg.wustl.edu www.humanconnectome.org -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.png Type: image/png Size: 58922 bytes Desc: not available URL: From mengtongxiao at gmail.com Wed Mar 5 14:28:48 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Wed, 5 Mar 2014 21:28:48 +0800 Subject: [FieldTrip] =?gb2312?b?SGVscCBhYm91dCBmdF90b3BvcGxvdElDo78=?= Message-ID: Dear all, My question is: I use ICA to remove EOG artifacts, can't plot the components for visual inspection using ft_topoplotIC(). Now for what I did: cfg=[]; cfg.grad =data.grad; layout = ft_prepare_layout(cfg, data); figure cfg = []; cfg.component = [1:20]; cfg.layout = layout ; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) ??? Error using ==> surf at 78 X, Y, Z, and C cannot be complex. Error in ==> ft_plot_topo at 251 h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in ==> topoplot_common at 701 ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ==> ft_topoplotTFR at 191 [cfg] = topoplot_common(cfg, varargin{:}); Error in ==> ft_topoplotIC at 142 ft_topoplotTFR(cfg, varargin{:}); how can I do? Thanks a lot Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Wed Mar 5 14:37:33 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Wed, 5 Mar 2014 14:37:33 +0100 (CET) Subject: [FieldTrip] =?utf-8?q?Help_about_ft=5FtopoplotIC=EF=BC=9F?= In-Reply-To: Message-ID: <957227235.5665491.1394026653690.JavaMail.root@sculptor.zimbra.ru.nl> Hi Xiao , It might be not a plotting but a ICA issue. See here: http :// fieldtrip . fcdonders . nl / faq /why_does_my_ ica _output_contain_complex_numbers If your EEG data is rank deficient (due to preprocessing steps as re-referencing, channel interpolations... before ICA computation), ICA output can contain complex number, which is not a good thing. See the above FAQ to see how to solve it. best, Diego ----- Original Message ----- > From: " tongxiao meng " < mengtongxiao @ gmail .com> > To: " fieldtrip " < fieldtrip @science. ru . nl > > Sent: Wednesday, 5 March, 2014 2:28:48 PM > Subject: [ FieldTrip ] Help about ft_ topoplotIC ? > Dear all, > My question is: I use ICA to remove EOG artifacts, can't plot the > components for visual inspection using ft_ topoplotIC (). > Now for what I did: > cfg =[]; > cfg .grad =data.grad; > layout = ft_prepare_layout( cfg , data); > figure > cfg = []; > cfg .component = [1:20]; > cfg .layout = layout ; > cfg .comment = 'no' ; > ft_ topoplotIC ( cfg , comp) > ??? Error using ==> surf at 78 > X, Y, Z, and C cannot be complex. > Error in ==> ft_plot_ topo at 251 > h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size( Zi )), Zi , 'EdgeColor' , > 'none' , 'FaceColor' , shading); > Error in ==> topoplot _common at 701 > ft_plot_ topo ( chanX , chanY , datavector , 'interpmethod' , cfg > .interpolation,... > Error in ==> ft_ topoplotTFR at 191 > [ cfg ] = topoplot _common( cfg , varargin {:}); > Error in ==> ft_ topoplotIC at 142 > ft_ topoplotTFR ( cfg , varargin {:}); > how can I do? > Thanks a lot > Xiao > _______________________________________________ > 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 mariana_b_rebelo at hotmail.com Wed Mar 5 14:37:51 2014 From: mariana_b_rebelo at hotmail.com (Mariana Rebelo) Date: Wed, 5 Mar 2014 13:37:51 +0000 Subject: [FieldTrip] Number of randomizations + 1 in clustering tests? Message-ID: Dear all I am computing some clustering tests on my MEG data and I don't understand the p-value returned in the field stat.posclusters(1).probIf I perform 1000 randomizations I get a p-value of 0.00799201I don't understand how this is possible, the p-value should be equal to integer/1000, so I should get either 0.0070 or 0.0080It seems that in fact I am not performing 1000 randomizations as I set in numrandomization, but 1001, because then: 8/1001 = 0.00799201 Is this really the case? Is the fieldtrip script adding another randomization to what is set by the user? Thanks!Mariana -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 5 14:58:28 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 05 Mar 2014 14:58:28 +0100 Subject: [FieldTrip] Number of randomizations + 1 in clustering tests? In-Reply-To: References: Message-ID: <53172D84.6010101@donders.ru.nl> Hi Mariana, yes, this is the case. You can think of it as your original data also being an observation, thus needs to be added to the number of permutations. If I remember correctly, this is for example explained here in more detail (and probably in more correct terms): http://www.statsci.org/smyth/pubs/permp.pdf Best, Jörn On 3/5/2014 2:37 PM, Mariana Rebelo wrote: > Dear all > > I am computing some clustering tests on my MEG data and I don't > understand the p-value returned in the field stat.posclusters(1).prob > If I perform 1000 randomizations I get a p-value of 0.00799201 > I don't understand how this is possible, the p-value should be equal > to integer/1000, so I should get either 0.0070 or 0.0080 > It seems that in fact I am not performing 1000 randomizations as I set > in numrandomization, but 1001, because then: 8/1001 = 0.00799201 > > Is this really the case? Is the fieldtrip script adding another > randomization to what is set by the user? > > Thanks! > Mariana > > > _______________________________________________ > 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 f.roux at bcbl.eu Wed Mar 5 16:28:58 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: <341671566.860154.1394033338749.JavaMail.root@bcbl.eu> Dear all, I am using ICA to clean my MEG-data before source analysis. My code looks as follows: cfg = []; cfg.component = [comp_idx]; meg_data = ft_rejectcomponent(cfg,comp,meg_data); However, after the call to ft_rejectcomponent there is no grad field in the meg_data structure. Rather, the grad field ist located under meg_data.hdr.grad. Is this the grad-field that I am supposed to use further downstream in the analysis pipeline, or should there be a grad-field under meg_data.grad? Any help would be much appreciated. Fred From singhharsimrat at gmail.com Wed Mar 5 17:45:07 2014 From: singhharsimrat at gmail.com (Harsimrat Singh) Date: Wed, 5 Mar 2014 16:45:07 +0000 Subject: [FieldTrip] Bipolar neonatal montage -.lay Message-ID: Hi All I was wondering how to create a .lay file for a bipolar montage e.g. the conventional banana shaped neonatal montage - something like 'FP1-T3' 'T3-O1' 'FP1-C3' 'C3-O1' 'Fz-Cz' 'Cz-Pz' 'FP2-C4' 'C4-O2' 'FP2-T4' 'T4-O2' 'T3-C3' 'C3-CZ' 'CZ-C4' 'CZ-PZ' 'C4-T4' Best regards Harsimrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Thu Mar 6 02:09:11 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Thu, 6 Mar 2014 10:09:11 +0900 Subject: [FieldTrip] ft_prepare_neighbours Message-ID: Hello I have a problem with channel repair. Firstly, I created my own layout because I cannot apply my data into the offered layout files. As far as I know, my EEG data was acquired through SynAmps 2 system with 128 electrodes, but I cannot find a suitable layout files. QuikCap_NSL_128 does not match either. Anyway, I created own customized layout, and usual preprocessing steps were done. However, there were some bad recording channels so I removed them during preprocessing. Moreover, the removed channels are different among the subjects, and now it becomes a big problem for analyzing the data. So I tried channel repair process, but encountered with errors. >>> cfg = []; cfg.method = 'template'; cfg.template = 'bj_plot.mat'; cfg.layout = lay; cfg.channel = 'T7'; % channels for which neighbours should be found cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg, data); >>> I think I have to use 'template' method because, there are some missing channels serially. And here are my question. Is it possible to assign my own layout in the cfg.template or cfg.layout? Actually at this step, I do not understand how to proceed. Also, there are many missing channels differ from each subject, but I am not sure which channels should be placed in the cfg.channel. (T7 is one of the missing channel in a subject in my case.) Finally, at 'data' field, is it possible to assign a finalized preprocessed data? And after ft_prepare_neighbours, >>> cfg = []; cfg.method = 'spline' % cfg.badchannel = 'T7'; cfg.missingchannel = 'T7'; cfg.neighbours = neighbours; cfg.trials = 'all' interpolated = ft_channelrepair(cfg, data) Is that right? -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Mar 6 09:37:18 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 6 Mar 2014 09:37:18 +0100 Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: > > Hi Fred, > I use the same code , but the updated grad is stored in the data. meg_data.hdr.grad is the grad before ICA. After ICA , grad needs to be adjusted ,which is used for the later source reconstruction . Do you have the latest FT ? Best, Haiteng > ------------------------------ > > Message: 5 > Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: [FieldTrip] MEG grad data after ICA cleaning > Message-ID: <341671566.860154.1394033338749.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I am using ICA to clean my MEG-data before source analysis. > > My code looks as follows: > > cfg = []; > cfg.component = [comp_idx]; > > meg_data = ft_rejectcomponent(cfg,comp,meg_data); > > However, after the call to ft_rejectcomponent there is no grad field in > the meg_data structure. Rather, the grad field ist located under > meg_data.hdr.grad. > > Is this the grad-field that I am supposed to use further downstream in the > analysis pipeline, or should there be a grad-field under meg_data.grad? > > Any help would be much appreciated. > > Fred > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Thu Mar 6 11:01:02 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Thu, 6 Mar 2014 11:01:02 +0100 (CET) Subject: [FieldTrip] MEG grad data after ICA cleaning In-Reply-To: Message-ID: <282581989.868311.1394100062381.JavaMail.root@bcbl.eu> Dear Haiteng, thx for your response. The reason why the grad field did not appear in my data-structure was that there was no grad field prior to the call to ft_rejectomponent. After modifying my code to: data.grad = data.hdr.grad; cfg = []; cfg.component = comp_idx; new_data = ft_rejectcomponent(cfg,comp,data); I found that new_data has a grad field which has been adjusted for the rejected components. A question related to this issue is whether it matters if I used two different fieldtrip versions for doing the ICA decomposition (fieldtrip-20131120) vs. component rejection (fieldtrip-20140304)? Does anyone know if there are any changes between these versions that could have an effect on my data? Best regards, Fred Frédéric Roux ----- Original Message ----- From: "Haiteng Jiang" To: fieldtrip at science.ru.nl Sent: Thursday, March 6, 2014 9:37:18 AM Subject: Re: [FieldTrip] MEG grad data after ICA cleaning Hi Fred, I use the same code , but the updated grad is stored in the data. meg_data.hdr.grad is the grad before ICA. After ICA , grad needs to be adjusted ,which is used for the later source reconstruction . Do you have the latest FT ? Best, Haiteng ------------------------------ Message: 5 Date: Wed, 5 Mar 2014 16:28:58 +0100 (CET) From: Fr?d?ric Roux < f.roux at bcbl.eu > To: FieldTrip discussion list < fieldtrip at science.ru.nl > Subject: [FieldTrip] MEG grad data after ICA cleaning Message-ID: < 341671566.860154.1394033338749.JavaMail.root at bcbl.eu > Content-Type: text/plain; charset=utf-8 Dear all, I am using ICA to clean my MEG-data before source analysis. My code looks as follows: cfg = []; cfg.component = [comp_idx]; meg_data = ft_rejectcomponent(cfg,comp,meg_data); However, after the call to ft_rejectcomponent there is no grad field in the meg_data structure. Rather, the grad field ist located under meg_data.hdr.grad. Is this the grad-field that I am supposed to use further downstream in the analysis pipeline, or should there be a grad-field under meg_data.grad? Any help would be much appreciated. Fred -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Thu Mar 6 11:24:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Thu, 06 Mar 2014 11:24:43 +0100 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: Message-ID: <53184CEB.9050109@donders.ru.nl> Hi Beom, did your code produce an error? Generally, the 'template' method tries to look for already defined 'template' neighbours. However, as far as I understoog you only created a 'layout', which define where electrodes are placed, but not whether they are neighbours or not. I would advice you to use these settings: cfg = []; cfg.method = 'triangulation'; cfg.layout = lay; cfg.channel = 'all'; % that way you only need to run this once for *all* your subjects cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg); Then, if you are unhappy with the result, for modifcation you can use cfg = []; cfg.neighbours = neighbours; cfg.enableedit = 'yes'; neighbours = ft_neighboursplot(cfg); in that plot, you can click around to mark channels as being neighbours or not. When you are happy, save that neighbour structure and make sure to use it for all your subjects, so that there is no bias for individual subjects. Note that the data variable is used nowhere now, because that would cause missing sensors to be removed from the neighbour structure, but you probably do not want that (or if you do, then use it). And finally, yes, using preprocessed data is possible. Should you have any other questions, feel free to ask. Best, Jörn On 3/6/2014 2:09 AM, Beom Jun Min wrote: > > Hello > > I have a problem with channel repair. > > Firstly, I created my own layout because I cannot apply my data into > the offered layout files. > As far as I know, my EEG data was acquired through SynAmps 2 system > with 128 electrodes, but I cannot find a suitable layout files. > QuikCap_NSL_128 does not match either. > > Anyway, I created own customized layout, and usual preprocessing steps > were done. > However, there were some bad recording channels so I removed them > during preprocessing. > Moreover, the removed channels are different among the subjects, and > now it becomes a big problem for analyzing the data. > > So I tried channel repair process, but encountered with errors. > > >>> > cfg = []; > cfg.method = 'template'; > cfg.template = 'bj_plot.mat'; > cfg.layout = lay; > cfg.channel = 'T7'; % channels for which neighbours should be found > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg, data); > >>> > > I think I have to use 'template' method because, there are some > missing channels serially. > And here are my question. > Is it possible to assign my own layout in the cfg.template or > cfg.layout? Actually at this step, I do not understand how to proceed. > Also, there are many missing channels differ from each subject, but I > am not sure which channels should be placed in the cfg.channel. (T7 is > one of the missing channel in a subject in my case.) > Finally, at 'data' field, is it possible to assign a finalized > preprocessed data? > > And after ft_prepare_neighbours, > > >>> > cfg = []; > cfg.method = 'spline' > % cfg.badchannel = 'T7'; > cfg.missingchannel = 'T7'; > cfg.neighbours = neighbours; > cfg.trials = 'all' > interpolated = ft_channelrepair(cfg, data) > > Is that right? > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com , > http://bmssa.gist.ac.kr > > > _______________________________________________ > 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 mcantor at umich.edu Thu Mar 6 15:19:51 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 6 Mar 2014 09:19:51 -0500 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: <53184CEB.9050109@donders.ru.nl> References: <53184CEB.9050109@donders.ru.nl> Message-ID: Alternatively, you could create a .sfp file for cfg.elecfile of the ft_channelrepair. If your channels are equidistant the equation for determining the neighbours should be fairly straightforward, as long as you have at least the phi and theta coordinates. I talk about it in this thread: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html Here is the conclusion I came to: "For future reference, because I don't remember seeing anything on the fieldtrip FAQ about this and it may be useful to somebody else, the important thing is to turn the phi/theta from degrees into radians, and then applying a trigonometric function to get the X, Y, and Z coordinates. You can do all of these steps in 3 excel functions: X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) Z = =COS(RADIANS(Theta)) This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the coordinate system. I then typed up the channel name, x, y, and z coordinates in a four column notepad document saved as a .sfp file, and used that as my cfg.elecfile." I'm not sure if this is your problem, but I didn't see a cfg.elecfile parameter in your code, so hopefully this helps. On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < jm.horschig at donders.ru.nl> wrote: > Hi Beom, > > did your code produce an error? > > Generally, the 'template' method tries to look for already defined > 'template' neighbours. However, as far as I understoog you only created a > 'layout', which define where electrodes are placed, but not whether they > are neighbours or not. I would advice you to use these settings: > > cfg = []; > cfg.method = 'triangulation'; > cfg.layout = lay; > cfg.channel = 'all'; % that way you only need to run this once for > *all* your subjects > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg); > > Then, if you are unhappy with the result, for modifcation you can use > cfg = []; > cfg.neighbours = neighbours; > cfg.enableedit = 'yes'; > neighbours = ft_neighboursplot(cfg); > > in that plot, you can click around to mark channels as being neighbours or > not. When you are happy, save that neighbour structure and make sure to use > it for all your subjects, so that there is no bias for individual subjects. > > Note that the data variable is used nowhere now, because that would cause > missing sensors to be removed from the neighbour structure, but you > probably do not want that (or if you do, then use it). > > And finally, yes, using preprocessed data is possible. > > Should you have any other questions, feel free to ask. > > Best, > Jörn > > > > On 3/6/2014 2:09 AM, Beom Jun Min wrote: > >> >> Hello >> >> I have a problem with channel repair. >> >> Firstly, I created my own layout because I cannot apply my data into the >> offered layout files. >> As far as I know, my EEG data was acquired through SynAmps 2 system with >> 128 electrodes, but I cannot find a suitable layout files. >> QuikCap_NSL_128 does not match either. >> >> Anyway, I created own customized layout, and usual preprocessing steps >> were done. >> However, there were some bad recording channels so I removed them during >> preprocessing. >> Moreover, the removed channels are different among the subjects, and now >> it becomes a big problem for analyzing the data. >> >> So I tried channel repair process, but encountered with errors. >> >> >>> >> cfg = []; >> cfg.method = 'template'; >> cfg.template = 'bj_plot.mat'; >> cfg.layout = lay; >> cfg.channel = 'T7'; % channels for which neighbours should be found >> cfg.feedback = 'yes'; >> neighbours = ft_prepare_neighbours(cfg, data); >> >>> >> >> I think I have to use 'template' method because, there are some missing >> channels serially. >> And here are my question. >> Is it possible to assign my own layout in the cfg.template or cfg.layout? >> Actually at this step, I do not understand how to proceed. >> Also, there are many missing channels differ from each subject, but I am >> not sure which channels should be placed in the cfg.channel. (T7 is one of >> the missing channel in a subject in my case.) >> Finally, at 'data' field, is it possible to assign a finalized >> preprocessed data? >> >> And after ft_prepare_neighbours, >> >> >>> >> cfg = []; >> cfg.method = 'spline' >> % cfg.badchannel = 'T7'; >> cfg.missingchannel = 'T7'; >> cfg.neighbours = neighbours; >> cfg.trials = 'all' >> interpolated = ft_channelrepair(cfg, data) >> >> Is that right? >> >> >> -- >> BeomJun Min, M.D. >> >> Department of Medical System Engineering (DMSE) >> Gwangju Institute of Science and Technology (GIST) >> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >> 500-712, Republic of Korea (South) >> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >> E-mail: mbj0310 at gmail.com , >> http://bmssa.gist.ac.kr >> >> >> _______________________________________________ >> 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 Heng-RuMay.Tan at glasgow.ac.uk Thu Mar 6 23:18:55 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Thu, 6 Mar 2014 22:18:55 +0000 Subject: [FieldTrip] Q: extraction of MNE source filter to reconstruct single trial source timeseries Message-ID: <5318F44F.20209@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Fri Mar 7 01:41:58 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Fri, 7 Mar 2014 09:41:58 +0900 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: <53184CEB.9050109@donders.ru.nl> Message-ID: Dear Jörn and Max Thank you for your help. However, another error occurred. >>> cfg = []; cfg.method = 'triangulation'; %'distance', 'triangulation' or 'template' (default = 'distance') cfg.layout = lay; cfg.channel = {'all', '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'}; cfg.feedback = 'yes'; neighbours = ft_prepare_neighbours(cfg); >>> These work successfully. But >>> cfg = []; cfg.neighbours = neighbours; cfg.enableedit = 'yes'; neighbours = ft_neighbourplot(cfg); >>> ??? Error using ==> ft_fetch_sens at 179 no electrodes or gradiometers specified. Error in ==> ft_neighbourplot at 85 sens = ft_fetch_sens(cfg); In addition, >>> cfg = []; cfg.method = 'spline'; %'nearest', 'spline' or 'slap' (default='nearest') cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for details cfg.neighbours = neighbours; cfg.trials = 'all'; % cfg.lambda = % regularisation parameter (default = 1e-5, not for method 'distance') % cfg.order = % order of the polynomial interpolation (default = 4, not for method 'distance') interpolated = ft_channelrepair(cfg, final) >>> ??? Error using ==> ft_fetch_sens at 179 no electrodes or gradiometers specified. Error in ==> ft_channelrepair at 112 sens = ft_fetch_sens(cfg, data); It seems the problem is associated with position of electrode. But I do not have manufacture's file. Do I have to make the positions of electrodes manually? Actually, I do not understand the information from help* ft_datatype_sens, and ft_read_sens.* With regards 2014-03-06 23:19 GMT+09:00 Max Cantor : > Alternatively, you could create a .sfp file for cfg.elecfile of the > ft_channelrepair. If your channels are equidistant the equation for > determining the neighbours should be fairly straightforward, as long as you > have at least the phi and theta coordinates. > > I talk about it in this thread: > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html > > Here is the conclusion I came to: > > "For future reference, because I don't remember seeing anything on the > fieldtrip FAQ about this and it may be useful to somebody else, the > important thing is to turn the phi/theta from degrees into radians, and > then applying a trigonometric function to get the X, Y, and Z coordinates. > > You can do all of these steps in 3 excel functions: > > X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) > Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) > Z = =COS(RADIANS(Theta)) > > This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the > coordinate system. > > I then typed up the channel name, x, y, and z coordinates in a four column > notepad document saved as a .sfp file, and used that as my cfg.elecfile." > > I'm not sure if this is your problem, but I didn't see a cfg.elecfile > parameter in your code, so hopefully this helps. > > > On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < > jm.horschig at donders.ru.nl> wrote: > >> Hi Beom, >> >> did your code produce an error? >> >> Generally, the 'template' method tries to look for already defined >> 'template' neighbours. However, as far as I understoog you only created a >> 'layout', which define where electrodes are placed, but not whether they >> are neighbours or not. I would advice you to use these settings: >> >> cfg = []; >> cfg.method = 'triangulation'; >> cfg.layout = lay; >> cfg.channel = 'all'; % that way you only need to run this once for >> *all* your subjects >> cfg.feedback = 'yes'; >> neighbours = ft_prepare_neighbours(cfg); >> >> Then, if you are unhappy with the result, for modifcation you can use >> cfg = []; >> cfg.neighbours = neighbours; >> cfg.enableedit = 'yes'; >> neighbours = ft_neighboursplot(cfg); >> >> in that plot, you can click around to mark channels as being neighbours >> or not. When you are happy, save that neighbour structure and make sure to >> use it for all your subjects, so that there is no bias for individual >> subjects. >> >> Note that the data variable is used nowhere now, because that would cause >> missing sensors to be removed from the neighbour structure, but you >> probably do not want that (or if you do, then use it). >> >> And finally, yes, using preprocessed data is possible. >> >> Should you have any other questions, feel free to ask. >> >> Best, >> Jörn >> >> >> >> On 3/6/2014 2:09 AM, Beom Jun Min wrote: >> >>> >>> Hello >>> >>> I have a problem with channel repair. >>> >>> Firstly, I created my own layout because I cannot apply my data into the >>> offered layout files. >>> As far as I know, my EEG data was acquired through SynAmps 2 system with >>> 128 electrodes, but I cannot find a suitable layout files. >>> QuikCap_NSL_128 does not match either. >>> >>> Anyway, I created own customized layout, and usual preprocessing steps >>> were done. >>> However, there were some bad recording channels so I removed them during >>> preprocessing. >>> Moreover, the removed channels are different among the subjects, and now >>> it becomes a big problem for analyzing the data. >>> >>> So I tried channel repair process, but encountered with errors. >>> >>> >>> >>> cfg = []; >>> cfg.method = 'template'; >>> cfg.template = 'bj_plot.mat'; >>> cfg.layout = lay; >>> cfg.channel = 'T7'; % channels for which neighbours should be found >>> cfg.feedback = 'yes'; >>> neighbours = ft_prepare_neighbours(cfg, data); >>> >>> >>> >>> I think I have to use 'template' method because, there are some missing >>> channels serially. >>> And here are my question. >>> Is it possible to assign my own layout in the cfg.template or >>> cfg.layout? Actually at this step, I do not understand how to proceed. >>> Also, there are many missing channels differ from each subject, but I am >>> not sure which channels should be placed in the cfg.channel. (T7 is one of >>> the missing channel in a subject in my case.) >>> Finally, at 'data' field, is it possible to assign a finalized >>> preprocessed data? >>> >>> And after ft_prepare_neighbours, >>> >>> >>> >>> cfg = []; >>> cfg.method = 'spline' >>> % cfg.badchannel = 'T7'; >>> cfg.missingchannel = 'T7'; >>> cfg.neighbours = neighbours; >>> cfg.trials = 'all' >>> interpolated = ft_channelrepair(cfg, data) >>> >>> Is that right? >>> >>> >>> -- >>> BeomJun Min, M.D. >>> >>> Department of Medical System Engineering (DMSE) >>> Gwangju Institute of Science and Technology (GIST) >>> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >>> 500-712, Republic of Korea (South) >>> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >>> E-mail: mbj0310 at gmail.com , >>> http://bmssa.gist.ac.kr >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Fri Mar 7 04:26:24 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 6 Mar 2014 22:26:24 -0500 Subject: [FieldTrip] ft_prepare_neighbours In-Reply-To: References: <53184CEB.9050109@donders.ru.nl> Message-ID: I think the neighborplot not working may have to do with the cfg.elec parameter not being set in ft_prepareneighbours, though I'm not sure why you don't get the error there. You should try contacting the manufacturer, otherwise you may have to make the electrode positions manually. As I mentioned, I was able to take the phi/theta coordinates provided by the manufacturer to determine the electrode positions, but if you have literally nothing to go by you may have to measure it by hand. If the electrodes are equidistant, finding the measurement between any two should be able to inform the position of all of them, otherwise I'm not sure what you could do. On Thu, Mar 6, 2014 at 7:41 PM, Beom Jun Min wrote: > Dear Jörn and Max > > Thank you for your help. > However, another error occurred. > > >>> > cfg = []; > cfg.method = 'triangulation'; %'distance', 'triangulation' or > 'template' (default = 'distance') > cfg.layout = lay; > cfg.channel = {'all', > '-VEOG','-HEOG','-EKG','-EMG','-COMNT','-SCALE'}; > cfg.feedback = 'yes'; > neighbours = ft_prepare_neighbours(cfg); > >>> > These work successfully. > > But > >>> > cfg = []; > cfg.neighbours = neighbours; > cfg.enableedit = 'yes'; > neighbours = ft_neighbourplot(cfg); > >>> > ??? Error using ==> ft_fetch_sens at 179 > no electrodes or gradiometers specified. > > Error in ==> ft_neighbourplot at 85 > sens = ft_fetch_sens(cfg); > > In addition, > >>> > cfg = []; > cfg.method = 'spline'; %'nearest', 'spline' or 'slap' > (default='nearest') > cfg.missingchannel = 'T7'; % cell-array, see FT_CHANNELSELECTION for > details > cfg.neighbours = neighbours; > cfg.trials = 'all'; > % cfg.lambda = % regularisation parameter (default = 1e-5, not for > method 'distance') > % cfg.order = % order of the polynomial interpolation (default = > 4, not for method 'distance') > interpolated = ft_channelrepair(cfg, final) > >>> > ??? Error using ==> ft_fetch_sens at 179 > no electrodes or gradiometers specified. > > Error in ==> ft_channelrepair at 112 > sens = ft_fetch_sens(cfg, data); > > It seems the problem is associated with position of electrode. But I do > not have manufacture's file. > Do I have to make the positions of electrodes manually? > Actually, I do not understand the information from help* > ft_datatype_sens, and ft_read_sens.* > > With regards > > > > > > 2014-03-06 23:19 GMT+09:00 Max Cantor : > > Alternatively, you could create a .sfp file for cfg.elecfile of the >> ft_channelrepair. If your channels are equidistant the equation for >> determining the neighbours should be fairly straightforward, as long as you >> have at least the phi and theta coordinates. >> >> I talk about it in this thread: >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-November/007213.html >> >> Here is the conclusion I came to: >> >> "For future reference, because I don't remember seeing anything on the >> fieldtrip FAQ about this and it may be useful to somebody else, the >> important thing is to turn the phi/theta from degrees into radians, and >> then applying a trigonometric function to get the X, Y, and Z coordinates. >> >> You can do all of these steps in 3 excel functions: >> >> X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) >> Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) >> Z = =COS(RADIANS(Theta)) >> >> This link on the easycap website (http://www.easycap.de/easycap/e/downloads/how_to_read_3d.htm) explains the >> coordinate system. >> >> I then typed up the channel name, x, y, and z coordinates in a four column >> notepad document saved as a .sfp file, and used that as my cfg.elecfile." >> >> I'm not sure if this is your problem, but I didn't see a cfg.elecfile >> parameter in your code, so hopefully this helps. >> >> >> On Thu, Mar 6, 2014 at 5:24 AM, "Jörn M. Horschig" < >> jm.horschig at donders.ru.nl> wrote: >> >>> Hi Beom, >>> >>> did your code produce an error? >>> >>> Generally, the 'template' method tries to look for already defined >>> 'template' neighbours. However, as far as I understoog you only created a >>> 'layout', which define where electrodes are placed, but not whether they >>> are neighbours or not. I would advice you to use these settings: >>> >>> cfg = []; >>> cfg.method = 'triangulation'; >>> cfg.layout = lay; >>> cfg.channel = 'all'; % that way you only need to run this once for >>> *all* your subjects >>> cfg.feedback = 'yes'; >>> neighbours = ft_prepare_neighbours(cfg); >>> >>> Then, if you are unhappy with the result, for modifcation you can use >>> cfg = []; >>> cfg.neighbours = neighbours; >>> cfg.enableedit = 'yes'; >>> neighbours = ft_neighboursplot(cfg); >>> >>> in that plot, you can click around to mark channels as being neighbours >>> or not. When you are happy, save that neighbour structure and make sure to >>> use it for all your subjects, so that there is no bias for individual >>> subjects. >>> >>> Note that the data variable is used nowhere now, because that would >>> cause missing sensors to be removed from the neighbour structure, but you >>> probably do not want that (or if you do, then use it). >>> >>> And finally, yes, using preprocessed data is possible. >>> >>> Should you have any other questions, feel free to ask. >>> >>> Best, >>> Jörn >>> >>> >>> >>> On 3/6/2014 2:09 AM, Beom Jun Min wrote: >>> >>>> >>>> Hello >>>> >>>> I have a problem with channel repair. >>>> >>>> Firstly, I created my own layout because I cannot apply my data into >>>> the offered layout files. >>>> As far as I know, my EEG data was acquired through SynAmps 2 system >>>> with 128 electrodes, but I cannot find a suitable layout files. >>>> QuikCap_NSL_128 does not match either. >>>> >>>> Anyway, I created own customized layout, and usual preprocessing steps >>>> were done. >>>> However, there were some bad recording channels so I removed them >>>> during preprocessing. >>>> Moreover, the removed channels are different among the subjects, and >>>> now it becomes a big problem for analyzing the data. >>>> >>>> So I tried channel repair process, but encountered with errors. >>>> >>>> >>> >>>> cfg = []; >>>> cfg.method = 'template'; >>>> cfg.template = 'bj_plot.mat'; >>>> cfg.layout = lay; >>>> cfg.channel = 'T7'; % channels for which neighbours should be >>>> found >>>> cfg.feedback = 'yes'; >>>> neighbours = ft_prepare_neighbours(cfg, data); >>>> >>> >>>> >>>> I think I have to use 'template' method because, there are some missing >>>> channels serially. >>>> And here are my question. >>>> Is it possible to assign my own layout in the cfg.template or >>>> cfg.layout? Actually at this step, I do not understand how to proceed. >>>> Also, there are many missing channels differ from each subject, but I >>>> am not sure which channels should be placed in the cfg.channel. (T7 is one >>>> of the missing channel in a subject in my case.) >>>> Finally, at 'data' field, is it possible to assign a finalized >>>> preprocessed data? >>>> >>>> And after ft_prepare_neighbours, >>>> >>>> >>> >>>> cfg = []; >>>> cfg.method = 'spline' >>>> % cfg.badchannel = 'T7'; >>>> cfg.missingchannel = 'T7'; >>>> cfg.neighbours = neighbours; >>>> cfg.trials = 'all' >>>> interpolated = ft_channelrepair(cfg, data) >>>> >>>> Is that right? >>>> >>>> >>>> -- >>>> BeomJun Min, M.D. >>>> >>>> Department of Medical System Engineering (DMSE) >>>> Gwangju Institute of Science and Technology (GIST) >>>> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >>>> 500-712, Republic of Korea (South) >>>> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >>>> E-mail: mbj0310 at gmail.com , >>>> http://bmssa.gist.ac.kr >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr > > _______________________________________________ > 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 chris.day-2 at postgrad.manchester.ac.uk Fri Mar 7 16:36:28 2014 From: chris.day-2 at postgrad.manchester.ac.uk (Christopher Day) Date: Fri, 7 Mar 2014 15:36:28 +0000 Subject: [FieldTrip] Creation of MNI-aligned grids in individual gray matter? Message-ID: Hi, I'm quite new to FieldTrip, and I've been following the tutorials and example code online to perform source reconstruction on EEG data. I have had some success at creating MNI-aligned grids in individual head-space following this example: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space This is probably a stupid question, but why are some of the sources in the grid outside of the brain volume boundary in Figure 3 when the figure was plotted with the grid.inside positions? This is the plotting code copied from the example page: figure; ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; ft_plot_mesh(grid.pos(grid.inside,:)); I have also been trying to restrict my source analysis to gray matter using this FAQ: http://fieldtrip.fcdonders.nl/faq/can_i_restrict_the_source_reconstruction_to_the_grey_matter And this old conversation on the mailing list: http://mailman.science.ru.nl/pipermail/fieldtrip/2012-March/004984.html I was wondering whether it is possible to combine these two avenues I've been pursuing and restrict the source analysis to MNI-aligned grids in individual gray matter? If so, how do you do it? And if not, can you explain why not please? Any help gratefully received. Kind regards, Chris Day PhD Student in Psychological Sciences, University of Manchester, Zochonis Building, 3rd Floor, T4. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.day-2 at postgrad.manchester.ac.uk Fri Mar 7 16:52:55 2014 From: chris.day-2 at postgrad.manchester.ac.uk (Christopher Day) Date: Fri, 7 Mar 2014 15:52:55 +0000 Subject: [FieldTrip] Source time series question Message-ID: Hi, I noticed in this old conversation on the mailing list that it is possible to extract a 3-dimensional source moment at each time point in a trial: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-August/004185.html Would anyone be able to tell me whether the direction of this moment remains relatively constant throughout the time course of the trial? And furthermore, that it is mainly the magnitude of the source along this direction that explains the variation in each source? Intuitively, it seems to me that the direction of the source would be constrained by the brain tissue orientation. Is this the case? Any help would be gratefully received. Kind regards, Chris Day PhD Student in Psychological Sciences, University of Manchester, Zochonis Building, 3rd Floor, T4. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Tue Mar 4 09:06:34 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Tue, 4 Mar 2014 16:06:34 +0800 Subject: [FieldTrip] help Message-ID: Dear all: I don't know much about maxfilter, but I have a .fif file that have done tsss. Does it mean that I can use the data to do source reconstruction or some compute (eg.plv) ? thank youi very much again. Xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Mar 10 09:48:58 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 10 Mar 2014 09:48:58 +0100 Subject: [FieldTrip] help In-Reply-To: References: Message-ID: Dear Xiao, I am new to maxfilter as well, but this is what I understand; Maxfilter's SSS decomposes your data spatially, separating it into components that arise from the helmet from those that arise from outside the helmet. This results in a reduction of dimensionality of your data, typically to around 80. This should, as I understand it, be still OK for source reconstruction methods and, in fact, I think is often used in those. The tSSS method extends the SSS method to the temporal domain. I would therefor be extremely careful in using tSSS in combination with analyses of temporal correlations in the data, such as PLV. In any case you could test the effect it has on your dependent measures by applying the analysis with and without tSSS. Best of luck, Stephen On 4 March 2014 09:06, tongxiao meng wrote: > Dear all: > > I don't know much about maxfilter, but I have a .fif file that have done > tsss. > Does it mean that I can use the data to do source reconstruction or some > compute (eg.plv) ? > > thank youi very much again. > > Xiao > > _______________________________________________ > 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 maximilien.chaumon at gmail.com Mon Mar 10 13:40:44 2014 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Mon, 10 Mar 2014 13:40:44 +0100 Subject: [FieldTrip] Call for papers, Cutting-edge EEG methods Message-ID: Dear EEG community, Cutting EEG, the first symposium on Cutting-edge EEG methods for research on cognition happened in Berlin on the 19th to 21th February 2014. The success of this small event was resounding and we are now looking to raise its impact by preparing a* special issue at Journal of Neuroscience Methods for the end of this year*. By bringing together leading scientists contributing to the field in this special issue, we wish to create a landmark reference of methods for EEG research on cognition. We would like this issue to cover the most important basic aspects the EEG analysis workflow, as well as making state-of-the-art tools for signal processing, robust statistics and machine learning more accessible to our community. The submission process goes as follows: - Submission via http://ees.elsevier.com/jneumeth/ - Your paper will go through a full review process. We will be in contact through the submission system. The final decision to publish is made by Editor in Chief Vincenzo Crunelli . - There is no hard limit of page length, but we recommend 5000-7000 words. - No mandatory publication charges. Figures in color are free online. Optional charges for authors of color in print (each author will get 4 color figures in print for free but will pay 270 EUR per figure beyond that). There is also an Open Access option at your charge (1,800 USD per article). - For additional and more detailed information and guidelines: http://www.elsevier.com/journals/journal-of-neuroscience-methods/0165-0270/guide-for-authors Time schedule for this Special Issue: 31 May 2014 Deadline for submission of MSs July 2014 Reviews returned to authors October 2014 Acceptance deadline (final notifications) November 2014 Expected publication date Important note: The goal of this issue is to make your method accessible to non-expert EEG researchers. In order to make your contribution as much accessible and useful as possible, we would like to recommend the following: - Include a numbered list of steps required to implement your method - Share tips: the simple manipulations that enhance the quality of the data (e.g. normalization, re-referencing, preprocessing steps...) - Share code (e.g. through code repositories like Git, Google code or Sourceforge) Note also: manuscripts describing *known methods with a new look are also encouraged*. This means that if you think that your method has already been documented, but you have interesting tips or the current view on the topic has changed significantly over recent years, you are welcome to submit. Please *get in contact with us *with your submission inquiry. Finally, we are looking for some really *awesome looking visuals* for the cover-art of our Special Issue. Please feel free to contribute ideas or send us drafts! Please feel free to *contact us* if you have any questions. Best regards, Maximilien Chaumon, Sébastien Crouzet & Niko Busch Guest Editors, Special Issue on Cutting-edge EEG methods. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Tue Mar 11 16:04:51 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Tue, 11 Mar 2014 16:04:51 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: Message-ID: <531F2613.1040808@gmail.com> Dear FT-ers, I found an old posting to the mailing list (see below) that never got answered so my question still holds: given a location I found in the interpolated source, how do I find back the same location in .pos of the non-interpolated data? I can try and go around it by finding the corresponding MNI coordinates in the interpolated data (which by now I have to do by hand, so not optimal anyways), and then look for those coordinates in .pos. But I was wondering, like Cornelius was in his post, whether there is a neater way to get this information. Thanks a lot for the help, Vitória >>>>>>>>>>>>>> Hi mailing list, I'm still struggling with the conversion of coordinates between source and interpolated source space. For example, if i have the position of a single grid point how do i get the corresponding voxel in the interpolated source structure. Or the other way around, how to get the grid point which corresponds to a voxel (e.g the max voxel) in the interpolated source structure. I think this should be a common problem when working with virtual electrodes, shouldn't it? To make things easier i put together a example with the data from the source tutorial where i tried to calculated the grid pos of the max voxel in the interpolated source. clear all; load sourcePost_nocon; % source structure from tutorial mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial sourceNAI = sourcePost_nocon; sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ sourcePost_nocon.avg.noise; sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); % Find position of max activity [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); posInt=[xi, yi, zi]; % Plot interpolated source with position of max activity cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.locationcoordinates = 'voxel'; cfg.location = posInt; % location of max activity is marked correctly. figure; ft_sourceplot(cfg,sourceNAIInt); % Transform coordinate back to uninterpolated source??? dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); % Plot uninterpolated source with position aquired from interpolated source cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'avg.pow'; cfg.locationcoordinates = 'voxel'; cfg.location = dpos; % unfortunately this coordinate is obviously wrong!!! WHY? figure; ft_sourceplot(cfg,sourceNAI); Unfortunately the solution of Jan Mathijs did not work, nor did mine :( Any ideas??? Cornelius -------------- next part -------------- An HTML attachment was scrubbed... URL: From erick.ortiz at med.uni-tuebingen.de Tue Mar 11 18:35:42 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Tue, 11 Mar 2014 18:35:42 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <531F2613.1040808@gmail.com> References: <531F2613.1040808@gmail.com> Message-ID: Dear Vitória and Cornelius, this is a common problem, and maybe it would be good to clarify the strategies that can be used here. I hope this can help others in a similar situation, which I have found many times. 1) You are trying to convert voxel indexes to head (CTF) coordinates. In this case, there are two mistakes in the code: 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, 'homogeneous' ); ... should be done with sourceNAIInt, not mri. The transforms are different, in general; e.g. note the downsample=2. 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous post. Or remove this line, since 'head' is the default. 2) But if you are working with the same subject/grid, there is no need for interpolation at all. Simply find the grid position with highest 'pow' and take its position. [dummy,ind] = max(source.avg.pow); pos = source.pos(ind,:); 3) However, this is not possible when using different grids, e.g. in a grand average in MNI coordinates. Find the peak ('pos') in the interpolated volume, as in Cornelius' code, then find the index of the nearest grid position for a common (again, MNI) grid. This is also in JM's message. dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); [dummy,ind] = min(sum(dpos.^2,2)); 4) What I have been using, and strongly recommend, is an MNI grid warped to the subject's anatomy, according to this procedure: http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space This would give you both the benefits of working in MNI coordinates, and the ease of having a common grid across subjects (for instance, enabling solution #2). Still, some projects do call for one of the other options. Just a couple of details: - Pay utmost attention to coordinate systems and units. For instance, it is common to confuse unlabeled cm for mm, and either of these with voxels. Try to also label all structures as CTF or SPM (MNI). - Using pinv instead of inv is usually a good idea. Here, it is a not an issue, but matrix inversion in MATLAB can lead to a world of hurt to the unwary. Best, Erick On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: > Dear FT-ers, > > I found an old posting to the mailing list (see below) that never got > answered so my question still holds: given a location I found in the > interpolated source, how do I find back the same location in .pos of the > non-interpolated data? > I can try and go around it by finding the corresponding MNI coordinates in > the interpolated data (which by now I have to do by hand, so not optimal > anyways), and then look for those coordinates in .pos. But I was wondering, > like Cornelius was in his post, whether there is a neater way to get this > information. > > Thanks a lot for the help, > Vitória > > > >>>>>>>>>>>>>> >> >> Hi mailing list, >> >> I'm still struggling with the conversion of coordinates between source and >> interpolated source space. >> For example, if i have the position of a single grid point how do i get >> the >> corresponding voxel in the interpolated source structure. Or the other >> way >> around, how to get the grid point which corresponds to a voxel (e.g the >> max >> voxel) in the interpolated source structure. >> >> I think this should be a common problem when working with virtual >> electrodes, shouldn't it? >> >> To make things easier i put together a example with the data from the >> source tutorial where i tried to calculated the grid pos of the max voxel >> in the interpolated source. >> >> clear all; >> load sourcePost_nocon; % source structure from tutorial >> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >> >> sourceNAI = sourcePost_nocon; >> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >> sourcePost_nocon.avg.noise; >> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >> >> % Find position of max activity >> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >> posInt=[xi, yi, zi]; >> >> % Plot interpolated source with position of max activity >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = posInt; % location of max activity is marked >> correctly. >> figure; >> ft_sourceplot(cfg,sourceNAIInt); >> >> % Transform coordinate back to uninterpolated source??? >> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >> >> >> % Plot uninterpolated source with position aquired from interpolated >> source >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = dpos; % unfortunately this coordinate is >> obviously wrong!!! WHY? >> figure; >> ft_sourceplot(cfg,sourceNAI); >> >> >> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >> >> Any ideas??? >> >> Cornelius >> >> >> > > > > _______________________________________________ > 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 v.piai.research at gmail.com Wed Mar 12 09:24:53 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 12 Mar 2014 09:24:53 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> Message-ID: <532019D5.8040204@gmail.com> Dear Erick, Thanks for your detailed reply. I've been using individual MNI-warped grids (point 4 below) and I'm always using ft_convert_unit so those points are alright in my data. The reason why I do need to interpolate (at least, I think I need), is because I'm looking for max 'pow' in anatomically defined regions given the afni atlas. I managed to get it to work by interpolating to the mri and looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. Do you have any experience with this approach (searching within anatomical labels) without having to interpolate? Thanks once more, Vitória On 3/11/2014 6:35 PM, Erick Ortiz wrote: > Dear Vitória and Cornelius, > > this is a common problem, and maybe it would be good to clarify the > strategies that can be used here. I hope this can help others in a > similar situation, which I have found many times. > > 1) You are trying to convert voxel indexes to head (CTF) coordinates. > In this case, there are two mistakes in the code: > 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, > 'homogeneous' ); > ... should be done with sourceNAIInt, not mri. The transforms are > different, in general; e.g. note the downsample=2. > 1b) use cfg.locationcoordinates = 'head', as commented by JM in a > previous post. Or remove this line, since 'head' is the default. > > 2) But if you are working with the same subject/grid, there is no need > for interpolation at all. Simply find the grid position with highest > 'pow' and take its position. > [dummy,ind] = max(source.avg.pow); > pos = source.pos(ind,:); > > 3) However, this is not possible when using different grids, e.g. in a > grand average in MNI coordinates. Find the peak ('pos') in the > interpolated volume, as in Cornelius' code, then find the index of the > nearest grid position for a common (again, MNI) grid. This is also in > JM's message. > > dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); > [dummy,ind] = min(sum(dpos.^2,2)); > > 4) What I have been using, and strongly recommend, is an MNI grid > warped to the subject's anatomy, according to this procedure: > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > This would give you both the benefits of working in MNI coordinates, > and the ease of having a common grid across subjects (for instance, > enabling solution #2). Still, some projects do call for one of the > other options. > > Just a couple of details: > - Pay utmost attention to coordinate systems and units. For instance, > it is common to confuse unlabeled cm for mm, and either of these with > voxels. Try to also label all structures as CTF or SPM (MNI). > - Using pinv instead of inv is usually a good idea. Here, it is a not > an issue, but matrix inversion in MATLAB can lead to a world of hurt > to the unwary. > > Best, > Erick > > > > On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai > > wrote: > > Dear FT-ers, > > I found an old posting to the mailing list (see below) that never > got answered so my question still holds: given a location I found > in the interpolated source, how do I find back the same location > in .pos of the non-interpolated data? > I can try and go around it by finding the corresponding MNI > coordinates in the interpolated data (which by now I have to do by > hand, so not optimal anyways), and then look for those coordinates > in .pos. But I was wondering, like Cornelius was in his post, > whether there is a neater way to get this information. > > Thanks a lot for the help, > Vitória > > > >>>>>>>>>>>>>> > > Hi mailing list, > > I'm still struggling with the conversion of coordinates > between source and > interpolated source space. > For example, if i have the position of a single grid point how > do i get the > corresponding voxel in the interpolated source structure. Or > the other way > around, how to get the grid point which corresponds to a voxel > (e.g the max > voxel) in the interpolated source structure. > > I think this should be a common problem when working with virtual > electrodes, shouldn't it? > > To make things easier i put together a example with the data > from the > source tutorial where i tried to calculated the grid pos of > the max voxel > in the interpolated source. > > clear all; > load sourcePost_nocon; % source structure from > tutorial > mri = ft_read_mri('Subject01.mri'); % mri of subject01 from > tutorial > > sourceNAI = sourcePost_nocon; > sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ > sourcePost_nocon.avg.noise; > sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); > > % Find position of max activity > [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); > [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); > posInt=[xi, yi, zi]; > > % Plot interpolated source with position of max activity > cfg = []; > cfg.method = 'ortho'; > cfg.funparameter = 'avg.pow'; > cfg.locationcoordinates = 'voxel'; > cfg.location = posInt; % location of max > activity is marked > correctly. > figure; > ft_sourceplot(cfg,sourceNAIInt); > > % Transform coordinate back to uninterpolated source??? > dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); > > > % Plot uninterpolated source with position aquired from > interpolated source > cfg = []; > cfg.method = 'ortho'; > cfg.funparameter = 'avg.pow'; > cfg.locationcoordinates = 'voxel'; > cfg.location = dpos; % unfortunately this > coordinate is > obviously wrong!!! WHY? > figure; > ft_sourceplot(cfg,sourceNAI); > > > Unfortunately the solution of Jan Mathijs did not work, nor > did mine :( > > Any ideas??? > > Cornelius > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 erick.ortiz at med.uni-tuebingen.de Wed Mar 12 11:37:19 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Wed, 12 Mar 2014 11:37:19 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <532019D5.8040204@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> Message-ID: Dear Vitoria, What I do usually, is to simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch. About the interpolation, I cannot help much more. I have been using my own tools for years, and I was not following the support of atlases in Fieldtrip.I tried it today, but had issues with coordinate system labeling when defining a ROI (I updated to the latest version by SVN): afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); cfg = []; cfg.method = 'ortho'; cfg.interactive = 'yes'; cfg.funparameter = 'coh'; cfg.atlas = afni; cfg.coordsys = 'mni'; % cfg.roi = 'Middle Temporal Gyrus'; % cfg.inputcoord = 'tal'; ft_sourceplot(cfg, interp); Also note that I had to use ft_read_atlas, because ft_prepare_atlas does not generate the brick0label/brick1label fields. It works well, but if I try to define a ROI (uncommenting the two lines), I get the error "The field cfg.inputcoord is required". There seems to be some confusion between inputcoord and coordsys. It can be because I was doing something wrong: maybe a Fieldtrip developer could comment on that? Best, Erick On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: > Dear Erick, > > Thanks for your detailed reply. > I've been using individual MNI-warped grids (point 4 below) and I'm always > using ft_convert_unit so those points are alright in my data. > > The reason why I do need to interpolate (at least, I think I need), is > because I'm looking for max 'pow' in anatomically defined regions given the > afni atlas. I managed to get it to work by interpolating to the mri and > looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using > ft_volumelookup. > Do you have any experience with this approach (searching within anatomical > labels) without having to interpolate? > > Thanks once more, Vitória > > > > > On 3/11/2014 6:35 PM, Erick Ortiz wrote: > > Dear Vitória and Cornelius, > > this is a common problem, and maybe it would be good to clarify the > strategies that can be used here. I hope this can help others in a similar > situation, which I have found many times. > > 1) You are trying to convert voxel indexes to head (CTF) coordinates. In > this case, there are two mistakes in the code: > 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, > 'homogeneous' ); > ... should be done with sourceNAIInt, not mri. The transforms are > different, in general; e.g. note the downsample=2. > 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous > post. Or remove this line, since 'head' is the default. > > 2) But if you are working with the same subject/grid, there is no need for > interpolation at all. Simply find the grid position with highest 'pow' and > take its position. > [dummy,ind] = max(source.avg.pow); > pos = source.pos(ind,:); > > 3) However, this is not possible when using different grids, e.g. in a > grand average in MNI coordinates. Find the peak ('pos') in the interpolated > volume, as in Cornelius' code, then find the index of the nearest grid > position for a common (again, MNI) grid. This is also in JM's message. > > dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); > [dummy,ind] = min(sum(dpos.^2,2)); > > 4) What I have been using, and strongly recommend, is an MNI grid warped > to the subject's anatomy, according to this procedure: > > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > This would give you both the benefits of working in MNI coordinates, and > the ease of having a common grid across subjects (for instance, enabling > solution #2). Still, some projects do call for one of the other options. > > Just a couple of details: > - Pay utmost attention to coordinate systems and units. For instance, it > is common to confuse unlabeled cm for mm, and either of these with voxels. > Try to also label all structures as CTF or SPM (MNI). > - Using pinv instead of inv is usually a good idea. Here, it is a not an > issue, but matrix inversion in MATLAB can lead to a world of hurt to the > unwary. > > Best, > Erick > > > > On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: > >> Dear FT-ers, >> >> I found an old posting to the mailing list (see below) that never got >> answered so my question still holds: given a location I found in the >> interpolated source, how do I find back the same location in .pos of the >> non-interpolated data? >> I can try and go around it by finding the corresponding MNI coordinates >> in the interpolated data (which by now I have to do by hand, so not optimal >> anyways), and then look for those coordinates in .pos. But I was wondering, >> like Cornelius was in his post, whether there is a neater way to get this >> information. >> >> Thanks a lot for the help, >> Vitória >> >> >> >>>>>>>>>>>>>> >>> >>> Hi mailing list, >>> >>> I'm still struggling with the conversion of coordinates between source >>> and >>> interpolated source space. >>> For example, if i have the position of a single grid point how do i get >>> the >>> corresponding voxel in the interpolated source structure. Or the other >>> way >>> around, how to get the grid point which corresponds to a voxel (e.g the >>> max >>> voxel) in the interpolated source structure. >>> >>> I think this should be a common problem when working with virtual >>> electrodes, shouldn't it? >>> >>> To make things easier i put together a example with the data from the >>> source tutorial where i tried to calculated the grid pos of the max voxel >>> in the interpolated source. >>> >>> clear all; >>> load sourcePost_nocon; % source structure from tutorial >>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>> >>> sourceNAI = sourcePost_nocon; >>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>> sourcePost_nocon.avg.noise; >>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>> >>> % Find position of max activity >>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>> posInt=[xi, yi, zi]; >>> >>> % Plot interpolated source with position of max activity >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = posInt; % location of max activity is marked >>> correctly. >>> figure; >>> ft_sourceplot(cfg,sourceNAIInt); >>> >>> % Transform coordinate back to uninterpolated source??? >>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>> >>> >>> % Plot uninterpolated source with position aquired from interpolated >>> source >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = dpos; % unfortunately this coordinate >>> is >>> obviously wrong!!! WHY? >>> figure; >>> ft_sourceplot(cfg,sourceNAI); >>> >>> >>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>> >>> Any ideas??? >>> >>> Cornelius >>> >>> >>> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > _______________________________________________ > 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 juriguen at gmail.com Wed Mar 12 17:48:15 2014 From: juriguen at gmail.com (=?ISO-8859-1?Q?Jose_Antonio_Urig=FCen?=) Date: Wed, 12 Mar 2014 17:48:15 +0100 Subject: [FieldTrip] Problem with "openmeeg_eeg_leadfield_example" Message-ID: Regardless of the Fieldtrip version I use, I keep getting the following error when trying to run the m file "openmeeg_eeg_leadfield_example": "Reference to non-existent field 'cond'. Error in ft_compute_leadfield (line 390) vol.cond = vol.cond(indx); Error in openmeeg_eeg_leadfield_example (line 83) lf_sphere = ft_compute_leadfield(pos, sens, vol_sphere);" I would like to be able to eventually simulate a head model and compute the forward EEG leadfield. I believe this to be a good starting point, any other suggestions? Thanks Toni -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Wed Mar 12 17:50:00 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Wed, 12 Mar 2014 17:50:00 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> Message-ID: <53209038.8010906@gmail.com> Dear Erick, "simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch" -> that sounds like a good thing to do. Is this a very complicated thing to do? Would you mind sharing a piece of code or some tips for how I could achieve it? Thanks once more, Vitória On 3/12/2014 11:37 AM, Erick Ortiz wrote: > Dear Vitoria, > > What I do usually, is to simply label and/or define my ROI in the MNI > grid. When I warp to the individuals, everything is in place without a > hitch. > > About the interpolation, I cannot help much more. I have been using my > own tools for years, and I was not following the support of atlases in > Fieldtrip.I tried it today, but had issues with coordinate system > labeling when defining a ROI (I updated to the latest version by SVN): > > afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'yes'; > cfg.funparameter = 'coh'; > cfg.atlas = afni; > cfg.coordsys = 'mni'; > % cfg.roi = 'Middle Temporal Gyrus'; > % cfg.inputcoord = 'tal'; > ft_sourceplot(cfg, interp); > > Also note that I had to use ft_read_atlas, because ft_prepare_atlas > does not generate the brick0label/brick1label fields. > > It works well, but if I try to define a ROI (uncommenting the two > lines), I get the error "The field cfg.inputcoord is required". There > seems to be some confusion between inputcoord and coordsys. > > It can be because I was doing something wrong: maybe a Fieldtrip > developer could comment on that? > > Best, > Erick > > > > On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai > > wrote: > > Dear Erick, > > Thanks for your detailed reply. > I've been using individual MNI-warped grids (point 4 below) and > I'm always using ft_convert_unit so those points are alright in my > data. > > The reason why I do need to interpolate (at least, I think I > need), is because I'm looking for max 'pow' in anatomically > defined regions given the afni atlas. I managed to get it to work > by interpolating to the mri and looking for max 'pow' given a > label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. > Do you have any experience with this approach (searching within > anatomical labels) without having to interpolate? > > Thanks once more, Vitória > > > > > On 3/11/2014 6:35 PM, Erick Ortiz wrote: >> Dear Vitória and Cornelius, >> >> this is a common problem, and maybe it would be good to clarify >> the strategies that can be used here. I hope this can help others >> in a similar situation, which I have found many times. >> >> 1) You are trying to convert voxel indexes to head (CTF) >> coordinates. In this case, there are two mistakes in the code: >> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, >> 'homogeneous' ); >> ... should be done with sourceNAIInt, not mri. The transforms are >> different, in general; e.g. note the downsample=2. >> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a >> previous post. Or remove this line, since 'head' is the default. >> >> 2) But if you are working with the same subject/grid, there is no >> need for interpolation at all. Simply find the grid position with >> highest 'pow' and take its position. >> [dummy,ind] = max(source.avg.pow); >> pos = source.pos(ind,:); >> >> 3) However, this is not possible when using different grids, e.g. >> in a grand average in MNI coordinates. Find the peak ('pos') in >> the interpolated volume, as in Cornelius' code, then find the >> index of the nearest grid position for a common (again, MNI) >> grid. This is also in JM's message. >> >> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >> [dummy,ind] = min(sum(dpos.^2,2)); >> >> 4) What I have been using, and strongly recommend, is an MNI grid >> warped to the subject's anatomy, according to this procedure: >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> This would give you both the benefits of working in MNI >> coordinates, and the ease of having a common grid across subjects >> (for instance, enabling solution #2). Still, some projects do >> call for one of the other options. >> >> Just a couple of details: >> - Pay utmost attention to coordinate systems and units. For >> instance, it is common to confuse unlabeled cm for mm, and either >> of these with voxels. Try to also label all structures as CTF or >> SPM (MNI). >> - Using pinv instead of inv is usually a good idea. Here, it is a >> not an issue, but matrix inversion in MATLAB can lead to a world >> of hurt to the unwary. >> >> Best, >> Erick >> >> >> >> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai >> > wrote: >> >> Dear FT-ers, >> >> I found an old posting to the mailing list (see below) that >> never got answered so my question still holds: given a >> location I found in the interpolated source, how do I find >> back the same location in .pos of the non-interpolated data? >> I can try and go around it by finding the corresponding MNI >> coordinates in the interpolated data (which by now I have to >> do by hand, so not optimal anyways), and then look for those >> coordinates in .pos. But I was wondering, like Cornelius was >> in his post, whether there is a neater way to get this >> information. >> >> Thanks a lot for the help, >> Vitória >> >> >> >>>>>>>>>>>>>> >> >> Hi mailing list, >> >> I'm still struggling with the conversion of coordinates >> between source and >> interpolated source space. >> For example, if i have the position of a single grid >> point how do i get the >> corresponding voxel in the interpolated source >> structure. Or the other way >> around, how to get the grid point which corresponds to a >> voxel (e.g the max >> voxel) in the interpolated source structure. >> >> I think this should be a common problem when working with >> virtual >> electrodes, shouldn't it? >> >> To make things easier i put together a example with the >> data from the >> source tutorial where i tried to calculated the grid pos >> of the max voxel >> in the interpolated source. >> >> clear all; >> load sourcePost_nocon; % source structure from tutorial >> mri = ft_read_mri('Subject01.mri'); % mri of subject01 >> from tutorial >> >> sourceNAI = sourcePost_nocon; >> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >> sourcePost_nocon.avg.noise; >> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that >> to let >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >> >> % Find position of max activity >> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >> posInt=[xi, yi, zi]; >> >> % Plot interpolated source with position of max activity >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = posInt; % location of max >> activity is marked >> correctly. >> figure; >> ft_sourceplot(cfg,sourceNAIInt); >> >> % Transform coordinate back to uninterpolated source??? >> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >> >> >> % Plot uninterpolated source with position aquired from >> interpolated source >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funparameter = 'avg.pow'; >> cfg.locationcoordinates = 'voxel'; >> cfg.location = dpos; % unfortunately this >> coordinate is >> obviously wrong!!! WHY? >> figure; >> ft_sourceplot(cfg,sourceNAI); >> >> >> Unfortunately the solution of Jan Mathijs did not work, >> nor did mine :( >> >> Any ideas??? >> >> Cornelius >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 jan.schoffelen at donders.ru.nl Thu Mar 13 13:00:51 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 13 Mar 2014 13:00:51 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <53209038.8010906@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> Message-ID: <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Hi Vitória, Erick, Cornelius et al, Allow me to chime in to this Brazilio-German interaction ;-). It seems to me that the discussion consists of a few separable elements. -The first one pertains to the specific question how to map source locations between two different representations (source with pos versus volumetric MRI-type image with a transform). -The other one relates to some atlas related business, i.e. mapping locations that have a specific anatomical label to specific MEG source space locations. -And then there's a third one, which is important for 2, and pertains to the usual complicated stuff of mapping between different coordinate systems. There are several ways to achieve what Vitória is looking for, and I think that Erick already solved it, but recent changes in FieldTrip make it quite straightforward. So here goes my recipe: 1 I would go along with Erick to do my beamformer source reconstruction on a subject-specific grid, which is inverse-warped from a regular grid defined on the MNI-template. 2 If we take this template grid, which can be found in ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of your choice onto this sourcemodel, using ft_sourceinterpolate. Reading in of the atlas nowadays indeed should be done with ft_read_atlas (ft_prepare_atlas will be deprecated soon), and my personal taste would be NOT to use the afni atlas, because this one is defined in Talairach space, which is slightly different from MNI-space, and although FT accounts for the differences I am not sure how accurate this is. Anyway, one could do something like atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), load the template sourcemodel with the resolution you need (i.e. the resolution you used in your beamformer grid), and call ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'tissue'; sourcemodel2 = ft_sourceinterpolate(cfg,atlas,sourcemodel); % NOTE: ensure that the units are consistent in atlas and sourcemodel, if not use ft_convert_units 3 Step 2 should have given you sourcemodel2 with a field 'tissue', that represents the anatomical labels, according to the corresponding atlas. Atlas.tissuelabel gives the labels that correspond to the numbers in the tissue field. 4 Then, without the need to call ft_sourceinterpolate, nor ft_volumenormalise on your source-reconstructed data, you can do indx = find(sourcemodel2.tissue==x), where x is the number of your choice, and you directly get the indices of the source positions in your 'source' variable, that have this particular anatomical label. 5 Then, you can do whatever you like with it, e.g. take a max or mean or whatever... I hope I was clear enough, and that someone feels inclined to make this into a FAQ on the FieldTrip wiki ;-). Best wishes, Jan-Mathijs On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > Dear Erick, > > "simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch" -> that sounds like a good thing to do. > Is this a very complicated thing to do? Would you mind sharing a piece of code or some tips for how I could achieve it? > > Thanks once more, Vitória > > On 3/12/2014 11:37 AM, Erick Ortiz wrote: >> Dear Vitoria, >> >> What I do usually, is to simply label and/or define my ROI in the MNI grid. When I warp to the individuals, everything is in place without a hitch. >> >> About the interpolation, I cannot help much more. I have been using my own tools for years, and I was not following the support of atlases in Fieldtrip.I tried it today, but had issues with coordinate system labeling when defining a ROI (I updated to the latest version by SVN): >> >> afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); >> cfg = []; >> cfg.method = 'ortho'; >> cfg.interactive = 'yes'; >> cfg.funparameter = 'coh'; >> cfg.atlas = afni; >> cfg.coordsys = 'mni'; >> % cfg.roi = 'Middle Temporal Gyrus'; >> % cfg.inputcoord = 'tal'; >> ft_sourceplot(cfg, interp); >> >> Also note that I had to use ft_read_atlas, because ft_prepare_atlas does not generate the brick0label/brick1label fields. >> >> It works well, but if I try to define a ROI (uncommenting the two lines), I get the error "The field cfg.inputcoord is required". There seems to be some confusion between inputcoord and coordsys. >> >> It can be because I was doing something wrong: maybe a Fieldtrip developer could comment on that? >> >> Best, >> Erick >> >> >> >> On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: >> Dear Erick, >> >> Thanks for your detailed reply. >> I've been using individual MNI-warped grids (point 4 below) and I'm always using ft_convert_unit so those points are alright in my data. >> >> The reason why I do need to interpolate (at least, I think I need), is because I'm looking for max 'pow' in anatomically defined regions given the afni atlas. I managed to get it to work by interpolating to the mri and looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using ft_volumelookup. >> Do you have any experience with this approach (searching within anatomical labels) without having to interpolate? >> >> Thanks once more, Vitória >> >> >> >> >> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >>> Dear Vitória and Cornelius, >>> >>> this is a common problem, and maybe it would be good to clarify the strategies that can be used here. I hope this can help others in a similar situation, which I have found many times. >>> >>> 1) You are trying to convert voxel indexes to head (CTF) coordinates. In this case, there are two mistakes in the code: >>> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, 'homogeneous' ); >>> ... should be done with sourceNAIInt, not mri. The transforms are different, in general; e.g. note the downsample=2. >>> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a previous post. Or remove this line, since 'head' is the default. >>> >>> 2) But if you are working with the same subject/grid, there is no need for interpolation at all. Simply find the grid position with highest 'pow' and take its position. >>> [dummy,ind] = max(source.avg.pow); >>> pos = source.pos(ind,:); >>> >>> 3) However, this is not possible when using different grids, e.g. in a grand average in MNI coordinates. Find the peak ('pos') in the interpolated volume, as in Cornelius' code, then find the index of the nearest grid position for a common (again, MNI) grid. This is also in JM's message. >>> >>> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >>> [dummy,ind] = min(sum(dpos.^2,2)); >>> >>> 4) What I have been using, and strongly recommend, is an MNI grid warped to the subject's anatomy, according to this procedure: >>> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >>> >>> This would give you both the benefits of working in MNI coordinates, and the ease of having a common grid across subjects (for instance, enabling solution #2). Still, some projects do call for one of the other options. >>> >>> Just a couple of details: >>> - Pay utmost attention to coordinate systems and units. For instance, it is common to confuse unlabeled cm for mm, and either of these with voxels. Try to also label all structures as CTF or SPM (MNI). >>> - Using pinv instead of inv is usually a good idea. Here, it is a not an issue, but matrix inversion in MATLAB can lead to a world of hurt to the unwary. >>> >>> Best, >>> Erick >>> >>> >>> >>> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: >>> Dear FT-ers, >>> >>> I found an old posting to the mailing list (see below) that never got answered so my question still holds: given a location I found in the interpolated source, how do I find back the same location in .pos of the non-interpolated data? >>> I can try and go around it by finding the corresponding MNI coordinates in the interpolated data (which by now I have to do by hand, so not optimal anyways), and then look for those coordinates in .pos. But I was wondering, like Cornelius was in his post, whether there is a neater way to get this information. >>> >>> Thanks a lot for the help, >>> Vitória >>> >>> >>> >>>>>>>>>>>>>> >>> >>> Hi mailing list, >>> >>> I'm still struggling with the conversion of coordinates between source and >>> interpolated source space. >>> For example, if i have the position of a single grid point how do i get the >>> corresponding voxel in the interpolated source structure. Or the other way >>> around, how to get the grid point which corresponds to a voxel (e.g the max >>> voxel) in the interpolated source structure. >>> >>> I think this should be a common problem when working with virtual >>> electrodes, shouldn't it? >>> >>> To make things easier i put together a example with the data from the >>> source tutorial where i tried to calculated the grid pos of the max voxel >>> in the interpolated source. >>> >>> clear all; >>> load sourcePost_nocon; % source structure from tutorial >>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>> >>> sourceNAI = sourcePost_nocon; >>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ sourcePost_nocon.avg.noise; >>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>> >>> % Find position of max activity >>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>> posInt=[xi, yi, zi]; >>> >>> % Plot interpolated source with position of max activity >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = posInt; % location of max activity is marked >>> correctly. >>> figure; >>> ft_sourceplot(cfg,sourceNAIInt); >>> >>> % Transform coordinate back to uninterpolated source??? >>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>> >>> >>> % Plot uninterpolated source with position aquired from interpolated source >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.locationcoordinates = 'voxel'; >>> cfg.location = dpos; % unfortunately this coordinate is >>> obviously wrong!!! WHY? >>> figure; >>> ft_sourceplot(cfg,sourceNAI); >>> >>> >>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>> >>> Any ideas??? >>> >>> Cornelius >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From erick.ortiz at med.uni-tuebingen.de Fri Mar 14 02:05:23 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Fri, 14 Mar 2014 02:05:23 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Message-ID: Thanks for shedding light on the issue, JM: I tested your suggestion and it worked brilliantly, far faster and more elegant than the script I wrote years ago. (in my defense, it was only run a couple of times, to label our standard grids...) The old mni2tal question creeps again into the discussion. I would like to use the AFNI atlas, but the conversion introduces too much distortion. For the others (AAL, SPM17/18, Brainweb), all is fine. See attached figure comparing AFNI (blue) with Brainweb grey_matter (red). I might get around to add this to the FAQ next week. :-) Vitória, there is a number of other atlases you can use instead of AFNI then. Either from the link below or any MNI-aligned template, using JM's procedure now it takes 3 seconds to re-label your grid. http://fieldtrip.fcdonders.nl/template/atlas Best, Erick On Thu, Mar 13, 2014 at 1:00 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Vitória, Erick, Cornelius et al, > > Allow me to chime in to this Brazilio-German interaction ;-). > It seems to me that the discussion consists of a few separable elements. > > -The first one pertains to the specific question how to map source > locations between two different representations (source with pos versus > volumetric MRI-type image with a transform). > -The other one relates to some atlas related business, i.e. mapping > locations that have a specific anatomical label to specific MEG source > space locations. > -And then there's a third one, which is important for 2, and pertains to > the usual complicated stuff of mapping between different coordinate systems. > > There are several ways to achieve what Vitória is looking for, and I think > that Erick already solved it, but recent changes in FieldTrip make it quite > straightforward. > > So here goes my recipe: > 1 I would go along with Erick to do my beamformer source reconstruction on > a subject-specific grid, which is inverse-warped from a regular grid > defined on the MNI-template. > 2 If we take this template grid, which can be found in > ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of your > choice onto this sourcemodel, using ft_sourceinterpolate. Reading in of the > atlas nowadays indeed should be done with ft_read_atlas (ft_prepare_atlas > will be deprecated soon), and my personal taste would be NOT to use the > afni atlas, because this one is defined in Talairach space, which is > slightly different from MNI-space, and although FT accounts for the > differences I am not sure how accurate this is. Anyway, one could do > something like atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), > load the template sourcemodel with the resolution you need (i.e. the > resolution you used in your beamformer grid), and call > ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter > = 'tissue'; sourcemodel2 = ft_sourceinterpolate(cfg,atlas,sourcemodel); % > NOTE: ensure that the units are consistent in atlas and sourcemodel, if not > use ft_convert_units > 3 Step 2 should have given you sourcemodel2 with a field 'tissue', that > represents the anatomical labels, according to the corresponding atlas. > Atlas.tissuelabel gives the labels that correspond to the numbers in the > tissue field. > 4 Then, without the need to call ft_sourceinterpolate, nor > ft_volumenormalise on your source-reconstructed data, you can do indx = > find(sourcemodel2.tissue==x), where x is the number of your choice, and you > directly get the indices of the source positions in your 'source' variable, > that have this particular anatomical label. > 5 Then, you can do whatever you like with it, e.g. take a max or mean or > whatever... > > I hope I was clear enough, and that someone feels inclined to make this > into a FAQ on the FieldTrip wiki ;-). > > Best wishes, > Jan-Mathijs > > > > On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > > Dear Erick, > > "simply label and/or define my ROI in the MNI grid. When I warp to the > individuals, everything is in place without a hitch" -> that sounds like a > good thing to do. > Is this a very complicated thing to do? Would you mind sharing a piece of > code or some tips for how I could achieve it? > > Thanks once more, Vitória > > On 3/12/2014 11:37 AM, Erick Ortiz wrote: > > Dear Vitoria, > > What I do usually, is to simply label and/or define my ROI in the MNI > grid. When I warp to the individuals, everything is in place without a > hitch. > > About the interpolation, I cannot help much more. I have been using my > own tools for years, and I was not following the support of atlases in > Fieldtrip.I tried it today, but had issues with coordinate system labeling > when defining a ROI (I updated to the latest version by SVN): > > afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); > cfg = []; > cfg.method = 'ortho'; > cfg.interactive = 'yes'; > cfg.funparameter = 'coh'; > cfg.atlas = afni; > cfg.coordsys = 'mni'; > % cfg.roi = 'Middle Temporal Gyrus'; > % cfg.inputcoord = 'tal'; > ft_sourceplot(cfg, interp); > > Also note that I had to use ft_read_atlas, because ft_prepare_atlas does > not generate the brick0label/brick1label fields. > > It works well, but if I try to define a ROI (uncommenting the two lines), > I get the error "The field cfg.inputcoord is required". There seems to be > some confusion between inputcoord and coordsys. > > It can be because I was doing something wrong: maybe a Fieldtrip developer > could comment on that? > > Best, > Erick > > > > On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai wrote: > >> Dear Erick, >> >> Thanks for your detailed reply. >> I've been using individual MNI-warped grids (point 4 below) and I'm >> always using ft_convert_unit so those points are alright in my data. >> >> The reason why I do need to interpolate (at least, I think I need), is >> because I'm looking for max 'pow' in anatomically defined regions given the >> afni atlas. I managed to get it to work by interpolating to the mri and >> looking for max 'pow' given a label (e.g., 'Middle Temporal Gyrus') using >> ft_volumelookup. >> Do you have any experience with this approach (searching within >> anatomical labels) without having to interpolate? >> >> Thanks once more, Vitória >> >> >> >> >> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >> >> Dear Vitória and Cornelius, >> >> this is a common problem, and maybe it would be good to clarify the >> strategies that can be used here. I hope this can help others in a similar >> situation, which I have found many times. >> >> 1) You are trying to convert voxel indexes to head (CTF) coordinates. In >> this case, there are two mistakes in the code: >> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), posInt, >> 'homogeneous' ); >> ... should be done with sourceNAIInt, not mri. The transforms are >> different, in general; e.g. note the downsample=2. >> 1b) use cfg.locationcoordinates = 'head', as commented by JM in a >> previous post. Or remove this line, since 'head' is the default. >> >> 2) But if you are working with the same subject/grid, there is no need >> for interpolation at all. Simply find the grid position with highest 'pow' >> and take its position. >> [dummy,ind] = max(source.avg.pow); >> pos = source.pos(ind,:); >> >> 3) However, this is not possible when using different grids, e.g. in a >> grand average in MNI coordinates. Find the peak ('pos') in the interpolated >> volume, as in Cornelius' code, then find the index of the nearest grid >> position for a common (again, MNI) grid. This is also in JM's message. >> >> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >> [dummy,ind] = min(sum(dpos.^2,2)); >> >> 4) What I have been using, and strongly recommend, is an MNI grid warped >> to the subject's anatomy, according to this procedure: >> >> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> This would give you both the benefits of working in MNI coordinates, and >> the ease of having a common grid across subjects (for instance, enabling >> solution #2). Still, some projects do call for one of the other options. >> >> Just a couple of details: >> - Pay utmost attention to coordinate systems and units. For instance, it >> is common to confuse unlabeled cm for mm, and either of these with voxels. >> Try to also label all structures as CTF or SPM (MNI). >> - Using pinv instead of inv is usually a good idea. Here, it is a not an >> issue, but matrix inversion in MATLAB can lead to a world of hurt to the >> unwary. >> >> Best, >> Erick >> >> >> >> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai wrote: >> >>> Dear FT-ers, >>> >>> I found an old posting to the mailing list (see below) that never got >>> answered so my question still holds: given a location I found in the >>> interpolated source, how do I find back the same location in .pos of the >>> non-interpolated data? >>> I can try and go around it by finding the corresponding MNI coordinates >>> in the interpolated data (which by now I have to do by hand, so not optimal >>> anyways), and then look for those coordinates in .pos. But I was wondering, >>> like Cornelius was in his post, whether there is a neater way to get this >>> information. >>> >>> Thanks a lot for the help, >>> Vitória >>> >>> >>> >>>>>>>>>>>>>> >>>> >>>> Hi mailing list, >>>> >>>> I'm still struggling with the conversion of coordinates between source >>>> and >>>> interpolated source space. >>>> For example, if i have the position of a single grid point how do i get >>>> the >>>> corresponding voxel in the interpolated source structure. Or the other >>>> way >>>> around, how to get the grid point which corresponds to a voxel (e.g the >>>> max >>>> voxel) in the interpolated source structure. >>>> >>>> I think this should be a common problem when working with virtual >>>> electrodes, shouldn't it? >>>> >>>> To make things easier i put together a example with the data from the >>>> source tutorial where i tried to calculated the grid pos of the max >>>> voxel >>>> in the interpolated source. >>>> >>>> clear all; >>>> load sourcePost_nocon; % source structure from tutorial >>>> mri = ft_read_mri('Subject01.mri'); % mri of subject01 from tutorial >>>> >>>> sourceNAI = sourcePost_nocon; >>>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>>> sourcePost_nocon.avg.noise; >>>> sourceNAI=rmfield(sourceNAI,'freq'); % had to remove that to let >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI , mri); >>>> >>>> % Find position of max activity >>>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>>> posInt=[xi, yi, zi]; >>>> >>>> % Plot interpolated source with position of max activity >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = posInt; % location of max activity is >>>> marked >>>> correctly. >>>> figure; >>>> ft_sourceplot(cfg,sourceNAIInt); >>>> >>>> % Transform coordinate back to uninterpolated source??? >>>> dpos = warp_apply(inv(mri.transform), posInt, 'homogeneous'); >>>> >>>> >>>> % Plot uninterpolated source with position aquired from interpolated >>>> source >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = dpos; % unfortunately this coordinate >>>> is >>>> obviously wrong!!! WHY? >>>> figure; >>>> ft_sourceplot(cfg,sourceNAI); >>>> >>>> >>>> Unfortunately the solution of Jan Mathijs did not work, nor did mine :( >>>> >>>> Any ideas??? >>>> >>>> Cornelius >>>> >>>> >>>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> _______________________________________________ >> 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 >> > > > > _______________________________________________ > 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 > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 14 07:48:43 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 14 Mar 2014 07:48:43 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> Message-ID: <5322A64B.1000603@gmail.com> Hi Erick, I already wrote a FAQ yesterday: http://fieldtrip.fcdonders.nl/faq/how_can_i_map_source_locations_between_two_different_representations Probably not as good as you or JM would have written it though (I'm no specialist), so please feel free to improve it! :) Thanks for all the feedback, Vitória On 3/14/2014 2:05 AM, Erick Ortiz wrote: > Thanks for shedding light on the issue, JM: I tested your suggestion > and it worked brilliantly, far faster and more elegant than the script > I wrote years ago. (in my defense, it was only run a couple of times, > to label our standard grids...) > > The old mni2tal question creeps again into the discussion. I would > like to use the AFNI atlas, but the conversion introduces too much > distortion. For the others (AAL, SPM17/18, Brainweb), all is fine. See > attached figure comparing AFNI (blue) with Brainweb grey_matter (red). > > I might get around to add this to the FAQ next week. :-) > > Vitória, there is a number of other atlases you can use instead of > AFNI then. Either from the link below or any MNI-aligned template, > using JM's procedure now it takes 3 seconds to re-label your grid. > http://fieldtrip.fcdonders.nl/template/atlas > > Best, > Erick > > > > On Thu, Mar 13, 2014 at 1:00 PM, jan-mathijs schoffelen > > > wrote: > > Hi Vitória, Erick, Cornelius et al, > > Allow me to chime in to this Brazilio-German interaction ;-). > It seems to me that the discussion consists of a few separable > elements. > > -The first one pertains to the specific question how to map source > locations between two different representations (source with pos > versus volumetric MRI-type image with a transform). > -The other one relates to some atlas related business, i.e. > mapping locations that have a specific anatomical label to > specific MEG source space locations. > -And then there's a third one, which is important for 2, and > pertains to the usual complicated stuff of mapping between > different coordinate systems. > > There are several ways to achieve what Vitória is looking for, and > I think that Erick already solved it, but recent changes in > FieldTrip make it quite straightforward. > > So here goes my recipe: > 1 I would go along with Erick to do my beamformer source > reconstruction on a subject-specific grid, which is inverse-warped > from a regular grid defined on the MNI-template. > 2 If we take this template grid, which can be found in > ~/fieldtrip/template/sourcemodel, you can interpolate the atlas of > your choice onto this sourcemodel, using ft_sourceinterpolate. > Reading in of the atlas nowadays indeed should be done with > ft_read_atlas (ft_prepare_atlas will be deprecated soon), and my > personal taste would be NOT to use the afni atlas, because this > one is defined in Talairach space, which is slightly different > from MNI-space, and although FT accounts for the differences I am > not sure how accurate this is. Anyway, one could do something like > atlas = ft_read_atlas('~/fieldtrip/template/atlas/....'), load the > template sourcemodel with the resolution you need (i.e. the > resolution you used in your beamformer grid), and call > ft_sourceinterpolate: cfg = []; cfg.interpmethod = 'nearest'; > cfg.parameter = 'tissue'; sourcemodel2 = > ft_sourceinterpolate(cfg,atlas,sourcemodel); % NOTE: ensure that > the units are consistent in atlas and sourcemodel, if not use > ft_convert_units > 3 Step 2 should have given you sourcemodel2 with a field 'tissue', > that represents the anatomical labels, according to the > corresponding atlas. Atlas.tissuelabel gives the labels that > correspond to the numbers in the tissue field. > 4 Then, without the need to call ft_sourceinterpolate, nor > ft_volumenormalise on your source-reconstructed data, you can do > indx = find(sourcemodel2.tissue==x), where x is the number of your > choice, and you directly get the indices of the source positions > in your 'source' variable, that have this particular anatomical label. > 5 Then, you can do whatever you like with it, e.g. take a max or > mean or whatever... > > I hope I was clear enough, and that someone feels inclined to make > this into a FAQ on the FieldTrip wiki ;-). > > Best wishes, > Jan-Mathijs > > > > On Mar 12, 2014, at 5:50 PM, Vitoria Piai wrote: > >> Dear Erick, >> >> "simply label and/or define my ROI in the MNI grid. When I warp >> to the individuals, everything is in place without a hitch" -> >> that sounds like a good thing to do. >> Is this a very complicated thing to do? Would you mind sharing a >> piece of code or some tips for how I could achieve it? >> >> Thanks once more, Vitória >> >> On 3/12/2014 11:37 AM, Erick Ortiz wrote: >>> Dear Vitoria, >>> >>> What I do usually, is to simply label and/or define my ROI in >>> the MNI grid. When I warp to the individuals, everything is in >>> place without a hitch. >>> >>> About the interpolation, I cannot help much more. I have been >>> using my own tools for years, and I was not following the >>> support of atlases in Fieldtrip.I tried it today, but had issues >>> with coordinate system labeling when defining a ROI (I updated >>> to the latest version by SVN): >>> >>> afni = ft_read_atlas('template/atlas/afni/TTatlas+tlrc.HEAD'); >>> cfg = []; >>> cfg.method = 'ortho'; >>> cfg.interactive = 'yes'; >>> cfg.funparameter = 'coh'; >>> cfg.atlas = afni; >>> cfg.coordsys = 'mni'; >>> % cfg.roi = 'Middle Temporal Gyrus'; >>> % cfg.inputcoord = 'tal'; >>> ft_sourceplot(cfg, interp); >>> >>> Also note that I had to use ft_read_atlas, because >>> ft_prepare_atlas does not generate the brick0label/brick1label >>> fields. >>> >>> It works well, but if I try to define a ROI (uncommenting the >>> two lines), I get the error "The field cfg.inputcoord is >>> required". There seems to be some confusion between inputcoord >>> and coordsys. >>> >>> It can be because I was doing something wrong: maybe a Fieldtrip >>> developer could comment on that? >>> >>> Best, >>> Erick >>> >>> >>> >>> On Wed, Mar 12, 2014 at 9:24 AM, Vitoria Piai >>> > >>> wrote: >>> >>> Dear Erick, >>> >>> Thanks for your detailed reply. >>> I've been using individual MNI-warped grids (point 4 below) >>> and I'm always using ft_convert_unit so those points are >>> alright in my data. >>> >>> The reason why I do need to interpolate (at least, I think I >>> need), is because I'm looking for max 'pow' in anatomically >>> defined regions given the afni atlas. I managed to get it to >>> work by interpolating to the mri and looking for max 'pow' >>> given a label (e.g., 'Middle Temporal Gyrus') using >>> ft_volumelookup. >>> Do you have any experience with this approach (searching >>> within anatomical labels) without having to interpolate? >>> >>> Thanks once more, Vitória >>> >>> >>> >>> >>> On 3/11/2014 6:35 PM, Erick Ortiz wrote: >>>> Dear Vitória and Cornelius, >>>> >>>> this is a common problem, and maybe it would be good to >>>> clarify the strategies that can be used here. I hope this >>>> can help others in a similar situation, which I have found >>>> many times. >>>> >>>> 1) You are trying to convert voxel indexes to head (CTF) >>>> coordinates. In this case, there are two mistakes in the code: >>>> 1a) pos = warp_apply( pinv( sourceNAIInt.transform ), >>>> posInt, 'homogeneous' ); >>>> ... should be done with sourceNAIInt, not mri. The >>>> transforms are different, in general; e.g. note the >>>> downsample=2. >>>> 1b) use cfg.locationcoordinates = 'head', as commented by >>>> JM in a previous post. Or remove this line, since 'head' is >>>> the default. >>>> >>>> 2) But if you are working with the same subject/grid, there >>>> is no need for interpolation at all. Simply find the grid >>>> position with highest 'pow' and take its position. >>>> [dummy,ind] = max(source.avg.pow); >>>> pos = source.pos(ind,:); >>>> >>>> 3) However, this is not possible when using different >>>> grids, e.g. in a grand average in MNI coordinates. Find the >>>> peak ('pos') in the interpolated volume, as in Cornelius' >>>> code, then find the index of the nearest grid position for >>>> a common (again, MNI) grid. This is also in JM's message. >>>> >>>> dpos = source.pos - repmat( pos, size(source.pos,1), 1 ); >>>> [dummy,ind] = min(sum(dpos.^2,2)); >>>> >>>> 4) What I have been using, and strongly recommend, is an >>>> MNI grid warped to the subject's anatomy, according to this >>>> procedure: >>>> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >>>> >>>> This would give you both the benefits of working in MNI >>>> coordinates, and the ease of having a common grid across >>>> subjects (for instance, enabling solution #2). Still, some >>>> projects do call for one of the other options. >>>> >>>> Just a couple of details: >>>> - Pay utmost attention to coordinate systems and units. For >>>> instance, it is common to confuse unlabeled cm for mm, and >>>> either of these with voxels. Try to also label all >>>> structures as CTF or SPM (MNI). >>>> - Using pinv instead of inv is usually a good idea. Here, >>>> it is a not an issue, but matrix inversion in MATLAB can >>>> lead to a world of hurt to the unwary. >>>> >>>> Best, >>>> Erick >>>> >>>> >>>> >>>> On Tue, Mar 11, 2014 at 4:04 PM, Vitoria Piai >>>> >>> > wrote: >>>> >>>> Dear FT-ers, >>>> >>>> I found an old posting to the mailing list (see below) >>>> that never got answered so my question still holds: >>>> given a location I found in the interpolated source, >>>> how do I find back the same location in .pos of the >>>> non-interpolated data? >>>> I can try and go around it by finding the corresponding >>>> MNI coordinates in the interpolated data (which by now >>>> I have to do by hand, so not optimal anyways), and then >>>> look for those coordinates in .pos. But I was >>>> wondering, like Cornelius was in his post, whether >>>> there is a neater way to get this information. >>>> >>>> Thanks a lot for the help, >>>> Vitória >>>> >>>> >>>> >>>>>>>>>>>>>> >>>> >>>> Hi mailing list, >>>> >>>> I'm still struggling with the conversion of >>>> coordinates between source and >>>> interpolated source space. >>>> For example, if i have the position of a single >>>> grid point how do i get the >>>> corresponding voxel in the interpolated source >>>> structure. Or the other way >>>> around, how to get the grid point which corresponds >>>> to a voxel (e.g the max >>>> voxel) in the interpolated source structure. >>>> >>>> I think this should be a common problem when >>>> working with virtual >>>> electrodes, shouldn't it? >>>> >>>> To make things easier i put together a example with >>>> the data from the >>>> source tutorial where i tried to calculated the >>>> grid pos of the max voxel >>>> in the interpolated source. >>>> >>>> clear all; >>>> load sourcePost_nocon; % source structure from tutorial >>>> mri = ft_read_mri('Subject01.mri'); % mri of >>>> subject01 from tutorial >>>> >>>> sourceNAI = sourcePost_nocon; >>>> sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./ >>>> sourcePost_nocon.avg.noise; >>>> sourceNAI=rmfield(sourceNAI,'freq'); % had to >>>> remove that to let >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI >>>> , mri); >>>> >>>> % Find position of max activity >>>> [dum, maxindx] = max(sourceNAIInt.avg.pow(:)); >>>> [xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx); >>>> posInt=[xi, yi, zi]; >>>> >>>> % Plot interpolated source with position of max >>>> activity >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = posInt; % location of max >>>> activity is marked >>>> correctly. >>>> figure; >>>> ft_sourceplot(cfg,sourceNAIInt); >>>> >>>> % Transform coordinate back to uninterpolated source??? >>>> dpos = warp_apply(inv(mri.transform), posInt, >>>> 'homogeneous'); >>>> >>>> >>>> % Plot uninterpolated source with position aquired >>>> from interpolated source >>>> cfg = []; >>>> cfg.method = 'ortho'; >>>> cfg.funparameter = 'avg.pow'; >>>> cfg.locationcoordinates = 'voxel'; >>>> cfg.location = dpos; % unfortunately >>>> this coordinate is >>>> obviously wrong!!! WHY? >>>> figure; >>>> ft_sourceplot(cfg,sourceNAI); >>>> >>>> >>>> Unfortunately the solution of Jan Mathijs did not >>>> work, nor did mine :( >>>> >>>> Any ideas??? >>>> >>>> Cornelius >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > 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 erick.ortiz at med.uni-tuebingen.de Fri Mar 14 08:57:28 2014 From: erick.ortiz at med.uni-tuebingen.de (Erick Ortiz) Date: Fri, 14 Mar 2014 08:57:28 +0100 Subject: [FieldTrip] reverse source interpolate? In-Reply-To: <5322A64B.1000603@gmail.com> References: <531F2613.1040808@gmail.com> <532019D5.8040204@gmail.com> <53209038.8010906@gmail.com> <39C91C44-E602-4BE3-90E8-9BFEE88FD0DA@donders.ru.nl> <5322A64B.1000603@gmail.com> Message-ID: A final note: Sorry, my ad-blocker prevented me from including the picture yesterday. Here it is. Caption: Comparing grey matter tagging using atlases AFNI (all labels; blue) and Brainweb (tissue grey_matter; red). Note how the AFNI version does not fill the VCM completely, probably due to TAL to MNI transformation issues. [image: Inline image 1] Vitória, if you would like, this could be included in the FAQ to illustrate JM's comment. Best, Erick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: atlas_afni_brainweb_sourcespace.png Type: image/png Size: 480741 bytes Desc: not available URL: From virginie.van.wassenhove at gmail.com Fri Mar 14 09:39:44 2014 From: virginie.van.wassenhove at gmail.com (Virginie van Wassenhove) Date: Fri, 14 Mar 2014 09:39:44 +0100 Subject: [FieldTrip] postdoctoral position @ NeuroSpin Message-ID: Please follow the link! http://www.inria.fr/en/institute/recruitment/offers/post -doctoral-research-fellowships/post -doctoral-research-fellowships/campaign-2014/(view)/details.html?id=PNGFK026203F3VBQB6G68LOE1&ContractType=4546&LG=EN&Resultsperpage=20&nPostingID=8498&nPostingTargetID=14266&option=52&sort=DESC&nDepartmentID=19 Best, -Virginie -- Virginie van Wassenhove Exec Dir NeuroSpin MEG Group leader, Brain Dynamics CEA.DSV.I2BM.NeuroSpin - INSERM Cognitive Neuroimaging Unit Bât 145 Point Courrier 156 Gif s/ Yvette F-91191 FRANCE +33(0)1.69.08.1667 Virginie.van.Wassenhove at gmail.com https://sites.google.com/site/virginievanwassenhove/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Fri Mar 14 11:47:44 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 11:47:44 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Hi all, I've been trying to append data from two datasets that were read in and segmented into trials separately. Whenever I do so all events get mixed up, i.e., eventvalues that were not specified for ft_definetrial (and ft_redefinetrial) show up in the databrowser and the original events of interest are not aligned to 0 anymore. The warning I get is "input data comes from different datafiles; removing sampleinfo field". Is there another way to combine data from different recordings? I use Vision Recorder and subjects need to take a break during the experiment, which is why I end up with two datasets in the first place. I figured that combining the datasets before defining trials would be more efficient anyway but then I don't know how to read in all events (since ft_definetrial requires one dataset). Thanks in advance! Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Fri Mar 14 12:08:21 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 14 Mar 2014 07:08:21 -0400 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> References: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Message-ID: Hi Phyllis, I believe a trial function (see ft_trialfun_general) will solve your problem. The concatenated datasets will still lose their sampleinfo field, but the trialinfo field will retain the proper offsets, triggers, etc. as long as you put them in your trial function. Best, Raquel > On Mar 14, 2014, at 6:47 AM, "Phyllis Mania" wrote: > > Hi all, > > I’ve been trying to append data from two datasets that were read in and segmented into trials separately. > Whenever I do so all events get mixed up, i.e., eventvalues that were not specified for ft_definetrial (and ft_redefinetrial) show up in the databrowser and the original events of interest are not aligned to 0 anymore. > The warning I get is “input data comes from different datafiles; removing sampleinfo field”. > > Is there another way to combine data from different recordings? I use Vision Recorder and subjects need to take a break during the experiment, which is why I end up with two datasets in the first place. > > I figured that combining the datasets before defining trials would be more efficient anyway but then I don’t know how to read in all events (since ft_definetrial requires one dataset). > > Thanks in advance! > Phyllis > > > _______________________________________________ > 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 Fri Mar 14 12:03:52 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 14 Mar 2014 12:03:52 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> References: <001201cf3f72$d54e16c0$7fea4440$@uni-hamburg.de> Message-ID: Hi Phyllis, The way I would approach this is to segment the data for both data files separately, making sure that all relevant information is stored in the .trialinfo field. If you write your own trialfun, then any information you store in the 4th and upward column of the trl matrix will end up in data.trialinfo when doing ft_definetrial and ft_preprocessing. Then you can simply use ft_appenddata to append the data sets and all should be fine. Even though the events are removed (which they must be, as their time stamps are coded in terms of samples from the onset of recording), you still have the information in trialinfo. Would that work? Best, Eelke On 14 March 2014 11:47, Phyllis Mania wrote: > Hi all, > > > > I've been trying to append data from two datasets that were read in and > segmented into trials separately. > > Whenever I do so all events get mixed up, i.e., eventvalues that were not > specified for ft_definetrial (and ft_redefinetrial) show up in the > databrowser and the original events of interest are not aligned to 0 > anymore. > > The warning I get is "input data comes from different datafiles; removing > sampleinfo field". > > > > Is there another way to combine data from different recordings? I use Vision > Recorder and subjects need to take a break during the experiment, which is > why I end up with two datasets in the first place. > > > > I figured that combining the datasets before defining trials would be more > efficient anyway but then I don't know how to read in all events (since > ft_definetrial requires one dataset). > > > > Thanks in advance! > > Phyllis > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From juriguen at gmail.com Fri Mar 14 12:23:22 2014 From: juriguen at gmail.com (=?ISO-8859-1?Q?Jose_Antonio_Urig=FCen?=) Date: Fri, 14 Mar 2014 12:23:22 +0100 Subject: [FieldTrip] Solution to the EEG forward problem Message-ID: Dear all This may be simple to answer, since I am quite new to the area and keep struggling with the tutorials at the main website. So here we go: I want to use Fieltrip in Matlab (Windows) to: 1. Compute the leadfield at a set of electrodes positioned in the scalp based on a BEM model of the head (something along the line of http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg plus correct use of the ft_prepare_leadfield function) So, what is confusing me is that say I have a head model / volume and the set of electrodes (result of following http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg ), then if I do *pos = [0 0 0.5];* *cfg = [];* *cfg.grid.pos = pos;* *gridp = ft_prepare_sourcemodel(cfg, vol, elec_aligned);* *cfg = [];* *cfg.vol = vol;* *cfg.elec = elec_aligned;* *cfg.grid = gridp;* *grid = ft_prepare_leadfield(cfg);* *lf_openmeeg = grid.leadfield{1};* I get the leadfield at the electrode locations. However, how do I get the actual potential at the electrodes if, say, I have dipole magnitudes and moments. Is the solution simply V = *lf_openmeeg * (magnitudes * moments)* *??* 2. Can I use Fieltrip to obtain a set of simulated EEG channels with brain rhythms? I was thinking of using available waveforms from the internet of intracraneal recordings as one of the inputs, however I woudl still need dipole positions / orientations (moments). Any ideas how to do this? Thanks in advance Toni -------------- next part -------------- An HTML attachment was scrubbed... URL: From phyllis.mania at uni-hamburg.de Fri Mar 14 13:03:13 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 13:03:13 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> Dear Eelke, Thanks for the quick response! What you're suggesting is exactly what I'm doing and the trialinfo for both the single and the appended dataset look the way they should. However, when looking at the databrowser, I see data from the beginning of the recording onwards, only with markers after a few trials (and then not aligned). The single datasets look fine in the databrowser, though. Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Mar 14 13:17:42 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 14 Mar 2014 13:17:42 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> References: <003101cf3f7d$601fc370$205f4a50$@uni-hamburg.de> Message-ID: Hi Phyllis, Hmm I'm not sure if I understand the problem exactly, but one thing comes to mind, namely that the input into databrowser is not entirely correct. You should not be seeing any markers anymore actually, after appended data. How are you calling ft_databrowser? For segmented data in memory (as is the case here), you should call it like so: cfg = []; cfg.continuous = 'no'; ft_databrowser(cfg, data); Is that how you are using it? If it is, and the problem is still there, then could you try doing data = rmfield(data, 'cfg') before calling ft_databrowser? (This will strip any event structures possibly still present in the cfg.previous-tree.) Best, Eelke On 14 March 2014 13:03, Phyllis Mania wrote: > Dear Eelke, > > > > Thanks for the quick response! What you're suggesting is exactly what I'm > doing and the trialinfo for both the single and the appended dataset look > the way they should. However, when looking at the databrowser, I see data > from the beginning of the recording onwards, only with markers after a few > trials (and then not aligned). The single datasets look fine in the > databrowser, though. > > > > Cheers, > Phyllis > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From phyllis.mania at uni-hamburg.de Fri Mar 14 13:52:43 2014 From: phyllis.mania at uni-hamburg.de (Phyllis Mania) Date: Fri, 14 Mar 2014 13:52:43 +0100 Subject: [FieldTrip] appending data from two recordings Message-ID: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> Dear Eelke, Calling 'rmfield' helped, thank you! Cheers, Phyllis -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Mar 14 14:11:02 2014 From: jm.horschig at donders.ru.nl (=?windows-1252?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 14 Mar 2014 14:11:02 +0100 Subject: [FieldTrip] appending data from two recordings In-Reply-To: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> References: <005e01cf3f84$4aafec70$e00fc550$@uni-hamburg.de> Message-ID: <5322FFE6.7000902@donders.ru.nl> Heyho, yes, I think the databrowser digs deep down in data.cfg to obtain the original event-matrix of your dataset. After the sampleinfo-field is reconstructed, the databrowser tries to relate the sampleinfo field with the original event-structure. As the two have nothing in common anymore, the output will of course be nonsense. Removing the cfg is imho the only option to prvent the databrowser from doing so. But this is clearly something that the databrowser should not do, because we want a smart databrowser, not a stupid one ;) Phyllis, could you be so kind to open up a bug on bugzilla.fcdonders.nl about this? Just shortly describe what you are doing in terms of code and describing the error would be sufficient. We will then take care that this get's solved in future versions. If you have questions about bugzilla or if you do not want to post the bug there, please let me/us know. But we'd appreciate if you could open up a bug :) Thanks in any case for your message! Best, Jörn On 3/14/2014 1:52 PM, Phyllis Mania wrote: > > Dear Eelke, > > Calling ‘rmfield’ helped, thank you! > > Cheers, > > Phyllis > > > > _______________________________________________ > 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 virginie.van.wassenhove at gmail.com Fri Mar 14 21:10:57 2014 From: virginie.van.wassenhove at gmail.com (Virginie van Wassenhove) Date: Fri, 14 Mar 2014 21:10:57 +0100 Subject: [FieldTrip] additional info Message-ID: It appears the link previously posted is dysfunctional. Additional information about the project can be found here: https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxwaGlsaXBwZWNpdWNpdXxneDoxYTI3MGUyZjMzMTg0Y2Uy All the best, -Virginie -- Virginie van Wassenhove Exec Dir NeuroSpin MEG Group leader, Brain Dynamics CEA.DSV.I2BM.NeuroSpin - INSERM Cognitive Neuroimaging Unit Bât 145 Point Courrier 156 Gif s/ Yvette F-91191 FRANCE +33(0)1.69.08.1667 Virginie.van.Wassenhove at gmail.com https://sites.google.com/site/virginievanwassenhove/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Mon Mar 17 01:20:45 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Mon, 17 Mar 2014 00:20:45 +0000 Subject: [FieldTrip] MNE covariance window and ft_plot_mesh error Message-ID: <53263FDD.1060205@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Mar 17 01:21:23 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 17 Mar 2014 00:21:23 +0000 Subject: [FieldTrip] using eeglab's ICA data with beamformer Message-ID: Hello fieldtrip, I am new to the fieltrip toolbox and Ive come from eeglab to do some beamformer and connectivity processing. Ive used the function eeglab2fieldtrip, with one of the arguments being 'componentanalysis'. I tried using the data in the beamformer tutorial and everything worked fine until I got to the ft_sourceanalysis script where it used the channel labels and positions from the original non-ICAed data. So the code crashed because the ICA labels and channels labels didnt match. I was wondering whether beamformer can be used with ICs from eeglab, and if so, where I am going wrong. We also want to do functional connectivity as I mentioned, which requires a beamformer that operates in the time domain as opposed to the frequency domain. However, there arent any tutorials on the Constrained Minimum Variance (LCMV) beamformer (which I think works in the time domain), so I am trying to make do with the one used in the tutorial. Any help will be greatly appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Mar 17 12:34:51 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 17 Mar 2014 11:34:51 +0000 Subject: [FieldTrip] using eeglab's ICA data with beamformer In-Reply-To: References: Message-ID: Dear Tyler, Beamforming is one type of inverse method and it requires the sensor data covariance matrix. It also assumes that underlying sources are uncorrelated. If you try to input data from only 1 IC, all the sensors will covary together and any underlying sources that contribute to this 1 IC will be 100% temporally correlated. You can apply beamforming to a mixture of ICs, mixed back from the 'component space' back to the 'sensor space' (see ft_rejectcomponent). This is often done for example by excluding a few components which are artefactual and keeping many remaining (presumably brain) components. Normally the 'rank' of your covariance matrix is equal to the number of sensors (rank is the number of independent rows or columns, i.e. contributions), and so by removing a few ICs from the data, you have reduced the rank. If your rank is reduced relative to number of sensors, then you should use the regularisation option (cfg.lambda). This is true for either LCMV or DICS. However, this is usually only done when the rank is still well above 1. However, if you wish to localise the underlying sources of just 1 (or a small number of mixed) ICs, then better to use a min-norm method which does not depend on the sensor covariance. In this case, you still must re-project the IC back to sensor space in FieldTrip for the labels of the data to match the labels of the leadfield. See also: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors (<- LCMV) Hope this helps; please ask again if you need further clarification, or please give a specific error message. Cheers, Johanna 2014-03-17 0:21 GMT+00:00 Tyler Grummett : > Hello fieldtrip, > > > I am new to the fieltrip toolbox and Ive come from eeglab to do some > beamformer and connectivity processing. > > > Ive used the function eeglab2fieldtrip, with one of the arguments being > 'componentanalysis'. I tried using the data in the beamformer tutorial and > everything worked fine > > until I got to the ft_sourceanalysis script where it used the channel > labels and positions from the original non-ICAed data. So the code crashed > because the ICA labels > > and channels labels didnt match. > > > I was wondering whether beamformer can be used with ICs from eeglab, and > if so, where I am going wrong. > > > We also want to do functional connectivity as I mentioned, which > requires a beamformer that operates in the time domain as opposed to the > frequency domain. > > > However, there arent any tutorials on the Constrained Minimum Variance > (LCMV) beamformer (which I think works in the time domain), so I am > trying to make do with the one used in the tutorial. > > > Any help will be greatly appreciated. > > > Tyler. > > > ************************* > > *Tyler Grummett ( BBSc, BSc(Hons I))* > *PhD Candidate* > *Brain Signals Laboratory* > *Flinders University* > *Rm 5A301* > *Ext 66124* > > _______________________________________________ > 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 yturbidesw at wit.edu Mon Mar 17 13:28:07 2014 From: yturbidesw at wit.edu (Yturbides, Walker) Date: Mon, 17 Mar 2014 12:28:07 +0000 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset Message-ID: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> Hello FieldTrip Users, I am new to the FieldTrip toolbox and I have a background in Electronics Engineering. I recently bought an EEG Neuroheadset and want to control a wheelchair with it for my senior design project. There is so much that is possible using FieldTrip that I do not know where to start. Can someone help me get started, or perhaps have any suggestions? Also, I am trying to read the raw EEG signals from the Emotiv headset into MATLAB. Does anyone have any information that would help me? Any suggestions are very much appreciated. Thank You, Walker -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 17 13:57:33 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 17 Mar 2014 13:57:33 +0100 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> Message-ID: <5326F13D.6080302@donders.ru.nl> Hi Walker, where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: http://fieldtrip.fcdonders.nl/tutorial You could start with the preprocessing tutorials and see how you can adapt them to what you want. And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': http://fieldtrip.fcdonders.nl/?do=search&id=emotiv But better start in the beginning instead of skipping important steps ;) Best, Jörn On 3/17/2014 1:28 PM, Yturbides, Walker wrote: > > Hello FieldTrip Users, > > I am new to the FieldTrip toolbox and I have a background in > Electronics Engineering. I recently bought an EEG Neuroheadset and > want to control a wheelchair with it for my senior design project. > There is so much that is possible using FieldTrip that I do not know > where to start. Can someone help me get started, or perhaps have any > suggestions? Also, I am trying to read the raw EEG signals from the > Emotiv headset into MATLAB. Does anyone have any information that > would help me? > > Any suggestions are very much appreciated. > > Thank You, > > Walker > > > > _______________________________________________ > 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 yturbidesw at wit.edu Mon Mar 17 14:11:15 2014 From: yturbidesw at wit.edu (Yturbides, Walker) Date: Mon, 17 Mar 2014 13:11:15 +0000 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <5326F13D.6080302@donders.ru.nl> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> <5326F13D.6080302@donders.ru.nl> Message-ID: <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> Hi Jörn, Thank you for your response. I am currently trying to use the applications that FieldTrip offers such as 'Emotiv2ft.exe' and the 'demo_buffer.exe' and when I try to plot the signals in real time, I am not able to. I just need to be able to import all the raw EEG signals into Matlab for now. Once I have the real-time signals in Matlab I will be processing them but as of right now that is where I am stuck at. Would you have any suggestions on how to import the signals so I am able to process them in real-time or as close as possible? Thank You, Walker -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of "Jörn M. Horschig" Sent: Monday, March 17, 2014 8:58 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset Hi Walker, where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: http://fieldtrip.fcdonders.nl/tutorial You could start with the preprocessing tutorials and see how you can adapt them to what you want. And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': http://fieldtrip.fcdonders.nl/?do=search&id=emotiv But better start in the beginning instead of skipping important steps ;) Best, Jörn On 3/17/2014 1:28 PM, Yturbides, Walker wrote: > > Hello FieldTrip Users, > > I am new to the FieldTrip toolbox and I have a background in > Electronics Engineering. I recently bought an EEG Neuroheadset and > want to control a wheelchair with it for my senior design project. > There is so much that is possible using FieldTrip that I do not know > where to start. Can someone help me get started, or perhaps have any > suggestions? Also, I am trying to read the raw EEG signals from the > Emotiv headset into MATLAB. Does anyone have any information that > would help me? > > Any suggestions are very much appreciated. > > Thank You, > > Walker > > > > _______________________________________________ > 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 -------------- A non-text attachment was scrubbed... Name: error_with_demo_buffer.PNG Type: image/png Size: 36644 bytes Desc: error_with_demo_buffer.PNG URL: From jm.horschig at donders.ru.nl Mon Mar 17 14:19:47 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 17 Mar 2014 14:19:47 +0100 Subject: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset In-Reply-To: <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> References: <50c9f6e168a047a0a90c3d38a3fdd998@BY2PR03MB157.namprd03.prod.outlook.com> <5326F13D.6080302@donders.ru.nl> <30e05f92c1984001bd2078b83985e333@BY2PR03MB157.namprd03.prod.outlook.com> Message-ID: <5326F673.5030308@donders.ru.nl> Hi Walker, you could start here: http://fieldtrip.fcdonders.nl/faq/how_should_i_get_started_with_the_fieldtrip_realtime_buffer and then search for related pages on the wiki-page. This should get you started on how to read in the data. Additionally, there are example scripts coming with FieldTrip, i think in the realtime folder. That should point you to how to read in data ;) Best, Jörn On 3/17/2014 2:11 PM, Yturbides, Walker wrote: > Hi Jörn, > > Thank you for your response. I am currently trying to use the applications that FieldTrip offers such as 'Emotiv2ft.exe' and the 'demo_buffer.exe' and when I try to plot the signals in real time, I am not able to. I just need to be able to import all the raw EEG signals into Matlab for now. Once I have the real-time signals in Matlab I will be processing them but as of right now that is where I am stuck at. Would you have any suggestions on how to import the signals so I am able to process them in real-time or as close as possible? > > Thank You, > Walker > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of "Jörn M. Horschig" > Sent: Monday, March 17, 2014 8:58 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Real-time Analysis using Matlab with Emotiv EEG Headset > > Hi Walker, > > where to start depends a lot on your already existing knowledge on electrophsyiological data analysis and your programming experience. If you have not very much experience in the former, I would suggest to read http://fieldtrip.fcdonders.nl/walkthrough > This also gives a very nice overview on some rationales in the FieldTrip toolbox in general. > I assume your programming to be somewhat good due to your background, so you can go on by checking existing tutorials and adapting their example code to your need: > http://fieldtrip.fcdonders.nl/tutorial > > You could start with the preprocessing tutorials and see how you can adapt them to what you want. > And, be sure to use the search function of the wikipage, e.g. search for 'import data' if you get stuck on importing your data ;) As another example, you can search for 'emotiv': > http://fieldtrip.fcdonders.nl/?do=search&id=emotiv > > But better start in the beginning instead of skipping important steps ;) > > Best, > Jörn > > > On 3/17/2014 1:28 PM, Yturbides, Walker wrote: >> Hello FieldTrip Users, >> >> I am new to the FieldTrip toolbox and I have a background in >> Electronics Engineering. I recently bought an EEG Neuroheadset and >> want to control a wheelchair with it for my senior design project. >> There is so much that is possible using FieldTrip that I do not know >> where to start. Can someone help me get started, or perhaps have any >> suggestions? Also, I am trying to read the raw EEG signals from the >> Emotiv headset into MATLAB. Does anyone have any information that >> would help me? >> >> Any suggestions are very much appreciated. >> >> Thank You, >> >> Walker >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 l.verhagen at fcdonders.ru.nl Mon Mar 17 17:40:07 2014 From: l.verhagen at fcdonders.ru.nl (Lennart Verhagen) Date: Mon, 17 Mar 2014 16:40:07 +0000 Subject: [FieldTrip] comparing EEG systems for EEG-TMS and EEG-MRI Message-ID: <8EFA9DC0-5160-4F9E-8CD4-87246F88E602@fcdonders.ru.nl> Dear all, We are planning to acquire an EEG system for concurrent EEG-TMS and/or EEG-MRI. I would be very interested to hear form someone with hands-on experience in these conditions with NeuroScan and/or BrainProducts systems (and perhaps other competitors). What is your opinion about the data quality of these systems? Don’t worry, I’m not looking for a lengthy detailed review, any brief comment would be appreciated :) Thanks! Cheers, Lennart From damingwang.tongji at gmail.com Tue Mar 18 03:11:11 2014 From: damingwang.tongji at gmail.com (=?GB2312?B?zfW088P3?=) Date: Tue, 18 Mar 2014 10:11:11 +0800 Subject: [FieldTrip] Is fieldtrip software suitable for processing computational simulation data Message-ID: Dear friends: I am student from China and currently very interested in your software of fieldtrip. There is a question puzzling me: If I use integrate-and-fire or other neural models to simulate and get spike and LFP(local field potential) data, is fieldtrip still suitable for processing these data? And the main part which I concern mostly is spike and LFP data analysis. Your reply and help will be sincerely appreciated! Thank you! Best Wishes Daming Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Mar 18 12:25:21 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 18 Mar 2014 12:25:21 +0100 Subject: [FieldTrip] deleting bad channels Message-ID: Hi! I have a bad channel that I would like to delete from the data using Fieldtrip, however, I'm not sure how the commands work for deleting bad channels. Would appreciate if someone could help me on this. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Mar 18 12:33:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Mar 2014 12:33:08 +0100 Subject: [FieldTrip] deleting bad channels In-Reply-To: References: Message-ID: Hi Hweeling, Try: cfg = []; cfg.channel = {'MEG' '-MLO12'}; data = ft_selectdata(cfg, data); to remove channel MLO12 from the data, but keep all other MEG channels (adapt to whatever you need). Note that you can also use this channel syntax in many other functions directly, like ft_freqanalysis or ft_timelockanalysis. Best, Eelke On 18 March 2014 12:25, Hwee Ling Lee wrote: > Hi! > > I have a bad channel that I would like to delete from the data using > Fieldtrip, however, I'm not sure how the commands work for deleting bad > channels. > > Would appreciate if someone could help me on this. > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From vasenka at gmail.com Tue Mar 18 19:02:47 2014 From: vasenka at gmail.com (Vasily Vakorin) Date: Tue, 18 Mar 2014 14:02:47 -0400 Subject: [FieldTrip] read write MarkerFile.mrk file Message-ID: I am trying to modify file MarkerFile.mrk, using function readmarkerfile.m and writeMarkerFile.m. Function readmarkerfile.m create a structure with four fields: number_markers, number_samples, marker_names, trial_times. However, function writeMarkerFile.m requires another field: ClassGroupId (only 0 and 3 are allowed). Any suggestions on how to create the "right" structure for writeMarkerFile.m ? Thank you, Vasily -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at gmail.com Wed Mar 19 08:42:00 2014 From: michelic72 at gmail.com (Cristiano Micheli) Date: Wed, 19 Mar 2014 03:42:00 -0400 Subject: [FieldTrip] read write MarkerFile.mrk file In-Reply-To: References: Message-ID: Dear Vasily I bumped into this site after a quick internet search: https://w3.rcc.uchicago.edu/redmine/projects/cacioppo/repository/annotate/spm8_dev/external/ctf/readCTFds.m A function's header therein referes to a CTF reference document, named PN900-0088: "This format is rigid and readMarkerFile assumes that the MarkerFile has the format current in October 2006. The document lists 4 Class Groups, but only CLASSGROUPID=0 (triggers) and CLASSGROUPID=3 (Manual) are actually used. read_MArkerFile reads only these two groups, but it prints a message if the other groups are encountered. Trigger markers (CLASSGROUPID=0) have an additional 4 pieces of information supplied: BITNUMBER(int), POLARITY(+ or 1),SOURCE(text) and THRESHOLD (float). FOr CLASSGROUPID=3, these fields are left empty." I hope this helps Cristiano On Tue, Mar 18, 2014 at 2:02 PM, Vasily Vakorin wrote: > I am trying to modify file MarkerFile.mrk, using function readmarkerfile.m > and writeMarkerFile.m. > > Function readmarkerfile.m create a structure with four fields: > number_markers, number_samples, marker_names, trial_times. > > However, function writeMarkerFile.m requires another field: ClassGroupId > (only 0 and 3 are allowed). > > Any suggestions on how to create the "right" structure for > writeMarkerFile.m ? > > Thank you, > Vasily > > _______________________________________________ > 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 mbj0310 at gmail.com Wed Mar 19 11:10:08 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Wed, 19 Mar 2014 19:10:08 +0900 Subject: [FieldTrip] ft_freqstatistics for between subject design Message-ID: Hello trippers. I am trying to do* t-test* with *the power* derived from frequency analysis of two different groups. The first group has 36 subjects, and the second group has 28 subjects. I did the ft_freqanalysis with the Morlet wavelet, and made the* induced power* of gamma band. After the plotting of the results, it looks like there might be a difference in the frequency range between [38 42], at the latency between [0.5 1] approximately. So, I made a script as below. cfg = []; cfg.channel = 'PZ'; % name of the electrode cfg.latency = [0.5 1]; cfg.trials = 'all'; cfg.frequency = [38 42]; cfg.avgoverchan = 'no'; cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'analytic'; cfg.statistic = 'indepsamplesT'; cfg.alpha = 0.05; cfg.design = [ones(1,36), ones(1,28)*2] ; % N x num of observations cfg.ivar = 1; stat = ft_freqstatistics(cfg, Induced_Ctrl_14{1:36}, Induced_CHR_14{1:28}); In terms of the structure of the result, there are five values in the stat, prob, mask and freq. I think that each 5 values correspond with the frequency data point. Is that script suitable for the test for the significance, especially avgovertime option 'yes'? If I change the avgovertime option to 'no', then can I found the p-values for each frequencies(5 values), and each time point(51 values), in total 255 values that could have multiple comparison issue? And I thought the 'mask' values of 0 indicates 'statistically non-significance'. Is that right? -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimparkinson at me.com Wed Mar 19 12:40:46 2014 From: jimparkinson at me.com (Jim Parkinson) Date: Wed, 19 Mar 2014 11:40:46 +0000 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics Message-ID: Hi. i have some TFR data which has been analysed over 1 : .5 : 30 Hz using ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions Right now I'd like to compare the two conditions using ft_freqstatistics but restrain the statistics to the freq range 1:10. so I've set cfg.frequency = [1 10] But, by the time the stats are running, the analysis is over the full range produced by ft_freqanalysis (1:30 Hz), and the output stats reflects this. Somewhere in ft_freqstatistics the cfg.frequency setting seems to be overridden. Is this a bug, am i doing something wrong, or have I misunderstood what cfg,frequency is supposed to be doing? thanks for any help! -- Dr Jim Parkinson, D.Phil j.m.parkinson at sussex.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Wed Mar 19 12:52:54 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Wed, 19 Mar 2014 12:52:54 +0100 (CET) Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics In-Reply-To: Message-ID: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> Hi Jim, Without seeing all the code you used it's hard to determine where exactly the problem is. NEvertheless, two things come to mind: (1) you need to specify the frequency of interest with "cfg.foi = 1:10". To be precise, it is also good to specify the numbers of steps you wish to calculate e.g., 1:1:10. please see here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis Alternatively, prior to calling ft_freqanalysis, you can use the function ft_selectdata(cfg,freqdata) to select the frequency band of interest. Hope this gets you started! Best, Nietzsche ----- Original Message ----- > From: "Jim Parkinson" > To: fieldtrip at science.ru.nl > Sent: Wednesday, 19 March, 2014 12:40:46 PM > Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics > Hi. > > > i have some TFR data which has been analysed over 1 : .5 : 30 Hz using > ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions > > > Right now I'd like to compare the two conditions using > ft_freqstatistics but restrain the statistics to the freq range 1:10. > so I've set > > > cfg.frequency = [1 10] > > > But, by the time the stats are running, the analysis is over the full > range produced by ft_freqanalysis (1:30 Hz), and the output stats > reflects this. Somewhere in ft_freqstatistics the cfg.frequency > setting seems to be overridden. Is this a bug, am i doing something > wrong, or have I misunderstood what cfg,frequency is supposed to be > doing? > > > thanks for any help! > > > -- > > > > Dr Jim Parkinson, D.Phil > > j.m.parkinson at sussex.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From jan.schoffelen at donders.ru.nl Wed Mar 19 12:57:41 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 12:57:41 +0100 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics In-Reply-To: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> References: <574720105.1427482.1395229974453.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <8EF7ABC9-13A3-46D7-A2AA-9569764FF4AF@donders.ru.nl> Hi Jim and Nietzsche, Let me chime in here: Where Nietzsche typed 'ft_freqanalysis' one should read 'ft_freqstatistics' probably. Also, cfg.frequency as option into ft_freqstatistics should be a 2-element array, specifying the lower and upper bound, contrary to Nietzsche's advice. I just tried this quickly, and it works for me. Jim, are you using an up to date version of FieldTrip? Also, if the problem persists, could you provide is with example code/data for us to be able to reproduce your problem. We usually do this through our bugzilla system: bugzilla.fcdonders.nl Best, Jan-Mathijs On Mar 19, 2014, at 12:52 PM, Lam, Nietzsche wrote: > Hi Jim, > > Without seeing all the code you used it's hard to determine where exactly the problem is. > NEvertheless, two things come to mind: > > (1) you need to specify the frequency of interest with "cfg.foi = 1:10". > To be precise, it is also good to specify the numbers of steps you wish to calculate e.g., 1:1:10. > please see here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis > > Alternatively, prior to calling ft_freqanalysis, you can use the function ft_selectdata(cfg,freqdata) to select the frequency band of interest. > > Hope this gets you started! > > Best, > Nietzsche > > ----- Original Message ----- >> From: "Jim Parkinson" >> To: fieldtrip at science.ru.nl >> Sent: Wednesday, 19 March, 2014 12:40:46 PM >> Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics >> Hi. >> >> >> i have some TFR data which has been analysed over 1 : .5 : 30 Hz using >> ft_freqanalysis (MTMCONVOL), 11 subjects, 2 conditions >> >> >> Right now I'd like to compare the two conditions using >> ft_freqstatistics but restrain the statistics to the freq range 1:10. >> so I've set >> >> >> cfg.frequency = [1 10] >> >> >> But, by the time the stats are running, the analysis is over the full >> range produced by ft_freqanalysis (1:30 Hz), and the output stats >> reflects this. Somewhere in ft_freqstatistics the cfg.frequency >> setting seems to be overridden. Is this a bug, am i doing something >> wrong, or have I misunderstood what cfg,frequency is supposed to be >> doing? >> >> >> thanks for any help! >> >> >> -- >> >> >> >> Dr Jim Parkinson, D.Phil >> >> j.m.parkinson at sussex.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimparkinson at me.com Wed Mar 19 13:50:28 2014 From: jimparkinson at me.com (Jim Parkinson) Date: Wed, 19 Mar 2014 12:50:28 +0000 Subject: [FieldTrip] Wrong functionality/ misunderstanding with cfg.frequency field in ft_freqstatistics Message-ID: Aah, please ignore my previous message; embarrassingly, I was doing a rush-job, messy code, and found I was in fact overwriting my OWN cfg.frequency field somewhere. schoolboy error, apologies -- Dr Jim Parkinson, D.Phil Postdoctoral Research Fellow Sackler Centre For Consciousness Science School of Psychology University of Sussex Brighton BN1 9QH jimparkinson at me.com j.m.parkinson at sussex.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.passaro at gmail.com Wed Mar 19 14:15:16 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 09:15:16 -0400 Subject: [FieldTrip] Linearly indexed data for mvar connectivity Message-ID: I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. Thank you, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.passaro at gmail.com Wed Mar 19 14:22:51 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 09:22:51 -0400 Subject: [FieldTrip] Speeding up Statistics using multiple cores Message-ID: I have seen this issue come up a few times on the list-serve, especially in regards to processing the statistics for large datasets (usually analyses with several dimensions and many subjects, trials, and/or channels/sources). Typically to run even 1000 iterations of a montecarlo simulation with a cluster correction to compare two large datasets takes a long time and often times, the computer doesn't have enough memory to perform the operation. One possible solution that we found takes advantage of multi-core computers such that the number of iterations are reduced to only 50 or 100 and the process is spread across cores simultaneously. In order to compute the statistical significance of a cluster, one only needs the distribution of cluster t-values across all iterations. That being the case, one can simply save the cluster t's across iterations and cores and then compute a significance value for each cluster based on this distribution. In our experience this tends to reduce the processing time by a factor of the number of cores available on a given computer. Perhaps this is something that can be implemented in a future release of Fieldtrip? -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 19 14:38:17 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 14:38:17 +0100 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Dear Tony, I don't think that these immediate plans exist. I wasn't aware of the fact that ft_freqanalysis_mvar does not swallow the linearly indexed combinations. We may want to look into that. Could you post a bug on bugzilla for this? The fact that it is not supported for dtf and pdc actually has a reason, which is related to the fact that these measures are normalized with respect to the total inflow/outflow for a given channel, where the MVAR-model explicitly should be based on the multivariate decomposition (i.e. where multi means all channels included). The functionality of ft_mvaranalysis with cfg.channelcmb fits a separate mvar-model for each channel pair. Does this make sense? Best wishes, Jan-Mathijs On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. > > Thank you, > -Tony > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From bingshuo.li at student.uni-tuebingen.de Wed Mar 19 14:53:45 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Wed, 19 Mar 2014 14:53:45 +0100 Subject: [FieldTrip] Is fieldtrip software suitable for processing computational simulation data In-Reply-To: References: Message-ID: Dear Mr. Wang, I don't see the reason why you cannot use FieldTrip to analyze those data. Quantitatively, the simulation generated data you have should not be different than real (i.e. recorded) data. In our lab, we use FieldTrip to analyze multi-unit data. So far it's been proven that FieldTrip is fairly good! You may want to take a look at this tutorial (if you have not done so) http://fieldtrip.fcdonders.nl/tutorial/spike Good luck! ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Tue, Mar 18, 2014 at 3:11 AM, 王大明 wrote: > Dear friends: > > I am student from China and currently very interested in your software of > fieldtrip. There is a question puzzling me: > > If I use integrate-and-fire or other neural models to simulate and get > spike and LFP(local field potential) data, is fieldtrip still suitable for > processing these data? And the main part which I concern mostly is spike > and LFP data analysis. > > Your reply and help will be sincerely appreciated! Thank you! > > > Best Wishes > > > Daming Wang > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Mar 19 15:28:04 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 19 Mar 2014 15:28:04 +0100 Subject: [FieldTrip] ft_freqstatistics for between subject design In-Reply-To: References: Message-ID: <5329A974.60708@donders.ru.nl> Hi BeomJun Min, > I think that each 5 values correspond with the frequency data point. yes, that;s correct. > > Is that script suitable for the test for the significance, especially > avgovertime option 'yes'? Yes and no. Yes, because you are testing for significance and, depending on what hypothesis you have, averaging over time is perfectly fine. Use avgovertime if you are looking for an effect independent of time, otherwise set it to 'no'. No, because you should pay attention to why selecting this time-frequency region. Now it seems that you selected frequency and time window based on eyeballing the data. If you have no apriori hypothesis about these frequencies and time window, it's a faulty approach to just select the region that shows the strongest approach and do a statistical test. You should take the whole time-window and whole freuqency spectrum (narrowed down as much as apriori hypotheses allow). If this is a real effect it is likely that a proper statistical test will show up only around that time-frequency. > > If I change the avgovertime option to 'no', then can I found the > p-values for each frequencies(5 values), and each time point(51 > values), in total 255 values that could have multiple comparison issue? Yes, you have this problem, is there a reason why you are not using the cluster-based permutation test (or any other correction for multiple comparison which is implemented by setting the cfg.correctm parameter accordingly)? > > And I thought the 'mask' values of 0 indicates 'statistically > non-significance'. Is that right? Yes, that is correct. Best, Jörn > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com , > http://bmssa.gist.ac.kr > > > _______________________________________________ > 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 antony.passaro at gmail.com Wed Mar 19 16:27:18 2014 From: antony.passaro at gmail.com (Antony Passaro) Date: Wed, 19 Mar 2014 11:27:18 -0400 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Dear Jan-Mathijs, Thank you for your reply, I appreciate it. In regards to the potential bug in the ft_freqanalysis_mvar function, I see that it does indeed "swallow" linearly indexed combos, however, a reshape error is typically returned (line 146) since it tries to reshape the matrix into the incorrect number of elements. Perhaps I am doing something wrong, but I only feed the untouched output from the mvaranalysis to the freqanalysis function. I will send the "bug" to Bugzilla. In regards to your point about DTF and PDC normalization, as I understand it, one is normalized by the outflow and the other is normalized by the inflow (DTF and PDC respectively?). That being the case, it seems like a normalization to only one channel (or a subset of channels) or from only one channel (or a subset) would produce a correct normalization in one case (ie outflow) but not in the other (ie inflow). PDC and DTF taken together should then show the correct inflow but not outflow (PDC?) and the correct outflow but not inflow (DTF?), correct? I know that proposal may not be the most mathematically viable option, however, I'm not sure how else to tackle this issue. Thanks, -Tony On Wed, Mar 19, 2014 at 9:38 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Tony, > > I don't think that these immediate plans exist. I wasn't aware of the fact > that ft_freqanalysis_mvar does not swallow the linearly indexed > combinations. We may want to look into that. Could you post a bug on > bugzilla for this? The fact that it is not supported for dtf and pdc > actually has a reason, which is related to the fact that these measures are > normalized with respect to the total inflow/outflow for a given channel, > where the MVAR-model explicitly should be based on the multivariate > decomposition (i.e. where multi means all channels included). The > functionality of ft_mvaranalysis with cfg.channelcmb fits a separate > mvar-model for each channel pair. > > Does this make sense? > > Best wishes, > Jan-Mathijs > > > > On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > > I was wondering if there were any immediate plans to implement this > functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? > Linearly indexed data such as specific channel pairs (instead of all > possible channel pair combinations) seems to work fine for the > ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function > and is not fully implemented in the ft_connectivity_dtf and _pdc functions. > Any advice on how to proceed would be much appreciated. > > Thank you, > -Tony > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 19 16:37:44 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 19 Mar 2014 16:37:44 +0100 Subject: [FieldTrip] Linearly indexed data for mvar connectivity In-Reply-To: References: Message-ID: Hi Tony, > In regards to your point about DTF and PDC normalization, as I understand it, one is normalized by the outflow and the other is normalized by the inflow (DTF and PDC respectively?). That being the case, it seems like a normalization to only one channel (or a subset of channels) or from only one channel (or a subset) would produce a correct normalization in one case (ie outflow) but not in the other (ie inflow). PDC and DTF taken together should then show the correct inflow but not outflow (PDC?) and the correct outflow but not inflow (DTF?), correct? I know that proposal may not be the most mathematically viable option, however, I'm not sure how else to tackle this issue. I think the restriction is more fundamental that what you sketch. Not only there may be missing channel combinations, with the added problem of normalising with the sum of a different number of channels for different channel combinations, it is related to the fact that a full MVAR model is mandatory to get a DTF or PDC estimate that lives up to its definition (i.e. an estimate of inflow/outflow (always forget which is which) relative to the total network's in/outflow). Best, Jan-Mathijs > > Thanks, > -Tony > > > On Wed, Mar 19, 2014 at 9:38 AM, jan-mathijs schoffelen wrote: > Dear Tony, > > I don't think that these immediate plans exist. I wasn't aware of the fact that ft_freqanalysis_mvar does not swallow the linearly indexed combinations. We may want to look into that. Could you post a bug on bugzilla for this? The fact that it is not supported for dtf and pdc actually has a reason, which is related to the fact that these measures are normalized with respect to the total inflow/outflow for a given channel, where the MVAR-model explicitly should be based on the multivariate decomposition (i.e. where multi means all channels included). The functionality of ft_mvaranalysis with cfg.channelcmb fits a separate mvar-model for each channel pair. > > Does this make sense? > > Best wishes, > Jan-Mathijs > > > > On Mar 19, 2014, at 2:15 PM, Antony Passaro wrote: > >> I was wondering if there were any immediate plans to implement this functionality for the mvar connectivity measures (ie DTF, PDC, etc.)? Linearly indexed data such as specific channel pairs (instead of all possible channel pair combinations) seems to work fine for the ft_mvaranalysis function but fails for the ft_freqanalysis_mvar function and is not fully implemented in the ft_connectivity_dtf and _pdc functions. Any advice on how to proceed would be much appreciated. >> >> Thank you, >> -Tony >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Wed Mar 19 17:17:17 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Wed, 19 Mar 2014 16:17:17 +0000 Subject: [FieldTrip] Source localizing auditory steady state responses Message-ID: <5329C30D.4090600@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Wed Mar 19 18:21:24 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Wed, 19 Mar 2014 13:21:24 -0400 Subject: [FieldTrip] Source localizing auditory steady state responses In-Reply-To: <5329C30D.4090600@glasgow.ac.uk> References: <5329C30D.4090600@glasgow.ac.uk> Message-ID: Hey May, Beamorming on correlated sources is my interest too. The problem is that most beamformers (I deal with SAM and vector beamformer) are going to suppress or/and misplace any correlated source. The way I deal with this problem is by creating a region of interest (around primary auditory cortex) and beaformer over each ROI separately. The signal correlation problem is still there but with a lesser extant (I think). Here is a great article on this topic: Beamformer reconstruction of correlated sources using a modified source model and Modified Beamformers for Coherent Source Region Suppression Also if I localize evoked responses I always prefer dipole fitting over other methods, you could try the moving dipolar fitting method and have your wave former from the dipole t-course. Let me know how it will go for you. Cheers, Inna Inna McGowin On Wed, Mar 19, 2014 at 12:17 PM, Heng-Ru May Tan < Heng-RuMay.Tan at glasgow.ac.uk> wrote: > > Hi All, > I am trying to localize frequency specific ASSR but have not been > successful in doing so with the 'mne' method in the ft_sourceanalysis. > At the sensor-level the topo plots show clear bilateral generators. > > Is it possible to localize the bilateral sources using beamforming? And > would I need to create a different forward model? > Additionally, I would also like to retrieve the source signals and ideally > comparing between 2 time periods within the same trial. > > I would appreciate if someone could advise or comment on how best to go > about doing so. > > Thanks, > May > > > -- > > > ____________________________________________________________________________________________________________________________________ > > Heng-Ru *May* Tan, PhD. > > > Institute of Neuroscience and Psychology (INP) ▫ Centre for Cognitive > Neuroimaging (CCNi) ▫ College of Medical, Veterinary and Life Sciences > > University of Glasgow ▫ 58 Hillhead Street, Glasgow G12 8QB ▫ +44 > (0)141-330-5090 ▫ Heng-RuMay.Tan at glasgow.ac.uk > > _______________________________________________ > 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 mbj0310 at gmail.com Thu Mar 20 00:42:20 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Thu, 20 Mar 2014 08:42:20 +0900 Subject: [FieldTrip] ft_freqstatistics for between subject design In-Reply-To: <5329A974.60708@donders.ru.nl> References: <5329A974.60708@donders.ru.nl> Message-ID: Dear Jörn Thank you for your kind reply. Now I think I can approach for the better way. Actually I am a novice, and trying to learn about the MATLAB, and the fieldtrip. :) So far, I have processed step by step, and now I will consider the multiple comparison issue. Anyway, thank you again. With regards. 2014-03-19 23:28 GMT+09:00 "Jörn M. Horschig" : > Hi BeomJun Min, > > > > I think that each 5 values correspond with the frequency data point. >> > yes, that;s correct. > > > >> Is that script suitable for the test for the significance, especially >> avgovertime option 'yes'? >> > Yes and no. Yes, because you are testing for significance and, depending > on what hypothesis you have, averaging over time is perfectly fine. Use > avgovertime if you are looking for an effect independent of time, otherwise > set it to 'no'. No, because you should pay attention to why selecting this > time-frequency region. Now it seems that you selected frequency and time > window based on eyeballing the data. If you have no apriori hypothesis > about these frequencies and time window, it's a faulty approach to just > select the region that shows the strongest approach and do a statistical > test. You should take the whole time-window and whole freuqency spectrum > (narrowed down as much as apriori hypotheses allow). If this is a real > effect it is likely that a proper statistical test will show up only around > that time-frequency. > > > >> If I change the avgovertime option to 'no', then can I found the p-values >> for each frequencies(5 values), and each time point(51 values), in total >> 255 values that could have multiple comparison issue? >> > Yes, you have this problem, is there a reason why you are not using the > cluster-based permutation test (or any other correction for multiple > comparison which is implemented by setting the cfg.correctm parameter > accordingly)? > > > >> And I thought the 'mask' values of 0 indicates 'statistically >> non-significance'. Is that right? >> > Yes, that is correct. > > Best, > Jörn > > >> -- >> BeomJun Min, M.D. >> >> Department of Medical System Engineering (DMSE) >> Gwangju Institute of Science and Technology (GIST) >> 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju >> 500-712, Republic of Korea (South) >> Phone: +82-62-715-3266 / Fax: +82-62-715-3244 >> E-mail: mbj0310 at gmail.com , >> http://bmssa.gist.ac.kr >> >> >> _______________________________________________ >> 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 > -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Thu Mar 20 12:47:16 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Thu, 20 Mar 2014 11:47:16 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 40, Issue 33 In-Reply-To: References: Message-ID: <532AD544.4020908@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Thu Mar 20 14:03:52 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Thu, 20 Mar 2014 13:03:52 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 40, Issue 33 In-Reply-To: <532AD544.4020908@glasgow.ac.uk> References: <532AD544.4020908@glasgow.ac.uk> Message-ID: Hi May, Inna, everyone, I'm not sure exactly what Inna meant by the ROI, specifically whether the ROI was applied to source space or to sensors. Applying a ROI to sources will not work: the beamformer result at one location in the brain is the same irrespective of where else you also compute a beamformer result. However, perhaps Inna meant ROI over channels (e.g. left channels for the left auditory cortex). If so, then as she says, it will reduce the problem a bit but it will still be there. See cfg.supchan in ft_sourceanalysis. Indeed the method by Dalal et al. was initially implemented in the NUTMEG software (which is compatible with FieldTrip). However, it is also now implemented in FieldTrip by using the cfg.supdip option in ft_sourceanalysis, which allows you to suppress a region (e.g. right auditory cortex) so that you can estimate activity elsewhere (e.g. left auditory cortex). Cheers, Johanna 2014-03-20 11:47 GMT+00:00 Heng-Ru May Tan : > Hi Inna, > > Thanks for the suggestions re using ROI beamforming separately and > references. I'll give it a go. > > BTW, I wonder if those beamforming algorithms e.g. Dalal et al2006 (IEEE > biomed. eng.) might have already been implemented somewhere... or might it > be something that fieldtrip might/could consider adding to their > sourceanalysis options? =) > > Thanks, > May > > > ForwardedMessage.eml > Subject: > Re: [FieldTrip] Source localizing auditory steady state responses > From: > "McGowin, Inna" > Date: > 19/03/2014 17:21 > To: > FieldTrip discussion list > > Hey May, > Beamorming on correlated sources is my interest too. The problem is that > most beamformers (I deal with SAM and vector beamformer) are going to > suppress or/and misplace any correlated source. The way I deal with this > problem is by creating a region of interest (around primary auditory > cortex) and beaformer over each ROI separately. The signal correlation > problem is still there but with a lesser extant (I think). Here is a great > article on this topic: > Beamformer reconstruction of correlated sources using a modified source > model > and > Modified Beamformers for Coherent Source Region Suppression > > Also if I localize evoked responses I always prefer dipole fitting over > other methods, you could try the moving dipolar fitting method and have > your wave former from the dipole t-course. > Let me know how it will go for you. > Cheers, > Inna > > > Inna McGowin > > > On Wed, Mar 19, 2014 at 12:17 PM, Heng-Ru May Tan < > Heng-RuMay.Tan at glasgow.ac.uk> wrote: > > Hi All, > I am trying to localize frequency specific ASSR but have not been > successful in doing so with the 'mne' method in the ft_sourceanalysis. > At the sensor-level the topo plots show clear bilateral generators. > > Is it possible to localize the bilateral sources using beamforming? And > would I need to create a different forward model? > Additionally, I would also like to retrieve the source signals and ideally > comparing between 2 time periods within the same trial. > > I would appreciate if someone could advise or comment on how best to go > about doing so. > > Thanks, > May > > > > _______________________________________________ > 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 Thu Mar 20 15:08:18 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 20 Mar 2014 15:08:18 +0100 Subject: [FieldTrip] ICA plots crash Matlab Message-ID: Dear all, I'm experiencing a weird problem and was wondering if anyone might know why. In certain versions of fieldtrip (for example, the latest version on the ftp server on 20140319), the figure plot for the ICA components crashed my Matlab. This also happened when I used the fieldtrip version on 20140121. Yet, the version on 20140203 did not crash my Matlab when it plots the ICA components. What could be causing the problem? I'm using Matlab 2012b 64 bit. Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From Heng-RuMay.Tan at glasgow.ac.uk Fri Mar 21 14:05:33 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 21 Mar 2014 13:05:33 +0000 Subject: [FieldTrip] Source localizing auditory steady state responses In-Reply-To: References: Message-ID: <532C391D.4010504@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Fri Mar 21 15:36:19 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Fri, 21 Mar 2014 15:36:19 +0100 Subject: [FieldTrip] Permutation statistics Message-ID: Dear all, I've got EEG datasets for 64 channels, and I would like to perform permutation statistics on the power frequency analyses to compare the two conditions (before and after resting state periods). However, I'm not sure how to operationalise the statistical analyses since most of the examples on the website are for MEG datasets. I would appreciate very much if someone could help me on this! Thanks! Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 21 20:10:50 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Fri, 21 Mar 2014 20:10:50 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: References: Message-ID: <532C8EBA.2020806@gmail.com> Dear Hweeling, There is nothing inherent to the ft_freqstatistics function that makes it special for MEG, rather than for EEG data. If you've been using other FieldTrip functions, you probably have used cfg.channel before. These are the channels present in your EEG data. How you should set some of the other parameters depends only on your design, not on whether the data are from MEG or EEG. Maybe you can specify what is unclear to you when calling the function so that you can get appropriate help! Good luck, Vitoria On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: > > Dear all, > > I've got EEG datasets for 64 channels, and I would like to perform > permutation statistics on the power frequency analyses to compare the > two conditions (before and after resting state periods). > > However, I'm not sure how to operationalise the statistical analyses > since most of the examples on the website are for MEG datasets. > > I would appreciate very much if someone could help me on this! Thanks! > > Cheers, > Hweeling > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sun Mar 23 01:08:26 2014 From: russgport at gmail.com (Russell G Port) Date: Sat, 22 Mar 2014 20:08:26 -0400 Subject: [FieldTrip] Dipole fitting Message-ID: Hi All, I am currently struggling to fit dipoles to my auditory data. In short I want to 'turn off' half the channels (so I only have one hemisphere) (as can easily be done in CTF tools DipoleFit). I thought this would be easy by having the timelocked data that went into ft_dipolefitting, have cfg.channel='MR' or 'ML'. The issue I have is when I dipole fit this data, the dipole ends up in the center of the head. I definitely have only left or right channels selected (as checked in the output of ft_timelockanalysis). I thought of two ways around this. A) I use an initial guess away from the center of the head (with cfg.nonlinear ='yes') B) I have a source model with the medial - lateral space starting starting away from the center (e.g. in CTF coordinate Y = 2:1:7) [again with cfg.linear='yes']. While these approaches normally work, I have a particularly stubbon couple of datasets, that still think the the dipole is in the center of the head. When I check the topoplot of the date being fit, it appears that the 'turned off/not analyzed' side (the side not specified in ft_timelock analysis's cfg) is completely red on the topoplot, which would not be a problem but there is a small sink close to it, which is throwing off the dipole placement. Next I repeated my dipole fitting using my altered source model with cfg.nonlinear='no', but again this source and sink caused by the contralateral hemisphere is pulling the dipole to the edge of my source model space. Does anyone have any suggestions. When I try to dipole fitting this data in CTF DipoleFit I do not have this issue (presumably because the contralateral hemisphere is no contributing to the dipole fit). Thanks Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbj0310 at gmail.com Sun Mar 23 03:14:34 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Sun, 23 Mar 2014 11:14:34 +0900 Subject: [FieldTrip] Intertrial coherence (phase locking factor) Message-ID: Hello trippers, I am confused with the 'cfg.method' for ITC. After examining the previous discussion list, I found method for ITC calculation as below. *tmpdat = freq.fourierspctrm;* *tmpdat = tmpdat./abs(tmpdat); % this will normalise each trial for its amplitude;* *itc = abs(mean(tmpdat)); % this will give the itc* In addition, for this method, the ft_freqanalysis should have configuration as below. *cfg = [];* *cfg.keeptrials = 'yes';* *cfg.keeptapers = 'yes';* *cfg.output = 'fourier';* *cfg.channel = 'all';* *cfg.method = 'mtmfft';* *cfg.foi = 20:1:60;* *cfg.toi = -0.5:0.01:1.5;* *cfg.tapsmofrq = 4;* *cfg.taper = 'hanning';* However, I use 'wavelet' for the calculation of gamma band now. Should I use 'mtmfft' for the calucation of ITC? In case of 'wavelet', the result of itc has 4-D data - trial (averaged) * channel * freq * time Meanwhile, in case of 'mtmfft' the result has 3D data - trial (averaged) * channel * freq without time. Which structure is right? And, if I want to calculate the mean value of ITC of a group, is the order of the processing below right? : preprocessed data of each individual -> time-frequency analysis -> calculate ITC -> grandaverage With regards. -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Sun Mar 23 15:19:30 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Sun, 23 Mar 2014 15:19:30 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: <532C8EBA.2020806@gmail.com> References: <532C8EBA.2020806@gmail.com> Message-ID: Dear Vitoria, Thanks for the tip. I'm trying to perform a within-trial analysis. I've got two sets of data, before and after resting state EEG activity. First set has 54 trials and second set has 51 trials. Hence, my cfg.design = [ones(1, 105); ones(1,54), ones(1,51)*2]. I've set up the statistical analysis like this: cfg = []; cfg.layout = lay; cfg.channel = 'all'; cfg.latency = 'all'; cfg.trials = 'all'; cfg.frequency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.numrandomization = 1000; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; [stat] = ft_freqstatistics(cfg, post_c200freq, pre_c200freq); However, I got an error message: Error using ft_statfun_depsamplesT (line 84) Invalid specification of the design array. Error in ft_statistics_montecarlo (line 285) [statobs, cfg] = statfun(cfg, dat, design); Error in ft_freqstatistics (line 323) [stat, cfg] = statmethod(cfg, dat, cfg.design); Can someone please tell me what parameters did I specify wrongly? Thanks. Best wishes, Hweeling On 21 March 2014 20:10, Vitória Piai wrote: > Dear Hweeling, > > There is nothing inherent to the ft_freqstatistics function that makes it > special for MEG, rather than for EEG data. If you've been using other > FieldTrip functions, you probably have used cfg.channel before. These are > the channels present in your EEG data. > How you should set some of the other parameters depends only on your > design, not on whether the data are from MEG or EEG. > Maybe you can specify what is unclear to you when calling the function so > that you can get appropriate help! > > Good luck, Vitoria > > > On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: > > > Dear all, > > I've got EEG datasets for 64 channels, and I would like to perform > permutation statistics on the power frequency analyses to compare the two > conditions (before and after resting state periods). > > However, I'm not sure how to operationalise the statistical analyses > since most of the examples on the website are for MEG datasets. > > I would appreciate very much if someone could help me on this! Thanks! > > Cheers, > Hweeling > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 tyler.grummett at flinders.edu.au Mon Mar 24 00:32:21 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sun, 23 Mar 2014 23:32:21 +0000 Subject: [FieldTrip] ft_timelockanalysis and tf_sourceanalysis Message-ID: Hello fieldtrip, I just want to discuss my processing steps and to determine if I have made any analysis errors. Firstly, I have data converted from eeglab using the following code: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); The data is 30 seconds of someone having their eyes closed. There are no trigger codes unfortunately. I then run the ft_timelockanalysis function (to be used in tf_sourceanalysis), without any configuration settings specified (I will use the defaults). % calculating the cross spectral density matrix ?cfg = []; timelock = ft_timelockanalysis(cfg, data); The code runs fine without any errors. As it calculates the data to be one trial long, has the code done anything to do the data. What has it timelocked to? I then calculate the mri_headmodel: % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); I then run the source analysis code: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; % cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost = ft_sourceanalysis( cfg, timelock); The code also runs fine. However, what I have found is that I cant plot the data using ft_sourceplot. As I am not 100% on how these functions operate and how to properly run a beamformer on continuous data, I am not sure whether the step that I have taken are appropriate, or that I am kind of making it up as I go along. I cant find anywhere how to do a beamformer on continuous data without trials of some sort. Any help will be appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 24 08:54:17 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 24 Mar 2014 08:54:17 +0100 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: References: Message-ID: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Dear Christine, I am forwarding your question to the FieldTrip discussion list. No doubt somebody with hands-on experience can give you a much better reply than I could. If you haven't subscribed to the list: this would be the time to do so ;-). Best wishes, Jan-Mathijs On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: > Dear Jan-Mathijs > > I just have a very naive question on the EEG-MRI coregistration - for source reconstruction. > > For us, we actually do concurrent EEG-MRI. I read the gold standard is to use the 3D digitalisor (fastrack) system to record the sensor space. But since we are doing concurrent recording, we can actually see most of the electrode on the T1 images (due to small signal distortion, the electrodes look like small dents on the scalp). To me, who has not done EEG before, this information should be useful for co-register EEG with MRI? and potentially be better than register everything to the three landmark. > > Does Fieldtrip have functions that might work with such configuration? I imagine we could do a first automated co-reg as a first rough estimate, and maybe manually line up the electrode with T1. > > Best regards > Christine > Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From stebollmann at gmail.com Mon Mar 24 15:34:45 2014 From: stebollmann at gmail.com (Steffen Bollmann) Date: Mon, 24 Mar 2014 15:34:45 +0100 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> References: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Message-ID: Dear Christine, I have the same problem, but haven't found a very fast and easy way to do this. However, I found a tool, which helps a lot: http://pylocator.thorstenkranz.de/ Maybe anyone else has better ways of doing it and could share his thoughts? All the best Steffen 2014-03-24 8:54 GMT+01:00 jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl>: > Dear Christine, > > I am forwarding your question to the FieldTrip discussion list. No doubt > somebody with hands-on experience can give you a much better reply than I > could. > If you haven't subscribed to the list: this would be the time to do so ;-). > > Best wishes, > Jan-Mathijs > > > On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: > > Dear Jan-Mathijs > > I just have a very naive question on the EEG-MRI coregistration - for > source reconstruction. > > For us, we actually do concurrent EEG-MRI. I read the gold standard is to > use the 3D digitalisor (fastrack) system to record the sensor space. But > since we are doing concurrent recording, we can actually see most of the > electrode on the T1 images (due to small signal distortion, the electrodes > look like small dents on the scalp). To me, who has not done EEG before, > this information should be useful for co-register EEG with MRI? and > potentially be better than register everything to the three landmark. > > Does Fieldtrip have functions that might work with such configuration? I > imagine we could do a first automated co-reg as a first rough estimate, and > maybe manually line up the electrode with T1. > > Best regards > Christine > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Tue Mar 25 09:25:12 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Tue, 25 Mar 2014 09:25:12 +0100 Subject: [FieldTrip] Permutation statistics In-Reply-To: References: <532C8EBA.2020806@gmail.com> Message-ID: <53313D68.7040304@gmail.com> Hi Hweeling, I'm sorry, I don't understand exactly what you mean by "within-trial" analysis. If you mean comparing trials within the same participant, then there are two things you should change in your code: cfg.statistic = 'indepsamplesT'; %% this should be indepsamplesT rather than depsamplesT cfg.uvar = 1; %%% Remove this line from your configuration cfg.ivar = 1; %% the indep. var here should be 1, rather than 2 Maybe your design will also need some adjustment, I'm not so sure (I don't use indepsamplesT that much). In any case, it could help to have a look at: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock?s[]=indepsamplest If you want a cleaner code, you can also remove all these lines (they should be default): cfg.channel = 'all'; cfg.latency = 'all'; cfg.trials = 'all'; cfg.frequency = 'all'; I hope this works, otherwise email the list again. Good luck, Vitória On 3/23/2014 3:19 PM, Hwee Ling Lee wrote: > Dear Vitoria, > > Thanks for the tip. > > I'm trying to perform a within-trial analysis. > > I've got two sets of data, before and after resting state EEG > activity. First set has 54 trials and second set has 51 trials. Hence, > my cfg.design = [ones(1, 105); ones(1,54), ones(1,51)*2]. > > I've set up the statistical analysis like this: > > cfg = []; > cfg.layout = lay; > cfg.channel = 'all'; > cfg.latency = 'all'; > cfg.trials = 'all'; > cfg.frequency = 'all'; > cfg.avgovertime = 'no'; > cfg.avgoverfreq = 'no'; > cfg.avgoverchan = 'no'; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.numrandomization = 1000; > cfg.design = design; > cfg.uvar = 1; > cfg.ivar = 2; > [stat] = ft_freqstatistics(cfg, post_c200freq, pre_c200freq); > > However, I got an error message: > > Error using ft_statfun_depsamplesT (line 84) > Invalid specification of the design array. > > Error in ft_statistics_montecarlo (line 285) > [statobs, cfg] = statfun(cfg, dat, design); > > Error in ft_freqstatistics (line 323) > [stat, cfg] = statmethod(cfg, dat, cfg.design); > > Can someone please tell me what parameters did I specify wrongly? Thanks. > > Best wishes, > Hweeling > > > > > On 21 March 2014 20:10, Vitória Piai > wrote: > > Dear Hweeling, > > There is nothing inherent to the ft_freqstatistics function that > makes it special for MEG, rather than for EEG data. If you've been > using other FieldTrip functions, you probably have used > cfg.channel before. These are the channels present in your EEG data. > How you should set some of the other parameters depends only on > your design, not on whether the data are from MEG or EEG. > Maybe you can specify what is unclear to you when calling the > function so that you can get appropriate help! > > Good luck, Vitoria > > > On 3/21/2014 3:36 PM, Hwee Ling Lee wrote: >> >> Dear all, >> >> I've got EEG datasets for 64 channels, and I would like to >> perform permutation statistics on the power frequency analyses to >> compare the two conditions (before and after resting state periods). >> >> However, I'm not sure how to operationalise the statistical >> analyses since most of the examples on the website are for MEG >> datasets. >> >> I would appreciate very much if someone could help me on this! >> Thanks! >> >> Cheers, >> Hweeling >> >> >> >> _______________________________________________ >> 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 e.maris at psych.ru.nl Tue Mar 25 12:01:35 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 25 Mar 2014 12:01:35 +0100 (CET) Subject: [FieldTrip] PhD position at Donders Institute Message-ID: <011401cf4819$961e3ca0$c25ab5e0$@maris@psych.ru.nl> The Donders Institute for Brain, Cognition and Behaviour has a vacancy for a PhD student on the project Characterizing phase-coupled oscillatory networks in the alpha and the theta band: their relation to perception and attention, and to individual differences in cognitive performance Research Group Neurophysiology of Active Perception The objective of our research group is to formulate and validate mechanistic explanations of cognitive phenomena, that is explanations in terms of their underlying neurophysiological mechanisms. As an integral part of this objective, our group has an important methodological component, the characterization of interactions in spatially distributed neural activity, which is the central topic of this PhD project. Project Description Phase-consistent rhythmic activity is ubiquitous in electrophysiological recordings, and it may reflect networks of phase-coupled neuronal populations oscillating at different frequencies. Because neuronal oscillations may reflect rhythmic modulations of neuronal excitability, phase-coupled oscillatory networks (PCONs) could be functional building blocks for routing information through the brain. This project focuses on PCONs involving brain rhythms that (1) are modulated by selective attention and working memory, and (2) are correlated with individual differences in cognitive performance. Using newly developed methods, we extract PCONs from magneto-encephalography (MEG) data on the basis of the patterns of phase-consistency induced by these PCONs. These methods succeed because PCONs can be separated on the basis their frequency content, the brain areas over which they can be observed, and their pattern of between-site phase relations. We will test three hypotheses with respect to the functional role of alpha and theta band PCONs, one pertaining to their behavioral relevance, one to the mechanism underlying sustained attention, and one to their relation with individual differences in cognitive performance. All hypotheses can be tested using existing data. Job Requirements This project calls for either a cognitive neuroscientist with a strong interest and skills in data analysis or a person with a computational background (machine learning, applied statistics, signal processing) with a strong interest in cognitive neuroscience. We are looking for candidates with a MSc degree who are highly motivated to conduct research. It is highly desirable to have extensive experience with a high-level programming language such as Matlab or Python. The candidate must be available at 1-10-2014. Application deadline: 14-7-2014 The Institute The Donders Institute for Brain, Cognition and Behaviour consists of three research centres, the Centre for Cognition, the Centre for Cognitive Neuroimaging and the Centre for Neuroscience. The Donders Institute focuses on state of the art cognitive neuroscience, in a multidisciplinary approach, and offers excellent lab and neuroimaging facilities. The project is embedded within the Donders research theme Brain Networks and Neuronal Communication (http://www.ru.nl/donders/research/theme-4-brain/) and will be supervised by dr. Eric Maris at the Donders Centre for Cognition (DCC). The DCC is part of the Faculty of Social Sciences, one of the largest faculties at Radboud University Nijmegen. The faculty hosts high-quality research and study programs that rank among the best in the Netherlands. Contact Information Dr. Eric Maris e.maris at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From christine.cong at gmail.com Wed Mar 26 05:22:50 2014 From: christine.cong at gmail.com (Cong Christine Guo) Date: Wed, 26 Mar 2014 14:22:50 +1000 Subject: [FieldTrip] coregister EEG MRI from concurrent recording In-Reply-To: References: <0E86F6C4-27EF-4279-8B65-3681C31F1153@donders.ru.nl> Message-ID: Dear Steffen the tool you suggested is indeed very helpful. We can live with that before there is a fast automated way -- I reckon digitising the sensors during prep probably consume similar amount time. best regards Christine On Tue, Mar 25, 2014 at 12:34 AM, Steffen Bollmann wrote: > Dear Christine, > > I have the same problem, but haven't found a very fast and easy way to do > this. > > However, I found a tool, which helps a lot: > http://pylocator.thorstenkranz.de/ > > Maybe anyone else has better ways of doing it and could share his thoughts? > All the best > Steffen > > > > 2014-03-24 8:54 GMT+01:00 jan-mathijs schoffelen < > jan.schoffelen at donders.ru.nl>: > >> Dear Christine, >> >> I am forwarding your question to the FieldTrip discussion list. No doubt >> somebody with hands-on experience can give you a much better reply than I >> could. >> If you haven't subscribed to the list: this would be the time to do so >> ;-). >> >> Best wishes, >> Jan-Mathijs >> >> >> On Mar 24, 2014, at 7:43 AM, Cong Christine Guo wrote: >> >> Dear Jan-Mathijs >> >> I just have a very naive question on the EEG-MRI coregistration - for >> source reconstruction. >> >> For us, we actually do concurrent EEG-MRI. I read the gold standard is >> to use the 3D digitalisor (fastrack) system to record the sensor space. >> But since we are doing concurrent recording, we can actually see most of >> the electrode on the T1 images (due to small signal distortion, the >> electrodes look like small dents on the scalp). To me, who has not done >> EEG before, this information should be useful for co-register EEG with MRI? >> and potentially be better than register everything to the three landmark. >> >> Does Fieldtrip have functions that might work with such configuration? >> I imagine we could do a first automated co-reg as a first rough estimate, >> and maybe manually line up the electrode with T1. >> >> Best regards >> Christine >> >> >> Jan-Mathijs Schoffelen, MD PhD >> >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> >> Max Planck Institute for Psycholinguistics, >> Nijmegen, The Netherlands >> >> J.Schoffelen at donders.ru.nl >> Telephone: +31-24-3614793 >> >> http://www.hettaligebrein.nl >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Mar 26 08:54:02 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 26 Mar 2014 08:54:02 +0100 Subject: [FieldTrip] Intertrial coherence (phase locking factor) In-Reply-To: References: Message-ID: <6D191C38-3829-45FC-8B03-654E488B7AC6@donders.ru.nl> Dear Beom Jun Min, > I am confused with the 'cfg.method' for ITC. There is currently no cfg.method that gives you ITC directly, indeed you should use the formula below, which is correct if you have a single taper per trial (which you have if you use cfg.taper = 'hanning' in ft_freqanalysis). > After examining the previous discussion list, I found method for ITC calculation as below. > > tmpdat = freq.fourierspctrm; > tmpdat = tmpdat./abs(tmpdat); % this will normalise each trial for its amplitude; > itc = abs(mean(tmpdat)); % this will give the itc > > In addition, for this method, the ft_freqanalysis should have configuration as below. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.keeptapers = 'yes'; > cfg.output = 'fourier'; > cfg.channel = 'all'; > cfg.method = 'mtmfft'; > cfg.foi = 20:1:60; > cfg.toi = -0.5:0.01:1.5; > cfg.tapsmofrq = 4; > cfg.taper = 'hanning'; > > However, I use 'wavelet' for the calculation of gamma band now. > > Should I use 'mtmfft' for the calucation of ITC? > > In case of 'wavelet', the result of itc has 4-D data - trial (averaged) * channel * freq * time > Meanwhile, in case of 'mtmfft' the result has 3D data - trial (averaged) * channel * freq without time. > Which structure is right? The distinction between 'mtmfft' and 'wavelet'/'mtmconvol' is exactly whether time is taken into account. The functionality that you want to use, depends on your question. > And, if I want to calculate the mean value of ITC of a group, > is the order of the processing below right? : > preprocessed data of each individual -> time-frequency analysis -> calculate ITC -> grandaverage The order is correct. Best wishes, Jan-Mathijs > > With regards. > > > -- > BeomJun Min, M.D. > > Department of Medical System Engineering (DMSE) > Gwangju Institute of Science and Technology (GIST) > 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju > 500-712, Republic of Korea (South) > Phone: +82-62-715-3266 / Fax: +82-62-715-3244 > E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.lalancette at sickkids.ca Wed Mar 26 21:33:43 2014 From: marc.lalancette at sickkids.ca (Marc Lalancette) Date: Wed, 26 Mar 2014 20:33:43 +0000 Subject: [FieldTrip] MEG lead field units Message-ID: <2A2B6A5B8C4C174CBCCE0B45E548DEB229F66CD0@SKMBXX01.sickkids.ca> Hello all, I am not (yet) a common user of Fieldtrip, but I am using it now to investigate some basic properties of our MEG system. I only needed a realistic forward solution so I chose Nolte's "singleshell" model with mostly default parameters. I just spent quite a bit of time going through the code trying to figure out the units of the lead field I obtained. As it was not too obvious, I would appreciate some confirmation/correction. By default, my volume conduction and sensor structures were in units of 'cm'. That seems to be also what Nolte's method requires. Nowhere by default are the units specified for the (meg) channels or the source dipoles when simply calling ft_prepare_leadfield, and looking at the spherical computation in Nolte's code, I concluded that it would work with the channels in T and the dipole in A*cm. Thus the lead field units would be T/(A*cm). This also seems consistent with the lead field amplitude I am getting for our system (in the order of 10^-9). Is this correct? Thanks for your help! Marc Lalancette Lab Research Project Manager The Hospital for Sick Children, Toronto, Canada ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Mar 27 08:30:59 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 27 Mar 2014 08:30:59 +0100 Subject: [FieldTrip] POSTDOCTORAL POSITION ON ANALYSIS AND MODELING OF LFP AND MEG SIGNALS Message-ID: Hi all, The Faculty of Psychology and Neuroscience at Maastricht University offers a 21-month postdoc focused on the analysis and computational modeling of Local Field Potentials (LFPs) measured invasively in monkey cortex, and Magneto-Encephalo-Graphy (MEG) data measured in human cortex. Please feel free to distribute it. *PROJECT:* Existing human MEG data as well as rhesus monkey spiking, LFP and ECoG data have been collected in V1 during grating contrast modulations. The project is focused on analyzing and modeling the spectral responses in the different existing datasets, and to build detailed neural network models at the level of columns and layers, as well as transfer models to test which aspects of network models in monkey can be generalized to the human. *CANDIDATE: *The ideal candidate would have a strong background in mathematics, physics, computer science, and/or neuroscience, or related backgrounds, and a strong interest in the analysis and modeling of oscillatory signals. Expertise is expected with the modeling of single neurons, ING/PING or Izhikevich-type networks, and related approaches. *PLACE OF PROJECT:* The project will be carried out in Nijmegen, on the campus of the Radboud University. *FUNDING:* The funding is provided through a grant awarded by the Human Brain Project. The postdoctoral position is for 21 months. Salary and benefits are according to Dutch standards and according to experience. *WE OFFER:* We offer a highly multidisciplinary, international and stimulating environment. The project is relevant and prestigious, and will be performed in an intense collaboration with Nicosia University, our partner on the HBP award. *HOW TO APPLY:* To apply, please send a CV including the names of two references, and a brief motivation statement to Prof. Peter De Weerd p.deweerd at maastrichtuniversity.nl. We aim to fill the position within the month of April. Best, Haiteng -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mengtongxiao at gmail.com Thu Mar 27 11:03:41 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Thu, 27 Mar 2014 18:03:41 +0800 Subject: [FieldTrip] help about ' fieldtrip2fiff ' Message-ID: Dear all: I want to save .mat file to .fif file use fieldtrip, there are errors cfg = []; cfg.dataset = 'D:\raw_tsss.fif'; data = ft_preprocessing(cfg); data = hdr: [1x1 struct] label: {306x1 cell} time: {[1x616000 double]} trial: {[306x616000 double]} fsample: 1000 grad: [1x1 struct] cfg: [1x1 struct] sampleinfo: [1 616000] fiff_file = 'song_tsss.fif'; fieldtrip2fiff(fiff_file, data) ??? Undefined function or variable 'fsample'. Error in ==> fieldtrip2fiff at 61 info.sfreq = fsample when I let fsample=1000(from data), there are also errors, ???'dataout' is not exist what should I do? thanks xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Thu Mar 27 11:51:48 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 27 Mar 2014 10:51:48 +0000 Subject: [FieldTrip] Time domain beamformer Message-ID: <76289E9F-A1B3-4FC8-ADD6-4B6AC4311B19@flinders.edu.au> Hello fieldtrip, I just want to discuss my processing steps and to determine if I have made any analysis errors. Firstly, I have data converted from eeglab using the following code: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); The data is 30 seconds of someone having their eyes closed. There are no trigger codes unfortunately. I then run the ft_timelockanalysis function (to be used in tf_sourceanalysis), without any configuration settings specified (I will use the defaults). % calculating the cross spectral density matrix ​cfg = []; timelock = ft_timelockanalysis(cfg, data); The code runs fine without any errors. As it calculates the data to be one trial long, has the code done anything to do the data. What has it timelocked to? I then calculate the mri_headmodel: % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); I then run the source analysis code: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; % cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; sourcePost = ft_sourceanalysis( cfg, timelock); The code also runs fine. However, what I have found is that I cant plot the data using ft_sourceplot. As I am not 100% on how these functions operate and how to properly run a beamformer on continuous data, I am not sure whether the step that I have taken are appropriate, or that I am kind of making it up as I go along. I cant find anywhere how to do a beamformer on continuous data without trials of some sort. Any help will be appreciated. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sauer.mpih at googlemail.com Thu Mar 27 12:10:36 2014 From: sauer.mpih at googlemail.com (Andreas Sauer) Date: Thu, 27 Mar 2014 12:10:36 +0100 Subject: [FieldTrip] Research Assistant / Associate at the University of Glasgow Message-ID: Dear all, there is a position as research assistant at the University of Glasgow available (see below). Best, Andreas _________________ University of Glasgow College of Medical, Veterinary and Life Sciences Research Institute of Neuroscience and Psychology Research Assistant / Associate Ref: M00563 Grade 6/7: £26,527 - £29,837 / £32,590 - £36,661 per annum You will contribute to a project, funded by the Medical Research Council (MRC), entitled "Using Magnetoencephalography to Investigate Aberrant Neural Synchrony in Prodromal Schizophrenia". Specifically, the job requires the analysis and acquisition of MEG-data sets and implementation of novel analytic tools, contributing to the design and programming of MEG experiments, recruiting and running the participants, assisting in analysing the results, and participating in the writing up of the results. With extensive, up-to-date practical knowledge in MEG or EEG, you will have excellent knowledge of source-localization, Matlab and experimental control software. This post is initially funded for 2 years. It is anticipated that this will be extended to 3 years subject to securing additional funding. Informal enquires to Dr Peter Uhlhaas (Email: Peter.Uhlhaas at glasgow.ac.uk; Tel: 0141 330 8730) Apply online at: www.gla.ac.uk/jobs Closing date: 28 April 2014 The University has recently been awarded the Athena SWAN Institutional Bronze Award The University is committed to equality of opportunity in employment. The University of Glasgow, charity number SC004401. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gio at gpiantoni.com Thu Mar 27 14:01:47 2014 From: gio at gpiantoni.com (Gio Piantoni) Date: Thu, 27 Mar 2014 09:01:47 -0400 Subject: [FieldTrip] help about ' fieldtrip2fiff ' In-Reply-To: References: Message-ID: Hi Xiao, It seems that you are using an old (one-year old) version of Fieldtrip, https://github.com/fieldtrip/fieldtrip/blob/92c805e819a126c61bfb96a38bc1a8025c8348ba/fieldtrip2fiff.m and the function has been updated a few times since then. Do you mind downloading a new version of FieldTrip and report back if you get any error? thanks! -g On Thu, Mar 27, 2014 at 6:03 AM, tongxiao meng wrote: > Dear all: > I want to save .mat file to .fif file use fieldtrip, there are errors > > cfg = []; > cfg.dataset = 'D:\raw_tsss.fif'; > data = ft_preprocessing(cfg); > > data = > > hdr: [1x1 struct] > label: {306x1 cell} > time: {[1x616000 double]} > trial: {[306x616000 double]} > fsample: 1000 > grad: [1x1 struct] > cfg: [1x1 struct] > sampleinfo: [1 616000] > > fiff_file = 'song_tsss.fif'; > fieldtrip2fiff(fiff_file, data) > > > ??? Undefined function or variable 'fsample'. > > Error in ==> fieldtrip2fiff at 61 > info.sfreq = fsample > when I let fsample=1000(from data), there are also errors, > ???'dataout' is not exist > > what should I do? > thanks > xiao > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From v.piai.research at gmail.com Thu Mar 27 15:20:24 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Mar 2014 15:20:24 +0100 Subject: [FieldTrip] ft_sourceplot with surface method in most recent FT version Message-ID: <533433A8.2070508@gmail.com> Hi everyone, I hope someone can help me out with a seemingly very easy question. When using ft_sourceplot, I was used to defining the surffile for the surface method. I'd then plot my interpolated source-reconstructed activity. In a more recent version of FT, apparently this is no longer needed (and the surffile I was used to use ''surface_l4_both.mat' doesn't even exist anymore). The page http://fieldtrip.fcdonders.nl/template/anatomy suggests that other files should be used instead, but it's still unclear to me from the page how the new function works. The tutorials I could find also still make use of a surffile. The help of ft_sourceplot (version 2014-02-26) still mentions the use of a surffile: "The following parameters apply to surface-plotting when an interpolation is required cfg.surffile = string, file that contains the surface (default = 'single_subj_T1.mat') 'single_subj_T1.mat' contains a triangulation that corresponds with the SPM anatomical template in MNI coordinates" but if I use the default surffile with method 'surface', I get an error that the fileformat is unknown: ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information So what is the right way of plotting source-reconstructed activity using the surface method after interpolation with a more recent FT version? I'm sorry if I'm missing something obvious but all the info I could gather didn't help me to get an answer... (I can update the info on the Wiki if it's not there yet). Cheers, Vitória From v.piai.research at gmail.com Thu Mar 27 22:56:33 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 27 Mar 2014 22:56:33 +0100 Subject: [FieldTrip] ft_sourceplot with surface method in most recent FT version In-Reply-To: <533433A8.2070508@gmail.com> References: <533433A8.2070508@gmail.com> Message-ID: <53349E91.6000403@gmail.com> (Apologies for double posting) Hi everyone, I hope someone can help me out with a seemingly very easy question. When using ft_sourceplot, I was used to defining the surffile for the surface method. I'd then plot my interpolated source-reconstructed activity. In a more recent version of FT, apparently this is no longer needed (and the surffile I was used to use ''surface_l4_both.mat' doesn't even exist anymore). The page http://fieldtrip.fcdonders.nl/template/anatomy suggests that other files should be used instead, but it's still unclear to me from the page how the new function works. The tutorials I could find also still make use of a surffile. The help of ft_sourceplot (version 2014-02-26) still mentions the use of a surffile: "The following parameters apply to surface-plotting when an interpolation is required cfg.surffile = string, file that contains the surface (default = 'single_subj_T1.mat') 'single_subj_T1.mat' contains a triangulation that corresponds with the SPM anatomical template in MNI coordinates" but if I use the default surffile with method 'surface', I get an error that the fileformat is unknown: ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information So what is the right way of plotting source-reconstructed activity using the surface method after interpolation with a more recent FT version? I'm sorry if I'm missing something obvious but all the info I could gather didn't help me to get an answer... (I can update the info on the Wiki if it's not there yet). Cheers, Vitória From paolo.belardinelli at gmail.com Fri Mar 28 19:41:21 2014 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 28 Mar 2014 19:41:21 +0100 Subject: [FieldTrip] Within-subject statistical comparison of coherent sources Message-ID: Dear Fieldtrippers, I need to make a statistical comparison of within-subject coherence source mappings. I see on the fieldtrip webpage a source statistics approach for power is illustrated. In the Maris et al.paper (Journal of Neuroscience Methods 163 (2007) ) some sensor level results are shown. Specifically, I have 5 very long trials for each of two independent conditions, with 63 tapers per trial. Therefore, using the 'rawtrials' option in ft_sourceanalysis does not give me a good estimation for single trials. How can I (1) combine them to obtain a meaningful sampling, and (2) apply ft_sourcestatistics to compare two conditions? Best. Paolo -- -- Paolo Belardinelli, PhD Functional and Restorative Neurosurgery University Hospital Tuebingen Eberhard Karls University Tuebingen Otfried-Mueller-Str.45 D-72076 Tuebingen Tel: +49 7071 / 29 8 5626 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 529609 bytes Desc: not available URL: From tyler.grummett at flinders.edu.au Mon Mar 31 05:46:27 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 03:46:27 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot Message-ID: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> I have been trying to plot my interpolated source data using the code: % interpolate sources mri = ft_read_mri('Subject01.mri'); mri = ft_volumereslice([], mri); cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceInt = ft_sourceinterpolate( cfg, source, mri); sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter % does not vary over time, therefore the time dimension is not needed. % Plot interpolated data cfg = []; %#ok cfg.method = 'ortho'; % spline cfg.funparameter = 'avg.pow'; ft_sourceplot( cfg, sourceInt); However the figure that comes up just had orange squares in the subplots. I dont know where Ive gone wrong. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 09:00:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 09:00:43 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <5339129B.1030608@donders.ru.nl> Hi Tyler, what you are describing sounds to me like the center bias of the beamformer. Did you contrast the activity with anything, or did you normalize your leadfield? Check this out: http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition Best, Jörn On 3/31/2014 5:46 AM, Tyler Grummett wrote: > I have been trying to plot my interpolated source data using the code: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow > parameter > % does not vary over time, therefore the time dimension > is not needed. > > % Plot interpolated data > cfg = []; %#ok > cfg.method = 'ortho'; % spline > cfg.funparameter = 'avg.pow'; > ft_sourceplot( cfg, sourceInt); > > However the figure that comes up just had orange squares in the subplots. > > I dont know where Ive gone wrong. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > 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 tyler.grummett at flinders.edu.au Mon Mar 31 09:41:31 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 07:41:31 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <5339129B.1030608@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> Message-ID: <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> Hey Jorn, Previously I have let ft_sourceanalysis do a lead field because if I use the following code: % compute lead field ( apparently source analysis computes % lead field anyway cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO and then calculate the source analysis: % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; % cfg.grid.pos = maxpos; cfg.keepfilter = 'yes'; cfg.dics.projectnoise = 'yes'; % cfg.dics.lambda = 0; source = ft_sourceanalysis( cfg, timelock); then I get an error than says: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); I just removed the leadfield code and it successfully ran. I could also interpolate it later. Is this the correct approach. Thankyou in advance! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 5:30 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, what you are describing sounds to me like the center bias of the beamformer. Did you contrast the activity with anything, or did you normalize your leadfield? Check this out: http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition Best, Jörn On 3/31/2014 5:46 AM, Tyler Grummett wrote: > I have been trying to plot my interpolated source data using the code: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow > parameter > % does not vary over time, therefore the time dimension > is not needed. > > % Plot interpolated data > cfg = []; %#ok > cfg.method = 'ortho'; % spline > cfg.funparameter = 'avg.pow'; > ft_sourceplot( cfg, sourceInt); > > However the figure that comes up just had orange squares in the subplots. > > I dont know where Ive gone wrong. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From mengtongxiao at gmail.com Mon Mar 31 10:37:07 2014 From: mengtongxiao at gmail.com (tongxiao meng) Date: Mon, 31 Mar 2014 16:37:07 +0800 Subject: [FieldTrip] help about ' fieldtrip2fiff ' Message-ID: Hi all I downloading a new version of FieldTrip, but there are also have some errors, ??? Error using ==> fiff_start_file at 35 Permission denied Error in ==> fiff_start_writing_raw at 54 fid = fiff_start_file(name); Error in ==> fieldtrip2fiff at 124 [outfid, cals] = fiff_start_writing_raw(fifffile, info); Why? thanks, xiao -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 10:43:54 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 10:43:54 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <53392ACA.2030108@donders.ru.nl> Hi Tyler, hm, okay, it could be that the issue with the leadfield and with the plot are related, but it could also be that they are separate issues. I just saw that you posted the same 'problem' on bugzilla and included a picture. Maybe for next time, include a picture on the mailinglist and just create a bug on bugzilla if you are sure it is a bug in Fieldtrip and not if you are not sure. That saves us a lot of time in separating code issues from user problems ;) So, back to you problem. It seems that your reconstruction results in one voxel only. Are you sure that your grid consistents of more than just one position? So, for example check the size of the matrices in source.avg, source- and headmodel, etc. Also, you can check in Matlab the respective fields of source and sourceInt and see whether that makes sense. Lastly, a neat way to check is always to use your code on data from the tutorial, and vice versa, use code from the tutorial on your data and see whether that works. Both should give sensible results, and if one does not, you know where to start looking for a solution ;) Best, Jörn On 3/31/2014 9:41 AM, Tyler Grummett wrote: > Hey Jorn, > > Previously I have let ft_sourceanalysis do a lead field because if I use the following code: > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO > > and then calculate the source analysis: > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = maxpos; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > % cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > then I get an error than says: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * > invCy; % van Veen eqn. 23, use > PINV/SVD to cover rank deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), > optarg{:}); > > I just removed the leadfield code and it successfully ran. I could also interpolate it later. > Is this the correct approach. > > Thankyou in advance! > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 5:30 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > what you are describing sounds to me like the center bias of the > beamformer. Did you contrast the activity with anything, or did you > normalize your leadfield? > Check this out: > http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition > > Best, > Jörn > > On 3/31/2014 5:46 AM, Tyler Grummett wrote: >> I have been trying to plot my interpolated source data using the code: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >> parameter >> % does not vary over time, therefore the time dimension >> is not needed. >> >> % Plot interpolated data >> cfg = []; %#ok >> cfg.method = 'ortho'; % spline >> cfg.funparameter = 'avg.pow'; >> ft_sourceplot( cfg, sourceInt); >> >> However the figure that comes up just had orange squares in the subplots. >> >> I dont know where Ive gone wrong. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 tyler.grummett at flinders.edu.au Mon Mar 31 12:36:52 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 10:36:52 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <53392ACA.2030108@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> Message-ID: <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> Jorn, I apologise about the bugzilla report. My last two emails on this emailing list were ignored, thats all. I didnt really know how else to approach this issue. I had a look at my variables. source.avg = pow: [642x1 double] filter: {642x1 cell} sourceInt.avg = pow: [16777216x1 double] So clearly, as both variables are completely different. Something has gone wrong. The next part of my code is the following: % interpolate sources mri = ft_read_mri('Subject01.mri'); mri = ft_volumereslice([], mri); cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourceInt = ft_sourceinterpolate( cfg, source, mri); sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter % does not vary over time, therefore the time dimension is not needed. mri = anatomy: [256x256x256 double] dim: [256 256 256] transform: [4x4 double] coordsys: 'ctf' unit: 'mm' cfg: [1x1 struct] I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. Ive been wrong before though, thanks for your help. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 7:13 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, hm, okay, it could be that the issue with the leadfield and with the plot are related, but it could also be that they are separate issues. I just saw that you posted the same 'problem' on bugzilla and included a picture. Maybe for next time, include a picture on the mailinglist and just create a bug on bugzilla if you are sure it is a bug in Fieldtrip and not if you are not sure. That saves us a lot of time in separating code issues from user problems ;) So, back to you problem. It seems that your reconstruction results in one voxel only. Are you sure that your grid consistents of more than just one position? So, for example check the size of the matrices in source.avg, source- and headmodel, etc. Also, you can check in Matlab the respective fields of source and sourceInt and see whether that makes sense. Lastly, a neat way to check is always to use your code on data from the tutorial, and vice versa, use code from the tutorial on your data and see whether that works. Both should give sensible results, and if one does not, you know where to start looking for a solution ;) Best, Jörn On 3/31/2014 9:41 AM, Tyler Grummett wrote: > Hey Jorn, > > Previously I have let ft_sourceanalysis do a lead field because if I use the following code: > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO > > and then calculate the source analysis: > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = maxpos; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > % cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > then I get an error than says: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * > invCy; % van Veen eqn. 23, use > PINV/SVD to cover rank deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), > optarg{:}); > > I just removed the leadfield code and it successfully ran. I could also interpolate it later. > Is this the correct approach. > > Thankyou in advance! > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 5:30 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > what you are describing sounds to me like the center bias of the > beamformer. Did you contrast the activity with anything, or did you > normalize your leadfield? > Check this out: > http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition > > Best, > Jörn > > On 3/31/2014 5:46 AM, Tyler Grummett wrote: >> I have been trying to plot my interpolated source data using the code: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >> parameter >> % does not vary over time, therefore the time dimension >> is not needed. >> >> % Plot interpolated data >> cfg = []; %#ok >> cfg.method = 'ortho'; % spline >> cfg.funparameter = 'avg.pow'; >> ft_sourceplot( cfg, sourceInt); >> >> However the figure that comes up just had orange squares in the subplots. >> >> I dont know where Ive gone wrong. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 31 13:54:53 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 13:54:53 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <5339578D.4050308@donders.ru.nl> Hi Tyler, there is not much inherently different between time- and freuqency-domain beamformer, at least in terms of computing the forward and the inverse solution. But I see that you are obviously confused, so let me try to help you out and shed some light on what you are actually doing ;) > I had a look at my variables. > > source.avg = > > pow: [642x1 double] > filter: {642x1 cell} > > sourceInt.avg = > > pow: [16777216x1 double] > > So clearly, as both variables are completely different. Something has gone wrong. No, that is actually how it should be. From below you can see that your MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = 16777216 elements. In line with source.avg.pow, you should see that your 'grid' consists of 642 elements, so you were computing your source activity on a grid of in total 642 elements. Then you used the original MRI to interpolate from 642 to these 16 million grid points. Actually, since you specific cfg.downsample = 2, it should have been only 8 million points, so that's where things already get a bit weird. So let's go into some sanity checks: 1. are you using the latest version (or a recent, i.e. from this year) of FielTrip? 2. sourceInt should look something like this, does it? source_diff_int = inside: [46x55x46 logical] avg: [1x1 struct] dim: [46 55 46] transform: [4x4 double] anatomy: [46x55x46 double] unit: 'mm' cfg: [1x1 struct] 3. source should look something like this: source = dim: [20 25 22] freq: 54.8287 cumtapcnt: [338x1 double] pos: [11000x3 double] inside: [1x5798 double] outside: [1x5202 double] method: 'average' avg: [1x1 struct] trialinfo: [338x1 double] cfg: [1x1 struct] 4. also check your grid, should be something like this: sourcemodel = pos: [11000x3 double] dim: [20 25 22] unit: 'cm' inside: [1x5798 double] outside: [1x5202 double] params: [1x1 struct] initial: [4x4 double] cfg: [1x1 struct] Of course, it should all look a bit different, because you are using LCMV, but essentially it should be the same. Lastly, you can check other source plotting methods, like 'ortho' or try to plot the source structure rather than the sourceInt structure. In the end, the error must be somewhere in your grid, be it in .pos or .inside, because FieldTrip thinks that there is only one voxel to be plotted. There are other things that may be the issue, but I am not sure about these. So, I would suggest that you play a bit around and see where the error might come from (e.g. follow this tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the steps that you need for LCMV, maybe also check out: http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg there, LCMV is used, but on one voxel only) Best, Jörn > > The next part of my code is the following: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter > % does not vary over time, therefore the time dimension is not needed. > > mri = > > anatomy: [256x256x256 double] > dim: [256 256 256] > transform: [4x4 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. > > Ive been wrong before though, > > thanks for your help. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 7:13 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > hm, okay, it could be that the issue with the leadfield and with the > plot are related, but it could also be that they are separate issues. I > just saw that you posted the same 'problem' on bugzilla and included a > picture. Maybe for next time, include a picture on the mailinglist and > just create a bug on bugzilla if you are sure it is a bug in Fieldtrip > and not if you are not sure. That saves us a lot of time in separating > code issues from user problems ;) > > So, back to you problem. It seems that your reconstruction results in > one voxel only. Are you sure that your grid consistents of more than > just one position? So, for example check the size of the matrices in > source.avg, source- and headmodel, etc. > > Also, you can check in Matlab the respective fields of source and > sourceInt and see whether that makes sense. > > Lastly, a neat way to check is always to use your code on data from the > tutorial, and vice versa, use code from the tutorial on your data and > see whether that works. Both should give sensible results, and if one > does not, you know where to start looking for a solution ;) > > Best, > Jörn > > > On 3/31/2014 9:41 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >> >> % compute lead field ( apparently source analysis computes >> % lead field anyway >> cfg = []; >> cfg.elec = timelock.elec; >> cfg.vol = vol; >> cfg.reducerank = 3; >> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >> cfg.grid.unit = 'cm'; >> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >> >> and then calculate the source analysis: >> >> % Source Analysis: without contrasting condition >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = grid; >> cfg.vol = vol; >> % cfg.grid.pos = maxpos; >> cfg.keepfilter = 'yes'; >> cfg.dics.projectnoise = 'yes'; >> % cfg.dics.lambda = 0; >> source = ft_sourceanalysis( cfg, timelock); >> >> then I get an error than says: >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in beamformer_lcmv (line 268) >> filt = pinv(lf' * invCy * lf) * lf' * >> invCy; % van Veen eqn. 23, use >> PINV/SVD to cover rank deficient leadfield >> >> Error in ft_sourceanalysis (line 794) >> dip(i) = beamformer_lcmv(grid, sens, vol, >> squeeze_avg, squeeze(Cy(i,:,:)), >> optarg{:}); >> >> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >> Is this the correct approach. >> >> Thankyou in advance! >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 5:30 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> what you are describing sounds to me like the center bias of the >> beamformer. Did you contrast the activity with anything, or did you >> normalize your leadfield? >> Check this out: >> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >> >> Best, >> Jörn >> >> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>> I have been trying to plot my interpolated source data using the code: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time dimension >>> is not needed. >>> >>> % Plot interpolated data >>> cfg = []; %#ok >>> cfg.method = 'ortho'; % spline >>> cfg.funparameter = 'avg.pow'; >>> ft_sourceplot( cfg, sourceInt); >>> >>> However the figure that comes up just had orange squares in the subplots. >>> >>> I dont know where Ive gone wrong. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 tyler.grummett at flinders.edu.au Mon Mar 31 15:15:19 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 13:15:19 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <5339578D.4050308@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> Message-ID: Hey Jorn, Yes I am definitely confused haha, this stuff is way out of my league as a PhD student. Anyway, I feel we are getting somewhere. timelock = avg: [121x19767 double] var: [121x19767 double] time: [1x19767 double] dof: [121x19767 double] label: {1x121 cell} dimord: 'chan_time' cov: [121x121 double] elec: [1x1 struct] cfg: [1x1 struct] source = time: [1x19767 double] pos: [642x3 double] inside: [642x1 double] outside: [] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] sourceInt = time: [1x19767 double] avg: [1x1 struct] pos: [16777216x3 double] dim: [256 256 256] inside: [1x16777216 double] outside: [1x0 double] coordsys: 'ctf' unit: 'mm' cfg: [1x1 struct] Given what I said last time, I might not comment on the differences. I hope you can see something wrong. One thing I should mention is that the data is continuous, around 30 seconds. Therefore there is only one trial, is that an issue? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Monday, 31 March 2014 10:24 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, there is not much inherently different between time- and freuqency-domain beamformer, at least in terms of computing the forward and the inverse solution. But I see that you are obviously confused, so let me try to help you out and shed some light on what you are actually doing ;) > I had a look at my variables. > > source.avg = > > pow: [642x1 double] > filter: {642x1 cell} > > sourceInt.avg = > > pow: [16777216x1 double] > > So clearly, as both variables are completely different. Something has gone wrong. No, that is actually how it should be. From below you can see that your MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = 16777216 elements. In line with source.avg.pow, you should see that your 'grid' consists of 642 elements, so you were computing your source activity on a grid of in total 642 elements. Then you used the original MRI to interpolate from 642 to these 16 million grid points. Actually, since you specific cfg.downsample = 2, it should have been only 8 million points, so that's where things already get a bit weird. So let's go into some sanity checks: 1. are you using the latest version (or a recent, i.e. from this year) of FielTrip? 2. sourceInt should look something like this, does it? source_diff_int = inside: [46x55x46 logical] avg: [1x1 struct] dim: [46 55 46] transform: [4x4 double] anatomy: [46x55x46 double] unit: 'mm' cfg: [1x1 struct] 3. source should look something like this: source = dim: [20 25 22] freq: 54.8287 cumtapcnt: [338x1 double] pos: [11000x3 double] inside: [1x5798 double] outside: [1x5202 double] method: 'average' avg: [1x1 struct] trialinfo: [338x1 double] cfg: [1x1 struct] 4. also check your grid, should be something like this: sourcemodel = pos: [11000x3 double] dim: [20 25 22] unit: 'cm' inside: [1x5798 double] outside: [1x5202 double] params: [1x1 struct] initial: [4x4 double] cfg: [1x1 struct] Of course, it should all look a bit different, because you are using LCMV, but essentially it should be the same. Lastly, you can check other source plotting methods, like 'ortho' or try to plot the source structure rather than the sourceInt structure. In the end, the error must be somewhere in your grid, be it in .pos or .inside, because FieldTrip thinks that there is only one voxel to be plotted. There are other things that may be the issue, but I am not sure about these. So, I would suggest that you play a bit around and see where the error might come from (e.g. follow this tutorial: http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the steps that you need for LCMV, maybe also check out: http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg there, LCMV is used, but on one voxel only) Best, Jörn > > The next part of my code is the following: > > % interpolate sources > mri = ft_read_mri('Subject01.mri'); > mri = ft_volumereslice([], mri); > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'avg.pow'; > sourceInt = ft_sourceinterpolate( cfg, source, mri); > sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter > % does not vary over time, therefore the time dimension is not needed. > > mri = > > anatomy: [256x256x256 double] > dim: [256 256 256] > transform: [4x4 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. > > Ive been wrong before though, > > thanks for your help. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 7:13 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > hm, okay, it could be that the issue with the leadfield and with the > plot are related, but it could also be that they are separate issues. I > just saw that you posted the same 'problem' on bugzilla and included a > picture. Maybe for next time, include a picture on the mailinglist and > just create a bug on bugzilla if you are sure it is a bug in Fieldtrip > and not if you are not sure. That saves us a lot of time in separating > code issues from user problems ;) > > So, back to you problem. It seems that your reconstruction results in > one voxel only. Are you sure that your grid consistents of more than > just one position? So, for example check the size of the matrices in > source.avg, source- and headmodel, etc. > > Also, you can check in Matlab the respective fields of source and > sourceInt and see whether that makes sense. > > Lastly, a neat way to check is always to use your code on data from the > tutorial, and vice versa, use code from the tutorial on your data and > see whether that works. Both should give sensible results, and if one > does not, you know where to start looking for a solution ;) > > Best, > Jörn > > > On 3/31/2014 9:41 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >> >> % compute lead field ( apparently source analysis computes >> % lead field anyway >> cfg = []; >> cfg.elec = timelock.elec; >> cfg.vol = vol; >> cfg.reducerank = 3; >> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >> cfg.grid.unit = 'cm'; >> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >> >> and then calculate the source analysis: >> >> % Source Analysis: without contrasting condition >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.grid = grid; >> cfg.vol = vol; >> % cfg.grid.pos = maxpos; >> cfg.keepfilter = 'yes'; >> cfg.dics.projectnoise = 'yes'; >> % cfg.dics.lambda = 0; >> source = ft_sourceanalysis( cfg, timelock); >> >> then I get an error than says: >> >> Error using * >> Inner matrix dimensions must agree. >> >> Error in beamformer_lcmv (line 268) >> filt = pinv(lf' * invCy * lf) * lf' * >> invCy; % van Veen eqn. 23, use >> PINV/SVD to cover rank deficient leadfield >> >> Error in ft_sourceanalysis (line 794) >> dip(i) = beamformer_lcmv(grid, sens, vol, >> squeeze_avg, squeeze(Cy(i,:,:)), >> optarg{:}); >> >> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >> Is this the correct approach. >> >> Thankyou in advance! >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 5:30 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> what you are describing sounds to me like the center bias of the >> beamformer. Did you contrast the activity with anything, or did you >> normalize your leadfield? >> Check this out: >> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >> >> Best, >> Jörn >> >> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>> I have been trying to plot my interpolated source data using the code: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time dimension >>> is not needed. >>> >>> % Plot interpolated data >>> cfg = []; %#ok >>> cfg.method = 'ortho'; % spline >>> cfg.funparameter = 'avg.pow'; >>> ft_sourceplot( cfg, sourceInt); >>> >>> However the figure that comes up just had orange squares in the subplots. >>> >>> I dont know where Ive gone wrong. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hweeling.lee at gmail.com Mon Mar 31 16:48:34 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 31 Mar 2014 16:48:34 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab Message-ID: Dear all, I'm encountering a problem with running ICA in Matlab. After ICA, when I tried to plot the components, Matlab keeps prompting an internal problem and needs to be closed. I wonder why this is the case. Could someone please tell me what went wrong? Here's part of my script for ICA: cfg = []; % if data were cleaned, then use this if sub == 5 %|| sub == 7 cfg.channel = {'all', '-AFz', '-FT7'}; elseif sub == 7 cfg.channel = {'all' '-AFz'}; else cfg.channel = {'all'}; end % cfg.runica.pca = 121; % using the rank of my data % ic_data = ft_componentanalysis(cfg,cleandata); % if data were cleaned then use this ic_data = ft_componentanalysis(cfg, cleandata); % after ICA, look for components that we want to substract from our data, % only looking at ten channels (components) at a time cfg = []; cfg.dataset = rawdatafile; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blocksize = 8; cfg.channels = 'all'; cfg.layout = 'EEG1020.lay'; ft_databrowser(cfg,ic_data); The internal problem appears even when I downsampled my data from 5000 Hz to 1000 Hz. The internal problem appears also when I have short segments of my data (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). The memory of my PC workstation is: Maximum possible array: 60253 MB (6.318e+10 bytes) * Memory available for all arrays: 60253 MB (6.318e+10 bytes) * Memory used by MATLAB: 560 MB (5.872e+08 bytes) Physical Memory (RAM): 32685 MB (3.427e+10 bytes) Interestingly, this internal problem does not occur when I ran my script on my Macbook Pro. I'm feeling very lost here. Any help is highly appreciated. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Mon Mar 31 16:56:57 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 16:56:57 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> Message-ID: <53398239.1010004@donders.ru.nl> Hi Tyler, yes, it seems like something went wrong in the computation of your forward model. Usually, your source structure should have a .dim field, specifying the dimensions of your .pos matrix. The pos-matrix has to be a regular 3D grid, i.e. be representable as a 3x3x3 matrix. I am not quite sure how the sourceinterpolate function is handeling the fact that you do not have that .dim field. Apparently, it is also confused ;) Do you want to reconstruct only some voxels? From your code it seems that you want to cover the whole brain with a 1cm resolution. If the latter is the case, maybe restart with creating your forward model by following the tutorial that I posted in my previous mail. There are some sanity checks that can help you figuring out if you are doing the correct thing. If the former one is the case, please explain again what exactly you want to achieve and how you are building your forward model. Best, Jörn btw, there's nothing wrong with being a PhD student, it's just a matter of experience in practice and theory as in all domains in life ;) On 3/31/2014 3:15 PM, Tyler Grummett wrote: > Hey Jorn, > > Yes I am definitely confused haha, this stuff is way out of my league as a PhD student. > Anyway, I feel we are getting somewhere. > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > source = > > time: [1x19767 double] > pos: [642x3 double] > inside: [642x1 double] > outside: [] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > sourceInt = > > time: [1x19767 double] > avg: [1x1 struct] > pos: [16777216x3 double] > dim: [256 256 256] > inside: [1x16777216 double] > outside: [1x0 double] > coordsys: 'ctf' > unit: 'mm' > cfg: [1x1 struct] > > Given what I said last time, I might not comment on the differences. I hope you can see something wrong. > > One thing I should mention is that the data is continuous, around 30 seconds. Therefore there is only one trial, > is that an issue? > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Monday, 31 March 2014 10:24 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > Hi Tyler, > > there is not much inherently different between time- and > freuqency-domain beamformer, at least in terms of computing the forward > and the inverse solution. But I see that you are obviously confused, so > let me try to help you out and shed some light on what you are actually > doing ;) > > >> I had a look at my variables. >> >> source.avg = >> >> pow: [642x1 double] >> filter: {642x1 cell} >> >> sourceInt.avg = >> >> pow: [16777216x1 double] >> >> So clearly, as both variables are completely different. Something has gone wrong. > No, that is actually how it should be. From below you can see that your > MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = > 16777216 elements. In line with source.avg.pow, you should see that your > 'grid' consists of 642 elements, so you were computing your source > activity on a grid of in total 642 elements. Then you used the original > MRI to interpolate from 642 to these 16 million grid points. Actually, > since you specific cfg.downsample = 2, it should have been only 8 > million points, so that's where things already get a bit weird. > > So let's go into some sanity checks: > 1. are you using the latest version (or a recent, i.e. from this year) > of FielTrip? > 2. sourceInt should look something like this, does it? > > source_diff_int = > inside: [46x55x46 logical] > avg: [1x1 struct] > dim: [46 55 46] > transform: [4x4 double] > anatomy: [46x55x46 double] > unit: 'mm' > cfg: [1x1 struct] > > > > 3. source should look something like this: > > source = > dim: [20 25 22] > freq: 54.8287 > cumtapcnt: [338x1 double] > pos: [11000x3 double] > inside: [1x5798 double] > outside: [1x5202 double] > method: 'average' > avg: [1x1 struct] > trialinfo: [338x1 double] > cfg: [1x1 struct] > > 4. also check your grid, should be something like this: > > sourcemodel = > > pos: [11000x3 double] > dim: [20 25 22] > unit: 'cm' > inside: [1x5798 double] > outside: [1x5202 double] > params: [1x1 struct] > initial: [4x4 double] > cfg: [1x1 struct] > > > Of course, it should all look a bit different, because you are using > LCMV, but essentially it should be the same. Lastly, you can check other > source plotting methods, like 'ortho' or try to plot the source > structure rather than the sourceInt structure. In the end, the error > must be somewhere in your grid, be it in .pos or .inside, because > FieldTrip thinks that there is only one voxel to be plotted. There are > other things that may be the issue, but I am not sure about these. So, I > would suggest that you play a bit around and see where the error might > come from (e.g. follow this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the > steps that you need for LCMV, maybe also check out: > http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg > there, LCMV is used, but on one voxel only) > > Best, > Jörn > >> The next part of my code is the following: >> >> % interpolate sources >> mri = ft_read_mri('Subject01.mri'); >> mri = ft_volumereslice([], mri); >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'avg.pow'; >> sourceInt = ft_sourceinterpolate( cfg, source, mri); >> sourceInt = rmfield( sourceInt,'time'); % The avg.pow parameter >> % does not vary over time, therefore the time dimension is not needed. >> >> mri = >> >> anatomy: [256x256x256 double] >> dim: [256 256 256] >> transform: [4x4 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> I cant really see if the data works in the tutorial because it doesnt appear as though fieldtrip has a tutorial on lcmv beamformers, they seem to stick to frequency domain beamformers. >> >> Ive been wrong before though, >> >> thanks for your help. >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Monday, 31 March 2014 7:13 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> Hi Tyler, >> >> hm, okay, it could be that the issue with the leadfield and with the >> plot are related, but it could also be that they are separate issues. I >> just saw that you posted the same 'problem' on bugzilla and included a >> picture. Maybe for next time, include a picture on the mailinglist and >> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >> and not if you are not sure. That saves us a lot of time in separating >> code issues from user problems ;) >> >> So, back to you problem. It seems that your reconstruction results in >> one voxel only. Are you sure that your grid consistents of more than >> just one position? So, for example check the size of the matrices in >> source.avg, source- and headmodel, etc. >> >> Also, you can check in Matlab the respective fields of source and >> sourceInt and see whether that makes sense. >> >> Lastly, a neat way to check is always to use your code on data from the >> tutorial, and vice versa, use code from the tutorial on your data and >> see whether that works. Both should give sensible results, and if one >> does not, you know where to start looking for a solution ;) >> >> Best, >> Jörn >> >> >> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Previously I have let ft_sourceanalysis do a lead field because if I use the following code: >>> >>> % compute lead field ( apparently source analysis computes >>> % lead field anyway >>> cfg = []; >>> cfg.elec = timelock.elec; >>> cfg.vol = vol; >>> cfg.reducerank = 3; >>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution >>> cfg.grid.unit = 'cm'; >>> cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window >>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE I AM UP TO >>> >>> and then calculate the source analysis: >>> >>> % Source Analysis: without contrasting condition >>> cfg = []; >>> cfg.method = 'lcmv'; >>> cfg.grid = grid; >>> cfg.vol = vol; >>> % cfg.grid.pos = maxpos; >>> cfg.keepfilter = 'yes'; >>> cfg.dics.projectnoise = 'yes'; >>> % cfg.dics.lambda = 0; >>> source = ft_sourceanalysis( cfg, timelock); >>> >>> then I get an error than says: >>> >>> Error using * >>> Inner matrix dimensions must agree. >>> >>> Error in beamformer_lcmv (line 268) >>> filt = pinv(lf' * invCy * lf) * lf' * >>> invCy; % van Veen eqn. 23, use >>> PINV/SVD to cover rank deficient leadfield >>> >>> Error in ft_sourceanalysis (line 794) >>> dip(i) = beamformer_lcmv(grid, sens, vol, >>> squeeze_avg, squeeze(Cy(i,:,:)), >>> optarg{:}); >>> >>> I just removed the leadfield code and it successfully ran. I could also interpolate it later. >>> Is this the correct approach. >>> >>> Thankyou in advance! >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Monday, 31 March 2014 5:30 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> Hi Tyler, >>> >>> what you are describing sounds to me like the center bias of the >>> beamformer. Did you contrast the activity with anything, or did you >>> normalize your leadfield? >>> Check this out: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>> >>> Best, >>> Jörn >>> >>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>> I have been trying to plot my interpolated source data using the code: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time dimension >>>> is not needed. >>>> >>>> % Plot interpolated data >>>> cfg = []; %#ok >>>> cfg.method = 'ortho'; % spline >>>> cfg.funparameter = 'avg.pow'; >>>> ft_sourceplot( cfg, sourceInt); >>>> >>>> However the figure that comes up just had orange squares in the subplots. >>>> >>>> I dont know where Ive gone wrong. >>>> >>>> >>>> Tyler >>>> >>>> >>>> ************************* >>>> >>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>> /PhD Candidate/ >>>> /Brain Signals Laboratory/ >>>> /Flinders University/ >>>> /Rm 5A301/ >>>> /Ext 66124/ >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- 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 gio at gpiantoni.com Mon Mar 31 17:01:41 2014 From: gio at gpiantoni.com (Gio Piantoni) Date: Mon, 31 Mar 2014 11:01:41 -0400 Subject: [FieldTrip] help about ' fieldtrip2fiff ' In-Reply-To: References: Message-ID: Hi Xiao, Nice that updating the FieldTrip version was sufficient to get rid of the initial error. The current error is related to writing permissions on your OS: https://github.com/fieldtrip/fieldtrip/blob/master/external/mne/fiff_start_file.m#L35 The command that fails is fopen (matlab built-in command). Can you try to run: [fid,message] = fopen(name,'w+','ieee-be'); where 'name' is the name of the file that you want to write in FIFF format. If that fails, please have a look at the matlab documentation for fopen and related troubleshooting. Best, -g On Mon, Mar 31, 2014 at 4:37 AM, tongxiao meng wrote: > Hi all > > I downloading a new version of FieldTrip, but there are also have some > errors, > > ??? Error using ==> fiff_start_file at 35 > Permission denied > > Error in ==> fiff_start_writing_raw at 54 > fid = fiff_start_file(name); > > Error in ==> fieldtrip2fiff at 124 > [outfid, cals] = fiff_start_writing_raw(fifffile, info); > > Why? > thanks, > xiao > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Mon Mar 31 17:12:24 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Mon, 31 Mar 2014 17:12:24 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <53398239.1010004@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl> Message-ID: <533985D8.4080504@donders.ru.nl> just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- 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 hweeling.lee at gmail.com Mon Mar 31 17:25:10 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 31 Mar 2014 17:25:10 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: Message-ID: Hi, Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of RAM installed. In the previous month, I was able to run ICA and plot its components without any error message from Matlab. Recently, I keep experiencing the error message, and Matlab crashes completely. I have no clue what could have gone wrong. Cheers, Hweeling On 31 March 2014 17:08, Stephen Politzer-Ahles wrote: > Hello Hweeling, > > What kind of error do you get in MATLAB when you try to do ICA, is it an > "Out of memory" error? I'm asking because this is a fairly common issue in > MATLAB on Windows systems (I don't know the details of your data, but I've > experienced this issue on 32-channel, 1000-Hz epoched EEG data if the > epochs are long enough and numerous enough). For me the only solutions > (other than shortening the epochs or downsampling the data, which might not > be good options depending on your research question) were to use a > Unix-based operating system (like Mac OS) or to upgrade my Windows (I had > errors like this when using a 32-bit version of Windows with 2 GB of RAM, > but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure > if this is the issue you're having, though. > > Best, > Steve > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 7:02 PM, wrote: > >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) >> 2. Re: plotting interpolated sources with ft_sourceplot >> (J?rn M. Horschig) >> 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 31 Mar 2014 16:48:34 +0200 >> From: Hwee Ling Lee >> To: FieldTrip discussion list >> Subject: [FieldTrip] Fieldtrip ICA crashes Matlab >> Message-ID: >> > poVtb-1ApZuDQ at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Dear all, >> >> I'm encountering a problem with running ICA in Matlab. After ICA, when I >> tried to plot the components, Matlab keeps prompting an internal problem >> and needs to be closed. I wonder why this is the case. Could someone >> please >> tell me what went wrong? >> >> Here's part of my script for ICA: >> >> cfg = []; % if data were cleaned, then use this >> >> if sub == 5 %|| sub == 7 >> cfg.channel = {'all', '-AFz', '-FT7'}; >> elseif sub == 7 >> cfg.channel = {'all' '-AFz'}; >> else >> cfg.channel = {'all'}; >> end >> >> % cfg.runica.pca = 121; % using the rank of my data >> % ic_data = ft_componentanalysis(cfg,cleandata); % if data were >> cleaned then use this >> ic_data = ft_componentanalysis(cfg, cleandata); >> >> % after ICA, look for components that we want to substract from >> our >> data, >> % only looking at ten channels (components) at a time >> cfg = []; >> cfg.dataset = rawdatafile; >> cfg.viewmode = 'component'; >> cfg.continuous = 'no'; >> cfg.blocksize = 8; >> cfg.channels = 'all'; >> cfg.layout = 'EEG1020.lay'; >> ft_databrowser(cfg,ic_data); >> >> >> The internal problem appears even when I downsampled my data from 5000 Hz >> to 1000 Hz. >> >> The internal problem appears also when I have short segments of my data >> (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). >> >> The memory of my PC workstation is: >> Maximum possible array: 60253 MB (6.318e+10 bytes) * >> Memory available for all arrays: 60253 MB (6.318e+10 bytes) * >> Memory used by MATLAB: 560 MB (5.872e+08 bytes) >> Physical Memory (RAM): 32685 MB (3.427e+10 bytes) >> >> Interestingly, this internal problem does not occur when I ran my script >> on >> my Macbook Pro. >> >> I'm feeling very lost here. Any help is highly appreciated. >> >> Cheers, >> Hweeling >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html >> > >> > -- ================================================= 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 ktyler at swin.edu.au Mon Mar 31 17:32:24 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 31 Mar 2014 15:32:24 +0000 Subject: [FieldTrip] ft_volumerealign and ft_dipolefitting Message-ID: Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Mon Mar 31 17:34:03 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Mon, 31 Mar 2014 15:34:03 +0000 Subject: [FieldTrip] FW: ft_volumerealign and ft_dipolefitting In-Reply-To: References: Message-ID: Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia ________________________________ From: Kaelasha Tyler Sent: Tuesday, 1 April 2014 2:32 AM To: fieldtrip at science.ru.nl Subject: ft_volumerealign and ft_dipolefitting Hi All, I have a question regarding dipole fitting and aligning anatomical images and volume conduction models with MEG sensors. I know a lot of other people have posted on related issues on this email list, but looking through previous emails, I can't see the solution to my current problems. Any help, much appreciated. Ultimately, when I use ft_dipolefitting and plot with ft_sourceplot, I end up with 'dipoles' appearing outside the head...... Checking the registration of my volume conduction model with sensors, it also appears the volume conduction model is aligned unrealistically high within the sensors (see jpg). Yes, I have checked that the coordsys and units are the same for sensors, mri, segmented mri and volume conduction model. I am using a neuromag system, and use ft_volumerealign with cfg.method = 'interactive' and cfg.coordsys = 'neuromag' to bring the MRI into neuromag coordinates. I can't see where co-registration problems are arising, or why the dipoles should be being shown as appearing outside the head. I have fussed over this for so long, if anyone can point me towards the light I will be utterly grateful..... Regards, Kaelasha Tyler PhD Candidate Brain and Psychological Sciences Research Centre Swinburne University Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: VolSens.jpg Type: image/jpeg Size: 27213 bytes Desc: VolSens.jpg URL: From r.oostenveld at donders.ru.nl Mon Mar 31 21:41:48 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Mon, 31 Mar 2014 21:41:48 +0200 Subject: [FieldTrip] Donders Summer School References: <9C7B0CAE-BE54-4F49-A444-7D1C3C98F1B1@gmail.com> Message-ID: Radboud Summer School Neural metrics: Quantitative analysis of neural organisation and function The Donders Institute for Brain, Cognition and Behaviour is organizing a summer school on neural metrics where the aim is to get participants acquainted with the quantitative analysis of neural organisation and function. We have compiled an exciting program with an excellent set of national and international speakers. Topics range from the analysis of single-neuron responses to the analysis of macroscopic brain networks. The course is designed for PhD students and starting postdoctoral researchers working at the interface between cognitive neuroscience and the application of advanced methods. Please consult the Radboud Summer School website for details on the programme, social events and registration. Further details for the Neural Metrics Summer School can be found below and on the website. Note that the early bird deadline is April 1st. Dates Monday 11 August - Friday 15 August 2014 (one week) Course leaders Dr. M. (Marcel) van Gerven, Assisstant Professor Prof. T. (Tansu) Celikel, Professor Neurophysiology Donders Institute for Brain, Cognition and Behaviour Entry level PhD students in the field of Neuroscience with an MSc in Biology, Computer Science, Psychology, Physics, Al or similar subject For whom is this course designed This course was developed for PhD students (10 local + 20 international) and early postdoctoral researchers working at the interface between cognitive neuroscience and the application of advanced methods. This includes cognitive neuroscientists and researchers with practical experience. Admission requirements As part of the admission procedure, we ask you to send us your CV and a motivation letter in which you explain your interest for our course. Course fee €400 The course fee includes the registration fee, course materials, access to library and IT facilities, coffee/tea, lunch, and a number of social activities. Accommodation is available for the course participants. For details please see http://www.ru.nl/radboudsummerschool/practical-matters/housing/ Discounts • 10% discount for early bird applicants. The early bird deadline is 1 April 2014. • 15% discount for students and PhD candidates from Radboud University and partner universities Course description The brain as a network In order to fully understand the neuronal substrate of human cognition, we need to start viewing the working brain as a network.Many neurological and mental disorders are viewed as the result of a malfunction at the network level. The growing interest in brain networks is complemented by rapid theoretical and technical developments. We will embrace these developments throughout the course to help us understand the human brain network. This will be done by examining the theoretical background and by learning the necessary measurement and data analysis techniques used to study brain connectivity. The topics will be structured according to micro, meso and macro-scale connectivity. Course contents Micro-scale connectivity involves neuron communication at the cellular and synaptic level; mesa-scale connectivity addresses communication between brain regions; and macro-scale connectivity explores the structure and dynamics of large brain networks. We will strive to include components of electrophysiology, anatomy, functional blood flow measures, computational modelling and advanced data analysis at each level. While doing so, we will focus on both the animal and human brain. The course consists of lectures and computer exercises, supplemented with in-depth discussions. Lecture slides and exercises will also be distributed among the participants. We will ensure active participation in the following way: • In the hands-on sessions you will work together in small groups (2-3 people). These sessions will include exercises aimed at promoting discussions and encouraging you to reflect on the core theoretical issues. Learning outcomes 1. Understand new techniques and approaches in the field of neuroscience networks 2. Understand the basics of new connectivity analysis tools 3. Understand new theories and computational modelling approaches 4. Identify the appropriate research methodology for answering specific research questions on brain connectivity 5. Improve your communication skills and develop research questions in a group setting Number of ECTS credits 2 ECTS credits Registration For registration, please consult the website. More information radboudsummerschool at ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From aharown at hotmail.com Mon Mar 31 21:51:51 2014 From: aharown at hotmail.com (Aaron Hanford) Date: Mon, 31 Mar 2014 14:51:51 -0500 Subject: [FieldTrip] ICA: eeglab and fieldtrip Message-ID: Hi,I'm resending this with the figures turned into jpgs so it's not oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab (although much more so to fieldtrip). I'm trying to figure out the following: On the exact same dataset, I did the following two things: 1) in eeglab, I just chose Tools -> Run ICA with default settings. Then, starting over with the original raw data: 2) In fieldtrip I ran the following: data = eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = 'runica';[comp]=ft_componentanalysis(cfg,data);layout = 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); In both cases I then plotted the 2-D component maps, attached. So my question is, why are these results so completely different? The fieldtrip results don't look right at all, in that for instance they don't obviously identify a blink component (note that in this dataset, there is only one electrode placed near the right eye, not the left). I did this a handful of times and got the same sort of big differences. Am I doing something wrong or what? I actually think the cap file seems incorrect, but I've been assured by my PI that it's correct, so .... is there another likely answer? Thanks, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip.JPG Type: image/jpeg Size: 110477 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eeglab.JPG Type: image/jpeg Size: 99185 bytes Desc: not available URL: From spa268 at nyu.edu Mon Mar 31 22:08:55 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Tue, 1 Apr 2014 00:08:55 +0400 Subject: [FieldTrip] ICA: eeglab and fieldtrip Message-ID: Hello Aaron, This doesn't, answer the rest of your questions, but... In your attached Fieldtrip image, component 1 does look like a likely blink component to me? Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ On Mon, Mar 31, 2014 at 11:52 PM, wrote: > > Message: 2 > Date: Mon, 31 Mar 2014 14:51:51 -0500 > From: Aaron Hanford > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] ICA: eeglab and fieldtrip > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi,I'm resending this with the figures turned into jpgs so it's not > oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab > (although much more so to fieldtrip). I'm trying to figure out the > following: > On the exact same dataset, I did the following two things: > 1) in eeglab, I just chose Tools -> Run ICA with default settings. > Then, starting over with the original raw data: > 2) In fieldtrip I ran the following: data = > eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = > 'runica';[comp]=ft_componentanalysis(cfg,data);layout = > 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component > = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); > In both cases I then plotted the 2-D component maps, attached. > So my question is, why are these results so completely different? The > fieldtrip results don't look right at all, in that for instance they don't > obviously identify a blink component (note that in this dataset, there is > only one electrode placed near the right eye, not the left). I did this a > handful of times and got the same sort of big differences. Am I doing > something wrong or what? > > I actually think the cap file seems incorrect, but I've been assured by my > PI that it's correct, so .... is there another likely answer? > Thanks, > Aaron > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip.JPG > Type: image/jpeg > Size: 110477 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.jpe > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: eeglab.JPG > Type: image/jpeg > Size: 99185 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment-0001.jpe > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 40, Issue 48 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Mar 31 22:10:36 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 31 Mar 2014 22:10:36 +0200 Subject: [FieldTrip] ICA: eeglab and fieldtrip In-Reply-To: References: Message-ID: Hi Aaron (i see Stephen just wrote a similar response) Those component topoplots look pretty good to me. In the FT one, I would say the first and third have a good change of being related to eyeblinks, and the fifth and twenty-fifth to eye-movements. However, you should really look at the timecourses to identify them as related to saccades and blinks, and by comparing them with your EOG recording. Although each ICA will *always* give you different results (if you don't specifiy the random seed), to make them more comparable you could add the EOG channel to the layout. Cheer, Stephen On 31 March 2014 22:08, Stephen Politzer-Ahles wrote: > Hello Aaron, > > This doesn't, answer the rest of your questions, but... In your attached > Fieldtrip image, component 1 does look like a likely blink component to me? > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 11:52 PM, wrote: > >> >> Message: 2 >> Date: Mon, 31 Mar 2014 14:51:51 -0500 >> From: Aaron Hanford >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] ICA: eeglab and fieldtrip >> Message-ID: >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi,I'm resending this with the figures turned into jpgs so it's not >> oversize...anyway, so I'm somewhat new to both fieldtrip and eeglab >> (although much more so to fieldtrip). I'm trying to figure out the >> following: >> >> On the exact same dataset, I did the following two things: >> 1) in eeglab, I just chose Tools -> Run ICA with default settings. >> Then, starting over with the original raw data: >> 2) In fieldtrip I ran the following: data = >> eeglab2fieldtrip(EEG,'preprocessing','none');cfg = [];cfg.method = >> 'runica';[comp]=ft_componentanalysis(cfg,data);layout = >> 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component >> = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); >> In both cases I then plotted the 2-D component maps, attached. >> So my question is, why are these results so completely different? The >> fieldtrip results don't look right at all, in that for instance they don't >> obviously identify a blink component (note that in this dataset, there is >> only one electrode placed near the right eye, not the left). I did this a >> handful of times and got the same sort of big differences. Am I doing >> something wrong or what? >> >> I actually think the cap file seems incorrect, but I've been assured by >> my PI that it's correct, so .... is there another likely answer? >> Thanks, >> Aaron >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.html >> > >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: fieldtrip.JPG >> Type: image/jpeg >> Size: 110477 bytes >> Desc: not available >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment.jpe >> > >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: eeglab.JPG >> Type: image/jpeg >> Size: 99185 bytes >> Desc: not available >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/8ae47e96/attachment-0001.jpe >> > >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 40, Issue 48 >> ***************************************** >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: