From runna90 at 126.com Tue Mar 1 09:23:48 2016 From: runna90 at 126.com (CRN) Date: Tue, 1 Mar 2016 16:23:48 +0800 Subject: [FieldTrip] where is the trial information after doing ft_timelockgrandaverage using within method Message-ID: <971DC9DB-D127-4553-9524-F662A6CA90D3@126.com> Dear all, I am new to field trip and I encountered a lot problems when I analyzing the MEG data. Looking forward to your help! My data structure is like this, 3 subjects x 3 conditions x 2 blocks. Now I want to do time-locked permutation test between trialsI. Here is my procedure: preprocessing-define trials-timelockanalysis-timelockgrandaverage. The problem occurred in the forth step, the trial information was depreciated when I used the ft_timelockgrandaverage function. I got a warning: Warning: depreciating trial field: using the avg to compute the grand average. But it is required when I do permutation test. What should I do? Thank you for your time! Best wishes, Runnan runna90 at 126.com Institute of Biophysics, Chinese Academy of Science, Beijing, China -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Tue Mar 1 10:44:16 2016 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Tue, 1 Mar 2016 10:44:16 +0100 Subject: [FieldTrip] How to plot sourcedata at the cortical surface In-Reply-To: <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> References: <347287188.845797.1456776718141.JavaMail.yahoo.ref@mail.yahoo.com> <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> Message-ID: <005f01d1739e$ec0347c0$c409d740$@artinis.com> Hi Diljit, I hope you are doing fine. Have you seen this tutorial, which explains the processing of anatomical data? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate It’s a somewhat cumbersome work including some freesurfer action. With best regards, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of D I L J I T Sent: Monday, February 29, 2016 21:12 To: fieldtrip at science.ru.nl Subject: [FieldTrip] How to plot sourcedata at the cortical surface Hi All, We have done the MEG source analysis using fieltrip. We want to plot the the source data at the surface. We want to have the individual surface. Can anyone please guide us how to prepare them(i.e. surface_white_both.mat etc). Thanks alot in advance, Warm Regards DJ Diljit Singh Kajal ------------------------------------ Ph.D Research Scholar, International Max Planck Research School, Graduate Training Centre for Neuroscience, Institute for Medical Psychology & Behavioural Neurobiology, MEG Centre, Room number 202, Otfried-Müller-Str. 47, University of Tübingen, Tübingen-72076, Germany. +49-176-88262138(M), +49-7071-2981196(O) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Mar 1 11:02:08 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 1 Mar 2016 10:02:08 +0000 Subject: [FieldTrip] How to plot sourcedata at the cortical surface In-Reply-To: <005f01d1739e$ec0347c0$c409d740$@artinis.com> References: <347287188.845797.1456776718141.JavaMail.yahoo.ref@mail.yahoo.com> <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> <005f01d1739e$ec0347c0$c409d740$@artinis.com> Message-ID: An alternative to Jorn’s suggestion would be to register the source reconstructed data to MNI space, and use the template surface for visualisation. Best, Jan-Mathijs On 01 Mar 2016, at 10:44, Jörn M. Horschig > wrote: Hi Diljit, I hope you are doing fine. Have you seen this tutorial, which explains the processing of anatomical data? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate It’s a somewhat cumbersome work including some freesurfer action. With best regards, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of D I L J I T Sent: Monday, February 29, 2016 21:12 To: fieldtrip at science.ru.nl Subject: [FieldTrip] How to plot sourcedata at the cortical surface Hi All, We have done the MEG source analysis using fieltrip. We want to plot the the source data at the surface. We want to have the individual surface. Can anyone please guide us how to prepare them(i.e. surface_white_both.mat etc). Thanks alot in advance, Warm Regards DJ Diljit Singh Kajal ------------------------------------ Ph.D Research Scholar, International Max Planck Research School, Graduate Training Centre for Neuroscience, Institute for Medical Psychology & Behavioural Neurobiology, MEG Centre, Room number 202, Otfried-Müller-Str. 47, University of Tübingen, Tübingen-72076, Germany. +49-176-88262138(M), +49-7071-2981196(O) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Tue Mar 1 11:51:17 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Tue, 1 Mar 2016 10:51:17 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth Message-ID: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 From stephen.politzer-ahles at ling-phil.ox.ac.uk Tue Mar 1 12:14:50 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Tue, 1 Mar 2016 11:14:50 +0000 Subject: [FieldTrip] MEG sensors statistics Message-ID: Hello Elana, This depends a lot on what statistical test you did and how your data were acquired and processed. e.g., to take the simplest example: if you simply do t-tests at each sensor and don't correct for multiple comparisons, this certainly is 'false power' (it's extremely anti-conservative: it will get a lot of false positives). However, if you use cluster-based statistics, this is less of a concern, since sensors showing related activity likely get grouped together. The fieldtrip tutorial on cluster-based permutation testing has more information. Even with that, there still are potentially related issues, for instance, if you recorded with axial gradiometers then a single dipole might show up as two clusters of sensors, whereas if you recorded with planar gradiometers (or transformed the data to the planar gradient) then a single dipole should only show up as one cluster. What you are describing in your message is also possible (it's similar to calculating global field power, which people do do), but it throws away any spatial information from the signal. Which analysis is most appropriate for you really depends on the nature of the hypotheses you want to test. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 8 > Date: Mon, 29 Feb 2016 20:20:17 +0000 > From: "Harris, Elana" > To: FieldTrip discussion list > Cc: "Shahana, Nasrin \(Nasrin Shahana\)" > Subject: [FieldTrip] MEG sensors statistics > Message-ID: > < > B622DB18EE766C4BBAA34EA95310C34C5021AA68 at MCEXMB3.chmccorp.cchmc.org> > Content-Type: text/plain; charset="utf-8" > > Dear All, > > I have the minimum, maximum and mean alpha power for each MEG sensor > (found using MEGProcessor developed by Jing Xiang, MD, PhD) for 16 > subjects, 8 of whom have a psychiatric condition and 8 are healthy > comparison subjects. > > We find statistical significance when comparing the set all of the MLF or > MRO sensors, for instance, between the groups (healthy and pathological), > however, I am wondering if this is false statistical power as all of the > sensors likely represent once source generator and not truly, multiple, > separate, non-independent recordings. Would it be best to summarize each > subject?s data with one number to represent the maximum alpha power for the > group of MLF sensors and then compare the two groups of subjects? > > I welcome your advice. > > Thank you. > > Elana > > Elana Harris, MD, PhD > Assistant Professor > Division of Child & Adolescent Psychiatry > Cincinnati Children?s Hospital Medical Center > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160229/598ee99d/attachment-0001.html > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Tue Mar 1 15:52:12 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Tue, 1 Mar 2016 09:52:12 -0500 Subject: [FieldTrip] volume conduction model Message-ID: Fieldtripers, What is the best volume conduction model that compute all sources (entire grid) that are within the brain volume? I am doing resting state analysis and wish to extract source time series for all the grids within the brain volume. I am using singleshell volume conduction model and lcmv and eloreta source models. Unfortunately, for large number of grids i.e, the source.avg.filter are empty. Please let me know if there are ways to deal with this problem. Thank you in advance. -Vasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.pedrosa at ndcn.ox.ac.uk Tue Mar 1 16:21:36 2016 From: david.pedrosa at ndcn.ox.ac.uk (David Pedrosa) Date: Tue, 1 Mar 2016 15:21:36 +0000 Subject: [FieldTrip] Question on coherence stats at sensor level Message-ID: Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Mar 1 17:06:25 2016 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 1 Mar 2016 17:06:25 +0100 Subject: [FieldTrip] volume conduction model In-Reply-To: References: Message-ID: Dear Vasan, the choice of your volume conduction model depends on the data you want to analyze. Do you use MEG or EEG? If you state, a large number of grid points are empty, do you refer to the "inside" grid points, i.e. the elements of your grid falling into the the brain volume, or do you refer to all grid points? If the latter is the case, that is the correct behavior, as grid points outside your brain volume should not contain data. Hope this helps, Julian On Tue, Mar 1, 2016 at 3:52 PM, Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com> wrote: > Fieldtripers, > > What is the best volume conduction model that compute all sources (entire > grid) that are within the brain volume? I am doing resting state analysis > and wish to extract source time series for all the grids within the brain > volume. I am using singleshell volume conduction model and lcmv and eloreta > source models. Unfortunately, for large number of grids i.e, the > source.avg.filter are empty. Please let me know if there are ways to deal > with this problem. > > Thank you in advance. > > -Vasan > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Tue Mar 1 17:20:34 2016 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Tue, 1 Mar 2016 17:20:34 +0100 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: References: Message-ID: <012d01d173d6$48b804b0$da280e10$@artinis.com> Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.Nieuwland at ed.ac.uk Tue Mar 1 21:04:08 2016 From: M.Nieuwland at ed.ac.uk (NIEUWLAND Mante) Date: Tue, 1 Mar 2016 20:04:08 +0000 Subject: [FieldTrip] colored or grey output from ft_singleplotTFR 'mask' Message-ID: Dear Fieldtrip users, With the same singleplotTFR script (see below), which masks the differenceplot of two conditions using the statistical result, I seem to get the expected color output in one dataset (1c1d.pdf) but unexpectedly grey output in another dataset (3c3d.pdf) *irrespective of how I set the z-lim*. I've also tried changing. Does anyone have an idea how this can happen? Cheers, Mante chan = {'C3'}; % channel to plot cfg = []; cfg.interactive = 'yes'; cfg.layout = 'elec_30layout.lay'; cfg.zlim = [.9 1.1]; cfg.ylim = [30 90]; cfg.xlim = [-.5 1.5]; cfg.colorbar = 'yes'; cfg.colormap = jet; cfg.renderer = 'painters'; %, 'painters', 'zbuffer',' opengl' or 'none' (default = []) cfg.channel = chan; figure; [other subplots] figure; cfg.zlim = [-.2 0.2]; % singlechan effect subplot(2, 1, 1) ft_singleplotTFR(cfg,grandavg_hi_131_132); title({''},'fontsize',15); linehandle = line([0 0], [30 90],'Color','b'); % line at zero set(linehandle, 'Color', 'k'); set(gca,'fontsize', 15); cfg.zlim = [-.2 0.2]; grandavg_hi_131_132.mask = logical(zeros(size(grandavg_hi_131_132.powspctrm))); grandavg_hi_131_132.mask(:,3:27,121:251) = statisTFR_hi_131_132.mask; cfg.maskstyle = 'saturation'; % 'saturation'; % 'outline'; % opacity cfg.maskparameter = 'mask'; subplot(2,1,2) ft_singleplotTFR(cfg,grandavg_hi_131_132); title(' ','fontsize',15); linehandle = line([0 0], [30 90],'Color','b'); set(linehandle, 'Color', 'k'); set(gca,'fontsize', 15); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1c1d.pdf Type: application/pdf Size: 15821 bytes Desc: 1c1d.pdf URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3c3d.pdf Type: application/pdf Size: 17214 bytes Desc: 3c3d.pdf URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From david.pedrosa at ndcn.ox.ac.uk Wed Mar 2 12:39:17 2016 From: david.pedrosa at ndcn.ox.ac.uk (David Pedrosa) Date: Wed, 2 Mar 2016 11:39:17 +0000 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: <012d01d173d6$48b804b0$da280e10$@artinis.com> References: , <012d01d173d6$48b804b0$da280e10$@artinis.com> Message-ID: Hi Jorn, thanks for the fast help! It was as you suggested. Now, I have a different issue someone might be able to help me with. When I do the analyses as explained, fieldtrip tells me that cluster stats are not possible as there are no labels in the data. This of course makes sense as it is coherence data with a labelcmb instead of label structure. Is there a way to do the cluster correction in fieldtrip with coherence data anyway? Or would it make more sense to take the raw fourier data into ft_freqstatistics and do the stats as desired in a custom statfun function with the corrections as wanted, e.g. similar to indepsamplesZcoh but for between subjects analyses? Best David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Jörn M. Horschig [jorn at artinis.com] Gesendet: Dienstag, 1. März 2016 16:20 An: 'FieldTrip discussion list' Betreff: Re: [FieldTrip] Question on coherence stats at sensor level Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Wed Mar 2 13:13:55 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 2 Mar 2016 12:13:55 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Message-ID: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel > On 01.03.2016, at 11:51, Hähnke, Daniel wrote: > > Dear FieldTrip users, > > I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. > However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. > > I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. > > Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. > > Does anyone know how to objectively choose the bandwidth parameter? > > Best, > > Daniel > -- > Daniel Hähnke > PhD student > > Technische Universität München > Institute of Neuroscience > Translational NeuroCognition Laboratory > Biedersteiner Straße 29, Bau 601 > 80802 Munich > Germany > > Email: daniel.haehnke at tum.de > Phone: +49 89 4140 3356 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed Mar 2 14:05:43 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 2 Mar 2016 13:05:43 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Message-ID: <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 daniel.haehnke at tum.de Wed Mar 2 15:08:24 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 2 Mar 2016 14:08:24 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> Message-ID: <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 fosco.bernasconi at gmail.com Wed Mar 2 15:29:53 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Wed, 2 Mar 2016 15:29:53 +0100 Subject: [FieldTrip] Beamformer source localization for EEG, template MRI & standard BEM Message-ID: Dear all, I'm trying to compute source localization (to eventually do some connectivity in the source space) on my EEG data, using template mri and standard bem. I have few errors: 1. When computing the leadfield: Warning: dipole lies on boundary of volume model > In forward/private/inf_medium_leadfield at 54 In forward/private/eeg_leadfieldb at 93 In ft_compute_leadfield at 442 In ft_prepare_leadfield at 222 2. I tried to discard this error, I cannot compute the source localization: Error using svd Input to SVD must not contain NaN or Inf. Error in beamformer_dics>pinv (line 643) [U,S,V] = svd(A,0); Error in beamformer_dics (line 336) filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 657) dip(i) = beamformer_dics(grid, sens, headmodel, [], squeeze(Cf(i,:,:)), optarg{:}); According to previous posts, the second error might be due to labeling of the electrodes. But the labels are ok, and I can make everything work when using the mne (by adapting the script of course) instead of beamforming. Therefore, I think the problem is more related to some of the previous steps. Here my code: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2 cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft); % read electrodes elec = ft_read_sens('/home/sv/Matlabtoolboxes/fieldtrip-20160223/template/electrode/biosemi64_1.sfp'); elec = ft_convert_units(elec,'cm'); % Load mri: mri = ft_read_mri('/home/sv/Matlabtoolboxes/fieldtrip-20160223/external/spm8/templates/T1.nii'); mri = ft_convert_units(mri,elec.unit); % Load headmodel: load('/home/sv/Matlabtoolboxes/fieldtrip-20160223//template/headmodel/standard_bem.mat'); vol = ft_convert_units(vol,elec.unit); [vol, sens] = ft_prepare_vol_sens(vol,elec); % Load sourcemodel: load('standard_sourcemodel3d8mm.mat'); % Compute LeadField cfg = []; cfg.channel = 'eeg'; cfg.elec = sens; cfg.headmodel = vol; grid = ft_prepare_leadfield(cfg,freq); % Compute Source: cfg = []; cfg.method = 'dics'; cfg.grid = grid; cfg.vol = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); any help is appreciated thanks a lot! fosco -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Wed Mar 2 17:54:28 2016 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Wed, 02 Mar 2016 11:54:28 -0500 Subject: [FieldTrip] TMS-EEG tutorial error Message-ID: <56D6D474020000DC00018FF5@MPRC.UMARYLAND.EDU> Dear all, I am trying to run the scripts on TMS-EEG tutorial (http://www.fieldtriptoolbox.org/tutorial/tms-eeg). However, when reject ICA components, it gave me an error message. Specifically, when I ran this command in Matlab: data_tms_clean_segmented = ft_rejectcomponent(cfg, comp_tms); The error message is : Error using cat Dimensions of matrices being concatenated are not consistent. Error in ft_apply_montage (line 245) tmp = cat(1, data_unused.trial{:}); Error in ft_rejectcomponent (line 184) data = ft_apply_montage(data, montage, 'keepunused', keepunused, 'feedback', cfg.feedback); It went through when I added an input data for ft_rejectcomponent like this data_tms_clean_segmented = ft_rejectcomponent(cfg, comp_tms, data_tms_segmented); Although the results I got look similar to the figures on the webpage, please let me know if there are some fundamental issues of adding the data-input. Any suggestions will be appreciated!Xiaoming -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Thu Mar 3 15:00:58 2016 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Thu, 3 Mar 2016 15:00:58 +0100 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: References: , <012d01d173d6$48b804b0$da280e10$@artinis.com> Message-ID: <012301d17555$1d578540$58068fc0$@artinis.com> Hi David, If I remember correctly you can call ft_checkdata with the key-value pair ‘cmbrepresentation’, ‘full’ if you want to switch back from data.labelcmb to data.label (or ‘sparse’ for the reverse way). Best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Wednesday, March 2, 2016 12:39 To: FieldTrip discussion list Subject: Re: [FieldTrip] Question on coherence stats at sensor level Hi Jorn, thanks for the fast help! It was as you suggested. Now, I have a different issue someone might be able to help me with. When I do the analyses as explained, fieldtrip tells me that cluster stats are not possible as there are no labels in the data. This of course makes sense as it is coherence data with a labelcmb instead of label structure. Is there a way to do the cluster correction in fieldtrip with coherence data anyway? Or would it make more sense to take the raw fourier data into ft_freqstatistics and do the stats as desired in a custom statfun function with the corrections as wanted, e.g. similar to indepsamplesZcoh but for between subjects analyses? Best David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ _____ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Jörn M. Horschig [jorn at artinis.com] Gesendet: Dienstag, 1. März 2016 16:20 An: 'FieldTrip discussion list' Betreff: Re: [FieldTrip] Question on coherence stats at sensor level Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.schreiner at psychologie.uzh.ch Thu Mar 3 21:22:29 2016 From: thomas.schreiner at psychologie.uzh.ch (thomas.schreiner at psychologie.uzh.ch) Date: Thu, 3 Mar 2016 21:22:29 +0100 Subject: [FieldTrip] open PhD position in sleep/memory research Message-ID: Hi all, please find attached a link leading to the details of an open PhD position.  The successful candidate will work on the project „Oscillatory mechanisms underlying memory retention and reactivation during sleep” under supervision of Björn Rasch at the University of Fribourg, Switzerland.  Feel free to share!  Best, Thomas --- University of Zurich Dr. Thomas Schreiner Department of Psychology Biopsychology Binzmuehlestr. 14 / Box 5 CH - 8050 Zuerich Tel. +41 44 635 7467 www.psychologie.uzh.ch thomas.schreiner at psychologie.uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.schreiner at psychologie.uzh.ch Thu Mar 3 23:00:27 2016 From: thomas.schreiner at psychologie.uzh.ch (thomas.schreiner at psychologie.uzh.ch) Date: Thu, 3 Mar 2016 23:00:27 +0100 Subject: [FieldTrip] open PhD position sleep/memory Message-ID: Hi again, here now the link concerning the sleep / memory PhD position... http://www.unifr.ch/psycho/assets/files/CogPsy/Open_PhD_Position_SleepMemory.pdf Best, Thomas --- University of Zurich Dr. Thomas Schreiner Department of Psychology Biopsychology Binzmuehlestr. 14 / Box 5 CH - 8050 Zuerich Tel. +41 44 635 7467 www.psychologie.uzh.ch thomas.schreiner at psychologie.uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 4 06:28:18 2016 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Thu, 3 Mar 2016 21:28:18 -0800 Subject: [FieldTrip] issue at interpolation after source analysis Message-ID: <56D91CF2.5080604@gmail.com> Hi everyone, I'm working with clinical MEG data for which part of the source pipeline has been conducted by someone else as part of a clinical protocol. I don't have full access to what has been done to the MRI that I'm getting, so I'm trying to put bits and pieces of code together to arrive at a source reconstruction. The rest of my pipeline is the pretty standard tutorial beamforming. I was hoping someone could help me figure out where my source analysis is going wrong by looking at this figure. On the left, the subject's headmodel seems to be fine (after warping to MNI). On the right, I'm plotting the source result without interpolating with any structural data. In the middle you see what happens when I interpolate the source with the "single_subj_T1.nii" structural image. It doesn't seem to be a matter of scaling (like mm to cm), but rather it being kinda upside down + something else? Does anyone know by looking at this whether the error emerges because of an unsuccessful interpolation or because something more fundamental is going wrong earlier on? Thanks so much, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: djijjfaf.png Type: image/png Size: 104874 bytes Desc: not available URL: From a.stolk8 at gmail.com Fri Mar 4 07:18:54 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 3 Mar 2016 22:18:54 -0800 Subject: [FieldTrip] issue at interpolation after source analysis In-Reply-To: <56D91CF2.5080604@gmail.com> References: <56D91CF2.5080604@gmail.com> Message-ID: Hey Vitoria, Hard to tell without seeing any code, but my hunch is that the plot on the left is subject space whereas the middle is subject spaced data plotted in MNI space. If the sourcemodel/grid on the left is truly MNI-aligned (but the regular spacing suggests otherwise) than it may be an instance of forgetting to copy over the dim and pos fields from the MNI template to the subject mri structure. You can check whether this is case by comparing the dim and pos fields of the template with those of the subject. They should be the same (after alignment). Hopefully that solves it. Otherwise you'd probably need to provide some code. Arjen 2016-03-03 21:28 GMT-08:00 Vitória Piai : > Hi everyone, > > I'm working with clinical MEG data for which part of the source pipeline > has been conducted by someone else as part of a clinical protocol. I don't > have full access to what has been done to the MRI that I'm getting, so I'm > trying to put bits and pieces of code together to arrive at a source > reconstruction. The rest of my pipeline is the pretty standard tutorial > beamforming. > > I was hoping someone could help me figure out where my source analysis is > going wrong by looking at this figure. On the left, the subject's headmodel > seems to be fine (after warping to MNI). On the right, I'm plotting the > source result without interpolating with any structural data. In the middle > you see what happens when I interpolate the source with the > "single_subj_T1.nii" structural image. > It doesn't seem to be a matter of scaling (like mm to cm), but rather it > being kinda upside down + something else? Does anyone know by looking at > this whether the error emerges because of an unsuccessful interpolation or > because something more fundamental is going wrong earlier on? > > Thanks so much, > Vitoria > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: djijjfaf.png Type: image/png Size: 104874 bytes Desc: not available URL: From andrea.brovelli at univ-amu.fr Fri Mar 4 09:21:18 2016 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Fri, 4 Mar 2016 09:21:18 +0100 Subject: [FieldTrip] Brain Connectivity Workshop 2016 Message-ID: <56D9457E.2000500@univ-amu.fr> Dear all, I thought it may interest some people from the list. Andrea -------------------------------------------------------------------------------------------------------------- ** *Brain Connectivity Workshop 2016, Marseille (France)* Registration is open now! (reduced rates until March 30^th ) When: 22nd to 24th June, 2016 Link to official website: http://bcw2016.org We are happy to announce the 15th edition of the *Brain Connectivity Workshop* (BCW) to take place in Marseille from the 22nd to the 24th of June 2016. The Brain Connectivity Workshop (BCW) is a well-established workshop series, which has been held annually in Europe, USA, Australia and Asia for the last 14 years. BCW is an official satellite of the annual meeting of OHBM, which is held in Geneva, Switzerland in 2016. BCW attracts every year a public of 100-200 participants working in cognitive, computational and clinical neurosciences. The discussions are centered on all themes around brain connectivity including structural and functional imaging, modeling, brain function and clinics. BCW is highly influential in the field due to the traditionally high quality of speakers and a long track record of innovation. For instance, both, the Connectome and The Virtual Brain have been born within the BCW community. The typical BCW format —a first educational day of lectures held by international authorities in their fields, followed by two days of shorter talks with ample time for discussion provides a unique forum for creativity, controversy and brainstorming. BCW 2016, introduced by a first day of tutorials by experts in their field, will feature focused sessions on themes such as perturbing the brain, mapping the brain, and brain dynamics in function (cognition) and dysfunction (epilepsy). *NB: Please note that European Cup of Football will be held in France during this period and hotels are going to be booked fast! * Confirmed educational lecturers (day 1) and workshop speakers (days 2-3) include: • Fabrice Bartolomei (Aix-Marseille University, Marseille, France) • Michael Breakspear (QIMR, Brisbane, Australia) • Vince Calhoun (University Of New Mexico, Albuquerque, NM) • Karl Friston (UCL, London, UK) • Jorge Gonzalez-Martinez (Cleveland Clinic, Cleveland, OH) • Marc Goodfellow (University of Exeter, Exeter, UK) • Charles Gray (Montana State University, Bozeman, MT) • Claudius Gros (Goethe University, Frankfurt am Main, Germany) • Sean Hill (EPFL, Lausanne, Switzerland) • Martin Hoffman-Apitius (Fraunhofer Institute SCAI, St Augustin, Germany) • Esther Krook-Magnuson (University of Minnesota, Minneapolis, MN) • Pierre Luppi (Lyon Neuroscience Research Center, Lyon, France) • Randy McIntosh (Baycrest Research Center, Toronto, ON) • Lionel Naccache (ICM, Paris, France) • Ivan Soltesz (UC Irvine, CA) • Olaf Sporns (Indiana University, Bloomington, IN) • William Stacey (University of Michigan, Ann Arbor, MI) • Gregor Thut (University of Glasgow, Glasgow, UK) • Stephan Van Gils (University of Twente, Ae Enschede, The Netherlands) • Michael Wibral (Goethe University, Frankfurt am Main, Germany) A special evening lecture will be delivered by Patrick Chauvel (Aix-Marseille University, Marseille, France). A detailed program is coming soon. Organizing committee Viktor Jirsa, Chair (INS, Aix-Marseille University, UMR 1106 INSERM) Demian Battaglia, Christian Bénar, Mireille Bonnard, Monique Esclapez (INS, Aix-Marseille University) Andrea Brovelli (INT, Aix-Marseille University), Maxime Guye (CRMBM, Aix-Marseille University, UMR 7339 CNRS & APHM) Ingo Bojak (University of Reading, UK). An event sponsored by: University Aix-Marseille, Brain Products, Bionics, Springer EPJ Nonlinear Biomedical Physics Journal, Codebox, Institute of System Neuroscience Inserm, Institute of Neuroscience Timone, Center for Magnetic Resonance in Biology and Medicine, Mediterranean Society of Neuroscience (IBRO member) -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 4 17:09:01 2016 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Fri, 4 Mar 2016 08:09:01 -0800 Subject: [FieldTrip] issue at interpolation after source analysis In-Reply-To: References: <56D91CF2.5080604@gmail.com> Message-ID: <56D9B31D.8060003@gmail.com> Thanks, Arjen! I know for sure dim and pos fields are the same as in the template because I do copy them from the template grid. So I'll try going back to make sure the alignment is really happening. If I can't figure it out, I'll post some code with it. Cheers, Vitoria On 3/3/2016 10:18 PM, Arjen Stolk wrote: > Hey Vitoria, > > Hard to tell without seeing any code, but my hunch is that the plot on > the left is subject space whereas the middle is subject spaced data > plotted in MNI space. If the sourcemodel/grid on the left is truly > MNI-aligned (but the regular spacing suggests otherwise) than it may > be an instance of forgetting to copy over the dim and pos fields from > the MNI template to the subject mri structure. You can check whether > this is case by comparing the dim and pos fields of the template with > those of the subject. They should be the same (after alignment). > > Hopefully that solves it. Otherwise you'd probably need to provide > some code. > Arjen > > 2016-03-03 21:28 GMT-08:00 Vitória Piai >: > > Hi everyone, > > I'm working with clinical MEG data for which part of the source > pipeline has been conducted by someone else as part of a clinical > protocol. I don't have full access to what has been done to the > MRI that I'm getting, so I'm trying to put bits and pieces of code > together to arrive at a source reconstruction. The rest of my > pipeline is the pretty standard tutorial beamforming. > > I was hoping someone could help me figure out where my source > analysis is going wrong by looking at this figure. On the left, > the subject's headmodel seems to be fine (after warping to MNI). > On the right, I'm plotting the source result without interpolating > with any structural data. In the middle you see what happens when > I interpolate the source with the "single_subj_T1.nii" structural > image. > It doesn't seem to be a matter of scaling (like mm to cm), but > rather it being kinda upside down + something else? Does anyone > know by looking at this whether the error emerges because of an > unsuccessful interpolation or because something more fundamental > is going wrong earlier on? > > Thanks so much, > Vitoria > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 104874 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Mon Mar 7 10:02:03 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 7 Mar 2016 09:02:03 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> Message-ID: <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 bushra.riaz at gu.se Mon Mar 7 10:18:21 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Mon, 7 Mar 2016 09:18:21 +0000 Subject: [FieldTrip] EEG position information not read properly from fif file Message-ID: <1457342301486.91257@gu.se> Hello, I am reading fif files with only EEG data (no MEG data)in fieldtrip . When my sensor locations are more than 60 than the positions in the elec.elecpos are not written Digging a bit deeper into this showed me that in mne2grad.m file line number 420 ( fieldtrip-20160306?) is the cause of the problem kChan = 0; for n = chn_eeg kChan = kChan+1; if nEEG<=60 % this if condition is the reason position was not written properly elec.elecpos(kChan,1:3) = orig.chs(n).eeg_loc(1:3); else if kChan<=numel(dig_eeg) elec.elecpos(kChan,1:3) = orig.dig(dig_eeg(kChan)).r; else ft_warning('not all EEG channel positions have been digitized'); elec.elecpos(kChan,1:3) = nan; end end elec.label{kChan} = deblank(orig.ch_names{n}); end I haven't read the whole source code for mne2grad.m to understand why this condition is important and why the limit is of 60 channels. I am solving my problem by changing this condition, I hope this will not effect rest of my processing Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Mon Mar 7 10:51:34 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Mon, 7 Mar 2016 17:51:34 +0800 Subject: [FieldTrip] common filter with more than two conditions Message-ID: Dear community, I'm trying to do lcmv beamformer source analysis with a common filter for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I am interested in both the main effect of A (A1 vs. A2) as well as the simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). My question is how to build the common filter. I could combine all the four conditions to obtain a common filter for the contrast of A1 vs. A2. Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I have to build a different common filter (to combine the A1B1 and A2B1 conditions) for the contrast of A1B1 vs. A2B1? Thanks for your help in advance! Best, Lin -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Mon Mar 7 13:04:00 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Mon, 7 Mar 2016 12:04:00 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Jan-Mathijs, thanks for sharing your thoughts about problems with using non-equidistant frequency bins. Also thanks for pointing out the possible problems in Granger causality. I actually computed the GC using non-parametric factorization and equidistant frequency bins, since the code gives an error if you don’t. As I wrote, these values from equidistant frequency bins look pretty similar to those PSI values from non-equidistant frequency bins. Best, Daniel On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Mon Mar 7 17:09:18 2016 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Mon, 7 Mar 2016 17:09:18 +0100 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Daniel and Jan-Mathis, since I also have tried to play around with PSI, I have an additional issue regarding the frequency bandwidth configuration. I found that with using linear equidistant frequency bins, the low frequency oscillation has narrower bandwidth compared to high frequencies. So if I took 5 Hz frequency bandwidth and compute the PSI to check the low frequency (i.e alpha) coupling direction, low frequency coupling may not have sufficient neighboring frequencies. In some cases PSI could also mixed up both the positive and negative phase slope, then the summation result from n-frequency bins can be spuriously positive or negative. Regarding the mixing of slope information, possibly this is one of methodological disadvantage. But for fairer frequency slope summation, I also have the same thought whether the logarithmic frequency step might be more proper in computing PSI.. Please someone correct me if I am wrong in interpreting these, I am trying to figure out how FieldTrip's PSI works. Thanks! Best, Sandhy ----------- Prasandhya A. Yusuf PhD student *Medizinische Hochschule Hannover* VIANNA - Institute of AudioNeuroTechnology On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel wrote: > Hi Jan-Mathijs, > > thanks for sharing your thoughts about problems with using non-equidistant > frequency bins. > > Also thanks for pointing out the possible problems in Granger causality. I > actually computed the GC using non-parametric factorization and equidistant > frequency bins, since the code gives an error if you don’t. As I wrote, > these values from equidistant frequency bins look pretty similar to those > PSI values from non-equidistant frequency bins. > > Best, > > Daniel > > > On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Daniel, > > I am not an expert on PSI theory either, and here I would like to stay on > the safe side. Even if it may be possible to vary the number of integration > bins across frequencies, and include some normalisation step on top if it, > I think it is very tricky, and rather won’t support this. The normalisation > is probably quite arbitrary, because it could also involve some > extrapolation of the underlying coherence spectrum. Also, using non > equidistant frequency spacing increases the risk of the user having > specified frequency specific smoothing, which further complicates > integration of phase and coherence estimates across neighbouring frequency > bins. Long story short, I will build in an explicit check about > equidistance of frequency bins in ft_connectivityanalysis, to return an > explicit error if this is not the case. This update will be a general clean > up of the psi functionality, which also will include better error handling > if the user happens to forget the bandwidth argument in the cfg. This will > address bug 3084 on bugzilla.fieldtriptoolbox.org. > > While I am at it, you mentioned that your psi results look very much like > the Granger you have computed. I am not sure how you have computed the > Granger causality, but (if you have used non parametric factorisation of > the cod matrix to get your spectral transfer matrices) it may be relevant > to know that it is incorrect to compute it from freq data with > non-equidistant frequency bins. The non-parametric spectral factorisation > code assumes the data to be represented on equidistant frequency bins. > > Best, > Jan-Mathijs > > > > On 02 Mar 2016, at 15:08, Hähnke, Daniel wrote: > > Hi Jan-Mathijs, > > never underestimate the creativity of scientists ;) > > Why do you think I can’t expect meaningful results from using > logarithmically spaced frequency bins? At least when comparing my Granger > results with the PSI values, they look pretty similar. > I know that the phase slope is dependent on the step size between > frequencies, so I could miss or aberrantly pick up non-monotonicity in the > phase slope if I use non-equidistant bins. > But if I assume that the slope changes monotonically across frequencies > (which, if I’m not mistaken, is also assumed for equidistant frequency > bins), a normalization by the bandwidth should be possible. > > Please correct me if I’m wrong. I’m obviously no expert in PSI theory and > would be glad to learn more. > > Best, > > Daniel > > On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Daniel > I have never in my life considered that people would be so creative as to > expect meaningful results when inputting the function with logarithmically > spaced frequency bins. I should have known better, but I would be strongly > in favour of checking for equidistant frequency bins, and if not: throw an > error*. *I am opposed to using ‘bins’ as a unit, because FieldTrip should > work wherever possible with physical units, rather than with unit-less > units. > > Best, > Jan-Mathijs > > > On 02 Mar 2016, at 13:13, Hähnke, Daniel wrote: > > Hi all, > > since only a few people seem to be using the PSI, I went into the code to > see what it actually does. I would like to point out that there are some > issues with the current implementation if you’re using logarithmically > spaced frequency axes. > > The parameter cfg.bandwidth (in Hz) is used to calculate the number of > frequency bins that is used to calculate the PSI. This calculation, > however, is only done once using the frequency from the lowest frequency > bin. If the chosen bandwidth is not an integer multiple of a frequency bin > step, this computation leads to a changed bandwidth. > If your frequency axis is not evenly spaced this leads to various > bandwidths across the frequency axis, since the code only uses a fixed > number of frequency bins across which to compute the PSI. > > I think it would be useful to change the cfg.bandwidth input from Hz to > number of bins. Also, people should be aware of the fact that the PSI value > is correlated with the bandwidth. So, if you use a logarithmically spaced > frequency axis, you should normalize your PSI values by the bandwidth > corresponding to each frequency bin. > > Best, > > Daniel > > On 01.03.2016, at 11:51, Hähnke, Daniel wrote: > > Dear FieldTrip users, > > I currently want to double-check the results I got from a non-parametric > Granger-causality analysis with another measure of directed communication, > phase slope index. > However, after having read Nolte et al.’s paper from 2008 that introduced > the PSI, I still don’t understand how to best choose the parameter > cfg.bandwidth. > > I tried out different values and got something qualitatively very similar > to my Granger results. But this is rather fitting the parameter to the > Granger results and kind of undermines my purpose of double-checking. > > Furthermore, I am using a logarithmic (to base 2) frequency axis. > Consequently, my frequency bins are not evenly spaced. I have the feeling > that I would rather need different bandwidths for the individual frequency > bins. > > Does anyone know how to objectively choose the bandwidth parameter? > > Best, > > Daniel > -- > Daniel Hähnke > PhD student > > Technische Universität München > Institute of Neuroscience > Translational NeuroCognition Laboratory > Biedersteiner Straße 29, Bau 601 > 80802 Munich > Germany > > Email: daniel.haehnke at tum.de > Phone: +49 89 4140 3356 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Mar 7 17:19:14 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 7 Mar 2016 08:19:14 -0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hey Lin, Provided that there are no systematic confounds (e.g. head position) across conditions, you could construct a common filter based on data from all conditions. I would leave any statistical comparison to after source-reconstruction. Does that answer your question? Arjen 2016-03-07 1:51 GMT-08:00 Lin Wang : > Dear community, > > I'm trying to do lcmv beamformer source analysis with a common filter for > more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I > am interested in both the main effect of A (A1 vs. A2) as well as the > simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). > > My question is how to build the common filter. I could combine all the > four conditions to obtain a common filter for the contrast of A1 vs. A2. > Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I > have to build a different common filter (to combine the A1B1 and A2B1 > conditions) for the contrast of A1B1 vs. A2B1? > > Thanks for your help in advance! > > Best, > Lin > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at nbt-analytics.com Mon Mar 7 18:03:01 2016 From: poil.simonshlomo at nbt-analytics.com (Simon-Shlomo Poil) Date: Mon, 7 Mar 2016 18:03:01 +0100 Subject: [FieldTrip] NBT Analytics is looking for a lead programmer Message-ID: Dear all, NBT Analytics is looking for a lead programmer. This Amsterdam based startup focuses on offering comprehensive EEG analyses for clinical trials, with the aim of improving drug development for CNS disorders. Get in touch if interested! Please read more here: http://www.nbt-analytics.com/#career Best regards, -- Dr. Simon-Shlomo Poil Co-founder / Chief Technology Officer NBT Analytics BV Amsterdam Health and Technology Center Paasheuvelweg 25 1105BP Amsterdam The Netherlands Website: https://www.nbt-analytics.com -- NBT Analytics BV http://www.nbt-analytics.com IMPORTANT: This message and any attachments are intended for the individual or entity named above. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, you must not read, copy, use or disclose this communication to others; also please notify the sender by replying to this message, and then delete it from your system. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logosmall.png Type: image/png Size: 2855 bytes Desc: not available URL: From fosco.bernasconi at gmail.com Mon Mar 7 18:10:19 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Mon, 7 Mar 2016 18:10:19 +0100 Subject: [FieldTrip] Use precomputed common filter problem Message-ID: Dear community, I'm computing the beamformer filters based on the entire eeg data (based on templates headmodel). But when I use the precomputed common filter to calculate the sources for each condition independently I have the following error: Subselecting/reordering the channels in the precomputed filters Bad cell reference operation. Error in ft_sourceanalysis (line 510) grid.filter{k} = grid.filter{k}(:, i2); Here my code: cfg = []; cfg.method = 'pcc'; cfg.channel = sens.label; cfg.grid = grid; cfg.vol = vol; cfg.grid.filter = source.avg.filter; source_C1 = ft_sourceanalysis(cfg,freq{isub,1}); -------------- next part -------------- An HTML attachment was scrubbed... URL: From vic.schroeder2 at gmail.com Mon Mar 7 21:47:07 2016 From: vic.schroeder2 at gmail.com (victoria schroeder) Date: Mon, 7 Mar 2016 20:47:07 +0000 Subject: [FieldTrip] ft_combineplanar after ft_channelrepair Message-ID: Hey Fieldtrip users, I am working with neuromag data 306 channels. I would like to interpolate channels using ft_channelrepair. Afterwards it would be good to combine the gradiometers to create planar gradients. However, unfortunately i get an error message when trying to use ft_combineplanar when i have used ft_channelrepair. Without using ft_channelrepair things work well. Can these two functions not be used on the same data? (See the code and the error message below) Thank you a lot Victoria %prepare neighbours cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'neuromag306all.lay'; neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig); % Interpolate and put into new data structure cfg = []; cfg.badchannel = { 'MEG1122', 'MEG1312','MEG1411'}; cfg.layout = 'neuromag306all.lay'; cfg.method = 'nearest'; cfg.neighbours = neighbours; Chan_clean = ft_channelrepair(cfg,data_orig); data=Chan_clean; %time frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'MEGGRAD'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [2:2:30]; cfg.toi = [-1.3:0.05:1]; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.keeptrials = 'yes'; cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128); freq = ft_freqanalysis(cfg, data); %time frequency baselined cfg=[]; cfg.baseline = [-0.5 0]; cfg.baselinetype = 'absolute'; Base = ft_freqbaseline(cfg, freq); %Combine planar Comb = ft_combineplanar([],Base); Error! Reference to non-existent field 'chanori'. Error in ft_combineplanar (line 293) newgrad.chanori = data.grad.chanori(sel,:); -------------- next part -------------- An HTML attachment was scrubbed... URL: From changa5 at mcmaster.ca Mon Mar 7 22:41:52 2016 From: changa5 at mcmaster.ca (Andrew Chang) Date: Mon, 7 Mar 2016 16:41:52 -0500 Subject: [FieldTrip] naive questions about resampling and ICA Message-ID: Dear all, I am very new to this toolbox, and still trying to figure out how to prepare my data for analyzing it in Fieldtrip. I am following the tutorial of this document ( http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts), and trying to adapt it to my own data. I got two problems, one is about resampling and another is about running ICA. Here is my script: cfg2 = []; cfg2.dataset = 'data\Andrew_EEG_continous1224\SS_CC_1.raw'; cfg2.trialdef.eventtype = 'trigger'; cfg2 = ft_definetrial(cfg2); cfg2.channel = 'EEG'; cfg2.continuous = 'yes'; data2 = ft_preprocessing(cfg2); The above part seems working, although I am not sure the information in the cfg2 or data2 was sufficient for subsequent analyses. Here is the printscreen of these 2 objects: [image: Inline image 1] Then run the resampling % downsample the data to speed up the next step cfg2 = []; cfg2.resamplefs = 300; cfg2.detrend = 'no'; data2 = ft_resampledata(cfg2, data2); I got the error message if the 'resamplefs' does not equal to 500, but 500 Hz was my original sampling rate: Matrix dimensions must agree. Error in ft_resampledata (line 226) data.trial{itr} = data.trial{itr} + bsl(:,ones(1,numel(data.time{itr}))); Skipping the resampling and run the ICA directly: % perform the independent component analysis (i.e., decompose the data) cfg2 = []; cfg2.method = 'runica'; % this is the default and uses the implementation from EEGLAB comp = ft_componentanalysis(cfg2,data2); Here is what MATLAB returns: the input is raw data with 257 channels and 203 trials the call to "ft_selectdata" took 0 seconds baseline correcting data no scaling applied, since factor is 0 concatenating data............... concatenated data matrix size 257x203 starting decomposition using runica runica(): data length (203) < data channels (257)! Output argument "sphere" (and maybe others) not assigned during call to "runica". Error in ft_componentanalysis (line 488) [weights, sphere] = runica(dat, optarg{:}); Some additional information: I am using MATLAB 2015b with Fieldtrip version 20160304 Any help is much appreciated! Thank you all Best, Andrew -- Andrew Chang Ph.D. Candidate Auditory Development Lab Department of Psychology, Neuroscience & Behaviour McMaster University http://changa5.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 144915 bytes Desc: not available URL: From murphyk5 at aston.ac.uk Mon Mar 7 22:56:10 2016 From: murphyk5 at aston.ac.uk (Murphy, Kelly (Research Student)) Date: Mon, 7 Mar 2016 21:56:10 +0000 Subject: [FieldTrip] ft_combineplanar after ft_channelrepair In-Reply-To: References: Message-ID: Hi Victoria, I don’t know if this will address your problem; but I think it might depend on the order of your pipeline because if you use PCA at any point before interpolating, you will be reducing the dimensionality of your data; and interpolation (and presumably combining gradiometers) relies on the data from neighbouring channels to be linearly related. In my pipeline, I’ve visually rejected trials and channels, then run ICA, then interpolated; I don’t know if that would address your issues? Hope you get it sorted Kelly From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of victoria schroeder Sent: 07 March 2016 20:47 To: FieldTrip discussion list Subject: [FieldTrip] ft_combineplanar after ft_channelrepair Hey Fieldtrip users, I am working with neuromag data 306 channels. I would like to interpolate channels using ft_channelrepair. Afterwards it would be good to combine the gradiometers to create planar gradients. However, unfortunately i get an error message when trying to use ft_combineplanar when i have used ft_channelrepair. Without using ft_channelrepair things work well. Can these two functions not be used on the same data? (See the code and the error message below) Thank you a lot Victoria %prepare neighbours cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'neuromag306all.lay'; neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig); % Interpolate and put into new data structure cfg = []; cfg.badchannel = { 'MEG1122', 'MEG1312','MEG1411'}; cfg.layout = 'neuromag306all.lay'; cfg.method = 'nearest'; cfg.neighbours = neighbours; Chan_clean = ft_channelrepair(cfg,data_orig); data=Chan_clean; %time frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'MEGGRAD'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [2:2:30]; cfg.toi = [-1.3:0.05:1]; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.keeptrials = 'yes'; cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128); freq = ft_freqanalysis(cfg, data); %time frequency baselined cfg=[]; cfg.baseline = [-0.5 0]; cfg.baselinetype = 'absolute'; Base = ft_freqbaseline(cfg, freq); %Combine planar Comb = ft_combineplanar([],Base); Error! Reference to non-existent field 'chanori'. Error in ft_combineplanar (line 293) newgrad.chanori = data.grad.chanori(sel,:); -------------- next part -------------- An HTML attachment was scrubbed... URL: From changa5 at mcmaster.ca Mon Mar 7 23:28:04 2016 From: changa5 at mcmaster.ca (Andrew Chang) Date: Mon, 7 Mar 2016 17:28:04 -0500 Subject: [FieldTrip] "not enough input" probelm in ft_artifact_zvalue tutorial code Message-ID: Dear all, Sorry for asking another naive question. I am following the tutorial code of this: http://www.fieldtriptoolbox.org/tutorial/automatic_artifact_rejection I used the ArtifactMEG.ds data, which is used in tutorial, and used the exact same code. However, I am unable to run the ft_artifact_zvalue function. I am running this code on MATLAB2015b with fieldtrip version 20160304. I got the same problem even I changed the MATLAB version into 2013a. I am really confused since I am running the exact same code as tutorial, but I got many warnings and MATLAB returned error too. Here is the script: cfg = []; cfg.dataset = 'ArtifactMEG.ds'; cfg.headerformat = 'ctf_ds'; cfg.dataformat = 'ctf_ds'; cfg.trialdef.eventtype = 'trial'; cfg = ft_definetrial(cfg); trl = cfg.trl(1:50,:); %% jump cfg = []; cfg.trl = trl; cfg.datafile = 'ArtifactMEG.ds'; cfg.headerfile = 'ArtifactMEG.ds'; cfg.continuous = 'yes'; % channel selection, cutoff and padding cfg.artfctdef.zvalue.channel = 'MEG'; cfg.artfctdef.zvalue.cutoff = 20; cfg.artfctdef.zvalue.trlpadding = 0; cfg.artfctdef.zvalue.artpadding = 0; cfg.artfctdef.zvalue.fltpadding = 0; % algorithmic parameters cfg.artfctdef.zvalue.cumulative = 'yes'; cfg.artfctdef.zvalue.medianfilter = 'yes'; cfg.artfctdef.zvalue.medianfiltord = 9; cfg.artfctdef.zvalue.absdiff = 'yes'; % make the process interactive cfg.artfctdef.zvalue.interactive = 'yes'; [cfg, artifact_jump] = ft_artifact_zvalue(cfg); Here are what MATLAB return to me: Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial (line 138) evaluating trialfunction 'ft_trialfun_general' getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_trialfun_general (line 78) In ft_definetrial (line 177) reading the events from 'ArtifactMEG.ds\ArtifactMEG.res4' getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_read_event (line 511) In ft_trialfun_general (line 86) In ft_definetrial (line 177) found 76 events created 76 trials the call to "ft_definetrial" took 1 seconds ans = [] getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_artifact_zvalue (line 195) searching for artifacts in 139 channels searching in trial 50 from 50 Not enough input arguments. Error in ft_artifact_zvalue (line 481) opt.data = data; Any comments are appreciated! Thank you all! Best, Andrew -- Andrew Chang Ph.D. Candidate Auditory Development Lab Department of Psychology, Neuroscience & Behaviour McMaster University http://changa5.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Tue Mar 8 01:16:27 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Tue, 8 Mar 2016 08:16:27 +0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hi Arjen, Yes, it answers my question. Thank! :-) Then a further question is: is it better to include as many trials as possible to have a good estimation of the covariance matrix (provided that the signals are good for all trials)? For example, there are two experimental conditions, with 20 trials per condition. There are also 40 filler trials with a similar structure as the experimental conditions. In this case, can I combine all the conditions to build the common filter and then only compare the two experimental conditions later? The cognitive processes might be different between the experimental conditions and the fillers, so I'm not sure whether combining them has any influence on the spatial filter. Best, Lin On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: > Hey Lin, > > Provided that there are no systematic confounds (e.g. head position) > across conditions, you could construct a common filter based on data from > all conditions. I would leave any statistical comparison to after > source-reconstruction. > > Does that answer your question? > Arjen > > 2016-03-07 1:51 GMT-08:00 Lin Wang : > >> Dear community, >> >> I'm trying to do lcmv beamformer source analysis with a common filter for >> more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I >> am interested in both the main effect of A (A1 vs. A2) as well as the >> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >> >> My question is how to build the common filter. I could combine all the >> four conditions to obtain a common filter for the contrast of A1 vs. A2. >> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >> have to build a different common filter (to combine the A1B1 and A2B1 >> conditions) for the contrast of A1B1 vs. A2B1? >> >> Thanks for your help in advance! >> >> Best, >> Lin >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Mar 8 01:28:11 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 7 Mar 2016 16:28:11 -0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hey Lin, Overall the more data (i.e. covariance matrices) the spatial filter is constructed from the better it'll be able to describe the spatiotemporal patterns present in the data (cf. ERPs, being smoother with more averaging). The latter indeed may be condition-specific, and since I do not know anything about your conditions, I'll refrain from having an opinion there. :) Arjen 2016-03-07 16:16 GMT-08:00 Lin Wang : > Hi Arjen, > > Yes, it answers my question. Thank! :-) > > Then a further question is: is it better to include as many trials as > possible to have a good estimation of the covariance matrix (provided that > the signals are good for all trials)? > > For example, there are two experimental conditions, with 20 trials per > condition. There are also 40 filler trials with a similar structure as the > experimental conditions. In this case, can I combine all the conditions to > build the common filter and then only compare the two experimental > conditions later? > > The cognitive processes might be different between the experimental > conditions and the fillers, so I'm not sure whether combining them has any > influence on the spatial filter. > > Best, > Lin > > On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: > >> Hey Lin, >> >> Provided that there are no systematic confounds (e.g. head position) >> across conditions, you could construct a common filter based on data from >> all conditions. I would leave any statistical comparison to after >> source-reconstruction. >> >> Does that answer your question? >> Arjen >> >> 2016-03-07 1:51 GMT-08:00 Lin Wang : >> >>> Dear community, >>> >>> I'm trying to do lcmv beamformer source analysis with a common filter >>> for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and >>> I am interested in both the main effect of A (A1 vs. A2) as well as the >>> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >>> >>> My question is how to build the common filter. I could combine all the >>> four conditions to obtain a common filter for the contrast of A1 vs. A2. >>> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >>> have to build a different common filter (to combine the A1B1 and A2B1 >>> conditions) for the contrast of A1B1 vs. A2B1? >>> >>> Thanks for your help in advance! >>> >>> Best, >>> Lin >>> >>> >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 wanglinsisi at gmail.com Tue Mar 8 07:16:15 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Tue, 8 Mar 2016 14:16:15 +0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hi Arjen, Thanks for your help. :-) Best, Lin On Tue, Mar 8, 2016 at 8:28 AM, Arjen Stolk wrote: > Hey Lin, > > Overall the more data (i.e. covariance matrices) the spatial filter is > constructed from the better it'll be able to describe the spatiotemporal > patterns present in the data (cf. ERPs, being smoother with more > averaging). The latter indeed may be condition-specific, and since I do not > know anything about your conditions, I'll refrain from having an opinion > there. :) > > Arjen > > 2016-03-07 16:16 GMT-08:00 Lin Wang : > >> Hi Arjen, >> >> Yes, it answers my question. Thank! :-) >> >> Then a further question is: is it better to include as many trials as >> possible to have a good estimation of the covariance matrix (provided that >> the signals are good for all trials)? >> >> For example, there are two experimental conditions, with 20 trials per >> condition. There are also 40 filler trials with a similar structure as the >> experimental conditions. In this case, can I combine all the conditions to >> build the common filter and then only compare the two experimental >> conditions later? >> >> The cognitive processes might be different between the experimental >> conditions and the fillers, so I'm not sure whether combining them has any >> influence on the spatial filter. >> >> Best, >> Lin >> >> On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: >> >>> Hey Lin, >>> >>> Provided that there are no systematic confounds (e.g. head position) >>> across conditions, you could construct a common filter based on data from >>> all conditions. I would leave any statistical comparison to after >>> source-reconstruction. >>> >>> Does that answer your question? >>> Arjen >>> >>> 2016-03-07 1:51 GMT-08:00 Lin Wang : >>> >>>> Dear community, >>>> >>>> I'm trying to do lcmv beamformer source analysis with a common filter >>>> for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and >>>> I am interested in both the main effect of A (A1 vs. A2) as well as the >>>> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >>>> >>>> My question is how to build the common filter. I could combine all the >>>> four conditions to obtain a common filter for the contrast of A1 vs. A2. >>>> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >>>> have to build a different common filter (to combine the A1B1 and A2B1 >>>> conditions) for the contrast of A1B1 vs. A2B1? >>>> >>>> Thanks for your help in advance! >>>> >>>> Best, >>>> Lin >>>> >>>> >>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 daniel.haehnke at tum.de Tue Mar 8 10:57:26 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Tue, 8 Mar 2016 09:57:26 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Sandhy, that’s interesting. Can you describe how you found out about the bandwidth being narrower for lower frequencies? When I read the code, I had the impression that the bandwidth parameter is used once to calculate one bandwidth parameter in frequency bins that is subsequently used for the whole spectrum. Best, Daniel On 07.03.2016, at 17:09, Prasandhya Astagiri Yusuf > wrote: Hi Daniel and Jan-Mathis, since I also have tried to play around with PSI, I have an additional issue regarding the frequency bandwidth configuration. I found that with using linear equidistant frequency bins, the low frequency oscillation has narrower bandwidth compared to high frequencies. So if I took 5 Hz frequency bandwidth and compute the PSI to check the low frequency (i.e alpha) coupling direction, low frequency coupling may not have sufficient neighboring frequencies. In some cases PSI could also mixed up both the positive and negative phase slope, then the summation result from n-frequency bins can be spuriously positive or negative. Regarding the mixing of slope information, possibly this is one of methodological disadvantage. But for fairer frequency slope summation, I also have the same thought whether the logarithmic frequency step might be more proper in computing PSI.. Please someone correct me if I am wrong in interpreting these, I am trying to figure out how FieldTrip's PSI works. Thanks! Best, Sandhy ----------- Prasandhya A. Yusuf PhD student Medizinische Hochschule Hannover VIANNA - Institute of AudioNeuroTechnology On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel > wrote: Hi Jan-Mathijs, thanks for sharing your thoughts about problems with using non-equidistant frequency bins. Also thanks for pointing out the possible problems in Granger causality. I actually computed the GC using non-parametric factorization and equidistant frequency bins, since the code gives an error if you don’t. As I wrote, these values from equidistant frequency bins look pretty similar to those PSI values from non-equidistant frequency bins. Best, Daniel On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eva.patai at psych.ox.ac.uk Tue Mar 8 18:05:21 2016 From: eva.patai at psych.ox.ac.uk (Zita Eva Patai) Date: Tue, 8 Mar 2016 17:05:21 +0000 Subject: [FieldTrip] ft_definetrial using data structure in workspace In-Reply-To: References: Message-ID: Dear FT-ers I would like to epoch my data, but as it is in a format not supported by Fieldtrip (.xdf), I used Eeglab to convert it, and then converted between Eeglab and FT with the eeg2fieldtrip function. Now i have a FT data structure. The data structure looks fine, but it seems that to use ft_definetrial, i need to specify a path to a file to be processed. Is there any way to change this so i can use something in the workspace? Many thanks On Tue, Mar 8, 2016 at 4:57 PM, Zita Eva Patai wrote: > Dear FT-ers > > I would like to epoch my data, but as it is in a format not supported by > Fieldtrip (.xdf), I used Eeglab to convert it, and then converted between > Eeglab and FT with the eeg2fieldtrip function. Now i have a FT data > structure. > > The data structure looks fine, but it seems that to use ft_definetrial, i > need to specify a path to a file to be processed. Is there any way to > change this so i can use something in the workspace? > > Many thanks > zita > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzuchenlung at gmail.com Wed Mar 9 04:34:59 2016 From: tzuchenlung at gmail.com (Jane Lung) Date: Wed, 9 Mar 2016 11:34:59 +0800 Subject: [FieldTrip] question about head model preparing Message-ID: Dear all, I am currently explore how to do the source reconstruction, my data come from Yokogawa160, and I use fieldtrip_20150708 after following the direction of the website: http://www.fieldtriptoolbox.org/getting_started/yokogawa I've met some problem preparing Head model: 1. after sourceplot three fiducial positions, these locations didn't stored automatically in a "marker-coregis.txt" file, as website mentioned. 2. so, I copy their locations from command window manually. for the next step, I also copy the marker's location from another marker location file (.hsp file), and define them in grad.fid.pnt(). Howerver, when I run the ft_sensorrealign, the error happened: Warning: use cfg.target instead of cfg.template > In ft_checkconfig (line 120) In ft_sensorrealign (line 135) using the fiducials instead of the sensor positions converting units from 'mm' to 'cm' Subscripted assignment between dissimilar structures. Error in ft_sensorrealign (line 228) tmp(i) = ft_convert_units(template(i), elec.unit); % ensure that the units are consistent with the electrodes I'll be really appreciated if I can get any comment ! Sincerely Tzu-Chen ---------------------------- Tzu-Chen Lung, M.S. Research Assistant, Institute of Cognitive Neuroscience, National Central University, Taiwan (R.O.C) -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Wed Mar 9 09:49:07 2016 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Wed, 9 Mar 2016 09:49:07 +0100 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Daniel, I mean it is known that the EEG bands have different frequency bandwidth, like: - Theta 4-7 Hz -> 4 Hz bandwidth - Alpha 8-15 Hz -> 8 Hz bandwidth - Beta 16-31 Hz -> 16 Hz bandwidth So in my opinion, I think it's not really fair to have (in example) 5 Hz bandwidth configuration in measuring PSI for Theta, even Delta, since it (probably) mixed other oscillation band together. In Field Trip's PSI, I found that the cross spectra S(f) are multiplied with the conjugate cross spectra of the neighboring-higher-frequency bin S*((f+1) to have phase lag difference between neighboring frequency bins (or yields frequency slope if divided by the frequency resolution). Then it sums together the results within 2 Hz above and 2 Hz below (for 5 Hz bandwidth example). Finally it takes the imaginary part from the result. If the phase lag difference between neighboring frequency bins (or the frequency slope) are consistent for all results within this 5 Hz bandwidth, then it yields high value. If they are inconsistent, they should not yield high value. But what if the result is quite high that we then interpret as a directionality, but it was only due to mixed up of positive and negative values..? I still cannot answer this one. Maybe someone could help. Best, Sandhy On Tue, Mar 8, 2016 at 10:57 AM, Hähnke, Daniel wrote: > Hi Sandhy, > > that’s interesting. Can you describe how you found out about the bandwidth > being narrower for lower frequencies? When I read the code, I had the > impression that the bandwidth parameter is used once to calculate one > bandwidth parameter in frequency bins that is subsequently used for the > whole spectrum. > > Best, > > Daniel > > > On 07.03.2016, at 17:09, Prasandhya Astagiri Yusuf < > prasandhya.a.yusuf at gmail.com> wrote: > > Hi Daniel and Jan-Mathis, > > since I also have tried to play around with PSI, I have an additional > issue regarding the frequency bandwidth configuration. > > I found that with using linear equidistant frequency bins, the low > frequency oscillation has narrower bandwidth compared to high frequencies. > So if I took 5 Hz frequency bandwidth and compute the PSI to check the low > frequency (i.e alpha) coupling direction, low frequency coupling may not > have sufficient neighboring frequencies. In some cases PSI could also mixed > up both the positive and negative phase slope, then the summation result > from n-frequency bins can be spuriously positive or negative. > > Regarding the mixing of slope information, possibly this is one of > methodological disadvantage. But for fairer frequency slope summation, I > also have the same thought whether the logarithmic frequency step might be > more proper in computing PSI.. > > Please someone correct me if I am wrong in interpreting these, I am trying > to figure out how FieldTrip's PSI works. > > Thanks! > > Best, > Sandhy > > ----------- > > Prasandhya A. Yusuf > > PhD student > > *Medizinische Hochschule Hannover* > VIANNA - Institute of AudioNeuroTechnology > > > > On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel > wrote: > >> Hi Jan-Mathijs, >> >> thanks for sharing your thoughts about problems with using >> non-equidistant frequency bins. >> >> Also thanks for pointing out the possible problems in Granger causality. >> I actually computed the GC using non-parametric factorization and >> equidistant frequency bins, since the code gives an error if you don’t. As >> I wrote, these values from equidistant frequency bins look pretty similar >> to those PSI values from non-equidistant frequency bins. >> >> Best, >> >> Daniel >> >> >> On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >> Hi Daniel, >> >> I am not an expert on PSI theory either, and here I would like to stay on >> the safe side. Even if it may be possible to vary the number of integration >> bins across frequencies, and include some normalisation step on top if it, >> I think it is very tricky, and rather won’t support this. The normalisation >> is probably quite arbitrary, because it could also involve some >> extrapolation of the underlying coherence spectrum. Also, using non >> equidistant frequency spacing increases the risk of the user having >> specified frequency specific smoothing, which further complicates >> integration of phase and coherence estimates across neighbouring frequency >> bins. Long story short, I will build in an explicit check about >> equidistance of frequency bins in ft_connectivityanalysis, to return an >> explicit error if this is not the case. This update will be a general clean >> up of the psi functionality, which also will include better error handling >> if the user happens to forget the bandwidth argument in the cfg. This will >> address bug 3084 on bugzilla.fieldtriptoolbox.org. >> >> While I am at it, you mentioned that your psi results look very much like >> the Granger you have computed. I am not sure how you have computed the >> Granger causality, but (if you have used non parametric factorisation of >> the cod matrix to get your spectral transfer matrices) it may be relevant >> to know that it is incorrect to compute it from freq data with >> non-equidistant frequency bins. The non-parametric spectral factorisation >> code assumes the data to be represented on equidistant frequency bins. >> >> Best, >> Jan-Mathijs >> >> >> >> On 02 Mar 2016, at 15:08, Hähnke, Daniel wrote: >> >> Hi Jan-Mathijs, >> >> never underestimate the creativity of scientists ;) >> >> Why do you think I can’t expect meaningful results from using >> logarithmically spaced frequency bins? At least when comparing my Granger >> results with the PSI values, they look pretty similar. >> I know that the phase slope is dependent on the step size between >> frequencies, so I could miss or aberrantly pick up non-monotonicity in the >> phase slope if I use non-equidistant bins. >> But if I assume that the slope changes monotonically across frequencies >> (which, if I’m not mistaken, is also assumed for equidistant frequency >> bins), a normalization by the bandwidth should be possible. >> >> Please correct me if I’m wrong. I’m obviously no expert in PSI theory and >> would be glad to learn more. >> >> Best, >> >> Daniel >> >> On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >> Hi Daniel >> I have never in my life considered that people would be so creative as to >> expect meaningful results when inputting the function with logarithmically >> spaced frequency bins. I should have known better, but I would be strongly >> in favour of checking for equidistant frequency bins, and if not: throw an >> error*. *I am opposed to using ‘bins’ as a unit, because FieldTrip >> should work wherever possible with physical units, rather than with >> unit-less units. >> >> Best, >> Jan-Mathijs >> >> >> On 02 Mar 2016, at 13:13, Hähnke, Daniel wrote: >> >> Hi all, >> >> since only a few people seem to be using the PSI, I went into the code to >> see what it actually does. I would like to point out that there are some >> issues with the current implementation if you’re using logarithmically >> spaced frequency axes. >> >> The parameter cfg.bandwidth (in Hz) is used to calculate the number of >> frequency bins that is used to calculate the PSI. This calculation, >> however, is only done once using the frequency from the lowest frequency >> bin. If the chosen bandwidth is not an integer multiple of a frequency bin >> step, this computation leads to a changed bandwidth. >> If your frequency axis is not evenly spaced this leads to various >> bandwidths across the frequency axis, since the code only uses a fixed >> number of frequency bins across which to compute the PSI. >> >> I think it would be useful to change the cfg.bandwidth input from Hz to >> number of bins. Also, people should be aware of the fact that the PSI value >> is correlated with the bandwidth. So, if you use a logarithmically spaced >> frequency axis, you should normalize your PSI values by the bandwidth >> corresponding to each frequency bin. >> >> Best, >> >> Daniel >> >> On 01.03.2016, at 11:51, Hähnke, Daniel wrote: >> >> Dear FieldTrip users, >> >> I currently want to double-check the results I got from a non-parametric >> Granger-causality analysis with another measure of directed communication, >> phase slope index. >> However, after having read Nolte et al.’s paper from 2008 that introduced >> the PSI, I still don’t understand how to best choose the parameter >> cfg.bandwidth. >> >> I tried out different values and got something qualitatively very similar >> to my Granger results. But this is rather fitting the parameter to the >> Granger results and kind of undermines my purpose of double-checking. >> >> Furthermore, I am using a logarithmic (to base 2) frequency axis. >> Consequently, my frequency bins are not evenly spaced. I have the feeling >> that I would rather need different bandwidths for the individual frequency >> bins. >> >> Does anyone know how to objectively choose the bandwidth parameter? >> >> Best, >> >> Daniel >> -- >> Daniel Hähnke >> PhD student >> >> Technische Universität München >> Institute of Neuroscience >> Translational NeuroCognition Laboratory >> Biedersteiner Straße 29, Bau 601 >> 80802 Munich >> Germany >> >> Email: daniel.haehnke at tum.de >> Phone: +49 89 4140 3356 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Wed Mar 9 11:57:44 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Wed, 9 Mar 2016 13:57:44 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. Message-ID: Pipeline for sourceanalysis with individualize grip Dear field trippers, I have a question related to pipeline for sourceanalysis with individualize grid. Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. Best Regards, Olga. % 1. load template grid, e.g. load( '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' ); template_grid = sourcemodel; %2. Make the individual subjects' grid %a) Load individual subject mri, e.g. [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); %b) construct individual grid by projecting to template grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); % 3. Make source reconstruction, using individualized grid and* template? or individual headmodel* %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); template_vol = vol; cfg = []; cfg.grid = grid_ind{Subj_i}; *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* cfg.channel = {'MEG'}; cfg.grad = freq_cmb{Subj_i}.grad; sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with individual or template headmodel?* *cfg.vol = vol_K0012_cm; **% individual or template vol???* cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed Mar 9 12:43:58 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 9 Mar 2016 12:43:58 +0100 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Dear Olga, > Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? I would use the individual head model based on the MRI as it provides more information for your source analysis. This should provide more accurate results. > Actually I tried both ways for one subject and did not notice any difference in the results. It seems to that this is due to this line of code, but I’m not quite sure about that: > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_cm{Subj_i}; > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); I think with this configuration the source model that is prepared is only based on the cfg.grid.template, and completely ignores the MRI (which you are interested in). This might explain why you see no difference. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: > > Pipeline for sourceanalysis with individualize grip > > > Dear field trippers, > > I have a question related to pipeline for sourceanalysis with individualize grid. > Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. > Best Regards, > Olga. > > % 1. load template grid, e.g. > > load('/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat'); > template_grid = sourcemodel; > > <>%2. Make the individual subjects' grid > %a) Load individual subject mri, e.g. > > [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); > mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); > > %b) construct individual grid by projecting to template grid > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_cm{Subj_i}; > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > % 3. Make source reconstruction, using individualized grid and template? or individual headmodel > %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); > template_vol = vol; > > cfg = []; > cfg.grid = grid_ind{Subj_i}; > cfg.vol = vol_K0012_cm; % individual or template vol??? > cfg.channel = {'MEG'}; > cfg.grad = freq_cmb{Subj_i}.grad; > sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); > > cfg = []; > cfg.frequency = freq_cmb{Subj_i}.freq; > cfg.grad = freq_cmb{Subj_i}.grad; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf{Subj_i}; % sourcemodel after leadfield with individual or template headmodel? > cfg.vol = vol_K0012_cm; % individual or template vol??? > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.taesler at uke.uni-hamburg.de Wed Mar 9 13:12:34 2016 From: p.taesler at uke.uni-hamburg.de (Philipp Taesler) Date: Wed, 9 Mar 2016 13:12:34 +0100 Subject: [FieldTrip] ft_definetrial using data structure in workspace In-Reply-To: References: Message-ID: <56E01332.5050506@uke.uni-hamburg.de> Hi Zita, if you have the info about which samples belong to your trials (e.g. extracted from some kind of marker file) you should be able to do this by using ft_redefinetrial. Basically you need a trial definition of the form described in the help to ft_definetrial (a Nx3 vector with start-sample, end-sample and zero-point offset). Then you might try something like: cfg = []; cfg.trl = *your Nx3 trial vector*; segmented_data = ft_redefinetrial(cfg, imported_data); Hope this works out for you. All the best, Phil Am 08.03.2016 um 18:05 schrieb Zita Eva Patai: > Dear FT-ers > > I would like to epoch my data, but as it is in a format not supported by > Fieldtrip (.xdf), I used Eeglab to convert it, and then converted > between Eeglab and FT with the eeg2fieldtrip function. Now i have a FT > data structure. > > The data structure looks fine, but it seems that to use ft_definetrial, > i need to specify a path to a file to be processed. Is there any way to > change this so i can use something in the workspace? > > Many thanks > > > -- Philipp Taesler Department of Systems Neuroscience University Medical Center Hamburg-Eppendorf Martinistr. 52, W34, 20248 Hamburg, Germany Phone: +49-40-7410-59902 Fax: +49-40-7410-59955 Email: p.taesler at uke.uni-hamburg.de -- _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From olga.v.sysoeva at gmail.com Wed Mar 9 17:18:11 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Wed, 9 Mar 2016 19:18:11 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the answer, but I think that this code should "create the subject specific grid, using the template grid" as specified in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. " % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid .warpmni = 'yes'; cfg.grid .template = template_grid; cfg.grid .nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.grid .unit ='mm';grid = ft_prepare_sourcemodel(cfg); I believe it "align/project" the template grid with individual mri using non-linear transformation. Correct me if I'm wrong. I'll be more than happy to get more comments on this. Best Regards, Olga. On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle wrote: > Dear Olga, > > Should I use template or subject-specific headmodel with “projected to > template grid individualized grid”? > > > I would use the individual head model based on the MRI as it provides more > information for your source analysis. This should provide more accurate > results. > > Actually I tried both ways for one subject and did not notice any > difference in the results. > > > It seems to that this is due to this line of code, but I’m not quite sure > about that: > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.grid.template = template_grid; > > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > > cfg.mri = mri_cm{Subj_i}; > > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > > I think with this configuration the source model that is prepared is only > based on the cfg.grid.template, and completely ignores the MRI (which you > are interested in). This might explain why you see no difference. > > Bests, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: > > Pipeline for sourceanalysis with individualize grip > > > > Dear field trippers, > > > I have a question related to pipeline for sourceanalysis with > individualize grid. > > Should I use template or subject-specific headmodel with “projected to > template grid individualized grid”? Below is my pipeline with details of > what I mean. Actually I tried both ways for one subject and did not notice > any difference in the results. Does it mean that I do not need to constract > headmodel for each subject? That's indeed save a lot of time, but I'd like > to get your green light on this. > > Best Regards, > > Olga. > > > % 1. load template grid, e.g. > > > load( > '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' > ); > > template_grid = sourcemodel; > > > %2. Make the individual subjects' grid > > %a) Load individual subject mri, e.g. > > > [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); > > mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); > > > %b) construct individual grid by projecting to template grid > > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.grid.template = template_grid; > > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > > cfg.mri = mri_cm{Subj_i}; > > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > > % 3. Make source reconstruction, using individualized grid and* template? > or individual headmodel* > > %a) load template volume > load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); > > template_vol = vol; > > > cfg = []; > > cfg.grid = grid_ind{Subj_i}; > > *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* > > cfg.channel = {'MEG'}; > > cfg.grad = freq_cmb{Subj_i}.grad; > > sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); > > > cfg = []; > > cfg.frequency = freq_cmb{Subj_i}.freq; > > cfg.grad = freq_cmb{Subj_i}.grad; > > cfg.method = 'dics'; > > cfg.keeptrials = 'yes'; > > *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with > individual or template headmodel?* > > *cfg.vol = vol_K0012_cm; **% individual or template vol???* > > cfg.keeptrials = 'yes'; > > cfg.dics.lambda = '5%'; > > cfg.dics.keepfilter = 'yes'; > > cfg.dics.fixedori = 'yes'; > > cfg.dics.realfilter = 'yes'; > > source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 ha438 at georgetown.edu Wed Mar 9 21:26:36 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 9 Mar 2016 15:26:36 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 Message-ID: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; *ft_sourceplot(cfg,seg)* I get the error: *Error using textscan* First input can not be empty. Expected a non-empty string or a valid file-id. *Error in issubfield (line 44)* t = textscan(f,'%s','delimiter','.'); *Error in ft_sourceplot (line 460)* hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan -------------- next part -------------- An HTML attachment was scrubbed... URL: From seymourr at aston.ac.uk Wed Mar 9 21:38:57 2016 From: seymourr at aston.ac.uk (Seymour, Robert (Research Student)) Date: Wed, 9 Mar 2016 20:38:57 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 Message-ID: Hi Hassan, Is there any reason you want to use the FSL template brain? If not, it might be worth trying SPM template like so: [mri] = ft_read_mri('~pathtofieldtrip/template/anatomy/single_subj_T1'); mri.coordsys ='SPM' Hope this works out for you, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Wed Mar 9 21:46:33 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 9 Mar 2016 15:46:33 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: Message-ID: Hi Robert, Thanks for your reply. I am looking to use both, but I have had the same issue with the SPM also. I feel that the problem is not datatype dependent. Best, Hassan On Mar 9, 2016 3:39 PM, "Seymour, Robert (Research Student)" < seymourr at aston.ac.uk> wrote: > Hi Hassan, > > > Is there any reason you want to use the FSL template brain? If not, it might > be worth trying SPM template like so: > > > [mri] = ft_read_mri('~pathtofieldtrip/template/anatomy/single_subj_T1'); > > mri.coordsys ='SPM' > > > Hope this works out for you, > > Rob > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Wed Mar 9 21:49:48 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 9 Mar 2016 13:49:48 -0700 Subject: [FieldTrip] Moving window peak-to-peak artifact correction Message-ID: Hi fieldtrippers, ERPlab has a method of artifact detection which, within an epoch, will take a moving window of a defined size, measure peak-to-peak amplitude difference, and reject the trial based on a defined threshold. http://erpinfo.org/erplab/erplab-documentation/manual_4/Artifact_Detection.html I would like to implement a similar method in fieldtrip, but the closest I can find is ft_artifact_threshold. As I understand it, the range or min-max is the peak-to-peak amplitude difference, but as best as I can tell there is no way to do this over a moving window, only across the whole trial. Is there a way to implement this in fieldtrip? On a related note, why is it that (nearly) all of the fieldtrip artifact rejection methods require the .trl matrix, even with epoched data? Is there a specific reason why artifacts can't just be rejected by trial, besides the fact that allowing for rejection by .trl matrices allows for partial trial rejection? That would be a reasonable explanation, but there have been times where, for various reasons, having to reject by the .trl matrix has created complications (usually due to lack of foresight on my part, but nonetheless frustrating). Thanks, Max -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Thu Mar 10 01:40:56 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Thu, 10 Mar 2016 01:40:56 +0100 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space Message-ID: Dear FieldTrip users, I have a few questions regarding source localisation and statistics: 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. Thank you! Best regards, Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Mar 10 08:55:54 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Mar 2016 07:55:54 +0000 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Hi Olga, The ‘template grid’ refers to a so-called source model, i.e. the set of positions that you use to model your sources. The headmodel refers to the volume conduction model of the head. The inverse warping is intended to facilitate group comparisons after the source reconstruction. For the source reconstruction you can use these ‘inverse warped template grids’, but it is advisable to always use a volume conduction model based on the participant’s anatomy, as Simon already suggested in his reply. Best wishes, Jan-Mathijs On 09 Mar 2016, at 17:18, Olga Sysoeva > wrote: Dear Simon, Thank you very much for the answer, but I think that this code should "create the subject specific grid, using the template grid" as specified in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. " % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.grid.unit ='mm'; grid = ft_prepare_sourcemodel(cfg); I believe it "align/project" the template grid with individual mri using non-linear transformation. Correct me if I'm wrong. I'll be more than happy to get more comments on this. Best Regards, Olga. On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle > wrote: Dear Olga, Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? I would use the individual head model based on the MRI as it provides more information for your source analysis. This should provide more accurate results. Actually I tried both ways for one subject and did not notice any difference in the results. It seems to that this is due to this line of code, but I’m not quite sure about that: cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); I think with this configuration the source model that is prepared is only based on the cfg.grid.template, and completely ignores the MRI (which you are interested in). This might explain why you see no difference. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 On 09 Mar 2016, at 11:57, Olga Sysoeva > wrote: Pipeline for sourceanalysis with individualize grip Dear field trippers, I have a question related to pipeline for sourceanalysis with individualize grid. Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. Best Regards, Olga. % 1. load template grid, e.g. load('/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat'); template_grid = sourcemodel; %2. Make the individual subjects' grid %a) Load individual subject mri, e.g. [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); %b) construct individual grid by projecting to template grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); % 3. Make source reconstruction, using individualized grid and template? or individual headmodel %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); template_vol = vol; cfg = []; cfg.grid = grid_ind{Subj_i}; cfg.vol = vol_K0012_cm; % individual or template vol??? cfg.channel = {'MEG'}; cfg.grad = freq_cmb{Subj_i}.grad; sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf{Subj_i}; % sourcemodel after leadfield with individual or template headmodel? cfg.vol = vol_K0012_cm; % individual or template vol??? cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 10 09:00:09 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Mar 2016 08:00:09 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: Message-ID: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Hassan, Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use? Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with. Best, Jan-Mathijs On 09 Mar 2016, at 21:26, Hassan Aleem > wrote: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; ft_sourceplot(cfg,seg) I get the error: Error using textscan First input can not be empty. Expected a non-empty string or a valid file-id. Error in issubfield (line 44) t = textscan(f,'%s','delimiter','.'); Error in ft_sourceplot (line 460) hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Thu Mar 10 12:44:53 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Thu, 10 Mar 2016 14:44:53 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Thank you Jan-Mathijs for clarification. Therefore, I think it is better for me to change my pipeline to more conventional. Like this? 1.read individual mri (I do have it in .fif format adjusted in Graph to sensor position) [mri{subj_i}] = ft_read_mri(filename{subj_i}); 2. perform the segmentation cfg = []; cfg.output = 'brain'; segmentedmri{subj_i} = ft_volumesegment(cfg, mri{subj_i}); 3. create a headmodel cfg = []; cfg.method='singleshell'; vol{subj_i} = ft_prepare_headmodel(cfg, segmentedmri{subj_i}); 4. create a leadfield (do I need to do it twice – sourcemodel first and than leadfield?). Which resolution is better to use? 1 cm – to coarse? cfg = []; cfg.grad = freqPost{Subj_i} .grad; cfg.vol = vol{Subj_i} ; cfg.reducerank = 2; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; [grid{Subj_i} ] = ft_prepare_leadfield(cfg); 5. do source reconstraction cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; *cfg.grid = **grid{Subj_i};* *cfg.vol = vol**{Subj_i};* cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; *source {Subj_i} = ft_sourceanalysis(cfg, freq_cmb{Subj_i});* How does it look for experienced sourcemodeller? Best Regards, Olga. On Thu, Mar 10, 2016 at 10:55 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Olga, > > The ‘template grid’ refers to a so-called source model, i.e. the set of > positions that you use to model your sources. > The headmodel refers to the volume conduction model of the head. > > The inverse warping is intended to facilitate group comparisons after the > source reconstruction. > > For the source reconstruction you can use these ‘inverse warped template > grids’, but it is advisable to always use a volume conduction model based > on the participant’s anatomy, as Simon already suggested in his reply. > > Best wishes, > Jan-Mathijs > > > > On 09 Mar 2016, at 17:18, Olga Sysoeva wrote: > > Dear Simon, > > Thank you very much for the answer, but I think that this code should > "create the subject specific grid, using the template grid" as specified > in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. > " > > % create the subject specific grid, using the template grid that has just been created > cfg = []; > cfg.grid .warpmni = 'yes'; > cfg.grid .template = template_grid; > cfg.grid .nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > cfg.grid .unit ='mm';grid = ft_prepare_sourcemodel(cfg); > > I believe it "align/project" the template grid with individual mri using > non-linear transformation. > > Correct me if I'm wrong. > I'll be more than happy to get more comments on this. > > Best Regards, > Olga. > > On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle > wrote: > >> Dear Olga, >> >> Should I use template or subject-specific headmodel with “projected to >> template grid individualized grid”? >> >> >> I would use the individual head model based on the MRI as it provides >> more information for your source analysis. This should provide more >> accurate results. >> >> Actually I tried both ways for one subject and did not notice any >> difference in the results. >> >> >> It seems to that this is due to this line of code, but I’m not quite sure >> about that: >> >> cfg = []; >> >> cfg.grid.warpmni = 'yes'; >> >> cfg.grid.template = template_grid; >> >> cfg.grid.nonlinear = 'yes'; % use non-linear normalization >> >> cfg.mri = mri_cm{Subj_i}; >> >> grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); >> >> >> I think with this configuration the source model that is prepared is only >> based on the cfg.grid.template, and completely ignores the MRI (which you >> are interested in). This might explain why you see no difference. >> >> Bests, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: >> >> Pipeline for sourceanalysis with individualize grip >> >> >> >> Dear field trippers, >> >> >> I have a question related to pipeline for sourceanalysis with >> individualize grid. >> >> Should I use template or subject-specific headmodel with “projected to >> template grid individualized grid”? Below is my pipeline with details of >> what I mean. Actually I tried both ways for one subject and did not notice >> any difference in the results. Does it mean that I do not need to constract >> headmodel for each subject? That's indeed save a lot of time, but I'd like >> to get your green light on this. >> >> Best Regards, >> >> Olga. >> >> >> % 1. load template grid, e.g. >> >> >> load( >> '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' >> ); >> >> template_grid = sourcemodel; >> >> >> %2. Make the individual subjects' grid >> >> %a) Load individual subject mri, e.g. >> >> >> [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); >> >> mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); >> >> >> %b) construct individual grid by projecting to template grid >> >> >> cfg = []; >> >> cfg.grid.warpmni = 'yes'; >> >> cfg.grid.template = template_grid; >> >> cfg.grid.nonlinear = 'yes'; % use non-linear normalization >> >> cfg.mri = mri_cm{Subj_i}; >> >> grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); >> >> >> % 3. Make source reconstruction, using individualized grid and* >> template? or individual headmodel* >> >> %a) load template volume >> load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); >> >> template_vol = vol; >> >> >> cfg = []; >> >> cfg.grid = grid_ind{Subj_i}; >> >> *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* >> >> cfg.channel = {'MEG'}; >> >> cfg.grad = freq_cmb{Subj_i}.grad; >> >> sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); >> >> >> cfg = []; >> >> cfg.frequency = freq_cmb{Subj_i}.freq; >> >> cfg.grad = freq_cmb{Subj_i}.grad; >> >> cfg.method = 'dics'; >> >> cfg.keeptrials = 'yes'; >> >> *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with >> individual or template headmodel?* >> >> *cfg.vol = vol_K0012_cm; **% individual or template vol???* >> >> cfg.keeptrials = 'yes'; >> >> cfg.dics.lambda = '5%'; >> >> cfg.dics.keepfilter = 'yes'; >> >> cfg.dics.fixedori = 'yes'; >> >> cfg.dics.realfilter = 'yes'; >> >> source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 laxmi.shaw22 at gmail.com Thu Mar 10 14:41:59 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Thu, 10 Mar 2016 19:11:59 +0530 Subject: [FieldTrip] Issue in topographs Message-ID: Dear Fieldtrip users, Can anybody is having complete manual book of fieldtrip toolbox. Actually i am facing problem in simple topographic plot. I am using fieldtrip-20051231 and my data set is in .xls files.Can anybody help in this regard. Thanks in advance Regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur India Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Fri Mar 11 01:02:54 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Thu, 10 Mar 2016 19:02:54 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Hi J.M, I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux operating system. However the problem appears also on my windows 10 OS. I am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot does not work with the same complaint as with trying to plot the source interpolation, I assume that's what you mean by checking them. Let me post the script to give you more information. ( the headmodel part of the script was modified from robert bauer) *%reading mri* [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' ----------------------------------- *%segmentation* cfg = []; cfg.brainthreshold = 0.5; cfg.scalpthreshold = 0.15; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); ---------------------------------- %plotting segmentation cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; ft_sourceplot(cfg,seg) *this does not work, same error.* ------------------------------------------ *%building mesh* cfg = []; cfg.method= 'projectmesh'; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [1000 1000 1000]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001 bnd(2).pnt = bnd(2).pnt.*1 bnd(3).pnt = bnd(3).pnt.*0.999 ft_plot_mesh(bnd(1))%scalp ft_plot_mesh(bnd(2))%skull ft_plot_mesh(bnd(3))%brain ---------------------------------------------------------- *%preparing headmodel* cfg = []; cfg.method = 'dipoli'; headmodel = ft_prepare_headmodel(cfg, bnd); -------------------------------------------------------- *%adding electrodes to headmodel* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') % aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp st_elec_aligned = ft_electroderealign(cfg); ----------------------------------------------- *%using the standard template sourcemodel from fieldtrip.* load('standard_sourcemodel3d5mm.mat') ------------------------------------- *%% timelock data* cfg = []; m0 = ft_timelockanalysis(cfg, dataM0); -------------------------------------- *%% perform source analysis* cfg = []; cfg.method = 'lcmv'; cfg.lcmv.lambda='5%'; cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD source_m0=ft_sourceanalysis(cfg,m0); ------------------------------ *%% source interpolation* cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; cfg.grid=sourcemodel.cfg.grid; sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); ---------------------------------------------- *%plotting* cfg = []; cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg, sourceinterp_m0); This is where it gives me the error. Please let me know if you need more information. I also had a question about making a 'source' it seems that the fieldtrip tutorial does not use a 'sourcemodel' but instead use a dipolefitting source, is this comparable. Thank you for the help in advance. Best, Hassan On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hassan, > Can you please provide a bit more information with respect to what version > of fieldtrip, matlab and operating system you use? > Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? > We need more information to work with. > Best, > Jan-Mathijs > > > > On 09 Mar 2016, at 21:26, Hassan Aleem wrote: > > Hi everyone, > > I have a question that is possibly very easy to solve but is evading me. I > am unable to get ft_sourceplot to work. For example when I run the code: > > [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); > mri.coordsys ='MNI' > > cfg = []; > cfg.output = {'brain' 'scalp' 'skull'}; > seg = ft_volumesegment(cfg, mri); > seg.anatomy = mri.anatomy; > > cfg = []; > cfg.funparameter = 'brain'; > *ft_sourceplot(cfg,seg)* > > I get the error: > > *Error using textscan* > First input can not be empty. Expected a non-empty string or a valid > file-id. > > * Error in issubfield (line 44)* > t = textscan(f,'%s','delimiter','.'); > > * Error in ft_sourceplot (line 460)* > hasmsk = issubfield(functional, cfg.maskparameter); > > This is happening regardless of what stage I use ft_sourceplot. > > Thanks for your consideration! > > Hassan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 Fri Mar 11 07:36:17 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Mar 2016 06:36:17 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: I cannot reproduce your problem. It seems that you are using an incorrect/outdated copy of issubfield. The line number you report in your error message does not line up with the current version. Please ensure that your matlab path is set correctly, in particular try to avoid copies of SPM or eeglab taking precedence. These may have old versions of FT code that can cause all kinds of erratic behaviour. Best wishes, Jan-Mathijs On 11 Mar 2016, at 01:02, Hassan Aleem > wrote: Hi J.M, I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux operating system. However the problem appears also on my windows 10 OS. I am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot does not work with the same complaint as with trying to plot the source interpolation, I assume that's what you mean by checking them. Let me post the script to give you more information. ( the headmodel part of the script was modified from robert bauer) %reading mri [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' ----------------------------------- %segmentation cfg = []; cfg.brainthreshold = 0.5; cfg.scalpthreshold = 0.15; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); ---------------------------------- %plotting segmentation cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; ft_sourceplot(cfg,seg) this does not work, same error. ------------------------------------------ %building mesh cfg = []; cfg.method= 'projectmesh'; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [1000 1000 1000]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001 bnd(2).pnt = bnd(2).pnt.*1 bnd(3).pnt = bnd(3).pnt.*0.999 ft_plot_mesh(bnd(1))%scalp ft_plot_mesh(bnd(2))%skull ft_plot_mesh(bnd(3))%brain ---------------------------------------------------------- %preparing headmodel cfg = []; cfg.method = 'dipoli'; headmodel = ft_prepare_headmodel(cfg, bnd); -------------------------------------------------------- %adding electrodes to headmodel elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') % aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp st_elec_aligned = ft_electroderealign(cfg); ----------------------------------------------- %using the standard template sourcemodel from fieldtrip. load('standard_sourcemodel3d5mm.mat') ------------------------------------- %% timelock data cfg = []; m0 = ft_timelockanalysis(cfg, dataM0); -------------------------------------- %% perform source analysis cfg = []; cfg.method = 'lcmv'; cfg.lcmv.lambda='5%'; cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD source_m0=ft_sourceanalysis(cfg,m0); ------------------------------ %% source interpolation cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; cfg.grid=sourcemodel.cfg.grid; sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); ---------------------------------------------- %plotting cfg = []; cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg, sourceinterp_m0); This is where it gives me the error. Please let me know if you need more information. I also had a question about making a 'source' it seems that the fieldtrip tutorial does not use a 'sourcemodel' but instead use a dipolefitting source, is this comparable. Thank you for the help in advance. Best, Hassan On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hassan, Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use? Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with. Best, Jan-Mathijs On 09 Mar 2016, at 21:26, Hassan Aleem > wrote: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; ft_sourceplot(cfg,seg) I get the error: Error using textscan First input can not be empty. Expected a non-empty string or a valid file-id. Error in issubfield (line 44) t = textscan(f,'%s','delimiter','.'); Error in ft_sourceplot (line 460) hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ha438 at georgetown.edu Fri Mar 11 07:46:18 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Fri, 11 Mar 2016 01:46:18 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Thanks for your response J.M. That makes sense. I will remove all eeglab/spm/fieldtrip and reinstall,making sure to keep fieldtrip separate. On Mar 11, 2016 1:40 AM, "Schoffelen, J.M. (Jan Mathijs)" < jan.schoffelen at donders.ru.nl> wrote: > I cannot reproduce your problem. It seems that you are using an > incorrect/outdated copy of issubfield. The line number you report in your > error message does not line up with the current version. Please ensure that > your matlab path is set correctly, in particular try to avoid copies of SPM > or eeglab taking precedence. These may have old versions of FT code that > can cause all kinds of erratic behaviour. > > Best wishes, > Jan-Mathijs > > > > > > > > On 11 Mar 2016, at 01:02, Hassan Aleem wrote: > > Hi J.M, > > I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux > operating system. However the problem appears also on my windows 10 OS. I > am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot > does not work with the same complaint as with trying to plot the source > interpolation, I assume that's what you mean by checking them. Let me post > the script to give you more information. ( the headmodel part of the script > was modified from robert bauer) > > *%reading mri* > [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); > mri.coordsys ='MNI' > ----------------------------------- > *%segmentation* > > cfg = []; > cfg.brainthreshold = 0.5; > cfg.scalpthreshold = 0.15; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'scalp' 'skull'}; > seg = ft_volumesegment(cfg, mri); > ---------------------------------- > %plotting segmentation > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > ft_sourceplot(cfg,seg) *this does not work, same error.* > ------------------------------------------ > *%building mesh* > cfg = []; > cfg.method= 'projectmesh'; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [1000 1000 1000]; > bnd = ft_prepare_mesh(cfg, seg); > > % i enlarged / reduced the boundary mesh a little bit, because they were > causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001 > bnd(2).pnt = bnd(2).pnt.*1 > bnd(3).pnt = bnd(3).pnt.*0.999 > > ft_plot_mesh(bnd(1))%scalp > ft_plot_mesh(bnd(2))%skull > ft_plot_mesh(bnd(3))%brain > > ---------------------------------------------------------- > *%preparing headmodel* > cfg = []; > cfg.method = 'dipoli'; > headmodel = ft_prepare_headmodel(cfg, bnd); > -------------------------------------------------------- > > * %adding electrodes to headmodel* > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode > file > > % visualize head surface (scalp) > > figure; > ft_plot_mesh(headmodel.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > > % aligning electrodes > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = headmodel.bnd(1);%scalp > st_elec_aligned = ft_electroderealign(cfg); > ----------------------------------------------- > *%using the standard template sourcemodel from fieldtrip.* > > load('standard_sourcemodel3d5mm.mat') > ------------------------------------- > *%% timelock data* > cfg = []; > m0 = ft_timelockanalysis(cfg, dataM0); > -------------------------------------- > > *%% perform source analysis * > cfg = []; > cfg.method = 'lcmv'; > cfg.lcmv.lambda='5%'; > cfg.grid = sourcemodel.cfg.grid;---this is the standard template from > fieldtrip > cfg.headmodel = headmodel; > cfg.lcmv.keepfilter = 'yes'; > cfg.lcmv.projectnoise='yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > source_m0=ft_sourceanalysis(cfg,m0); > ------------------------------ > *%% source interpolation* > > cfg = []; > cfg.interpmethod = 'nearest'; > cfg.parameter = 'pow'; > cfg.grid=sourcemodel.cfg.grid; > sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); > ---------------------------------------------- > *%plotting* > > cfg = []; > cfg.method = 'ortho'; > cfg.funcolorlim = 'maxabs'; > cfg.funparameter= 'pow'; > ft_sourceplot(cfg, sourceinterp_m0); > > This is where it gives me the error. Please let me know if you need more > information. I also had a question about making a 'source' it seems that > the fieldtrip tutorial does not use a 'sourcemodel' but instead use a > dipolefitting source, is this comparable. Thank you for the help in advance. > > Best, > > Hassan > > On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hassan, >> Can you please provide a bit more information with respect to what >> version of fieldtrip, matlab and operating system you use? >> Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? >> We need more information to work with. >> Best, >> Jan-Mathijs >> >> >> >> On 09 Mar 2016, at 21:26, Hassan Aleem wrote: >> >> Hi everyone, >> >> I have a question that is possibly very easy to solve but is evading me. >> I am unable to get ft_sourceplot to work. For example when I run the code: >> >> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >> mri.coordsys ='MNI' >> >> cfg = []; >> cfg.output = {'brain' 'scalp' 'skull'}; >> seg = ft_volumesegment(cfg, mri); >> seg.anatomy = mri.anatomy; >> >> cfg = []; >> cfg.funparameter = 'brain'; >> *ft_sourceplot(cfg,seg)* >> >> I get the error: >> >> *Error using textscan* >> First input can not be empty. Expected a non-empty string or a valid >> file-id. >> >> * Error in issubfield (line 44)* >> t = textscan(f,'%s','delimiter','.'); >> >> * Error in ft_sourceplot (line 460)* >> hasmsk = issubfield(functional, cfg.maskparameter); >> >> This is happening regardless of what stage I use ft_sourceplot. >> >> Thanks for your consideration! >> >> Hassan >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 bushra.riaz at gu.se Fri Mar 11 12:00:21 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Fri, 11 Mar 2016 11:00:21 +0000 Subject: [FieldTrip] error in reading epoched fif files Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> Hello, I am getting an error in reading epoched fiff files created with the latest stable version of mne Is there a quick fix to this problem? Thank you Kind regards Bushra Riaz? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri Mar 11 12:10:25 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 11 Mar 2016 11:10:25 +0000 Subject: [FieldTrip] Issue in topographs Message-ID: Hello Laxmi, The tutorials within the Fieldtrip wiki online, as well as the reference documentation and FAQs on the wiki, are the manual. You can find tutorials there for how to get your data into Fieldtrip, and examples for how to plot. There are also some video tutorials. If you have more specific questions then people here on the e-mail list might be able to help. But you would need to provide more details, such as, what is the format of your data in .xls files (is it averages, grand averages, epochs, continuous data, etc...?). If you search the archives of this mailing list I think you can find some previous messages about how to "hack" data from unsupported file formats into the proper MATLAB structure to be compatible with the fieldtrip functions. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 2 > Date: Thu, 10 Mar 2016 19:11:59 +0530 > From: Laxmi Shaw > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Issue in topographs > Message-ID: > < > CABWJU2Sk5qG_4G63EbYXkySo9wcOFfZxdqmsQ6i9mRMLQBSJkg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fieldtrip users, > Can anybody is having complete manual book of fieldtrip toolbox. Actually i > am facing problem in simple topographic plot. I am using > fieldtrip-20051231 and my data set is in .xls files.Can anybody help in > this regard. > > > > Thanks in advance > > > Regards > > -- > Laxmi Shaw > Research Scholar(PhD) > IIT Kharagpur > India > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Fri Mar 11 22:59:58 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Fri, 11 Mar 2016 21:59:58 +0000 Subject: [FieldTrip] DICS between two frequencies? Message-ID: Hi FieldTrip list, When doing source analysis using DICS the help document refers to cfg.foi as a single value, but the workshop notes (http://www.fieldtriptoolbox.org/workshop/meg-uk-2015/fieldtrip-beamformer-demo) use two values. So possibly silly question, but does ft_source analysis function normally using two values? Also, does it require wavelet transform data or would using fft data over a large frequency range then inputting the required bands be OK to do? Thanks, Peter From runna90 at 126.com Sat Mar 12 01:02:40 2016 From: runna90 at 126.com (runna90 at 126.com) Date: Sat, 12 Mar 2016 08:02:40 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: Message-ID: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Dear Harold, I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here . Source model: Co-registration of the source space to the sensor-based head coordinate system, I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? Best regards, Runnan > 在 2016年3月10日,08:40,Harold Cavendish 写道: > > Dear FieldTrip users, > > I have a few questions regarding source localisation and statistics: > > 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). > > What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? > > 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? > > I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. > > Thank you! > > Best regards, > Harold > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sat Mar 12 12:12:27 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sat, 12 Mar 2016 11:12:27 +0000 Subject: [FieldTrip] error in reading epoched fif files Message-ID: Hello Bushra, You will be more likely to get helpful advice if you can provide more details about your problem. See http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 1 > Date: Fri, 11 Mar 2016 11:00:21 +0000 > From: Bushra Riaz Syeda > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] error in reading epoched fif files > Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b at EXCH03-P.GU.GU.SE> > Content-Type: text/plain; charset="iso-8859-1" > > Hello, > > I am getting an error in reading epoched fiff files created with the > latest stable version of mne > Is there a quick fix to this problem? > > Thank you > Kind regards > Bushra Riaz? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Sat Mar 12 15:06:38 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Sat, 12 Mar 2016 15:06:38 +0100 Subject: [FieldTrip] Head model for EEG source localization - Possible bug in BEMCP? Message-ID: Dear all, I am working on EEG source localization of a very simple fist clenching task (right hand, 10 seconds of contraction alternated to 10 seconds of relaxation to be used as contrast condition) using DICS beamformer (frequency 10 Hz). I have the individial MRI and EEG electrode positions of my participants, so I wrote a script to create the individual forward model following the tutorials on the fieldtrip webpage and some useful discussions on the mailing list. Below I report the full code used for the forward model and the code used for the source analysis. Attached, you find the results of the source localization and ​some ​ figures of different steps in the computation of the forward model. According to my task, I expect to identify a desynchronization on the left motor cortex, but what I am getting are very weird results(see attachment ​s)​ . I tryed to use the standard MRI in template\headmodel\standard_mri, and I get similar results. After a full day of self-debugging, I managed to get the result I expect (attached) using the method "concentricspheres" instead of "bemcp" in the computation of the head model, both with the MRI of my participants and with the standard MRI. I assume there must be something wrong with "bemcp", also becasue when I use the standard bem headmodel (template\headmodel\standard_bem) created with the method "dipoli", everything looks fine again. Did anybody experienced a similar issue before? Is there anything wrong I am doing in the pipeline? Thanks a lot in advace for your support! Best, Debora Fieldtrip version: 20150828 Matlab version: R2015a (64 bit) OS: Windows 8 (64 bit) %%%% --------------------- Code for Forward Model ---------------- %%% %% Read MRI data (DICOM) mri = ft_read_mri(experiment.mri); % experiment.mri contains the path to individual MRIs %% Convert anatomical MRI to MNI coordinate system (= RAS) cfg = []; cfg.method = 'interactive'; cfg.coordsys = 'spm'; % MNI coordinate system (=RAS) cfg.viewmode = 'ortho'; mri_spm = ft_volumerealign(cfg,mri); %% Re-slice the MRI volume so that all the 3 dimensions have the same number of voxels cfg = []; cfg.resolution = 1; % 1 mm thick slices cfg.dim = [256 256 256]; mri_spm = ft_volumereslice(cfg,mri_spm); %% Visualize MRI data to check that everything is ok cfg = []; cfg.method = 'ortho'; ft_sourceplot(cfg,mri_spm) %% Segment the anatomical data cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; cfg.brainsmooth = 2; cfg.brainthreshold = 0.25; cfg.scalpthreshold = 0.025; mri_seg = ft_volumesegment(cfg, mri_spm); %% Check segmentation brain cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'brain'; ft_sourceplot(cfg,mri_seg) %% Check segmentation skull cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'skull'; ft_sourceplot(cfg,mri_seg) %% Check segmentation scalp cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'scalp'; ft_sourceplot(cfg,mri_seg) %% Prepare mesh: creates surfaces at the boarders of the different tissue-types cfg = []; cfg.method = 'projectmesh'; cfg.tissue = {'brain' 'skull' 'scalp'}; cfg.numvertices = [6000 4000 2000]; bnd = ft_prepare_mesh(cfg, mri_seg); %% Visualize surfaces figure ft_plot_mesh(bnd(1),'facecolor','none') % brain figure ft_plot_mesh(bnd(2),'facecolor','none') % skull figure ft_plot_mesh(bnd(3),'facecolor','none') % scalp %% Visualize full mesh figure ft_plot_mesh(bnd(3), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(bnd(1),'edgecolor','none','facecolor',[0.4 0.6 0.4]); %% Prepare head model (volume conduction model) cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg,bnd); %% % --------------------- Align the EEG electrodes!!!-------------------%%% %% (1) Read electrode position from Localizer file elec = ft_read_sens(experiment.electrodes); % experiment.electrodes contains the path to the individual electrode positions %% (2) Check if alignment is necessary figure %plot scalp ft_plot_mesh(headmodel.bnd(3),'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]) hold on % plot electrodes ft_plot_sens(elec,'style','sk') %% (3) If the electrodes are not aligned to the head surface, interactively align them cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(3); % scalp elec_aligned = ft_electroderealign(cfg); %% Load hdr and order elec_aligned accordign to original order of signal acquisition %%% This is necessary because the eeg elctrod eposition shave been acquired %%% in a different order with respect to theorder of the signal recording load([experiment.path '\Data'],'hdr') % hdr contains some information about the original order of the channels and so on... [~, original_order] = ismember(hdr.elec.label,elec_aligned.label); elec_aligned.chanpos = elec_aligned.chanpos(original_order,:); elec_aligned.elecpos = elec_aligned.elecpos(original_order,:); elec_aligned.label = elec_aligned.label(original_order); %% Check if the alignment is ok figure %plot scalp ft_plot_mesh(headmodel.bnd(3),'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]) hold on % plot electrodes ft_plot_sens(elec_aligned,'style','sk') %% -------------------------------- Source model -------------------------%% %% Make the individual subject's grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.resolution = 6; % resolution of the template grid in mm cfg.grid.nonlinear = 'yes'; % use non linear normalization cfg.mri = mri_spm; % use subject's mri in mni coordinates cfg.grid.unit = 'mm'; sourcemodel = ft_prepare_sourcemodel(cfg); %% Plot the single subject'e head model and grid positions figure hold on ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); ft_plot_mesh(sourcemodel.pos(sourcemodel.inside,:)); %% Double check that source model is aligned to the segmented volume and to the electrodes figure hold on plot3(sourcemodel.pos(sourcemodel.inside,1),sourcemodel.pos(sourcemodel.inside,2),sourcemodel.pos(sourcemodel.inside,3),'.'); ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); %% ---------------------- FORWARD SOLUTION ------------------------ %% %% Prepare leadfield cfg = []; cfg.elec = elec_aligned; cfg.grid = sourcemodel; cfg.headmodel = headmodel; leadfield = ft_prepare_leadfield(cfg); %% Test sourc elocalization load([experiment.path '\DATA'], 'preexperiment_freqsource') % preexperiment_freqsource contains the output of ft_freqanalysis cfg = []; cfg.elec = elec_aligned; cfg.method = 'dics'; cfg.frequency = 10; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.dics.keepfilter = 'yes'; cfg.dics.lambda = '10%'; src = ft_sourceanalysis(cfg, preexperiment_freqsource); filter = src.avg.filter; markers = [224 192]; % markers are some number in the trialinfo, 224 is related to fist clenching, 192 to relaxation for mm = 1:length(markers) cfg = []; cfg.trials = find(preexperiment_freqsource.trialinfo == markers(mm)); data = ft_selectdata(cfg,preexperiment_freqsource); %%% DICS cfg = []; cfg.elec = elec_aligned; cfg.method = 'dics'; cfg.frequency = 10; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '10%'; cfg.grid.filter = filter; Source{mm} = ft_sourceanalysis(cfg, data); end %% Interpolate results to anatomy source = Source{1}; source1 = Source{1}; %clenching source2 = Source{2}; % release source.avg.cont = (source2.avg.pow./source1.avg.pow)-1; cfg = []; cfg.parameter = 'cont'; source = ft_sourceinterpolate(cfg, source, mri_spm); %% Plot surface cfg = []; cfg.method = 'surface'; cfg.funparameter = 'cont'; cfg.funcolormap = 'jet'; ft_sourceplot(cfg, source) -------------------------------------------------------------------- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_CONCENTRICSPHERES_Results_Source.PNG Type: image/png Size: 126346 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0_IndividualMRI_spm.PNG Type: image/png Size: 80674 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1_Segmentaiton_BrainSkullScalp.PNG Type: image/png Size: 41612 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2a_Output ft_plot_mesh_BrainSkullScalp.PNG Type: image/png Size: 66519 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2b_Output ft_plot_mesh_allSurfaces.PNG Type: image/png Size: 40960 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3_BEMCP_SourceModel.PNG Type: image/png Size: 19959 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3_CONCENTRICSPHERES_SourceModel.PNG Type: image/png Size: 19714 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_BEMCP_Alignment_HeadModel_SourceModel_Electrodes.PNG Type: image/png Size: 58428 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_CONCENTRICSPHERES_Alignment_HeadModel_SourceModel_Electrodes.PNG Type: image/png Size: 67775 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_BEMCP_Results_Source.PNG Type: image/png Size: 143105 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Sat Mar 12 15:42:59 2016 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sat, 12 Mar 2016 14:42:59 +0000 Subject: [FieldTrip] BEMCP Message-ID: Deb: I have had problems with BEMCP. 1—one of the practical / technical problems is that if the compartments overlap, or even come close, then the procedure would not work—the ft_sourceanlaysis crashed. 2—There are a couple of studies comparing BEMCP and dipoli, among other methods. The BEMCP method does not fare well, the dipoli fares better, E. g., among three or four studies I have seen. Gramfort, A., et al. (2010). "OpenMEEG: opensource software for quasistatic bioelectromagnetics." Biomed Eng Online 9: 45. Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput Intell Neurosci 2011: 923703. 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, and the Simbio FEM model, by correlating results from each model (e.g., correlations of all the dipole CDR estimates; or correlations across anatomical ROIs). The BEMCP and concentric spheres work similarly, and the dipoli and Simbio-FEM work similarly. This was with infants using participant-computed realistic models for the compartments and the FEM. I am not claiming from this and superiority of the dipoli (or FEM) models over the BEMCP, but I suggest looking at the research literature formally comparing these methods before going much further with BEMCP. John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Sat Mar 12 16:30:12 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Sat, 12 Mar 2016 16:30:12 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear John, thanks a lot for your promt reply and your suggestion. I guess that I was sticking to the BEM head model just because I read the tutorial for EEG BEM head model first, but going quickly through the studies you have mentioned and considering the tests you have performed, I may also consider to switch to the FEM head model or to simply use the concentric spheres (which appeared to work similar to BEMCP in your comparisons). I am relatively new to source localization and had no crash/errors in my pipeline, and this combination makes always difficult to find possible pitfalls. As soon as I have them ready, I will post the results obtained with the FEM head model as well, maybe they will be useful for some other users :) Thanks again for your support! All the best, Debora On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN wrote: > Deb: > > I have had problems with BEMCP. > > 1—one of the practical / technical problems is that if the compartments > overlap, or even come close, then the procedure would not work—the > ft_sourceanlaysis crashed. > > 2—There are a couple of studies comparing BEMCP and dipoli, among other > methods. The BEMCP method does not fare well, the dipoli fares better, > > E. g., among three or four studies I have seen. > Gramfort, A., et al. (2010). "OpenMEEG: opensource software for > quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. > > Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput > Intell Neurosci *2011*: 923703. > > 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, > and the Simbio FEM model, by correlating results from each model (e.g., > correlations of all the dipole CDR estimates; or correlations across > anatomical ROIs). The BEMCP and concentric spheres work similarly, and the > dipoli and Simbio-FEM work similarly. This was with infants using > participant-computed realistic models for the compartments and the FEM. > > I am not claiming from this and superiority of the dipoli (or FEM) models > over the BEMCP, but I suggest looking at the research literature formally > comparing these methods before going much further with BEMCP. > > John > > *********************************************** > John E. Richards Carolina Distinguished Professor > Department of Psychology > University of South Carolina > Columbia, SC 29208 > Dept Phone: 803 777 2079 > Fax: 803 777 9558 > Email: richards-john at sc.edu > HTTP: jerlab.psych.sc.edu > *********************************************** > > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Sat Mar 12 17:14:40 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sat, 12 Mar 2016 16:14:40 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Debora, The critical thing with BEMCP is that your sources are not too close to the inner skull boundary. When they are closer than the safe distance the solution you get is completely wrong. When they are not too close, the solution is OK and comparable at least to concentric spheres. The safe distance is is more or less the average edge length in your skull mesh. In SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option cfg.moveinward that corrects the mesh to ensure that it is not too close. It would be interesting if you use this option and report whether this resolves your problem. This issue should occur in any BEM but depending on the implementation the critical distance might be shorter. Best, Vladimir On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri wrote: > Dear John, > thanks a lot for your promt reply and your suggestion. I guess that I was > sticking to the BEM head model just because I read the tutorial for EEG BEM > head model first, but going quickly through the studies you have mentioned > and considering the tests you have performed, I may also consider to switch > to the FEM head model or to simply use the concentric spheres (which > appeared to work similar to BEMCP in your comparisons). I am relatively new > to source localization and had no crash/errors in my pipeline, and this > combination makes always difficult to find possible pitfalls. > > As soon as I have them ready, I will post the results obtained with the > FEM head model as well, maybe they will be useful for some other users :) > > Thanks again for your support! > All the best, > Debora > > On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN > wrote: > >> Deb: >> >> I have had problems with BEMCP. >> >> 1—one of the practical / technical problems is that if the compartments >> overlap, or even come close, then the procedure would not work—the >> ft_sourceanlaysis crashed. >> >> 2—There are a couple of studies comparing BEMCP and dipoli, among other >> methods. The BEMCP method does not fare well, the dipoli fares better, >> >> E. g., among three or four studies I have seen. >> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >> >> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >> Intell Neurosci *2011*: 923703. >> >> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >> and the Simbio FEM model, by correlating results from each model (e.g., >> correlations of all the dipole CDR estimates; or correlations across >> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >> dipoli and Simbio-FEM work similarly. This was with infants using >> participant-computed realistic models for the compartments and the FEM. >> >> I am not claiming from this and superiority of the dipoli (or FEM) models >> over the BEMCP, but I suggest looking at the research literature formally >> comparing these methods before going much further with BEMCP. >> >> John >> >> *********************************************** >> John E. Richards Carolina Distinguished Professor >> Department of Psychology >> University of South Carolina >> Columbia, SC 29208 >> Dept Phone: 803 777 2079 >> Fax: 803 777 9558 >> Email: richards-john at sc.edu >> HTTP: jerlab.psych.sc.edu >> *********************************************** >> >> > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Sun Mar 13 13:20:16 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Sun, 13 Mar 2016 13:20:16 +0100 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Runnan, I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. *Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue.* Best regards, Harold On 12 March 2016 at 01:02, wrote: > Dear Harold, > I am very sorry that I am not writing to reply your question but to > request you something about minimum norm estimate because I am a rather new > fieldtripper. I noticed that you have got results applying MNE, thus I > think you must be more experienced! I followed the tutorial at > http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did > source reconstruction with MEG data acquired from ctf 275 system. But I > got stuck in here > . Source model: Co-registration of the source space to the sensor-based > head coordinate system, > I could not find the file named ‘orig-nomask.mgz’ under the mir folder. > Would you tell me in which step should this file be created? And how to > create this file? > > Best regards, > > Runnan > > > > > > > 在 2016年3月10日,08:40,Harold Cavendish 写道: > > > Dear FieldTrip users, > > > I have a few questions regarding source localisation and statistics: > > > 1. Suppose I'm doing source reconstruction of ERP using minimum-norm > estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() > and getting rather meaningful results which I visualise via ft_plot_mesh(). > > > What is the validity of this result? I understand there are many > individual dipoles spread over the cortical sheet and we're estimating best > fit to the data given the conductance model while minimising overall power, > but what does this actually tell us? If I find an area with higher power, > what conclusions can I draw? > > > 2. Can I compute a correlation between the result in the source space and > a behavioural variable? Perhaps even specify a region of interest? If yes, > is this approach considered to be valid? > > > I want to see if e.g. the power of the reconstructed activity in the > source space averaged over a time window correlates with my behavioural > variable. > > > Thank you! > > > Best regards, > > Harold > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > 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 alexandre.gramfort at telecom-paristech.fr Sun Mar 13 18:16:47 2016 From: alexandre.gramfort at telecom-paristech.fr (Alexandre Gramfort) Date: Sun, 13 Mar 2016 18:16:47 +0100 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: References: Message-ID: hi, Basically the MNE code has been updated and the fieldtrip code has not been updated to be able to read the new epochs files MNE produces. Bushra you should share a file and code snippet to replicate the problem. HTH Alex On Sat, Mar 12, 2016 at 12:12 PM, Stephen Politzer-Ahles wrote: > Hello Bushra, > > You will be more likely to get helpful advice if you can provide more > details about your problem. See > http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > > >> >> Message: 1 >> Date: Fri, 11 Mar 2016 11:00:21 +0000 >> From: Bushra Riaz Syeda >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] error in reading epoched fif files >> Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b at EXCH03-P.GU.GU.SE> >> Content-Type: text/plain; charset="iso-8859-1" >> >> >> Hello, >> >> I am getting an error in reading epoched fiff files created with the >> latest stable version of mne >> Is there a quick fix to this problem? >> >> Thank you >> Kind regards >> Bushra Riaz? >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From ha438 at georgetown.edu Sun Mar 13 20:42:06 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Sun, 13 Mar 2016 15:42:06 -0400 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Just to put this out there for reference. I was able to solve the problem by replacing the 'issubfield' function with its Matlab equivalent 'isfield'. On Fri, Mar 11, 2016 at 1:46 AM, Hassan Aleem wrote: > Thanks for your response J.M. That makes sense. I will remove all > eeglab/spm/fieldtrip and reinstall,making sure to keep fieldtrip separate. > On Mar 11, 2016 1:40 AM, "Schoffelen, J.M. (Jan Mathijs)" < > jan.schoffelen at donders.ru.nl> wrote: > >> I cannot reproduce your problem. It seems that you are using an >> incorrect/outdated copy of issubfield. The line number you report in your >> error message does not line up with the current version. Please ensure that >> your matlab path is set correctly, in particular try to avoid copies of SPM >> or eeglab taking precedence. These may have old versions of FT code that >> can cause all kinds of erratic behaviour. >> >> Best wishes, >> Jan-Mathijs >> >> >> >> >> >> >> >> On 11 Mar 2016, at 01:02, Hassan Aleem wrote: >> >> Hi J.M, >> >> I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux >> operating system. However the problem appears also on my windows 10 OS. I >> am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot >> does not work with the same complaint as with trying to plot the source >> interpolation, I assume that's what you mean by checking them. Let me post >> the script to give you more information. ( the headmodel part of the script >> was modified from robert bauer) >> >> *%reading mri* >> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >> mri.coordsys ='MNI' >> ----------------------------------- >> *%segmentation* >> >> cfg = []; >> cfg.brainthreshold = 0.5; >> cfg.scalpthreshold = 0.15; >> cfg.downsample = 1; %no downsampling >> cfg.output = {'brain' 'scalp' 'skull'}; >> seg = ft_volumesegment(cfg, mri); >> ---------------------------------- >> %plotting segmentation >> cfg = []; >> cfg.funparameter = 'trishells'; >> cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; >> ft_sourceplot(cfg,seg) *this does not work, same error.* >> ------------------------------------------ >> *%building mesh* >> cfg = []; >> cfg.method= 'projectmesh'; >> cfg.tissue = {'scalp', 'skull', 'brain'}; >> cfg.numvertices = [1000 1000 1000]; >> bnd = ft_prepare_mesh(cfg, seg); >> >> % i enlarged / reduced the boundary mesh a little bit, because they were >> causing errors, probably due to overlapping >> bnd(1).pnt = bnd(1).pnt.*1.001 >> bnd(2).pnt = bnd(2).pnt.*1 >> bnd(3).pnt = bnd(3).pnt.*0.999 >> >> ft_plot_mesh(bnd(1))%scalp >> ft_plot_mesh(bnd(2))%skull >> ft_plot_mesh(bnd(3))%brain >> >> ---------------------------------------------------------- >> *%preparing headmodel* >> cfg = []; >> cfg.method = 'dipoli'; >> headmodel = ft_prepare_headmodel(cfg, bnd); >> -------------------------------------------------------- >> >> * %adding electrodes to headmodel* >> elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load >> electrode file >> >> % visualize head surface (scalp) >> >> figure; >> ft_plot_mesh(headmodel.bnd(1), >> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); >> hold on; >> % plot electrodes >> ft_plot_sens(elec,'style', 'sk') >> >> % aligning electrodes >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = headmodel.bnd(1);%scalp >> st_elec_aligned = ft_electroderealign(cfg); >> ----------------------------------------------- >> *%using the standard template sourcemodel from fieldtrip.* >> >> load('standard_sourcemodel3d5mm.mat') >> ------------------------------------- >> *%% timelock data* >> cfg = []; >> m0 = ft_timelockanalysis(cfg, dataM0); >> -------------------------------------- >> >> *%% perform source analysis * >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.lcmv.lambda='5%'; >> cfg.grid = sourcemodel.cfg.grid;---this is the standard template from >> fieldtrip >> cfg.headmodel = headmodel; >> cfg.lcmv.keepfilter = 'yes'; >> cfg.lcmv.projectnoise='yes'; >> cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD >> source_m0=ft_sourceanalysis(cfg,m0); >> ------------------------------ >> *%% source interpolation* >> >> cfg = []; >> cfg.interpmethod = 'nearest'; >> cfg.parameter = 'pow'; >> cfg.grid=sourcemodel.cfg.grid; >> sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); >> ---------------------------------------------- >> *%plotting* >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funcolorlim = 'maxabs'; >> cfg.funparameter= 'pow'; >> ft_sourceplot(cfg, sourceinterp_m0); >> >> This is where it gives me the error. Please let me know if you need more >> information. I also had a question about making a 'source' it seems that >> the fieldtrip tutorial does not use a 'sourcemodel' but instead use a >> dipolefitting source, is this comparable. Thank you for the help in advance. >> >> Best, >> >> Hassan >> >> On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hassan, >>> Can you please provide a bit more information with respect to what >>> version of fieldtrip, matlab and operating system you use? >>> Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? >>> We need more information to work with. >>> Best, >>> Jan-Mathijs >>> >>> >>> >>> On 09 Mar 2016, at 21:26, Hassan Aleem wrote: >>> >>> Hi everyone, >>> >>> I have a question that is possibly very easy to solve but is evading me. >>> I am unable to get ft_sourceplot to work. For example when I run the code: >>> >>> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >>> mri.coordsys ='MNI' >>> >>> cfg = []; >>> cfg.output = {'brain' 'scalp' 'skull'}; >>> seg = ft_volumesegment(cfg, mri); >>> seg.anatomy = mri.anatomy; >>> >>> cfg = []; >>> cfg.funparameter = 'brain'; >>> *ft_sourceplot(cfg,seg)* >>> >>> I get the error: >>> >>> *Error using textscan* >>> First input can not be empty. Expected a non-empty string or a valid >>> file-id. >>> >>> * Error in issubfield (line 44)* >>> t = textscan(f,'%s','delimiter','.'); >>> >>> * Error in ft_sourceplot (line 460)* >>> hasmsk = issubfield(functional, cfg.maskparameter); >>> >>> This is happening regardless of what stage I use ft_sourceplot. >>> >>> Thanks for your consideration! >>> >>> Hassan >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 pgoodin at swin.edu.au Mon Mar 14 05:59:43 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 14 Mar 2016 04:59:43 +0000 Subject: [FieldTrip] Striations in stats? Message-ID: Hi Fieldtrip list (and apologies for two posts in 4 days), I've run source analysis using DICS and the method outlined on the extended beamformer tutorial (http://www.fieldtriptoolbox.org/tutorial/beamformingextended) and am happy with the outcome, except after running permutation stats there's striations the the output (see attached). Any ideas on where this is coming from and how it could possibly be fixed (if at all) would be really appreciated. Just in case I've attached the code used to run the source analysis and stats. Thanks, Peter Source analysis on individuals (using common filter): %Source analysis of conditions and baselines cfg=[]; cfg.grad=grad; cfg.frequency=foi; %foi is taken from a peak at ~18Hz with 9Hz smoothing cfg.method='dics'; cfg.grid=leadfield; cfg.grid.filter=common; %Common filter computed from adding 4 conditions together. cfg.headmodel=hdm; cfg.dics.lambda=reg; %reg is 0 (due to having ~500 trials per condition). cfg.dics.keepfilter='no'; cfg.dics.fixedori='yes'; cfg.dics.realfilter='yes'; source_bsl=ft_sourceanalysis(cfg, bl_freqs); source_cond=ft_sourceanalysis(cfg, av_freqs); source_diff=source_cond; source_diff.avg.pow = (source_cond.avg.pow ./ source_bsl.avg.pow) -1; %Replace subject source grid locations with MNI positions. source_diff.pos = template.sourcemodel.pos; source_diff.dim = template.sourcemodel.dim; source_cond.pos = template.sourcemodel.pos; source_cond.dim = template.sourcemodel.dim; source_bsl.pos = template.sourcemodel.pos; source_bsl.dim = template.sourcemodel.dim; cfg.parameter='pow'; cfg.interpmethod='spline'; source_diff=ft_sourceinterpolate(cfg, source_diff, mnimri); source_cond=ft_sourceinterpolate(cfg, source_cond, mnimri); source_bsl=ft_sourceinterpolate(cfg, source_bsl, mnimri); *****Average source (source_diff) calculated using ft_sourcegrandaverage***** Stats (13 subs, repeated measures t-test): subj=size(cond,2); design=zeros(2,2*subj); for i=1:subj design(1,i)=i; end for i=1:subj design(1,subj+i)=i; end design(2,1:subj)=1; design(2,subj+1:2*subj)=2; cfg=[]; cfg.parameter='pow'; cfg.method='montecarlo'; cfg.statistic='ft_statfun_depsamplesT'; cfg.correctm='cluster'; cfg.numrandomization=rand; %rand = 2000 cfg.clustertail=0; cfg.alpha=0.025; cfg.design=design; cfg.uvar=1; cfg.ivar=2; %stat=ft_sourcestatistics(cfg, cond_ga{:},bsl_ga{:}); stat=ft_sourcestatistics(cfg, cond{:},bsl{:}); Plotting (average source masked by stats <.05): cfg=[]; cfg.method='slice'; cfg.funparameter='pow'; cfg.anaparameter='anatomy'; cfg.maskparameter='mask'; source_diff.mask=stat.prob <.05; ft_sourceplot(cfg, source_diff); _______________________ Dr Peter Goodin, Brain and Psychological Sciences Research Centre (BPsyC) Swinburne University, Hawthorn, Vic, 3122 -------------- next part -------------- A non-text attachment was scrubbed... Name: beta.jpg Type: image/jpeg Size: 251484 bytes Desc: beta.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: beta_sig.jpg Type: image/jpeg Size: 282748 bytes Desc: beta_sig.jpg URL: From bushra.riaz at gu.se Mon Mar 14 07:30:47 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Mon, 14 Mar 2016 06:30:47 +0000 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> References: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> Message-ID: <1457937054408.48754@gu.se> My bad. I should have explained the problem I am using this code to read epoched fif files created with latest version of mne-python as was explained in fieldtrip tutorial (http://www.fieldtriptoolbox.org/development/integrate_with_mne) The sample epoched file can be downloaded from this link https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0? cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); and I am getting the following error Error using fiff_read_epochs (line 46) Could not find epochs data Error in fiff_read_epochs (line 46) error(me,'Could not find epochs data'); Error in ft_read_header (line 1601) epochs = fiff_read_epochs(filename); Error in ft_preprocessing (line 397) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 14 09:40:36 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 14 Mar 2016 08:40:36 +0000 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Hi Runnan, Sorry for the confusion. The part of the documentation you are working with is currently being improved, but not finalized yet. In particular, the part you refer to ‘Source model: co-registration of the source space to the sensor-based coordinate system’ needs a heavy update. I would assume that you have done the tutorial up until there. In particular, if you have done the preprocessing of the anatomical MRI, where you have created 2 transformation matrices (using the same anatomical volume), you’re almost there. So please forget about the orig.mgz, either nomask or not, and please be a bit patient until we (i.e. I) find time to update the documentation. This is how you get the appropriate coregistration: (Note: I assume that all the objects are defined in ‘mm’, otherwise it won’t work. To get all things in ‘mm’, use ft_convert_units). Preliminaries: -we know how to get from an arbitrary voxel-space to the sensor-based coordinate system: transform_vox2ctf -we know how to get to the ‘mni’ coordinate system from the same arbitrary voxel-space: transform_vox2spm -we know that the sourcespace is expressed in the ‘mni’ coordinate system (check the units, is it mm?) Based on the first two points above, we can easily construct a transformation matrix that goes from ‘mni’ to ‘ctf’: T = transform_vox2ctf/transform_vox2spm We can now use T to transform the sourcespace: sourcespace = ft_transform_geometry(T, sourcespace); I am pretty sure that this will do the trick. Best, Jan-Mathijs On 13 Mar 2016, at 13:20, Harold Cavendish > wrote: Dear Runnan, I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. Best regards, Harold On 12 March 2016 at 01:02, > wrote: Dear Harold, I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here . Source model: Co-registration of the source space to the sensor-based head coordinate system, I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? Best regards, Runnan 在 2016年3月10日,08:40,Harold Cavendish > 写道: Dear FieldTrip users, I have a few questions regarding source localisation and statistics: 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. Thank you! Best regards, Harold _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 deb.desideri at gmail.com Mon Mar 14 11:46:36 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Mon, 14 Mar 2016 11:46:36 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir, thanks for your explanation. I tryed to use the option cfg.moveinward in ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this did not solve the issue. As you can see from the attachment the cortex is now partially uncovered. I am not sure I am using this option properly, maybe there is a combination of values for cfg.moveinward and cfg.inwardshift that works fine. I tryed several, but none of them gave me the source localization that I expect. I don't know whether the fact that some dipoles fall outside the brain matters. For the attached figures I had no dipoles outside the brain, whilst for some of the others attempts I had. I actually found this post on the mailinglist where both you and John already pointed out this issue using BEM: http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html Also I don't know whether this link (still under construction/discussion) may be of interest in this contex: http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed Furthermore, this other page (also under construction), uses the option cfg.inwardshift for the template grid to be used in the creation of the individual subject's grid, but without an explanation of why the option is/should be used: http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) provided by Fiedltrip, I don't know whether craeting my own template_grid using the cfg.inwardshift option would actually fix the problem. I would like to perform some further attempts, as soon as I have some time to go through the function and understand how this options actually interplay. Meanwhile, I am still working on producing the results using the FEM head model. It is much more time-consuming than the BEM, and maybe that's one of the reasons to choose BEM models. As soon as they are ready I will post them as well :) Anyway, thanks so much for your help. It was actually quite useful and instructive! All the best wishes, Debora On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak wrote: > Dear Debora, > > The critical thing with BEMCP is that your sources are not too close to > the inner skull boundary. When they are closer than the safe distance the > solution you get is completely wrong. When they are not too close, the > solution is OK and comparable at least to concentric spheres. The safe > distance is is more or less the average edge length in your skull mesh. In > SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option > cfg.moveinward that corrects the mesh to ensure that it is not too close. > It would be interesting if you use this option and report whether this > resolves your problem. > > This issue should occur in any BEM but depending on the implementation the > critical distance might be shorter. > > Best, > > Vladimir > > On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri > wrote: > >> Dear John, >> thanks a lot for your promt reply and your suggestion. I guess that I was >> sticking to the BEM head model just because I read the tutorial for EEG BEM >> head model first, but going quickly through the studies you have mentioned >> and considering the tests you have performed, I may also consider to switch >> to the FEM head model or to simply use the concentric spheres (which >> appeared to work similar to BEMCP in your comparisons). I am relatively new >> to source localization and had no crash/errors in my pipeline, and this >> combination makes always difficult to find possible pitfalls. >> >> As soon as I have them ready, I will post the results obtained with the >> FEM head model as well, maybe they will be useful for some other users :) >> >> Thanks again for your support! >> All the best, >> Debora >> >> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN >> wrote: >> >>> Deb: >>> >>> I have had problems with BEMCP. >>> >>> 1—one of the practical / technical problems is that if the compartments >>> overlap, or even come close, then the procedure would not work—the >>> ft_sourceanlaysis crashed. >>> >>> 2—There are a couple of studies comparing BEMCP and dipoli, among other >>> methods. The BEMCP method does not fare well, the dipoli fares better, >>> >>> E. g., among three or four studies I have seen. >>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>> >>> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >>> Intell Neurosci *2011*: 923703. >>> >>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >>> and the Simbio FEM model, by correlating results from each model (e.g., >>> correlations of all the dipole CDR estimates; or correlations across >>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>> dipoli and Simbio-FEM work similarly. This was with infants using >>> participant-computed realistic models for the compartments and the FEM. >>> >>> I am not claiming from this and superiority of the dipoli (or FEM) >>> models over the BEMCP, but I suggest looking at the research literature >>> formally comparing these methods before going much further with BEMCP. >>> >>> John >>> >>> *********************************************** >>> John E. Richards Carolina Distinguished Professor >>> Department of Psychology >>> University of South Carolina >>> Columbia, SC 29208 >>> Dept Phone: 803 777 2079 >>> Fax: 803 777 9558 >>> Email: richards-john at sc.edu >>> HTTP: jerlab.psych.sc.edu >>> *********************************************** >>> >>> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ResultSource_moveinward6mm.PNG Type: image/png Size: 144542 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SourceModel_moveinward6mm.PNG Type: image/png Size: 12143 bytes Desc: not available URL: From litvak.vladimir at gmail.com Mon Mar 14 12:11:36 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Mon, 14 Mar 2016 11:11:36 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Debora, cfg.moveinward option is useful when your source space is a mesh as it actually deforms the mesh to push it inwards. When your source space is a grid you should use cfg.inwardshift to just exclude the points that are closer than 6 mm to the boundary. It might be a useful exercise for you to compute the lead fields with concentric spheres and with a BEM for the same grid and then look at correlations between these lead fields. You should see that the correlations should be high at depth but might be low for some points close to the surface. Once you hit the right value of inwardshift the low correlations should disappear. Best, Vladimir On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri wrote: > Dear Vladimir, > thanks for your explanation. I tryed to use the option cfg.moveinward in > ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this > did not solve the issue. As you can see from the attachment the cortex is > now partially uncovered. I am not sure I am using this option properly, > maybe there is a combination of values for cfg.moveinward and > cfg.inwardshift that works fine. I tryed several, but none of them gave me > the source localization that I expect. > I don't know whether the fact that some dipoles fall outside the brain > matters. For the attached figures I had no dipoles outside the brain, > whilst for some of the others attempts I had. > > I actually found this post on the mailinglist where both you and John > already pointed out this issue using BEM: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html > > Also I don't know whether this link (still under construction/discussion) > may be of interest in this contex: > > > http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed > > Furthermore, this other page (also under construction), uses the option > cfg.inwardshift for the template grid to be used in the creation of the > individual subject's grid, but without an explanation of why the option > is/should be used: > > > http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space > > In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) > provided by Fiedltrip, I don't know whether craeting my own template_grid > using the cfg.inwardshift option would actually fix the problem. I would > like to perform some further attempts, as soon as I have some time to go > through the function and understand how this options actually interplay. > > Meanwhile, I am still working on producing the results using the FEM head > model. It is much more time-consuming than the BEM, and maybe that's one of > the reasons to choose BEM models. As soon as they are ready I will post > them as well :) > > Anyway, thanks so much for your help. It was actually quite useful and > instructive! > > All the best wishes, > Debora > > > > On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < > litvak.vladimir at gmail.com> wrote: > >> Dear Debora, >> >> The critical thing with BEMCP is that your sources are not too close to >> the inner skull boundary. When they are closer than the safe distance the >> solution you get is completely wrong. When they are not too close, the >> solution is OK and comparable at least to concentric spheres. The safe >> distance is is more or less the average edge length in your skull mesh. In >> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >> cfg.moveinward that corrects the mesh to ensure that it is not too close. >> It would be interesting if you use this option and report whether this >> resolves your problem. >> >> This issue should occur in any BEM but depending on the implementation >> the critical distance might be shorter. >> >> Best, >> >> Vladimir >> >> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri >> wrote: >> >>> Dear John, >>> thanks a lot for your promt reply and your suggestion. I guess that I >>> was sticking to the BEM head model just because I read the tutorial for EEG >>> BEM head model first, but going quickly through the studies you have >>> mentioned and considering the tests you have performed, I may also consider >>> to switch to the FEM head model or to simply use the concentric spheres >>> (which appeared to work similar to BEMCP in your comparisons). I am >>> relatively new to source localization and had no crash/errors in my >>> pipeline, and this combination makes always difficult to find possible >>> pitfalls. >>> >>> As soon as I have them ready, I will post the results obtained with the >>> FEM head model as well, maybe they will be useful for some other users :) >>> >>> Thanks again for your support! >>> All the best, >>> Debora >>> >>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN >> > wrote: >>> >>>> Deb: >>>> >>>> I have had problems with BEMCP. >>>> >>>> 1—one of the practical / technical problems is that if the >>>> compartments overlap, or even come close, then the procedure would not >>>> work—the ft_sourceanlaysis crashed. >>>> >>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>> better, >>>> >>>> E. g., among three or four studies I have seen. >>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>> >>>> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >>>> Intell Neurosci *2011*: 923703. >>>> >>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >>>> and the Simbio FEM model, by correlating results from each model (e.g., >>>> correlations of all the dipole CDR estimates; or correlations across >>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>> participant-computed realistic models for the compartments and the FEM. >>>> >>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>> models over the BEMCP, but I suggest looking at the research literature >>>> formally comparing these methods before going much further with BEMCP. >>>> >>>> John >>>> >>>> *********************************************** >>>> John E. Richards Carolina Distinguished Professor >>>> Department of Psychology >>>> University of South Carolina >>>> Columbia, SC 29208 >>>> Dept Phone: 803 777 2079 >>>> Fax: 803 777 9558 >>>> Email: richards-john at sc.edu >>>> HTTP: jerlab.psych.sc.edu >>>> *********************************************** >>>> >>>> >>> >>> >>> -- >>> >>> Debora Desideri, PhD Student >>> BNP Lab - Neurology Department >>> University Hospital Tübingen >>> Eberhard Karls University Tübingen >>> Hoppe-Seyler Str. 3 >>> D-72076 Tübingen >>> Tel: +49 7071/29 80478 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Mon Mar 14 16:12:12 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Mon, 14 Mar 2016 15:12:12 +0000 Subject: [FieldTrip] Subsample spike structure Message-ID: <04263829-3D34-463B-AA84-61862B33445C@tum.de> Dear all, is it possible to subsample spikes from a spike structure according to trials-of-interest? I have an existing spike structure containing spikes at all trials, but I want to analyze only spikes specific to a subset of trials. Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 From recasensmarc at gmail.com Mon Mar 14 23:09:36 2016 From: recasensmarc at gmail.com (Marc Recasens) Date: Mon, 14 Mar 2016 22:09:36 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> Message-ID: Dear Jan-Mathijs, Sara and FT community, I'd like to bring up this old thread which I think might be of interest us all. I don't know if there's been any new development on the MNE approach (?) since this thread was started one year ago. Anyway, in order to get template-registered surfaces that allow for inter-subject comparison/averaging, I tried using Jan-Mathijs suggestion to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR . - I managed to get the .coord and .topo files using CARET - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico -6") registered to the template (fsaverage I assume) using the following files. Actually I'm not 100% sure these are the correct files I should read (the output seems to make sense though): ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for rh/lh.orig ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for rh/lh.white (JM did not say anything about rh/lh.white but mne_setup_source_space required it) - I got the resulting template-registered sourcespace properly co-registered in the correct coordinate system (individual sensor space) - and successfully applied MNE on the template-registered sourcespace. Sources make sense are meshes are exchangeable across subjects (which I think makes sense since they're all registered to a template). HOWEVER, I'm stuck in what I think should be a rather straight forward step, which is the creation of a template sourcemodel/grid (from the fsaverage or Colins brain) that I can use in the same way as the MNI-aligned template grid is used; that is a Talairach aligned surface with 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the lines below, but without success (because of MNI instead of TAL aligned?): template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); bnd.pnt = template_sourcemodel.pnt; bnd.tri = template_sourcemodel.tri; Any ideas about how to get such a template mesh will be highly appreciated! Best wishes Marc On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Sara, > > What you need are some of the .coord files, and the .topo files. > > Specifically, the midthickness_orig and the sphere files should be > converted into a format that the mne-software can work with. > The only way I managed this, was to convert the gifti files back into > freesurfer’s format: > > tmp = ft_read_headshape({‘something-something.topo.gii’ > ‘somethingelse-.L.midthickness_orig.coord.gii’}); > ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); > > and likewise for the right hemisphere, as well as for the spheres. > > Then, you can proceed with using mne_setup_source_space to create the 8196 > mesh. The final tricky thing eventually is to get the stuff properly > co-registered in the correct coordinate system again, but this should > proceed in the same way as when you would have used non-surface registered > meshes. > > The creation of the volume conduction model is a separate step (and does > not require the cortical meshes). > > Best, > Jan-Mathijs > > > On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe wrote: > > > Dear Jan Mathijs, > > > > Thank you very much for your quick and detailed answer! > > > > As suggested, I post-processed the surface of one of my subjects based > on the recipe on the link. > > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, > .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), > > but at this point I am not sure about how to proceed. So I have now > several questions: > > > > - Do you know which are the files containing the registered data for the > creation of the meshes? > > How should I create them given the current format? most are .gii files. > > - Once creating the meshes, should I follow with the creation of the > volume conduction model > > and analysis of the functional data as described in the tutorial? > http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > > > > Apologize for all these specific questions but it is being a little bit > confusing to me. > > So if anyone has experienced the same and/or have any suggestion, any > comment would be very welcomed. > > > > Thanks a lot in advance, > > > > Best, > > > > Sara > > > > > > > > > > > > > > > > ----- Original Message ----- > > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: "FieldTrip discussion list" > > Sent: Wednesday, September 30, 2015 9:33:03 AM > > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage > with MNE > > > > Hi Sara, > > > > I think that in this case there is no absolutely ‘correct’ approach, > although some approaches may make more sense than others. > > At this point in time it is indeed not well documented how to proceed > from individual subject results source-reconstructed onto an individual > cortically constrained mesh to a group analysis. > > In the past, we have been working with a procedure where the surface > data were interpolated onto a 3D-grid so that we could use volumetric > normalization techniques in order to get the subjects into a common space > to allow for group statistics. So, here the order of the steps would be to > call ft_sourceinterpolate, followed by ft_volumenormalise, or to > interpolate the functional data directly onto a MNI-warped grid ( > http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > ). > > In the code you pasted in your e-mail message, there is also reference > to ft_volumerealign, but I am not sure I understand why this is a required > step at this point in the pipeline. > > > > All the above being said, nowadays I would advocate a slightly different > approach, which bypasses the volumetric interpolation, where per subject I > would use cortical meshes that is surface-registered to a template mesh, > which as a consequence allows for direct comparison of source locations > across subjects. The way to achieve this would be to post-process the > surfaces that come out of the freesurfer pipeline according to the recipe > described on > http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. > After this registration step, the low-resolution (i.e. in this case the > 8196-vertex) meshes can be created. > > > > Best wishes, > > Jan-Mathijs > > > > > > > > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > > > Max Planck Institute for Psycholinguistics > > Donders Centre for Cognitive Neuroimaging > > > > E-mail: j.schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.fieldtriptoolbox.org > > http://www.hettaligebrein.nl > > > > > > > > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe > wrote: > > > >> Dear all, > >> > >> I am working on the source analysis of ERF data from ElektaNeuromag > system, with individual T1s, using minimum-norm estimate as described in > the following tutorial: > >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > >> I am exactly following the suggested steps, and so got the source > estimation for each of my subjects (bellow the output for one subject), > which i can nicely plot with the ft_plot_mesh function: > >> > >> sourceest = > >> > >> time: [1x1401 double] > >> inside: [8196x1 logical] > >> pos: [8196x3 double] > >> method: 'average' > >> avg: [1x1 struct] > >> cfg: [1x1 struct] > >> > >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, > >> I am trying to normalise (ft_volumenormalise) and interpolate > (ft_sourceinterpolate) the functional and anatomical data. > >> > >> However, I am struggling in this two last steps. > >> Since I did not find a clear pipeline/tutorial about the exact approach > (am I missing something?) > >> and after trying several options (bellow I copy the code I am using), > it is not clear to me: > >> > >> - which is the exact input data for each of these last two functions, > and > >> - in which order they should be called. > >> > >> Now, I would highly appreciate if anyone could give me any cue about > which the correct approach is. > >> > >> Thank you in advance, > >> > >> All the best, > >> > >> Sara > >> > >> > >> > >> %%%%%%%%%%%% > >> > >> % Inverse solution > >> cfg = []; > >> cfg.method = 'mne'; > >> cfg.grid = leadfield; > >> cfg.vol = vol; > >> cfg.mne.prewhiten = 'yes'; > >> cfg.mne.lambda = 3; > >> cfg.mne.scalesourcecov = 'yes'; > >> cfg.senstype = 'MEG'; > >> > >> sourceest = ft_sourceanalysis(cfg,erf); > >> > >> % read T1 volume - coords in scanner space > >> mri = ft_read_mri('s01.nii'); > >> mri.coordsys = 'neuromag'; > >> > >> % read headshape - Neuromag coords > >> hsf = 's01.fif'; > >> [headshape] = ft_read_headshape(hsf); > >> > >> % align T1 with head posiiton in MEG > >> cfg = []; > >> cfg.method = 'headshape'; > >> cfg.parameter = 'anatomy'; > >> cfg.headshape.headshape = headshape; > >> cfg.headshape.interactive = 'no'; > >> > >> mri_real = ft_volumerealign(cfg,mri); > >> > >> % normalize the realinged individual MRI to SPM template > >> cfg = []; > >> cfg.spmversion = 'spm8'; > >> % cfg.template='T1.nii'; % when enabling this field, an incoming error > message indicates that the template is not in the spm coordinate system. > >> % However, is the one used by default in this > function (as mentioned in the reference) so it is confusing to me > >> > >> norm_mri = ft_volumenormalise(cfg,mri_real); > >> > >> % interpolate Source with MEG-aligned T1 > >> cfg = []; > >> cfg.parameter = 'all'; > >> cfg.downsample = 2; > >> > >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); > >> > >> %%%%%%%%%%%%%% > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> 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 > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From runna90 at 126.com Tue Mar 15 09:45:16 2016 From: runna90 at 126.com (CRN) Date: Tue, 15 Mar 2016 16:45:16 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Jan-Mathijs, Thank you very much for your reply! I have been halted in this problem for a few days… And I am really looking forward urgently to get the source localization result. So I am sorry to bother you again! But there is still something wrong with followed steps in this page. 1. The built of volume conduction model. I noticed that it is required to create the volume model with same coordinate system as MEG sensor positions were defined. The ‘or-nomask.mgz’ file was asked to provide again to be used as anatomical data. I chose to replace this file with ‘orig.mgz’ first, but I got bad outcome as displayed below: the code I applied was copied from the web: mri_nom = ft_read_mri('orig.mgz'); cfg = []; cfg.coordsys = 'spm'; cfg.output = {'brain'}; seg = ft_volumesegment(cfg, mri_nom); seg = ft_convert_units(seg,'cm'); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg,seg); vol.bnd = ft_transform_geometry(T, vol.bnd); save vol vol; So should I use the mri data with ctf coordinate system to build the model and then transform it to spm system with the ’T’ metric? 2. When I did Forward solution, I could not find sourcespace.pnt, parameters I got in the sourcespace as below: what is the definition of ‘.pnt’? Why it was lost in my sourcespace data? Thank you for your help! Best Runnan > On Mar 14, 2016, at 16:40, Schoffelen, J.M. (Jan Mathijs) wrote: > > Hi Runnan, > > Sorry for the confusion. The part of the documentation you are working with is currently being improved, but not finalized yet. > In particular, the part you refer to ‘Source model: co-registration of the source space to the sensor-based coordinate system’ needs a heavy update. I would assume that you have done the tutorial up until there. In particular, if you have done the preprocessing of the anatomical MRI, where you have created 2 transformation matrices (using the same anatomical volume), you’re almost there. So please forget about the orig.mgz, either nomask or not, and please be a bit patient until we (i.e. I) find time to update the documentation. > > This is how you get the appropriate coregistration: > > (Note: I assume that all the objects are defined in ‘mm’, otherwise it won’t work. To get all things in ‘mm’, use ft_convert_units). > > Preliminaries: > -we know how to get from an arbitrary voxel-space to the sensor-based coordinate system: transform_vox2ctf > -we know how to get to the ‘mni’ coordinate system from the same arbitrary voxel-space: transform_vox2spm > -we know that the sourcespace is expressed in the ‘mni’ coordinate system (check the units, is it mm?) > > Based on the first two points above, we can easily construct a transformation matrix that goes from ‘mni’ to ‘ctf’: > > T = transform_vox2ctf/transform_vox2spm > > We can now use T to transform the sourcespace: > > sourcespace = ft_transform_geometry(T, sourcespace); > > I am pretty sure that this will do the trick. > > Best, > Jan-Mathijs > > > > >> On 13 Mar 2016, at 13:20, Harold Cavendish > wrote: >> >> Dear Runnan, >> >> I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). >> >> However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. >> >> As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. >> >> Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. >> >> Best regards, >> Harold >> >> >> On 12 March 2016 at 01:02, > wrote: >> Dear Harold, >> I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here >> . Source model: Co-registration of the source space to the sensor-based head coordinate system,  <> >> I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? >> >> Best regards, >> >> Runnan >> >> >> >> >> >> >>> 在 2016年3月10日,08:40,Harold Cavendish > 写道: >>> >>> Dear FieldTrip users, >>> >>> I have a few questions regarding source localisation and statistics: >>> >>> 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). >>> >>> What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? >>> >>> 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? >>> >>> I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. >>> >>> Thank you! >>> >>> Best regards, >>> Harold >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2016-03-14 at 18.05.20.png Type: image/png Size: 82608 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2016-03-15 at 16.40.16.png Type: image/png Size: 18951 bytes Desc: not available URL: From runna90 at 126.com Tue Mar 15 09:49:56 2016 From: runna90 at 126.com (CRN) Date: Tue, 15 Mar 2016 16:49:56 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Harold, Thank you for your reply! It is very kind of you that trying to help me even though you did not do analysis following the page I mentioned. Hope the reply from Jan-Mathijs could help both of us! Best, Runnan > On Mar 13, 2016, at 20:20, Harold Cavendish wrote: > > Dear Runnan, > > I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). > > However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. > > As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. > > Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. > > Best regards, > Harold > > > On 12 March 2016 at 01:02, > wrote: > Dear Harold, > I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here > . Source model: Co-registration of the source space to the sensor-based head coordinate system,  <> > I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? > > Best regards, > > Runnan > > > > > > >> 在 2016年3月10日,08:40,Harold Cavendish > 写道: >> >> Dear FieldTrip users, >> >> I have a few questions regarding source localisation and statistics: >> >> 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). >> >> What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? >> >> 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? >> >> I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. >> >> Thank you! >> >> Best regards, >> Harold >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 Tue Mar 15 16:16:29 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 15 Mar 2016 15:16:29 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> Message-ID: <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> Marc, I would not recommend to try and create a low-resolution mesh for Colin’s brain. In some sense, Colin’s brain is not more special than any of your single subject brains. In other words, you could pick any of your single subjects, and use that for visualization. If you would like to visualize your results on a ‘average’ brain, I’d recommend the Conte69 brain, that has been developed at Washington University (the Caret people). As a side note, Caret development is discontinued by the WashU group. They have moved to connectome workbench, which has most of the functionality supported by Caret. Specfically, there’s now also a freesurfer_to_fs_LR script that uses wb_command (the command line utility of connectome workbench). Note 2: the *.coord.* and *.topo.* files are old style Caret. Nowadays, the topologies are represented in a single file *.surf.* (rather than the positions in the coord and the triangles in the topo). BEst, JM On 14 Mar 2016, at 23:09, Marc Recasens > wrote: Dear Jan-Mathijs, Sara and FT community, I'd like to bring up this old thread which I think might be of interest us all. I don't know if there's been any new development on the MNE approach (?) since this thread was started one year ago. Anyway, in order to get template-registered surfaces that allow for inter-subject comparison/averaging, I tried using Jan-Mathijs suggestion to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. - I managed to get the .coord and .topo files using CARET - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico -6") registered to the template (fsaverage I assume) using the following files. Actually I'm not 100% sure these are the correct files I should read (the output seems to make sense though): ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for rh/lh.orig ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for rh/lh.white (JM did not say anything about rh/lh.white but mne_setup_source_space required it) - I got the resulting template-registered sourcespace properly co-registered in the correct coordinate system (individual sensor space) - and successfully applied MNE on the template-registered sourcespace. Sources make sense are meshes are exchangeable across subjects (which I think makes sense since they're all registered to a template). HOWEVER, I'm stuck in what I think should be a rather straight forward step, which is the creation of a template sourcemodel/grid (from the fsaverage or Colins brain) that I can use in the same way as the MNI-aligned template grid is used; that is a Talairach aligned surface with 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the lines below, but without success (because of MNI instead of TAL aligned?): template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); bnd.pnt = template_sourcemodel.pnt; bnd.tri = template_sourcemodel.tri; Any ideas about how to get such a template mesh will be highly appreciated! Best wishes Marc On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Sara, What you need are some of the .coord files, and the .topo files. Specifically, the midthickness_orig and the sphere files should be converted into a format that the mne-software can work with. The only way I managed this, was to convert the gifti files back into freesurfer’s format: tmp = ft_read_headshape({‘something-something.topo.gii’ ‘somethingelse-.L.midthickness_orig.coord.gii’}); ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); and likewise for the right hemisphere, as well as for the spheres. Then, you can proceed with using mne_setup_source_space to create the 8196 mesh. The final tricky thing eventually is to get the stuff properly co-registered in the correct coordinate system again, but this should proceed in the same way as when you would have used non-surface registered meshes. The creation of the volume conduction model is a separate step (and does not require the cortical meshes). Best, Jan-Mathijs On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe > wrote: > Dear Jan Mathijs, > > Thank you very much for your quick and detailed answer! > > As suggested, I post-processed the surface of one of my subjects based on the recipe on the link. > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), > but at this point I am not sure about how to proceed. So I have now several questions: > > - Do you know which are the files containing the registered data for the creation of the meshes? > How should I create them given the current format? most are .gii files. > - Once creating the meshes, should I follow with the creation of the volume conduction model > and analysis of the functional data as described in the tutorial? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > > Apologize for all these specific questions but it is being a little bit confusing to me. > So if anyone has experienced the same and/or have any suggestion, any comment would be very welcomed. > > Thanks a lot in advance, > > Best, > > Sara > > > > > > > > ----- Original Message ----- > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: "FieldTrip discussion list" > > Sent: Wednesday, September 30, 2015 9:33:03 AM > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE > > Hi Sara, > > I think that in this case there is no absolutely ‘correct’ approach, although some approaches may make more sense than others. > At this point in time it is indeed not well documented how to proceed from individual subject results source-reconstructed onto an individual cortically constrained mesh to a group analysis. > In the past, we have been working with a procedure where the surface data were interpolated onto a 3D-grid so that we could use volumetric normalization techniques in order to get the subjects into a common space to allow for group statistics. So, here the order of the steps would be to call ft_sourceinterpolate, followed by ft_volumenormalise, or to interpolate the functional data directly onto a MNI-warped grid (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space). > In the code you pasted in your e-mail message, there is also reference to ft_volumerealign, but I am not sure I understand why this is a required step at this point in the pipeline. > > All the above being said, nowadays I would advocate a slightly different approach, which bypasses the volumetric interpolation, where per subject I would use cortical meshes that is surface-registered to a template mesh, which as a consequence allows for direct comparison of source locations across subjects. The way to achieve this would be to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. After this registration step, the low-resolution (i.e. in this case the 8196-vertex) meshes can be created. > > Best wishes, > Jan-Mathijs > > > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > Max Planck Institute for Psycholinguistics > Donders Centre for Cognitive Neuroimaging > > E-mail: j.schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.fieldtriptoolbox.org > http://www.hettaligebrein.nl > > > > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe > wrote: > >> Dear all, >> >> I am working on the source analysis of ERF data from ElektaNeuromag system, with individual T1s, using minimum-norm estimate as described in the following tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> I am exactly following the suggested steps, and so got the source estimation for each of my subjects (bellow the output for one subject), which i can nicely plot with the ft_plot_mesh function: >> >> sourceest = >> >> time: [1x1401 double] >> inside: [8196x1 logical] >> pos: [8196x3 double] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, >> I am trying to normalise (ft_volumenormalise) and interpolate (ft_sourceinterpolate) the functional and anatomical data. >> >> However, I am struggling in this two last steps. >> Since I did not find a clear pipeline/tutorial about the exact approach (am I missing something?) >> and after trying several options (bellow I copy the code I am using), it is not clear to me: >> >> - which is the exact input data for each of these last two functions, and >> - in which order they should be called. >> >> Now, I would highly appreciate if anyone could give me any cue about which the correct approach is. >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> >> >> %%%%%%%%%%%% >> >> % Inverse solution >> cfg = []; >> cfg.method = 'mne'; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> cfg.senstype = 'MEG'; >> >> sourceest = ft_sourceanalysis(cfg,erf); >> >> % read T1 volume - coords in scanner space >> mri = ft_read_mri('s01.nii'); >> mri.coordsys = 'neuromag'; >> >> % read headshape - Neuromag coords >> hsf = 's01.fif'; >> [headshape] = ft_read_headshape(hsf); >> >> % align T1 with head posiiton in MEG >> cfg = []; >> cfg.method = 'headshape'; >> cfg.parameter = 'anatomy'; >> cfg.headshape.headshape = headshape; >> cfg.headshape.interactive = 'no'; >> >> mri_real = ft_volumerealign(cfg,mri); >> >> % normalize the realinged individual MRI to SPM template >> cfg = []; >> cfg.spmversion = 'spm8'; >> % cfg.template='T1.nii'; % when enabling this field, an incoming error message indicates that the template is not in the spm coordinate system. >> % However, is the one used by default in this function (as mentioned in the reference) so it is confusing to me >> >> norm_mri = ft_volumenormalise(cfg,mri_real); >> >> % interpolate Source with MEG-aligned T1 >> cfg = []; >> cfg.parameter = 'all'; >> cfg.downsample = 2; >> >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); >> >> %%%%%%%%%%%%%% >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 -- Marc Recasens Tel.: +34 639 24 15 98 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Tue Mar 15 19:18:34 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Tue, 15 Mar 2016 19:18:34 +0100 Subject: [FieldTrip] Events in databrowser Message-ID: An HTML attachment was scrubbed... URL: From recasensmarc at gmail.com Wed Mar 16 01:48:16 2016 From: recasensmarc at gmail.com (Marc Recasens) Date: Wed, 16 Mar 2016 00:48:16 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> Message-ID: Dear JM Thanks for you answer! didn't know anything about Connectome Workbench, but this FieldTrip-Connectome link sounds VERY cool! I'll have a look at the wb_command and see if I can read the Conte69 *surf from there. Best wishes Marc On Tue, Mar 15, 2016 at 3:16 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Marc, > > I would not recommend to try and create a low-resolution mesh for Colin’s > brain. In some sense, Colin’s brain is not more special than any of your > single subject brains. In other words, you could pick any of your single > subjects, and use that for visualization. > If you would like to visualize your results on a ‘average’ brain, I’d > recommend the Conte69 brain, that has been developed at Washington > University (the Caret people). > > As a side note, Caret development is discontinued by the WashU group. They > have moved to connectome workbench, which has most of the functionality > supported by Caret. Specfically, there’s now also a freesurfer_to_fs_LR > script that uses wb_command (the command line utility of connectome > workbench). Note 2: the *.coord.* and *.topo.* files are old style Caret. > Nowadays, the topologies are represented in a single file *.surf.* (rather > than the positions in the coord and the triangles in the topo). > > BEst, > JM > > > > > On 14 Mar 2016, at 23:09, Marc Recasens wrote: > > Dear Jan-Mathijs, Sara and FT community, > > I'd like to bring up this old thread which I think might be of interest us > all. I don't know if there's been any new development on the MNE approach > (?) since this thread was started one year ago. Anyway, in order to get > template-registered surfaces that allow for inter-subject > comparison/averaging, I tried using Jan-Mathijs suggestion to post-process > the surfaces that come out of the freesurfer pipeline according to the > recipe described on > http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR > . > > - I managed to get the .coord and .topo files using CARET > - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico > -6") registered to the template (fsaverage I assume) using the following > files. Actually I'm not 100% sure these are the correct files I should read > (the output seems to make sense though): > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for > rh/lh.orig > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for > rh/lh.white (JM did not say anything about rh/lh.white but > mne_setup_source_space required it) > > - I got the resulting template-registered sourcespace properly > co-registered in the correct coordinate system (individual sensor space) > - and successfully applied MNE on the template-registered sourcespace. > Sources make sense are meshes are exchangeable across subjects (which I > think makes sense since they're all registered to a template). > > HOWEVER, I'm stuck in what I think should be a rather straight forward > step, which is the creation of a template sourcemodel/grid (from the > fsaverage or Colins brain) that I can use in the same way as the > MNI-aligned template grid is used; that is a Talairach aligned surface with > 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the > lines below, but without success (because of MNI instead of TAL aligned?): > > template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); > template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); > bnd.pnt = template_sourcemodel.pnt; > bnd.tri = template_sourcemodel.tri; > > Any ideas about how to get such a template mesh will be highly appreciated! > > Best wishes > Marc > > > On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Sara, >> >> What you need are some of the .coord files, and the .topo files. >> >> Specifically, the midthickness_orig and the sphere files should be >> converted into a format that the mne-software can work with. >> The only way I managed this, was to convert the gifti files back into >> freesurfer’s format: >> >> tmp = ft_read_headshape({‘something-something.topo.gii’ >> ‘somethingelse-.L.midthickness_orig.coord.gii’}); >> ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); >> >> and likewise for the right hemisphere, as well as for the spheres. >> >> Then, you can proceed with using mne_setup_source_space to create the >> 8196 mesh. The final tricky thing eventually is to get the stuff properly >> co-registered in the correct coordinate system again, but this should >> proceed in the same way as when you would have used non-surface registered >> meshes. >> >> The creation of the volume conduction model is a separate step (and does >> not require the cortical meshes). >> >> Best, >> Jan-Mathijs >> >> >> On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe wrote: >> >> > Dear Jan Mathijs, >> > >> > Thank you very much for your quick and detailed answer! >> > >> > As suggested, I post-processed the surface of one of my subjects based >> on the recipe on the link. >> > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, >> .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), >> > but at this point I am not sure about how to proceed. So I have now >> several questions: >> > >> > - Do you know which are the files containing the registered data for >> the creation of the meshes? >> > How should I create them given the current format? most are .gii files. >> > - Once creating the meshes, should I follow with the creation of the >> volume conduction model >> > and analysis of the functional data as described in the tutorial? >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> > >> > Apologize for all these specific questions but it is being a little bit >> confusing to me. >> > So if anyone has experienced the same and/or have any suggestion, any >> comment would be very welcomed. >> > >> > Thanks a lot in advance, >> > >> > Best, >> > >> > Sara >> > >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > From: "Schoffelen, J.M. (Jan Mathijs)" >> > To: "FieldTrip discussion list" >> > Sent: Wednesday, September 30, 2015 9:33:03 AM >> > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage >> with MNE >> > >> > Hi Sara, >> > >> > I think that in this case there is no absolutely ‘correct’ approach, >> although some approaches may make more sense than others. >> > At this point in time it is indeed not well documented how to proceed >> from individual subject results source-reconstructed onto an individual >> cortically constrained mesh to a group analysis. >> > In the past, we have been working with a procedure where the surface >> data were interpolated onto a 3D-grid so that we could use volumetric >> normalization techniques in order to get the subjects into a common space >> to allow for group statistics. So, here the order of the steps would be to >> call ft_sourceinterpolate, followed by ft_volumenormalise, or to >> interpolate the functional data directly onto a MNI-warped grid ( >> http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> ). >> > In the code you pasted in your e-mail message, there is also reference >> to ft_volumerealign, but I am not sure I understand why this is a required >> step at this point in the pipeline. >> > >> > All the above being said, nowadays I would advocate a slightly >> different approach, which bypasses the volumetric interpolation, where per >> subject I would use cortical meshes that is surface-registered to a >> template mesh, which as a consequence allows for direct comparison of >> source locations across subjects. The way to achieve this would be to >> post-process the surfaces that come out of the freesurfer pipeline >> according to the recipe described on >> http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. >> After this registration step, the low-resolution (i.e. in this case the >> 8196-vertex) meshes can be created. >> > >> > Best wishes, >> > Jan-Mathijs >> > >> > >> > >> > >> > Jan-Mathijs Schoffelen, MD PhD, Senior researcher >> > >> > Max Planck Institute for Psycholinguistics >> > Donders Centre for Cognitive Neuroimaging >> > >> > E-mail: j.schoffelen at donders.ru.nl >> > Telephone: +31-24-3614793 >> > >> > http://www.fieldtriptoolbox.org >> > http://www.hettaligebrein.nl >> > >> > >> > >> > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe >> wrote: >> > >> >> Dear all, >> >> >> >> I am working on the source analysis of ERF data from ElektaNeuromag >> system, with individual T1s, using minimum-norm estimate as described in >> the following tutorial: >> >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> >> I am exactly following the suggested steps, and so got the source >> estimation for each of my subjects (bellow the output for one subject), >> which i can nicely plot with the ft_plot_mesh function: >> >> >> >> sourceest = >> >> >> >> time: [1x1401 double] >> >> inside: [8196x1 logical] >> >> pos: [8196x3 double] >> >> method: 'average' >> >> avg: [1x1 struct] >> >> cfg: [1x1 struct] >> >> >> >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, >> >> I am trying to normalise (ft_volumenormalise) and interpolate >> (ft_sourceinterpolate) the functional and anatomical data. >> >> >> >> However, I am struggling in this two last steps. >> >> Since I did not find a clear pipeline/tutorial about the exact >> approach (am I missing something?) >> >> and after trying several options (bellow I copy the code I am using), >> it is not clear to me: >> >> >> >> - which is the exact input data for each of these last two functions, >> and >> >> - in which order they should be called. >> >> >> >> Now, I would highly appreciate if anyone could give me any cue about >> which the correct approach is. >> >> >> >> Thank you in advance, >> >> >> >> All the best, >> >> >> >> Sara >> >> >> >> >> >> >> >> %%%%%%%%%%%% >> >> >> >> % Inverse solution >> >> cfg = []; >> >> cfg.method = 'mne'; >> >> cfg.grid = leadfield; >> >> cfg.vol = vol; >> >> cfg.mne.prewhiten = 'yes'; >> >> cfg.mne.lambda = 3; >> >> cfg.mne.scalesourcecov = 'yes'; >> >> cfg.senstype = 'MEG'; >> >> >> >> sourceest = ft_sourceanalysis(cfg,erf); >> >> >> >> % read T1 volume - coords in scanner space >> >> mri = ft_read_mri('s01.nii'); >> >> mri.coordsys = 'neuromag'; >> >> >> >> % read headshape - Neuromag coords >> >> hsf = 's01.fif'; >> >> [headshape] = ft_read_headshape(hsf); >> >> >> >> % align T1 with head posiiton in MEG >> >> cfg = []; >> >> cfg.method = 'headshape'; >> >> cfg.parameter = 'anatomy'; >> >> cfg.headshape.headshape = headshape; >> >> cfg.headshape.interactive = 'no'; >> >> >> >> mri_real = ft_volumerealign(cfg,mri); >> >> >> >> % normalize the realinged individual MRI to SPM template >> >> cfg = []; >> >> cfg.spmversion = 'spm8'; >> >> % cfg.template='T1.nii'; % when enabling this field, an incoming error >> message indicates that the template is not in the spm coordinate system. >> >> % However, is the one used by default in this >> function (as mentioned in the reference) so it is confusing to me >> >> >> >> norm_mri = ft_volumenormalise(cfg,mri_real); >> >> >> >> % interpolate Source with MEG-aligned T1 >> >> cfg = []; >> >> cfg.parameter = 'all'; >> >> cfg.downsample = 2; >> >> >> >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); >> >> >> >> %%%%%%%%%%%%%% >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> 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 >> > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzuchenlung at gmail.com Wed Mar 16 09:52:17 2016 From: tzuchenlung at gmail.com (Jane Lung) Date: Wed, 16 Mar 2016 16:52:17 +0800 Subject: [FieldTrip] Why does dissimilar structures happen? Message-ID: Dear FieldTrip users, I have a question about preparing head model, I got an error after executing: "grad_aligned = ft_sensorrealign(cfg, grad);" the error message as follow: Subscripted assignment between dissimilar structures. Error in ft_sensorrealign (line 235) tmp(i) = ft_convert_units(template(i), elec.unit); % ensure that the units are consistent with the electrodes since my data come from Yokogawa160 I just followed the tutorial: Getting started with Yokogawa data Can anyone give me a suggestion? what might be wrong? because I'm a beginner of fieldtrip user, so please excuse me for my naive question... Sincerely Jane -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Wed Mar 16 14:44:13 2016 From: alik.widge at gmail.com (Alik Widge) Date: Wed, 16 Mar 2016 09:44:13 -0400 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: My approach has been to define my events temporarily as "artifacts" in the cfg. Mark a few artifacts manually in the data browser, then inspect the cfg you get as output, you'll see the necessary structure. Just make sure to take them back out before you call rejectartifact! On Mar 16, 2016 1:08 AM, "Irene Sophia Mayer" wrote: > Dear fieldtrippers, > > I would like to look at my data while it is still in its continuous form > with databrowser. However, it does not display my events. > > Is there a way to display data in databrowser with the events visible? > > Cheers, > Irene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Wed Mar 16 18:36:30 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Wed, 16 Mar 2016 18:36:30 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf Message-ID: Dear all, I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion? Thank you very much in advance. Bests, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Wed Mar 16 19:00:02 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Wed, 16 Mar 2016 19:00:02 +0100 Subject: [FieldTrip] Events in databrowser Message-ID: An HTML attachment was scrubbed... URL: From gina.joue at univr.it Wed Mar 16 19:07:42 2016 From: gina.joue at univr.it (gj) Date: Wed, 16 Mar 2016 19:07:42 +0100 Subject: [FieldTrip] import own format (long trials) Message-ID: <56E9A0EE.3060006@univr.it> Hi, I am trying to import EEG data preprocessed and averaged in BrainVision Analyzer. I have a 2-second segment of data per condition per subject which corresponds to the averaged signal across all trials of each condition for the subject. Is the following approach correct? Import the 4 conditions as 4 long trials (2 sec or 2000 samples with sampling freq of 1000 Hz) => data.trial is a 1x4 cell array and each cell array contains an nchan x 2000 matrix I am trying to fill in the other fields of the data structure to mimic FieldTrip's raw data but I think I am having problems with data.sampleinfo which, if I understand correctly, needs to be specified for long trials. According to the wiki, this should be an array containing [startsample endsample] to specify the position of each trial, with info for each trial on every row. However, it doesn't seem right to have data.sampleinfo = repmat([1 2000],4,1) Thanks in advance for any help! Gina From Max.Cantor at Colorado.EDU Wed Mar 16 19:40:35 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 16 Mar 2016 12:40:35 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: I currently use a neuroscan64 system, with the quickcap64 layout. Just looking at the layout, it seems like FP1 could be interpolated from FPZ and AF3, but I'd have to test (or look at my neighbours structure) to see if this would be the case. Anyway, depending on your setup, it may be the case that FP1 does not have any designated neighbours to interpolate from. You may need to try a different method than average or nearest. On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer wrote: > Dear fieldtrippers, > > I have excluded noisy channels from my data using > > data = ft_rejectvisual(cfg, data); > data = ft_rejectartifact(cfg, data); > > and now want to interpolate them. To do so, I am first defining the > neighbours using a zebris file: > > cfg = []; > cfg.method = 'template'; > cfg.layout = 'EEG1010.lay'; > cfg.feedback = 'yes'; > cfg.elec = ft_read_sens('Maque.sfp'); > neighbours = ft_prepare_neighbours(cfg,data_con); > > With data_con being the data that still has all the channels in it. This > gives me the variable neighbours that does indeed contain the 6 neighbours > for my missing channel. However, when I try to use > > cfg.method = 'average'; > cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; > cfg.neighbours = neighbours; > data = ft_channelrepair(cfg,data); > > I get the following message for each and every trial: trying to > reconstruct missing channel Fp1 - cannot reconstruct channel - no > neighbours in the original data or in the sensor position. > > Does anyone have an idea why this is not working properly? > > Cheers, > Irene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From maity_winky at yahoo.es Wed Mar 16 19:55:00 2016 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Wed, 16 Mar 2016 18:55:00 +0000 (UTC) Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: Message-ID: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best,Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion?Thank you very much in advance.Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Wed Mar 16 20:31:09 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 16 Mar 2016 13:31:09 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: Coincidentally, I just had to remove FP1 from one of my datasets, failed to check my neighbours structure ahead of time despite this conversation, and can confirm that FP1 could not be interpolated for me as well. On Wed, Mar 16, 2016 at 12:40 PM, Max Cantor wrote: > I currently use a neuroscan64 system, with the quickcap64 layout. Just > looking at the layout, it seems like FP1 could be interpolated from FPZ and > AF3, but I'd have to test (or look at my neighbours structure) to see if > this would be the case. Anyway, depending on your setup, it may be the case > that FP1 does not have any designated neighbours to interpolate from. You > may need to try a different method than average or nearest. > > On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer > wrote: > >> Dear fieldtrippers, >> >> I have excluded noisy channels from my data using >> >> data = ft_rejectvisual(cfg, data); >> data = ft_rejectartifact(cfg, data); >> >> and now want to interpolate them. To do so, I am first defining the >> neighbours using a zebris file: >> >> cfg = []; >> cfg.method = 'template'; >> cfg.layout = 'EEG1010.lay'; >> cfg.feedback = 'yes'; >> cfg.elec = ft_read_sens('Maque.sfp'); >> neighbours = ft_prepare_neighbours(cfg,data_con); >> >> With data_con being the data that still has all the channels in it. This >> gives me the variable neighbours that does indeed contain the 6 neighbours >> for my missing channel. However, when I try to use >> >> cfg.method = 'average'; >> cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; >> cfg.neighbours = neighbours; >> data = ft_channelrepair(cfg,data); >> >> I get the following message for each and every trial: trying to >> reconstruct missing channel Fp1 - cannot reconstruct channel - no >> neighbours in the original data or in the sensor position. >> >> Does anyone have an idea why this is not working properly? >> >> Cheers, >> Irene >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Graduate Student > Cognitive Neuroscience of Language Lab > University of Colorado Boulder > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Thu Mar 17 03:47:22 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 16 Mar 2016 22:47:22 -0400 Subject: [FieldTrip] please help, approaching deadline. ft_sourceanalysis line 813 Message-ID: Hi all, I have a pipeline created where at the ft_prepare_leadfield step, the grid.label and cfg.channel fields both exist, But when I run the ft_sourceanalysis, they result as empty matrices--throwing an error. they are both cells {128x1}, but at ft_sourceanalysis result in [ ] here is my code for reference. Sorry for the long post, I am very close to a deadline and would be very grateful for your help. Please scroll below to see section where the error is thrown. *%% parameters list* (just for reference) mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; mritype='MNI'; realign='realigned'; volumereslicing='volumeresliced'; brainthresh=0.5; scalpthresh=0.10; scalpsmooth='scalp_smooth'; scalp_smooth.parameter=9; scalpvertices=1000; skullvertices=1000; brainvertices=1000; meshmethod='projectmesh'; headmodel_method='bemcp'; subjnum='915'; time='pre'; timetype='simple'; gridtype='template10'; beamformer='lcmv'; identifier='Parameter2'; *%% make headmodel* switch mritype case 'MNI' [mri] = ft_read_mri(mrifile); mri.coordsys ='MNI'; case 'Analyze' [mri] = ft_read_mri(mrifile); mri.coordsys ='Analyze'; end *%% realigning* switch realign case 'realigned' cfg=[]; cfg.method='fiducial'; cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; mri_realigned=ft_volumerealign(cfg,mri); save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') case 'notrealigned' %do nothing end *%% volume reslicing* switch volumereslicing case 'volumeresliced' cfg = []; cfg.resolution = 1; mri_resliced = ft_volumereslice(cfg, mri); save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') case 'notresliced' %do nothing end *%% segmentation parameters* switch scalpsmooth case 'noscalpsmooth' cfg = []; cfg.brainthreshold = braintresh; cfg.scalpthreshold = scalpthresh; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); case 'scalp_smooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.scalpsmooth = scalp_smooth.parameter; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); end *%%prepare mesh * cfg = []; cfg.method= meshmethod; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [scalpvertices skullvertices brainvertices]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001; bnd(2).pnt = bnd(2).pnt.*1; bnd(3).pnt = bnd(3).pnt.*0.999; *%% prepare headmodel* switch headmodel_method case 'dipoli' cfg = []; cfg.method = 'dipoli'; case 'bemcp' cfg = []; cfg.method = 'bemcp'; end headmodel = ft_prepare_headmodel(cfg, bnd); headmodel = ft_convert_units(headmodel,'cm'); *%% adding electrodes to headmodel* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') %most likely they are not aligned, so for aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes nas=mri_realigned.cfg.fiducial.nas; lpa=mri_realigned.cfg.fiducial.lpa; rpa=mri_realigned.cfg.fiducial.rpa; *%% load EEG data* i can send these to any ambitiously nice person wanting to try out the script exactly *%% timelock data* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); cfg = []; same = dataM0; same.trial = [dataM0.trial dataM3W.trial]; same.time = [dataM0.time dataM3W.time]; diff = dataM6; diff.trial = [dataM3Bb.trial dataM6.trial]; diff.time = [dataM3Bb.time dataM6.time]; switch timetype case 'simple' timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); case 'hassan' cfg.vartrllength = 2; cfg.covariance = 'yes'; cfg.covariancewindow = [0 .2]; cfg.keeptrials = 'yes'; timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); *%% make sourcemodel* cfg = []; cfg.headmodel = headmodel; cfg.mri=mri; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel.cfg.grid; cfg.grid.nonlinear = 'yes'; cfg.resolution = 10; % resolution of the template grid in mm cfg.moveinward = 1; cfg.grid.unit ='mm'; cfg.inwardshift = 0; cfg.elec = elec; % cfg.headshape=('cortex_5124.surf.gii'); mysourcemodel = ft_prepare_sourcemodel(cfg); *%% make leadfield* switch gridtype case 'individual' cfg = []; cfg.elec = elec; cfg.headmodel = headmodel; cfg.grid =mysourcemodel; % cfg.grid.resolution = 2; %gives me Error using ft_prepare_sourcemodel (line 163) %You cannot specify cfg.grid.resolution and an explicit cfg.grid.xgrid simultaneously cfg.reducerank= 3; cfg.channel = elec.chanpos; cfg.grid.unit = 'cm';% same unit as above, i.e. in cm [grid] = ft_prepare_leadfield(cfg); case 'templatebased' load('standard_sourcemodel3d10mm.mat') cfg = []; cfg.elec = elec; cfg.template = sourcemodel.cfg.grid; cfg.grid=grid; cfg.headmodel = headmodel; cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG cfg.channel = 'all'; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; [grid] = ft_prepare_leadfield(cfg); case 'template10' load('standard_sourcemodel3d10mm.mat') [grid]=sourcemodel.cfg.grid; end *%% run beamformer*-* this step is what gives the error, * switch beamformer case 'lcmv' cfg = []; cfg.method = 'lcmv'; cfg.elec=elec; cfg.lcmv.lambda='5%'; cfg.grid = grid; cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD >>>>>the error is>>> *Subscript indices must either be real positive integers or logicals.Error in beamformer_lcmv (line 168) noise = noise(end);Error in ft_sourceanalysis (line 841)dip(i) = beamformer_lcmv(grid, sens, headmodel, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:});* *I suspect its because in ft_sourceanalysis (line813) [i1, i2] = match_str(cfg.channel, grid.label)* *the result is i1=[] and i2=[]. eventhough when I look up cfg.channel and grid.label in my variables they exist. after running ft_sourceanalysis the cfg.channel field disappeaers. * *%%interpolate* cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri_resliced); sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri_resliced); sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri_resliced); sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri_resliced); sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri_resliced); sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri_resliced); *%%Plot* cfg = []; cfg.method = 'surface'; cfg.funcolormap = 'jet'; % cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg,sourceinterp_diff); ft_sourceplot(cfg,sourceinterp_m0); ft_sourceplot(cfg,sourceinterp_m6); ft_sourceplot(cfg,sourceinterp_m3w); ft_sourceplot(cfg,sourceinterp_m3b); ft_sourceplot(cfg,sourceinterp_same); -------------- next part -------------- An HTML attachment was scrubbed... URL: From gunnar.norrman at biling.su.se Thu Mar 17 08:36:22 2016 From: gunnar.norrman at biling.su.se (Gunnar Norrman) Date: Thu, 17 Mar 2016 07:36:22 +0000 Subject: [FieldTrip] Epoching EEG data after downsampling Message-ID: <1458200183218.67807@biling.su.se> Hello, I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > In ft_redefinetrial (line 222) Subscripted assignment dimension mismatch. Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? Thank you! Best regards, Gunnar Norrman --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Thu Mar 17 09:40:56 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Thu, 17 Mar 2016 09:40:56 +0100 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 15:08:05 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 15:08:05 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir and John, attached you can find the results of the source localizaiton with the FEM head model. Moreover, I also report the correlation of the lead fields for the FEM and concentric spheres models and BEM and concentric spheres model (the latter one using an inwardshift of 6 mm). Unfortunately, I could not produce the correlation trend we expected (I tryed several values of inwardshifts, ranging form 1mm to 10 mm and the plot is of course not identical to the one I posted, but it is qualitatively similar). There must still be something I don't fully get probably, since the correlation between the concentric spheres lead fields and the BEM lead fields is always so low, even close to the center of the head, regardless of the inwardshift value. All considered, I would rather go for a FEM model at least for the moment being. Thanks a lot for your support! Best, Debora On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak wrote: > Dear Debora, > > cfg.moveinward option is useful when your source space is a mesh as it > actually deforms the mesh to push it inwards. When your source space is a > grid you should use cfg.inwardshift to just exclude the points that are > closer than 6 mm to the boundary. It might be a useful exercise for you to > compute the lead fields with concentric spheres and with a BEM for the same > grid and then look at correlations between these lead fields. You should > see that the correlations should be high at depth but might be low for some > points close to the surface. Once you hit the right value of inwardshift > the low correlations should disappear. > > Best, > > Vladimir > > On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri > wrote: > >> Dear Vladimir, >> thanks for your explanation. I tryed to use the option cfg.moveinward in >> ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this >> did not solve the issue. As you can see from the attachment the cortex is >> now partially uncovered. I am not sure I am using this option properly, >> maybe there is a combination of values for cfg.moveinward and >> cfg.inwardshift that works fine. I tryed several, but none of them gave me >> the source localization that I expect. >> I don't know whether the fact that some dipoles fall outside the brain >> matters. For the attached figures I had no dipoles outside the brain, >> whilst for some of the others attempts I had. >> >> I actually found this post on the mailinglist where both you and John >> already pointed out this issue using BEM: >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >> >> Also I don't know whether this link (still under construction/discussion) >> may be of interest in this contex: >> >> >> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >> >> Furthermore, this other page (also under construction), uses the option >> cfg.inwardshift for the template grid to be used in the creation of the >> individual subject's grid, but without an explanation of why the option >> is/should be used: >> >> >> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >> >> In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) >> provided by Fiedltrip, I don't know whether craeting my own template_grid >> using the cfg.inwardshift option would actually fix the problem. I would >> like to perform some further attempts, as soon as I have some time to go >> through the function and understand how this options actually interplay. >> >> Meanwhile, I am still working on producing the results using the FEM head >> model. It is much more time-consuming than the BEM, and maybe that's one of >> the reasons to choose BEM models. As soon as they are ready I will post >> them as well :) >> >> Anyway, thanks so much for your help. It was actually quite useful and >> instructive! >> >> All the best wishes, >> Debora >> >> >> >> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >> litvak.vladimir at gmail.com> wrote: >> >>> Dear Debora, >>> >>> The critical thing with BEMCP is that your sources are not too close to >>> the inner skull boundary. When they are closer than the safe distance the >>> solution you get is completely wrong. When they are not too close, the >>> solution is OK and comparable at least to concentric spheres. The safe >>> distance is is more or less the average edge length in your skull mesh. In >>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>> It would be interesting if you use this option and report whether this >>> resolves your problem. >>> >>> This issue should occur in any BEM but depending on the implementation >>> the critical distance might be shorter. >>> >>> Best, >>> >>> Vladimir >>> >>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri >> > wrote: >>> >>>> Dear John, >>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>> BEM head model first, but going quickly through the studies you have >>>> mentioned and considering the tests you have performed, I may also consider >>>> to switch to the FEM head model or to simply use the concentric spheres >>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>> relatively new to source localization and had no crash/errors in my >>>> pipeline, and this combination makes always difficult to find possible >>>> pitfalls. >>>> >>>> As soon as I have them ready, I will post the results obtained with the >>>> FEM head model as well, maybe they will be useful for some other users :) >>>> >>>> Thanks again for your support! >>>> All the best, >>>> Debora >>>> >>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>> RICHARDS at mailbox.sc.edu> wrote: >>>> >>>>> Deb: >>>>> >>>>> I have had problems with BEMCP. >>>>> >>>>> 1—one of the practical / technical problems is that if the >>>>> compartments overlap, or even come close, then the procedure would not >>>>> work—the ft_sourceanlaysis crashed. >>>>> >>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>> better, >>>>> >>>>> E. g., among three or four studies I have seen. >>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>> >>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>> >>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>> participant-computed realistic models for the compartments and the FEM. >>>>> >>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>> models over the BEMCP, but I suggest looking at the research literature >>>>> formally comparing these methods before going much further with BEMCP. >>>>> >>>>> John >>>>> >>>>> *********************************************** >>>>> John E. Richards Carolina Distinguished Professor >>>>> Department of Psychology >>>>> University of South Carolina >>>>> Columbia, SC 29208 >>>>> Dept Phone: 803 777 2079 >>>>> Fax: 803 777 9558 >>>>> Email: richards-john at sc.edu >>>>> HTTP: jerlab.psych.sc.edu >>>>> *********************************************** >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> Debora Desideri, PhD Student >>>> BNP Lab - Neurology Department >>>> University Hospital Tübingen >>>> Eberhard Karls University Tübingen >>>> Hoppe-Seyler Str. 3 >>>> D-72076 Tübingen >>>> Tel: +49 7071/29 80478 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_FEM_CONCENTRICSPHERES.png Type: image/png Size: 80143 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FEM_SourceResults.png Type: image/png Size: 117351 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_BEM_CONCENTRICSPHERES_inwardshift6mm.png Type: image/png Size: 124166 bytes Desc: not available URL: From litvak.vladimir at gmail.com Thu Mar 17 15:21:26 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 17 Mar 2016 14:21:26 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: What about correlations between local spheres and the FEM? If it's only the BEM that's broken I'd expect that you should get decent values for those. Your plots don't look so good. I did something similar a couple of years ago and got much better results. Perhaps it'd be a good idea to re-check the BEM again. Vladimir On Thu, Mar 17, 2016 at 2:08 PM, Debora Desideri wrote: > Dear Vladimir and John, > attached you can find the results of the source localizaiton with the FEM > head model. Moreover, I also report the correlation of the lead fields for > the FEM and concentric spheres models and BEM and concentric spheres model > (the latter one using an inwardshift of 6 mm). Unfortunately, I could not > produce the correlation trend we expected (I tryed several values of > inwardshifts, ranging form 1mm to 10 mm and the plot is of course not > identical to the one I posted, but it is qualitatively similar). > There must still be something I don't fully get probably, since the > correlation between the concentric spheres lead fields and the BEM lead > fields is always so low, even close to the center of the head, regardless > of the inwardshift value. > > All considered, I would rather go for a FEM model at least for the moment > being. > Thanks a lot for your support! > > Best, > Debora > > > > > On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak < > litvak.vladimir at gmail.com> wrote: > >> Dear Debora, >> >> cfg.moveinward option is useful when your source space is a mesh as it >> actually deforms the mesh to push it inwards. When your source space is a >> grid you should use cfg.inwardshift to just exclude the points that are >> closer than 6 mm to the boundary. It might be a useful exercise for you to >> compute the lead fields with concentric spheres and with a BEM for the same >> grid and then look at correlations between these lead fields. You should >> see that the correlations should be high at depth but might be low for some >> points close to the surface. Once you hit the right value of inwardshift >> the low correlations should disappear. >> >> Best, >> >> Vladimir >> >> On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri > > wrote: >> >>> Dear Vladimir, >>> thanks for your explanation. I tryed to use the option cfg.moveinward in >>> ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this >>> did not solve the issue. As you can see from the attachment the cortex is >>> now partially uncovered. I am not sure I am using this option properly, >>> maybe there is a combination of values for cfg.moveinward and >>> cfg.inwardshift that works fine. I tryed several, but none of them gave me >>> the source localization that I expect. >>> I don't know whether the fact that some dipoles fall outside the brain >>> matters. For the attached figures I had no dipoles outside the brain, >>> whilst for some of the others attempts I had. >>> >>> I actually found this post on the mailinglist where both you and John >>> already pointed out this issue using BEM: >>> >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >>> >>> Also I don't know whether this link (still under >>> construction/discussion) may be of interest in this contex: >>> >>> >>> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >>> >>> Furthermore, this other page (also under construction), uses the option >>> cfg.inwardshift for the template grid to be used in the creation of the >>> individual subject's grid, but without an explanation of why the option >>> is/should be used: >>> >>> >>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >>> >>> In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) >>> provided by Fiedltrip, I don't know whether craeting my own template_grid >>> using the cfg.inwardshift option would actually fix the problem. I would >>> like to perform some further attempts, as soon as I have some time to go >>> through the function and understand how this options actually interplay. >>> >>> Meanwhile, I am still working on producing the results using the FEM >>> head model. It is much more time-consuming than the BEM, and maybe that's >>> one of the reasons to choose BEM models. As soon as they are ready I will >>> post them as well :) >>> >>> Anyway, thanks so much for your help. It was actually quite useful and >>> instructive! >>> >>> All the best wishes, >>> Debora >>> >>> >>> >>> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >>> litvak.vladimir at gmail.com> wrote: >>> >>>> Dear Debora, >>>> >>>> The critical thing with BEMCP is that your sources are not too close to >>>> the inner skull boundary. When they are closer than the safe distance the >>>> solution you get is completely wrong. When they are not too close, the >>>> solution is OK and comparable at least to concentric spheres. The safe >>>> distance is is more or less the average edge length in your skull mesh. In >>>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>>> It would be interesting if you use this option and report whether this >>>> resolves your problem. >>>> >>>> This issue should occur in any BEM but depending on the implementation >>>> the critical distance might be shorter. >>>> >>>> Best, >>>> >>>> Vladimir >>>> >>>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri < >>>> deb.desideri at gmail.com> wrote: >>>> >>>>> Dear John, >>>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>>> BEM head model first, but going quickly through the studies you have >>>>> mentioned and considering the tests you have performed, I may also consider >>>>> to switch to the FEM head model or to simply use the concentric spheres >>>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>>> relatively new to source localization and had no crash/errors in my >>>>> pipeline, and this combination makes always difficult to find possible >>>>> pitfalls. >>>>> >>>>> As soon as I have them ready, I will post the results obtained with >>>>> the FEM head model as well, maybe they will be useful for some other users >>>>> :) >>>>> >>>>> Thanks again for your support! >>>>> All the best, >>>>> Debora >>>>> >>>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>>> RICHARDS at mailbox.sc.edu> wrote: >>>>> >>>>>> Deb: >>>>>> >>>>>> I have had problems with BEMCP. >>>>>> >>>>>> 1—one of the practical / technical problems is that if the >>>>>> compartments overlap, or even come close, then the procedure would not >>>>>> work—the ft_sourceanlaysis crashed. >>>>>> >>>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>>> better, >>>>>> >>>>>> E. g., among three or four studies I have seen. >>>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>>> >>>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>>> >>>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>>> participant-computed realistic models for the compartments and the FEM. >>>>>> >>>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>>> models over the BEMCP, but I suggest looking at the research literature >>>>>> formally comparing these methods before going much further with BEMCP. >>>>>> >>>>>> John >>>>>> >>>>>> *********************************************** >>>>>> John E. Richards Carolina Distinguished Professor >>>>>> Department of Psychology >>>>>> University of South Carolina >>>>>> Columbia, SC 29208 >>>>>> Dept Phone: 803 777 2079 >>>>>> Fax: 803 777 9558 >>>>>> Email: richards-john at sc.edu >>>>>> HTTP: jerlab.psych.sc.edu >>>>>> *********************************************** >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Debora Desideri, PhD Student >>>>> BNP Lab - Neurology Department >>>>> University Hospital Tübingen >>>>> Eberhard Karls University Tübingen >>>>> Hoppe-Seyler Str. 3 >>>>> D-72076 Tübingen >>>>> Tel: +49 7071/29 80478 >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> >>> -- >>> >>> Debora Desideri, PhD Student >>> BNP Lab - Neurology Department >>> University Hospital Tübingen >>> Eberhard Karls University Tübingen >>> Hoppe-Seyler Str. 3 >>> D-72076 Tübingen >>> Tel: +49 7071/29 80478 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 15:46:46 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 15:46:46 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir, The correlation between concentric spheres and FEM (attached) it is not so bad I think. There are quite "low" (ca. 0.4-0.5) correlaiton values closer to the surface, but it is close enough to our expectations. I used concentric spheres because I am working with EEG data, isn't the local spheres method only for MEG? I am also surprised that the correlaiton between BEM and concentric spheres lead fields is so bad. It almost looks random... Best, Debora On Thu, Mar 17, 2016 at 3:21 PM, Vladimir Litvak wrote: > What about correlations between local spheres and the FEM? If it's only > the BEM that's broken I'd expect that you should get decent values for > those. Your plots don't look so good. I did something similar a couple of > years ago and got much better results. Perhaps it'd be a good idea to > re-check the BEM again. > > Vladimir > > On Thu, Mar 17, 2016 at 2:08 PM, Debora Desideri > wrote: > >> Dear Vladimir and John, >> attached you can find the results of the source localizaiton with the FEM >> head model. Moreover, I also report the correlation of the lead fields for >> the FEM and concentric spheres models and BEM and concentric spheres model >> (the latter one using an inwardshift of 6 mm). Unfortunately, I could not >> produce the correlation trend we expected (I tryed several values of >> inwardshifts, ranging form 1mm to 10 mm and the plot is of course not >> identical to the one I posted, but it is qualitatively similar). >> There must still be something I don't fully get probably, since the >> correlation between the concentric spheres lead fields and the BEM lead >> fields is always so low, even close to the center of the head, regardless >> of the inwardshift value. >> >> All considered, I would rather go for a FEM model at least for the moment >> being. >> Thanks a lot for your support! >> >> Best, >> Debora >> >> >> >> >> On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak < >> litvak.vladimir at gmail.com> wrote: >> >>> Dear Debora, >>> >>> cfg.moveinward option is useful when your source space is a mesh as it >>> actually deforms the mesh to push it inwards. When your source space is a >>> grid you should use cfg.inwardshift to just exclude the points that are >>> closer than 6 mm to the boundary. It might be a useful exercise for you to >>> compute the lead fields with concentric spheres and with a BEM for the same >>> grid and then look at correlations between these lead fields. You should >>> see that the correlations should be high at depth but might be low for some >>> points close to the surface. Once you hit the right value of inwardshift >>> the low correlations should disappear. >>> >>> Best, >>> >>> Vladimir >>> >>> On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri < >>> deb.desideri at gmail.com> wrote: >>> >>>> Dear Vladimir, >>>> thanks for your explanation. I tryed to use the option cfg.moveinward >>>> in ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but >>>> this did not solve the issue. As you can see from the attachment the cortex >>>> is now partially uncovered. I am not sure I am using this option properly, >>>> maybe there is a combination of values for cfg.moveinward and >>>> cfg.inwardshift that works fine. I tryed several, but none of them gave me >>>> the source localization that I expect. >>>> I don't know whether the fact that some dipoles fall outside the brain >>>> matters. For the attached figures I had no dipoles outside the brain, >>>> whilst for some of the others attempts I had. >>>> >>>> I actually found this post on the mailinglist where both you and John >>>> already pointed out this issue using BEM: >>>> >>>> >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >>>> >>>> Also I don't know whether this link (still under >>>> construction/discussion) may be of interest in this contex: >>>> >>>> >>>> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >>>> >>>> Furthermore, this other page (also under construction), uses the option >>>> cfg.inwardshift for the template grid to be used in the creation of the >>>> individual subject's grid, but without an explanation of why the option >>>> is/should be used: >>>> >>>> >>>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >>>> >>>> In ft_prepare_sourcemodel I am using the standard grid (6 mm >>>> resolution) provided by Fiedltrip, I don't know whether craeting my own >>>> template_grid using the cfg.inwardshift option would actually fix the >>>> problem. I would like to perform some further attempts, as soon as I have >>>> some time to go through the function and understand how this options >>>> actually interplay. >>>> >>>> Meanwhile, I am still working on producing the results using the FEM >>>> head model. It is much more time-consuming than the BEM, and maybe that's >>>> one of the reasons to choose BEM models. As soon as they are ready I will >>>> post them as well :) >>>> >>>> Anyway, thanks so much for your help. It was actually quite useful and >>>> instructive! >>>> >>>> All the best wishes, >>>> Debora >>>> >>>> >>>> >>>> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >>>> litvak.vladimir at gmail.com> wrote: >>>> >>>>> Dear Debora, >>>>> >>>>> The critical thing with BEMCP is that your sources are not too close >>>>> to the inner skull boundary. When they are closer than the safe distance >>>>> the solution you get is completely wrong. When they are not too close, the >>>>> solution is OK and comparable at least to concentric spheres. The safe >>>>> distance is is more or less the average edge length in your skull mesh. In >>>>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>>>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>>>> It would be interesting if you use this option and report whether this >>>>> resolves your problem. >>>>> >>>>> This issue should occur in any BEM but depending on the implementation >>>>> the critical distance might be shorter. >>>>> >>>>> Best, >>>>> >>>>> Vladimir >>>>> >>>>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri < >>>>> deb.desideri at gmail.com> wrote: >>>>> >>>>>> Dear John, >>>>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>>>> BEM head model first, but going quickly through the studies you have >>>>>> mentioned and considering the tests you have performed, I may also consider >>>>>> to switch to the FEM head model or to simply use the concentric spheres >>>>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>>>> relatively new to source localization and had no crash/errors in my >>>>>> pipeline, and this combination makes always difficult to find possible >>>>>> pitfalls. >>>>>> >>>>>> As soon as I have them ready, I will post the results obtained with >>>>>> the FEM head model as well, maybe they will be useful for some other users >>>>>> :) >>>>>> >>>>>> Thanks again for your support! >>>>>> All the best, >>>>>> Debora >>>>>> >>>>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>>>> RICHARDS at mailbox.sc.edu> wrote: >>>>>> >>>>>>> Deb: >>>>>>> >>>>>>> I have had problems with BEMCP. >>>>>>> >>>>>>> 1—one of the practical / technical problems is that if the >>>>>>> compartments overlap, or even come close, then the procedure would not >>>>>>> work—the ft_sourceanlaysis crashed. >>>>>>> >>>>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>>>> better, >>>>>>> >>>>>>> E. g., among three or four studies I have seen. >>>>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>>>> >>>>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>>>> >>>>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>>>> participant-computed realistic models for the compartments and the FEM. >>>>>>> >>>>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>>>> models over the BEMCP, but I suggest looking at the research literature >>>>>>> formally comparing these methods before going much further with BEMCP. >>>>>>> >>>>>>> John >>>>>>> >>>>>>> *********************************************** >>>>>>> John E. Richards Carolina Distinguished Professor >>>>>>> Department of Psychology >>>>>>> University of South Carolina >>>>>>> Columbia, SC 29208 >>>>>>> Dept Phone: 803 777 2079 >>>>>>> Fax: 803 777 9558 >>>>>>> Email: richards-john at sc.edu >>>>>>> HTTP: jerlab.psych.sc.edu >>>>>>> *********************************************** >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> Debora Desideri, PhD Student >>>>>> BNP Lab - Neurology Department >>>>>> University Hospital Tübingen >>>>>> Eberhard Karls University Tübingen >>>>>> Hoppe-Seyler Str. 3 >>>>>> D-72076 Tübingen >>>>>> Tel: +49 7071/29 80478 >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> Debora Desideri, PhD Student >>>> BNP Lab - Neurology Department >>>> University Hospital Tübingen >>>> Eberhard Karls University Tübingen >>>> Hoppe-Seyler Str. 3 >>>> D-72076 Tübingen >>>> Tel: +49 7071/29 80478 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_FEM_CONCENTRICSPHERES.png Type: image/png Size: 80143 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Thu Mar 17 15:57:47 2016 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Thu, 17 Mar 2016 14:57:47 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> "The correlation between concentric spheres and FEM (attached) it is not so bad” . I am not sure what you are correlating. Is this over the time of a beamformer model, or over participants with a single-time model? In either case, I think the correlations for the FEM-Concentric spheres are bad, many are less < 0.8, and a number are in the range from .9 to .95. This result confirms the difference in the FEM and concentric-sphere models. These are exacerbated even further when you use a subject-specific realistic FEM model and a concentric spheres model. The results between the BEMCP and concentric spheres suggests that the BEMCP model is not working. Most of the correlations should be positive. I have not used correlations as you have, but have done ROIs in an individual, and correlated the values of the ROIs over the head for one subject, or multiple subjects. I find higher correlations for the BEMCP and Concentric sphere models, than between either of these and a FEM model. However, in my case I am not using the standard model from FT, but using subject-specific BEMCP, concentric spheres, and FEM models. If the FEM model is working for you, why not use it? John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 16:13:35 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 16:13:35 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> References: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> Message-ID: Dear John, what I am correlating are the lead field produced using subject-specific realistic FEM head model or BEM head model and concentric spheres head model. As Vladimir suggested, this should help me to find the proper inward shift to apply in order to achieve good results with the BEM model. Unfortunately, the BEM model still seems not to work properly. Anyway, given the results of the latest attempts, I will definitely use the FEM model for my analysis, even if it is takes much longer to create the head model and lead fields. Thanks again! Best, Debora On Thu, Mar 17, 2016 at 3:57 PM, RICHARDS, JOHN wrote: > "The correlation between concentric spheres and FEM (attached) it is not > so bad” . I am not sure what you are correlating. Is this over the time of > a beamformer model, or over participants with a single-time model? In > either case, I think the correlations for the FEM-Concentric spheres are > bad, many are less < 0.8, and a number are in the range from .9 to .95. > > This result confirms the difference in the FEM and concentric-sphere > models. These are exacerbated even further when you use a > subject-specific realistic FEM model and a concentric spheres model. > > The results between the BEMCP and concentric spheres suggests that the > BEMCP model is not working. Most of the correlations should be positive. > I have not used correlations as you have, but have done ROIs in an > individual, and correlated the values of the ROIs over the head for one > subject, or multiple subjects. I find higher correlations for the BEMCP > and Concentric sphere models, than between either of these and a FEM > model. However, in my case I am not using the standard model from FT, but > using subject-specific BEMCP, concentric spheres, and FEM models. > > If the FEM model is working for you, why not use it? > > John > > *********************************************** > John E. Richards Carolina Distinguished Professor > Department of Psychology > University of South Carolina > Columbia, SC 29208 > Dept Phone: 803 777 2079 > Fax: 803 777 9558 > Email: richards-john at sc.edu > HTTP: jerlab.psych.sc.edu > *********************************************** > > > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Thu Mar 17 15:55:37 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Thu, 17 Mar 2016 15:55:37 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards, Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > Hi Federica, > > If you have access to BESA, you could import txt files and export them as > edf. > > Best, > Maite > > > El Miércoles 16 de marzo de 2016 18:57, Federica Mauro < > federica.ma at gmail.com> escribió: > > > Dear all, > I'm trying to convert txt files of web recordings in the edf format, but I > didn't find a any useful solution until now. > Do you have any suggestion? > Thank you very much in advance. > Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 joseluisblues at gmail.com Thu Mar 17 20:03:41 2016 From: joseluisblues at gmail.com (Jose) Date: Thu, 17 Mar 2016 20:03:41 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel Message-ID: dear list, There might be an error in the beamformer tutorial ( http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead field and the sources, *cfg.vol* rather than *cfg.headmodel *has to be defined to determine the headmodel. Thanks for corroborating this. -- José -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Thu Mar 17 21:20:12 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Thu, 17 Mar 2016 14:20:12 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: Ya, in the past I used an equidistant cap so it was never an issue to interpolate so long as multiple neighboring channels did not all need to be interpolated. Otherwise I don't see a way around it besides using a different method such as spline. On Thursday, March 17, 2016, Irene Sophia Mayer wrote: > My problem now is that I have the neighbours structure, including the > neighbours for 'Fp1', in the form of just a list stating the neighbours. > Still, it says that there are no neighbours. I will try to use a different > method than 'average' or 'nearest' but I'm not completely happy with > that... > > *Gesendet:* Mittwoch, 16. März 2016 um 20:31 Uhr > *Von:* "Max Cantor" > *An:* "FieldTrip discussion list" > > *Betreff:* Re: [FieldTrip] Events in databrowser > Coincidentally, I just had to remove FP1 from one of my datasets, failed > to check my neighbours structure ahead of time despite this conversation, > and can confirm that FP1 could not be interpolated for me as well. > > On Wed, Mar 16, 2016 at 12:40 PM, Max Cantor > wrote: >> >> I currently use a neuroscan64 system, with the quickcap64 layout. Just >> looking at the layout, it seems like FP1 could be interpolated from FPZ and >> AF3, but I'd have to test (or look at my neighbours structure) to see if >> this would be the case. Anyway, depending on your setup, it may be the case >> that FP1 does not have any designated neighbours to interpolate from. You >> may need to try a different method than average or nearest. >> >> On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer >> wrote: >> >>> Dear fieldtrippers, >>> >>> I have excluded noisy channels from my data using >>> >>> data = ft_rejectvisual(cfg, data); >>> data = ft_rejectartifact(cfg, data); >>> >>> and now want to interpolate them. To do so, I am first defining the >>> neighbours using a zebris file: >>> >>> cfg = []; >>> cfg.method = 'template'; >>> cfg.layout = 'EEG1010.lay'; >>> cfg.feedback = 'yes'; >>> cfg.elec = ft_read_sens('Maque.sfp'); >>> neighbours = ft_prepare_neighbours(cfg,data_con); >>> >>> With data_con being the data that still has all the channels in it. This >>> gives me the variable neighbours that does indeed contain the 6 neighbours >>> for my missing channel. However, when I try to use >>> >>> cfg.method = 'average'; >>> cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; >>> cfg.neighbours = neighbours; >>> data = ft_channelrepair(cfg,data); >>> >>> I get the following message for each and every trial: trying to >>> reconstruct missing channel Fp1 - cannot reconstruct channel - no >>> neighbours in the original data or in the sensor position. >>> >>> Does anyone have an idea why this is not working properly? >>> >>> Cheers, >>> Irene >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Max Cantor >> Graduate Student >> Cognitive Neuroscience of Language Lab >> University of Colorado Boulder >> > > > -- > Max Cantor > Graduate Student > Cognitive Neuroscience of Language Lab > University of Colorado Boulder > _______________________________________________ fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 18 08:36:18 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:36:18 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel In-Reply-To: References: Message-ID: Hi José The option cfg.vol (for “volume conduction model”) has been replaced by cfg.headmodel for quite some time (probably more than a year ago). The code is backward compatible, so cfg.vol will also still work, but the documentation reflects the current standard. I suggest you update your copy of FieldTrip to a more recent version. best regards, Robert On 17 Mar 2016, at 20:03, Jose wrote: > dear list, > > There might be an error in the beamformer tutorial (http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead field and the sources, cfg.vol rather than cfg.headmodel has to be defined to determine the headmodel. Thanks for corroborating this. > > -- > José > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 18 08:38:29 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:38:29 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> Hi Frederica, Please look at the FAQ How can I convert one dataformat into an other? best regards, Robert On 17 Mar 2016, at 15:55, Federica Mauro wrote: > Hi Maité, > > thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. > > Best regards, > Federica > > 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > Hi Federica, > > If you have access to BESA, you could import txt files and export them as edf. > > Best, > Maite > > > El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: > > > Dear all, > I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. > Do you have any suggestion? > Thank you very much in advance. > Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 r.oostenveld at donders.ru.nl Fri Mar 18 08:50:11 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:50:11 +0100 Subject: [FieldTrip] Epoching EEG data after downsampling In-Reply-To: <1458200183218.67807@biling.su.se> References: <1458200183218.67807@biling.su.se> Message-ID: Hi Gunnar, This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. cfg = [] cfg = … data_old = ft_preprocessing(cfg) data_old.label{end+1} = ‘sample’; for i=1:size(data_old.sampleinfo,1) % this works for one or more trials data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); end cfg = [] cfg = … data_new = ft_resampledata(cfg, data_old); The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. best regards, Robert On 17 Mar 2016, at 08:36, Gunnar Norrman wrote: > Hello, > > I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > > > In ft_redefinetrial (line 222) > Subscripted assignment dimension mismatch. > > Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. > > Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? > > Thank you! > > Best regards, > Gunnar Norrman > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Fri Mar 18 08:57:35 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Fri, 18 Mar 2016 07:57:35 +0000 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: <87DBECC2-4595-4D21-AA68-2C6E01A80108@cfin.au.dk> Dear Federica, To write EDF format, have you tried looking info the “swrite” function from the Biosig toolbox? http://biosig.sourceforge.net You should be able to import your text files directly into Matlab. If they are raw files with no header, simply “load -ascii filename.txt” should work. If there’s a header, you can try Matlab’s built-in tools like “uiimport” or “textread”. Cheers, Sarang On 17 Mar 2016, at 15:55, Federica Mauro > wrote: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards, Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García >: Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best, Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro > escribió: Dear all, I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion? Thank you very much in advance. Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 sarang at cfin.au.dk Fri Mar 18 11:53:08 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Fri, 18 Mar 2016 10:53:08 +0000 Subject: [FieldTrip] Postdoc/PhD positions for cortical/retinal oscillation project (Aarhus University, Denmark) In-Reply-To: <9747D2C1-584B-4665-8AEF-D4E62D8F7A74@CFIN.AU.DK> References: <9747D2C1-584B-4665-8AEF-D4E62D8F7A74@CFIN.AU.DK> Message-ID: <25362234-33E5-479A-BE81-73E09411E04E@cfin.au.dk> The Neuroelectromagnetic Oscillations (NEMO) Lab, directed by Sarang Dalal and recently relocated to Aarhus University (Denmark), is recruiting postdocs and PhD students for a large ERC-funded project. The ERC project will examine in detail how neural oscillations communicate information between the retina and cerebral cortex in humans, during presentation of various types of visual stimuli as well as during rest. This will involve several recording techniques, primarily magnetoencephalography (MEG) and electroretinography (ERG), with some components involving scalp EEG, intracranial EEG in epilepsy patients, and transcranial magnetic stimulation (TMS). Our group is part of the Center of Functionally Integrative Neuroscience at Aarhus University, which hosts lab facilities for these techniques, as well as MRI and PET. The working language of the research group and center is English. Qualified applicants will have a background in neuroimaging, systems/cognitive neuroscience, neural signal processing, retinal electrophysiology, or related fields. Start dates can be between summer 2016 and spring 2018, with an initial appointment of 2-3 years (postdoc) or 3 years (PhD student). Applications will be accepted until all positions are filled. For more details, please get in touch with Sarang: sarang at cfin.au.dk . Please feel free to forward to anybody who might be interested! From gunnar.norrman at biling.su.se Fri Mar 18 15:17:51 2016 From: gunnar.norrman at biling.su.se (Gunnar Norrman) Date: Fri, 18 Mar 2016 14:17:51 +0000 Subject: [FieldTrip] Epoching EEG data after downsampling In-Reply-To: References: <1458200183218.67807@biling.su.se>, Message-ID: <1458310671610.29705@biling.su.se> Thank you, Robert, this looks like a nice solution, I will try it out! Best, Gunnar --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Robert Oostenveld Sent: Friday, March 18, 2016 08:50 To: FieldTrip discussion list Subject: Re: [FieldTrip] Epoching EEG data after downsampling Hi Gunnar, This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. cfg = [] cfg = ... data_old = ft_preprocessing(cfg) data_old.label{end+1} = 'sample'; for i=1:size(data_old.sampleinfo,1) % this works for one or more trials data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); end cfg = [] cfg = ... data_new = ft_resampledata(cfg, data_old); The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. best regards, Robert On 17 Mar 2016, at 08:36, Gunnar Norrman > wrote: Hello, I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > In ft_redefinetrial (line 222) Subscripted assignment dimension mismatch. Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? Thank you! Best regards, Gunnar Norrman --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From paolo.belardinelli at gmail.com Fri Mar 18 15:35:54 2016 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 18 Mar 2016 15:35:54 +0100 Subject: [FieldTrip] Problem with Template Model for Source Reconstruction In-Reply-To: <56C58A7A.9000207@uni-konstanz.de> References: <56C58A7A.9000207@uni-konstanz.de> Message-ID: Dear Britta, I was deeply involved in the processing and I forgot to update this post. Thank you: it worked out! Eliminating the bias from MRI images (using light/very light regularization) leads to more accurate grids and correct results. Best, Paolo On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < britta.westner at uni-konstanz.de> wrote: > Dear Paolo, > > I experienced similar problems and found that correcting the field bias in > the participant's MRI (e.g. doing a "bias correction" with SPM) can help. > My explanation would be that the field bias either leads to small > inaccuracies in the segmentation and volume which then "get visible" when > warping the grid based on the non-segmented MRI, or that the warping > algorithm itself is affected by this bias. Maybe you can give that a try! > > Hope this helps, > Britta > > > > > Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: > > Dear Fieldtrippers, > we are encountering a problem with a template model for source > reconstruction. In particular, we are warping (non linearly) a template > grid to the individual subject's MRI. > Doing that, it appears that the very top of the brain is not fully covered > by dipole locations. > We found that this issue has been already reported: > > http://www.fieldtriptoolbox.org/template/sourcemodel > > Apparently, since March 7th 2013, this issue has been fixed. > However we are using August 28th 2015 Fieldtrip version and we are still > dealing with the same issue. > Any suggestions? > Here are our code lines: > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 6; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri_spm; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > sourcemodel = ft_prepare_sourcemodel(cfg); > > Thank you in advance. > > Paolo > > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Britta Westner, M.Sc. > Neuroelectromagnetic Oscillations Laboratory > > Fachbereich Psychologie > Universität Konstanz > Postfach 905 > 78457 Konstanz > > Telefon: +49-(0)7531-88-5703 > Fax: +49-(0)7531-88-5709 > www.psychologie.uni-konstanz.de/nemo-lab > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Paolo Belardinelli, PhD Neurology Department University Hospital Tuebingen Eberhard Karls University Tuebingen Hoppe-Seyler Str. 3 D-72076 Tuebingen Tel: +49 7071 / 29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Fri Mar 18 16:12:01 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Fri, 18 Mar 2016 16:12:01 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> Message-ID: Dear Sarang and Robert, thank you for youe suggestions. I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. Namely, when I try to construct the header with hdr = ft_fetch_header(data) it says: Error using ft_checkdata (line 464) This function requires raw data as input. Error in ft_fetch_header (line 32) data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes'); Thank you again for any suggestion. Cheers, Federica 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > Hi Frederica, > > Please look at the FAQ How can I convert one dataformat into an other? > > > best regards, > Robert > > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > Hi Maité, > > thank you for the suggestion. I don't have the access to BESA now, so I > wished I could work it out with Matlab and related toolboxes. > > Best regards, > Federica > > 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > >> Hi Federica, >> >> If you have access to BESA, you could import txt files and export them as >> edf. >> >> Best, >> Maite >> >> >> El Miércoles 16 de marzo de 2016 18:57, Federica Mauro < >> federica.ma at gmail.com> escribió: >> >> >> Dear all, >> I'm trying to convert txt files of web recordings in the edf format, but >> I didn't find a any useful solution until now. >> Do you have any suggestion? >> Thank you very much in advance. >> Bests, >> Federica >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 olga.v.sysoeva at gmail.com Fri Mar 18 16:29:10 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Fri, 18 Mar 2016 18:29:10 +0300 Subject: [FieldTrip] source grand average problem Message-ID: Dear FieldTrippers, I face the problem with source grand average. I use data after volumenormalization, but sourcegrandaverage function report that input files are vary in inside field? Why it might be the case? Best Regards, Olga Sysoeva. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maity_winky at yahoo.es Fri Mar 18 16:48:33 2016 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Fri, 18 Mar 2016 15:48:33 +0000 (UTC) Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: Message-ID: <484823217.1695076.1458316113761.JavaMail.yahoo@mail.yahoo.com> Hi Federica, when you open the .txt file in notepad, does it have any additional information apart from numeric values? If yes, then you should try another Matlab function for importing the data. If not, then you should find out relevant information, such as sampling rate, time, the labels of the channels, the number of trials, etc. Then, you could build your own data structure inside Matlab and save this file as edf with Fieldtrip. El Viernes 18 de marzo de 2016 16:33, Federica Mauro escribió: Dear Sarang and Robert, thank you for youe suggestions. I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. Namely, when I try to construct the header with hdr = ft_fetch_header(data) it says: Error using ft_checkdata (line 464) This function requires raw data as input. Error in ft_fetch_header (line 32) data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes'); Thank you again for any suggestion. Cheers, Federica 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : Hi Frederica, Please look at the FAQ How can I convert one dataformat into an other? best regards,Robert On 17 Mar 2016, at 15:55, Federica Mauro wrote: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards,Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García : Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best,Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion?Thank you very much in advance.Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From fosco.bernasconi at gmail.com Fri Mar 18 16:49:33 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Fri, 18 Mar 2016 16:49:33 +0100 Subject: [FieldTrip] Error in ft_sourceinterpolate Message-ID: Dear all, I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate: * Reference to non-existent field 'avg'.Error in getsubfield (line 45) s = s.(t{k});Error in ft_sourceinterpolate (line 209) if ~iscell(getsubfield(functional, cfg.parameter{i}))* If I check my source structure I do have the avg field. source = freq: 10 cumtapcnt: [157x1 double] dim: [18 21 18] inside: [6804x1 logical] pos: [6804x3 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] Any suggestion? Thank you for your help! Best, fosco here the rest of my code: load('standard_bem.mat'); load('standard_sourcemodel3d10mm.mat'); templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; template_mri = ft_read_mri(templatefile); template_mri = ft_convert_units(template_mri,'mm'); template_mri.coordsys = 'spm'; cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = template_mri; sourcemodel = ft_prepare_sourcemodel(cfg,freq); sourcemodel = ft_convert_units(sourcemodel,'mm'); cfg = []; cfg.elec = sens; cfg.channel = sens.label; cfg.headmodel = vol; cfg.grid = sourcemodel; cfg.grid.unit = 'mm';% same unit as above, i.e. in cm lf = ft_prepare_leadfield(cfg,freq); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft{1,1}); % compute source reconstruction cfg = []; cfg.frequency = freq.freq; cfg.method = 'pcc'; cfg.grid = lf; cfg.headmodel = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); % and provide mni template source_proj.dim = sourcemodel.dim; source_proj.pos = sourcemodel.pos; cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.nai'; source_int = ft_sourceinterpolate(cfg,source,template_mri); -------------- next part -------------- An HTML attachment was scrubbed... URL: From gina.joue at univr.it Fri Mar 18 19:08:42 2016 From: gina.joue at univr.it (gj) Date: Fri, 18 Mar 2016 19:08:42 +0100 Subject: [FieldTrip] import own format (long trials) In-Reply-To: <56E9A0EE.3060006@univr.it> References: <56E9A0EE.3060006@univr.it> Message-ID: <56EC442A.50605@univr.it> In case anyone else is having the same problem, my mistake was how I set "data.time". According to the FT Wiki, "data.time" should be a "cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1*Nsamples vector" but it should be in seconds and I had specified it in number of samples instead, which triggered the error Error using ft_specest_mtmfft (line 96) "the padding that you specified is shorter than the data On 16/03/16 19:07, gj wrote: > Hi, > > I am trying to import EEG data preprocessed and averaged in BrainVision > Analyzer. I have a 2-second segment of data per condition per subject > which corresponds to the averaged signal across all trials of each > condition for the subject. > > Is the following approach correct? > > Import the 4 conditions as 4 long trials (2 sec or 2000 samples with > sampling freq of 1000 Hz) > => data.trial is a 1x4 cell array > and each cell array contains an nchan x 2000 matrix > > I am trying to fill in the other fields of the data structure to mimic > FieldTrip's raw data but I think I am having problems with > data.sampleinfo > which, if I understand correctly, needs to be specified for long trials. > > According to the wiki, this should be an array containing [startsample > endsample] to specify the position of each trial, with info for each > trial on every row. However, it doesn't seem right to have > data.sampleinfo = repmat([1 2000],4,1) > > Thanks in advance for any help! > Gina From hibafouani123 at hotmail.com Sun Mar 20 13:29:43 2016 From: hibafouani123 at hotmail.com (hiba fouani) Date: Sun, 20 Mar 2016 12:29:43 +0000 Subject: [FieldTrip] Mechanical localization In-Reply-To: References: Message-ID: Dear Fieldtripper, Is there a tool for localized the mechanical activity in another word does there is a mechanical forward problem and mechanical inverse problem? thank you Hiba > From: fieldtrip-request at science.ru.nl > Subject: fieldtrip Digest, Vol 64, Issue 25 > To: fieldtrip at science.ru.nl > Date: Sat, 19 Mar 2016 12:00:02 +0100 > > 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. Re: Epoching EEG data after downsampling (Gunnar Norrman) > 2. Re: Problem with Template Model for Source Reconstruction > (Paolo Belardinelli) > 3. Re: EEG txt files conversion to .Edf (Federica Mauro) > 4. source grand average problem (Olga Sysoeva) > 5. Re: EEG txt files conversion to .Edf (Mait? Crespo Garc?a) > 6. Error in ft_sourceinterpolate (fosco bernasconi) > 7. Re: import own format (long trials) (gj) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Mar 2016 14:17:51 +0000 > From: Gunnar Norrman > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Epoching EEG data after downsampling > Message-ID: <1458310671610.29705 at biling.su.se> > Content-Type: text/plain; charset="iso-8859-1" > > Thank you, Robert, this looks like a nice solution, I will try it out! > > > Best, > > Gunnar > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > ________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of Robert Oostenveld > Sent: Friday, March 18, 2016 08:50 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Epoching EEG data after downsampling > > Hi Gunnar, > > This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. > > However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. > > cfg = [] > cfg = ... > data_old = ft_preprocessing(cfg) > > data_old.label{end+1} = 'sample'; > for i=1:size(data_old.sampleinfo,1) > % this works for one or more trials > data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); > end > > cfg = [] > cfg = ... > data_new = ft_resampledata(cfg, data_old); > > The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. > > best regards, > Robert > > > > > On 17 Mar 2016, at 08:36, Gunnar Norrman > wrote: > > Hello, > > I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > > > In ft_redefinetrial (line 222) > Subscripted assignment dimension mismatch. > > Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. > > Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? > > Thank you! > > Best regards, > Gunnar Norrman > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Fri, 18 Mar 2016 15:35:54 +0100 > From: Paolo Belardinelli > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Template Model for Source > Reconstruction > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Britta, > I was deeply involved in the processing and I forgot to update this post. > Thank you: it worked out! > Eliminating the bias from MRI images (using light/very light > regularization) leads to more accurate grids and correct results. > > Best, > > Paolo > > > > On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < > britta.westner at uni-konstanz.de> wrote: > > > Dear Paolo, > > > > I experienced similar problems and found that correcting the field bias in > > the participant's MRI (e.g. doing a "bias correction" with SPM) can help. > > My explanation would be that the field bias either leads to small > > inaccuracies in the segmentation and volume which then "get visible" when > > warping the grid based on the non-segmented MRI, or that the warping > > algorithm itself is affected by this bias. Maybe you can give that a try! > > > > Hope this helps, > > Britta > > > > > > > > > > Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: > > > > Dear Fieldtrippers, > > we are encountering a problem with a template model for source > > reconstruction. In particular, we are warping (non linearly) a template > > grid to the individual subject's MRI. > > Doing that, it appears that the very top of the brain is not fully covered > > by dipole locations. > > We found that this issue has been already reported: > > > > http://www.fieldtriptoolbox.org/template/sourcemodel > > > > Apparently, since March 7th 2013, this issue has been fixed. > > However we are using August 28th 2015 Fieldtrip version and we are still > > dealing with the same issue. > > Any suggestions? > > Here are our code lines: > > > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.resolution = 6; % resolution of the template grid in mm > > cfg.grid.nonlinear = 'yes'; % use non linear normalization > > cfg.mri = mri_spm; % use subject's mri in mni coordinates > > cfg.grid.unit = 'mm'; > > sourcemodel = ft_prepare_sourcemodel(cfg); > > > > Thank you in advance. > > > > Paolo > > > > > > > > > > -- > > -- > > Paolo Belardinelli, PhD > > Neurology Department > > University Hospital Tuebingen > > Eberhard Karls University Tuebingen > > Hoppe-Seyler Str. 3 > > D-72076 Tuebingen > > Tel: +49 7071 / 29 80478 > > > > > > > > _______________________________________________ > > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Britta Westner, M.Sc. > > Neuroelectromagnetic Oscillations Laboratory > > > > Fachbereich Psychologie > > Universit?t Konstanz > > Postfach 905 > > 78457 Konstanz > > > > Telefon: +49-(0)7531-88-5703 > > Fax: +49-(0)7531-88-5709 > > www.psychologie.uni-konstanz.de/nemo-lab > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Fri, 18 Mar 2016 16:12:01 +0100 > From: Federica Mauro > To: FieldTrip discussion list > Subject: Re: [FieldTrip] EEG txt files conversion to .Edf > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Sarang and Robert, > > thank you for youe suggestions. > > I've been working on them, but it seems that my main problem is I don't > have an header for my data. And at the moment I don't have any clue on how > to get it. > > Basically, when I success in load the data matrix on Matlab, it has the > dimensions of <5192001x5 double>, and this doesn't fit with any format > recognized by Fieldtrip. > Namely, when I try to construct the header with > > hdr = ft_fetch_header(data) > > it says: Error using ft_checkdata (line 464) > This function requires raw data as input. > > Error in ft_fetch_header (line 32) > data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', > 'yes'); > > Thank you again for any suggestion. > > Cheers, > > Federica > > > 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > > > Hi Frederica, > > > > Please look at the FAQ How can I convert one dataformat into an other? > > > > > > best regards, > > Robert > > > > > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > > > Hi Mait?, > > > > thank you for the suggestion. I don't have the access to BESA now, so I > > wished I could work it out with Matlab and related toolboxes. > > > > Best regards, > > Federica > > > > 2016-03-16 19:55 GMT+01:00 Mait? Crespo Garc?a : > > > >> Hi Federica, > >> > >> If you have access to BESA, you could import txt files and export them as > >> edf. > >> > >> Best, > >> Maite > >> > >> > >> El Mi?rcoles 16 de marzo de 2016 18:57, Federica Mauro < > >> federica.ma at gmail.com> escribi?: > >> > >> > >> Dear all, > >> I'm trying to convert txt files of web recordings in the edf format, but > >> I didn't find a any useful solution until now. > >> Do you have any suggestion? > >> Thank you very much in advance. > >> Bests, > >> Federica > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> 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: > > ------------------------------ > > Message: 4 > Date: Fri, 18 Mar 2016 18:29:10 +0300 > From: Olga Sysoeva > To: FieldTrip discussion list > Subject: [FieldTrip] source grand average problem > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear FieldTrippers, > > I face the problem with source grand average. I use data after > volumenormalization, but sourcegrandaverage function report that input > files are vary in inside field? Why it might be the case? > > Best Regards, > Olga Sysoeva. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 5 > Date: Fri, 18 Mar 2016 15:48:33 +0000 (UTC) > From: Mait? Crespo Garc?a > To: FieldTrip discussion list > Subject: Re: [FieldTrip] EEG txt files conversion to .Edf > Message-ID: > <484823217.1695076.1458316113761.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Federica, > when you open the .txt file in notepad, does it have any additional information apart from numeric values? If yes, then you should try another Matlab function for importing the data. If not, then you should find out relevant information, such as sampling rate, time, the labels of the channels, the number of trials, etc. Then, you could build your own data structure inside Matlab and save this file as edf with Fieldtrip. > > > El Viernes 18 de marzo de 2016 16:33, Federica Mauro escribi?: > > > Dear Sarang and Robert, > > thank you for youe suggestions. > > I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. > > Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. > Namely, when I try to construct the header with > hdr = ft_fetch_header(data) > > it says: Error using ft_checkdata (line 464) > This function requires raw data as input. > > Error in ft_fetch_header (line 32) > data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', > 'yes'); > > Thank you again for any suggestion. > > Cheers, > Federica > > 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > > Hi Frederica, > Please look at the FAQ?How can I convert one dataformat into an other? > best regards,Robert > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > Hi Mait?, > thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. > Best regards,Federica > 2016-03-16 19:55 GMT+01:00 Mait? Crespo Garc?a : > > Hi Federica, > If you have access to BESA, you could import txt files and export them as edf. > Best,Maite > > > El Mi?rcoles 16 de marzo de 2016 18:57, Federica Mauro escribi?: > > > Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. > Do you have any suggestion?Thank you very much in advance.Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 6 > Date: Fri, 18 Mar 2016 16:49:33 +0100 > From: fosco bernasconi > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Error in ft_sourceinterpolate > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I > have an error when calling ft_sourceinterpolate: > > > > > > * Reference to non-existent field 'avg'.Error in getsubfield (line 45) s = > s.(t{k});Error in ft_sourceinterpolate (line 209) if > ~iscell(getsubfield(functional, cfg.parameter{i}))* > > > If I check my source structure I do have the avg field. > > source = > freq: 10 > cumtapcnt: [157x1 double] > dim: [18 21 18] > inside: [6804x1 logical] > pos: [6804x3 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > > Any suggestion? > > Thank you for your help! > Best, > fosco > > > here the rest of my code: > > > load('standard_bem.mat'); > load('standard_sourcemodel3d10mm.mat'); > > templatefile = > '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; > template_mri = ft_read_mri(templatefile); > template_mri = ft_convert_units(template_mri,'mm'); > template_mri.coordsys = 'spm'; > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = template_mri; > sourcemodel = ft_prepare_sourcemodel(cfg,freq); > sourcemodel = ft_convert_units(sourcemodel,'mm'); > > cfg = []; > cfg.elec = sens; > cfg.channel = sens.label; > cfg.headmodel = vol; > cfg.grid = sourcemodel; > cfg.grid.unit = 'mm';% same unit as above, i.e. in cm > lf = ft_prepare_leadfield(cfg,freq); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 10; > freq = ft_freqanalysis(cfg,dataft{1,1}); > > % compute source reconstruction > cfg = []; > cfg.frequency = freq.freq; > cfg.method = 'pcc'; > cfg.grid = lf; > cfg.headmodel = vol; > cfg.keeptrials = 'yes'; > cfg.pcc.lambda = '5%'; > cfg.pcc.projectnoise = 'yes'; > source = ft_sourceanalysis(cfg,freq); > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > % and provide mni template > source_proj.dim = sourcemodel.dim; > source_proj.pos = sourcemodel.pos; > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.nai'; > source_int = ft_sourceinterpolate(cfg,source,template_mri); > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 7 > Date: Fri, 18 Mar 2016 19:08:42 +0100 > From: gj > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] import own format (long trials) > Message-ID: <56EC442A.50605 at univr.it> > Content-Type: text/plain; charset=utf-8; format=flowed > > In case anyone else is having the same problem, my mistake was how I set > "data.time". > > According to the FT Wiki, "data.time" should be a "cell-array containing > a time axis for each trial (1 X Ntrial), each time axis is a 1*Nsamples > vector" > > but it should be in seconds and I had specified it in number of samples > instead, which triggered the error > > Error using ft_specest_mtmfft (line 96) > "the padding that you specified is shorter than the data > > > On 16/03/16 19:07, gj wrote: > > Hi, > > > > I am trying to import EEG data preprocessed and averaged in BrainVision > > Analyzer. I have a 2-second segment of data per condition per subject > > which corresponds to the averaged signal across all trials of each > > condition for the subject. > > > > Is the following approach correct? > > > > Import the 4 conditions as 4 long trials (2 sec or 2000 samples with > > sampling freq of 1000 Hz) > > => data.trial is a 1x4 cell array > > and each cell array contains an nchan x 2000 matrix > > > > I am trying to fill in the other fields of the data structure to mimic > > FieldTrip's raw data but I think I am having problems with > > data.sampleinfo > > which, if I understand correctly, needs to be specified for long trials. > > > > According to the wiki, this should be an array containing [startsample > > endsample] to specify the position of each trial, with info for each > > trial on every row. However, it doesn't seem right to have > > data.sampleinfo = repmat([1 2000],4,1) > > > > Thanks in advance for any help! > > Gina > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 64, Issue 25 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Sun Mar 20 16:19:50 2016 From: jens.klinzing at uni-tuebingen.de (=?UTF-8?B?IkplbnMgS2xpbnppbmcsIFVuaXZlcnNpdMOkdCBUw7xiaW5nZW4i?=) Date: Sun, 20 Mar 2016 16:19:50 +0100 Subject: [FieldTrip] Elements have wrong orientation or are degenerated In-Reply-To: References: Message-ID: <56EEBF96.7000805@uni-tuebingen.de> Hi Andreas, I got the same error but it was resolved by applying ft_volumereslice to the mri before segmentation. This is also what they do in the FEM tutorial: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_fem ...however I didn't do it at first because the segmentation looked fine even without it. Another difference between your and my code is that you directly call ft_headmodel_simbio while I call the higher-level function ft_prepare_headmodel but I didn't check whether that makes a difference. I also don't know if the solution applies to your particular case (restriction to a subvolume with two tissue types). All the best, Jens Horn, Andreas wrote: > Hello everybody, > > I am new to fieldtrip and want to use it (and simbio) to forward model the current spread of a known dipole. I consider only a small cubic fraction of brain tissue which I so far have divided in gray and white matter. I pass that cubic volume into ft_prepare_mesh and get a hexahedral mesh without error. ft_plot_mesh also shows the correct mesh. However, once I pass the mesh into ft_headmodel_simbio, I get the error > > ‘Elements have wrong orientation or are degenerated’ > > Does anyone have an idea of why this could happen and how I could potentially fix the issue? > > Thanks a lot, > > Andreas > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From paolo.belardinelli at gmail.com Sun Mar 20 19:25:36 2016 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Sun, 20 Mar 2016 19:25:36 +0100 Subject: [FieldTrip] Problem with Template Model for Source Reconstruction In-Reply-To: References: <56C58A7A.9000207@uni-konstanz.de> Message-ID: Dear Britta, I have been working with the bias correction of my subject's MRI these days, and while working extremely well for some of them, some others appear to be even worse after correction. I don't have much experience with MRI images, so maybe the combination of parameters that I am setting may be not optimal. At the moment, I am playing around with the Bias correction parameter (from extremely light to no correction) and the FWHM bias (from 30mm to 150mm). In the original images I can see some non-uniformity in terms of contrast and usually they look quite smooth/low frequency to me. After correction I can observe an improvement in the MRI images themselves, but no improvement or even worsening in terms of not covered surface in the source localization. Do you have any suggestion how to find some quantificable parameters to help me out in this procedure? How can I quickly check whether the quality of the image is enough to guarantee that the cortex is fully covered, without going through the whole forward model production? Sometimes, even though the grid is well positioned, I still have the aforementioned problem. Best wishes, Paolo On Fri, Mar 18, 2016 at 3:35 PM, Paolo Belardinelli < paolo.belardinelli at gmail.com> wrote: > Dear Britta, > I was deeply involved in the processing and I forgot to update this post. > Thank you: it worked out! > Eliminating the bias from MRI images (using light/very light > regularization) leads to more accurate grids and correct results. > > Best, > > Paolo > > > > On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < > britta.westner at uni-konstanz.de> wrote: > >> Dear Paolo, >> >> I experienced similar problems and found that correcting the field bias >> in the participant's MRI (e.g. doing a "bias correction" with SPM) can >> help. My explanation would be that the field bias either leads to small >> inaccuracies in the segmentation and volume which then "get visible" when >> warping the grid based on the non-segmented MRI, or that the warping >> algorithm itself is affected by this bias. Maybe you can give that a try! >> >> Hope this helps, >> Britta >> >> >> >> >> Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: >> >> Dear Fieldtrippers, >> we are encountering a problem with a template model for source >> reconstruction. In particular, we are warping (non linearly) a template >> grid to the individual subject's MRI. >> Doing that, it appears that the very top of the brain is not fully >> covered by dipole locations. >> We found that this issue has been already reported: >> >> http://www.fieldtriptoolbox.org/template/sourcemodel >> >> Apparently, since March 7th 2013, this issue has been fixed. >> However we are using August 28th 2015 Fieldtrip version and we are still >> dealing with the same issue. >> Any suggestions? >> Here are our code lines: >> >> cfg = []; >> cfg.grid.warpmni = 'yes'; >> cfg.resolution = 6; % resolution of the template grid in mm >> cfg.grid.nonlinear = 'yes'; % use non linear normalization >> cfg.mri = mri_spm; % use subject's mri in mni coordinates >> cfg.grid.unit = 'mm'; >> sourcemodel = ft_prepare_sourcemodel(cfg); >> >> Thank you in advance. >> >> Paolo >> >> >> >> >> -- >> -- >> Paolo Belardinelli, PhD >> Neurology Department >> University Hospital Tuebingen >> Eberhard Karls University Tuebingen >> Hoppe-Seyler Str. 3 >> D-72076 Tuebingen >> Tel: +49 7071 / 29 80478 >> >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Britta Westner, M.Sc. >> Neuroelectromagnetic Oscillations Laboratory >> >> Fachbereich Psychologie >> Universität Konstanz >> Postfach 905 >> 78457 Konstanz >> >> Telefon: +49-(0)7531-88-5703 >> Fax: +49-(0)7531-88-5709 >> www.psychologie.uni-konstanz.de/nemo-lab >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > > -- -- Paolo Belardinelli, PhD Neurology Department University Hospital Tuebingen Eberhard Karls University Tuebingen Hoppe-Seyler Str. 3 D-72076 Tuebingen Tel: +49 7071 / 29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Mon Mar 21 12:57:53 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Mon, 21 Mar 2016 12:57:53 +0100 Subject: [FieldTrip] Correlation with a behavioural variable in the source space? Message-ID: Dear FieldTrip users, can I do a correlation test with a behavioural variable in the source space using ft_statfun_correlationT? I want to do the same as in sensor space but use voxels instead of electrodes. How can I define a region of interest to limit the number of tests? My current approach is to compute the inverse solution using cfg = []; cfg.method = 'mne'; cfg.grid = leadfield; cfg.headmodel = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; cfg.rawtrial = 'yes'; cfg.keeptrial = 'yes'; source = ft_sourceanalysis(cfg, timelock); and then simply call cfg = []; cfg.statistic = 'ft_statfun_correlationT'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.design = [1.457 1.214 2.477 5.441 …]; cfg.ivar = 1; cfg.alpha = 0.05; cfg.tail = 0; cfg.correcttail = 'alpha'; stat = ft_sourcestatistics(cfg, source); but Matlab just remains busy and nothing happens. Thank you. Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Mon Mar 21 17:08:51 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 12:08:51 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space Message-ID: Hi All, Is there any standard procedure (in Fieldtrip) for extracting virtual (source) time series from ROIs in Talariach or MNI space? Thank you -Vasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Mar 21 17:35:52 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 09:35:52 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hey Vasan, This page ("Extract the virtual channel time-series" section) provides an example: http://www.fieldtriptoolbox.org/tutorial/connectivity Arjen 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi All, > > Is there any standard procedure (in Fieldtrip) for extracting virtual > (source) time series from ROIs in Talariach or MNI space? > > Thank you > > -Vasan > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Mon Mar 21 17:40:37 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 12:40:37 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hi Arjen, The example scripts are for on the individual "subject space". I want to do the source analysis and also extracting time series for any ROIs in MNI space. -Vasan On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: > Hey Vasan, > > This page ("Extract the virtual channel time-series" section) provides an > example: > http://www.fieldtriptoolbox.org/tutorial/connectivity > > Arjen > > 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi All, >> >> Is there any standard procedure (in Fieldtrip) for extracting virtual >> (source) time series from ROIs in Talariach or MNI space? >> >> Thank you >> >> -Vasan >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 a.stolk8 at gmail.com Mon Mar 21 17:51:55 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 09:51:55 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hey Vasan, One way to do that is by 'normalizing' the subject's grid such that its points relate to specific points in MNI space. The procedure is described here: http://www.fieldtriptoolbox.org/tutorial/sourcemodel Using ft_volumelookup you can subsequently find the subject's grid points (now in MNI space) belonging to ROIs. Hope that helps, Arjen 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi Arjen, > > The example scripts are for on the individual "subject space". I want to > do the source analysis and also extracting time series for any ROIs in MNI > space. > > -Vasan > > On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: > >> Hey Vasan, >> >> This page ("Extract the virtual channel time-series" section) provides an >> example: >> http://www.fieldtriptoolbox.org/tutorial/connectivity >> >> Arjen >> >> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >> sreenivasan.r.nadar at gmail.com>: >> >>> Hi All, >>> >>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>> (source) time series from ROIs in Talariach or MNI space? >>> >>> Thank you >>> >>> -Vasan >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 sreenivasan.r.nadar at gmail.com Mon Mar 21 18:17:39 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 13:17:39 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hi Arjen, Thank you. I tried the method give in that link with ft_volumelookup for ROIs in MNI space and make a new leadfield for the ROIs and use the following commands for visualization: figure; hold on; ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); However, this method doesn't work properly as the grid sometime do not fall in the expected anatomical location. -Vasan On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: > Hey Vasan, > > One way to do that is by 'normalizing' the subject's grid such that its > points relate to specific points in MNI space. The procedure is described > here: > http://www.fieldtriptoolbox.org/tutorial/sourcemodel > > Using ft_volumelookup you can subsequently find the subject's grid points > (now in MNI space) belonging to ROIs. > > Hope that helps, > Arjen > > 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi Arjen, >> >> The example scripts are for on the individual "subject space". I want to >> do the source analysis and also extracting time series for any ROIs in MNI >> space. >> >> -Vasan >> >> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: >> >>> Hey Vasan, >>> >>> This page ("Extract the virtual channel time-series" section) provides >>> an example: >>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>> >>> Arjen >>> >>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>> sreenivasan.r.nadar at gmail.com>: >>> >>>> Hi All, >>>> >>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>> (source) time series from ROIs in Talariach or MNI space? >>>> >>>> Thank you >>>> >>>> -Vasan >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 a.stolk8 at gmail.com Mon Mar 21 18:37:00 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 10:37:00 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> References: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> Message-ID: Hi Vasan, Hard to tell based on this information, but did you copy over the template's dim and pos fields after normalization and/or check for (mis-)matches in geometric units (cm vs. mm) between grids and ROIs? Arjen 2016-03-21 10:17 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi Arjen, > > Thank you. I tried the method give in that link with ft_volumelookup for > ROIs in MNI space and make a new leadfield for the ROIs and use the > following commands for visualization: > > figure; hold on; > ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); > ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); > > However, this method doesn't work properly as the grid sometime do not > fall in the expected anatomical location. > > -Vasan > > On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: > >> Hey Vasan, >> >> One way to do that is by 'normalizing' the subject's grid such that its >> points relate to specific points in MNI space. The procedure is described >> here: >> http://www.fieldtriptoolbox.org/tutorial/sourcemodel >> >> Using ft_volumelookup you can subsequently find the subject's grid points >> (now in MNI space) belonging to ROIs. >> >> Hope that helps, >> Arjen >> >> 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >> sreenivasan.r.nadar at gmail.com>: >> >>> Hi Arjen, >>> >>> The example scripts are for on the individual "subject space". I want to >>> do the source analysis and also extracting time series for any ROIs in MNI >>> space. >>> >>> -Vasan >>> >>> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk >>> wrote: >>> >>>> Hey Vasan, >>>> >>>> This page ("Extract the virtual channel time-series" section) provides >>>> an example: >>>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>>> >>>> Arjen >>>> >>>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>>> sreenivasan.r.nadar at gmail.com>: >>>> >>>>> Hi All, >>>>> >>>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>>> (source) time series from ROIs in Talariach or MNI space? >>>>> >>>>> Thank you >>>>> >>>>> -Vasan >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> 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 joseluisblues at gmail.com Tue Mar 22 11:19:38 2016 From: joseluisblues at gmail.com (Jose) Date: Tue, 22 Mar 2016 11:19:38 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel Message-ID: Thanks Robert, It runs better. Still I would like to check some errors I got... When I run "ft_prepare_leadfield" I get: Warning: the selected value 18 should be within the range of the array from 17.8808 to 17.8808 When I run "ft_sourceinterpolate" I get: Warning: could not reshape freq to the expected dimensions Is this something I should worry about?, Or there is something I need to pay attention when I define my FOI?, best, Jose Luis ------------------------------ > > Message: 5 > Date: Fri, 18 Mar 2016 08:36:18 +0100 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] beamforming tutorial - cfg.headmodel > Message-ID: > Content-Type: text/plain; charset="windows-1252" > > Hi Jos? > > The option cfg.vol (for ?volume conduction model?) has been replaced by > cfg.headmodel for quite some time (probably more than a year ago). The code > is backward compatible, so cfg.vol will also still work, but the > documentation reflects the current standard. I suggest you update your copy > of FieldTrip to a more recent version. > > best regards, > Robert > > On 17 Mar 2016, at 20:03, Jose wrote: > > > dear list, > > > > There might be an error in the beamformer tutorial ( > http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead > field and the sources, cfg.vol rather than cfg.headmodel has to be defined > to determine the headmodel. Thanks for corroborating this. > > > > -- > > Jos? > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160318/0074e3e9/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Mar 22 15:48:40 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 22 Mar 2016 15:48:40 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel In-Reply-To: References: Message-ID: <26A274A1-34A4-4520-89AB-200521B53BFA@donders.ru.nl> Hi Jose Luis yes, you should worry about that. I don’t know whether it leads to errors, but it suggests that you are specifying things in the cfg that cannot be achieved with the data. You want to analyze 18 Hz, whereas the nearest frequency appears to be 17.8808 Hz, which is more than 2Hz off. Please check the frequency axis of your input data. You can always open (in the MATLAB editor) the code that issues the warning, and you can look at the code to try to understand it better. Robert On 22 Mar 2016, at 11:19, Jose wrote: > Thanks Robert, > It runs better. Still I would like to check some errors I got... > > When I run "ft_prepare_leadfield" I get: > Warning: the selected value 18 should be within the range of the array from 17.8808 to 17.8808 > > When I run "ft_sourceinterpolate" I get: > Warning: could not reshape freq to the expected dimensions > > Is this something I should worry about?, Or there is something I need to pay attention when I define my FOI?, > > best, > Jose Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Tue Mar 22 16:32:01 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Tue, 22 Mar 2016 11:32:01 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> Message-ID: Hi Arjen, Thank you. It worked well after I changed the template grid resolution. Vasan On Mon, Mar 21, 2016 at 1:37 PM, Arjen Stolk wrote: > Hi Vasan, > > Hard to tell based on this information, but did you copy over the > template's dim and pos fields after normalization and/or check for > (mis-)matches in geometric units (cm vs. mm) between grids and ROIs? > > Arjen > > 2016-03-21 10:17 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi Arjen, >> >> Thank you. I tried the method give in that link with ft_volumelookup for >> ROIs in MNI space and make a new leadfield for the ROIs and use the >> following commands for visualization: >> >> figure; hold on; >> ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); >> ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); >> >> However, this method doesn't work properly as the grid sometime do not >> fall in the expected anatomical location. >> >> -Vasan >> >> On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: >> >>> Hey Vasan, >>> >>> One way to do that is by 'normalizing' the subject's grid such that its >>> points relate to specific points in MNI space. The procedure is described >>> here: >>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel >>> >>> Using ft_volumelookup you can subsequently find the subject's grid >>> points (now in MNI space) belonging to ROIs. >>> >>> Hope that helps, >>> Arjen >>> >>> 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>> sreenivasan.r.nadar at gmail.com>: >>> >>>> Hi Arjen, >>>> >>>> The example scripts are for on the individual "subject space". I want >>>> to do the source analysis and also extracting time series for any ROIs in >>>> MNI space. >>>> >>>> -Vasan >>>> >>>> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk >>>> wrote: >>>> >>>>> Hey Vasan, >>>>> >>>>> This page ("Extract the virtual channel time-series" section) provides >>>>> an example: >>>>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>>>> >>>>> Arjen >>>>> >>>>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>>>> sreenivasan.r.nadar at gmail.com>: >>>>> >>>>>> Hi All, >>>>>> >>>>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>>>> (source) time series from ROIs in Talariach or MNI space? >>>>>> >>>>>> Thank you >>>>>> >>>>>> -Vasan >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Tue Mar 22 20:09:06 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Tue, 22 Mar 2016 19:09:06 +0000 (UTC) Subject: [FieldTrip] Dipole Moment Question from forward simulated data example References: <1602509026.3378850.1458673747178.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> I am working on simulated data example provided in the fieldtrip toolbox webpage. When I find the dipole moment after dipole fitting is [-1 0 0], where as original dipole mom was [1 0 0]. I was not sure if I am calculated dipole moment correctly. Any help would be appreciated.Thank you. Srinivas % http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % create a set of electrodes, randomly placed on the sphereelec = [];elec.pnt = randn(128,3);dum = sqrt(sum(elec.pnt.^2,2));elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit spherefor i=1:128 elec.label{i} = sprintf('%03d', i);end vol = [];vol.r = [0.88 0.92 1.00]; % radii of spheresvol.cond = [1 1/80 1]; % conductivityvol.o = [0 0 0]; % center of sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % create a dipole simulation with one dipole and a 10Hz sine wavecfg = [];cfg.vol = vol; % see abovecfg.elec = elec; % see abovecfg.dip.pos = [0 0.5 0.3];cfg.dip.mom = [1 0 0]'; % note, it should be transposedcfg.dip.frequency = 10;cfg.ntrials = 1;cfg.triallength = 1; % secondscfg.fsample = 250; % Hzraw1 = ft_dipolesimulation(cfg);avg1 = ft_timelockanalysis([], raw1);plot(avg1.time, avg1.avg); % plot the timecourse % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % do a dipole fit of the first simulated datasetcfg = [];cfg.vol = vol; % see abovecfg.elec = elec; % see abovecfg.dip.pos = [0 0 0]; % initial search positioncfg.gridsearch = 'no';dip1 = ft_dipolefitting(cfg, avg1); [u,s,v] = svd(dip1.dip.mom); if s(1,1) > s(2,2) dipole_orientation = u(:,1); end -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed Mar 23 10:35:10 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 23 Mar 2016 10:35:10 +0100 Subject: [FieldTrip] Dipole Moment Question from forward simulated data example In-Reply-To: <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> References: <1602509026.3378850.1458673747178.JavaMail.yahoo.ref@mail.yahoo.com> <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> Message-ID: Dear Srinivas Kota, So what you did here is simulate a dipole which changes its moment over time (refer to help ft_dipolesimulation) So the resulting dipole position it computed is something like [5.2523e-08 0.5000 0.3000]. However if you look at dip1.dip.mom you see it as [3x250 double] matrix. The first entry is the [1 0 0] which you were looking for and all the the other describe the moment at a different timepoint. If you have a quick look at plot(dip1.dip.mom(1,:)) you see the oscillation of the dipole. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 22 Mar 2016, at 20:09, Srinivas Kota wrote: > > I am working on simulated data example provided in the fieldtrip toolbox webpage. When I find the dipole moment after dipole fitting is [-1 0 0], where as original dipole mom was [1 0 0]. I was not sure if I am calculated dipole moment correctly. Any help would be appreciated. > Thank you. > Srinivas > > % http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % create a set of electrodes, randomly placed on the sphere > elec = []; > elec.pnt = randn(128,3); > dum = sqrt(sum(elec.pnt.^2,2)); > elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit sphere > for i=1:128 > elec.label{i} = sprintf('%03d', i); > end > > vol = []; > vol.r = [0.88 0.92 1.00]; % radii of spheres > vol.cond = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; % center of sphere > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % create a dipole simulation with one dipole and a 10Hz sine wave > cfg = []; > cfg.vol = vol; % see above > cfg.elec = elec; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; % note, it should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 1; > cfg.triallength = 1; % seconds > cfg.fsample = 250; % Hz > raw1 = ft_dipolesimulation(cfg); > avg1 = ft_timelockanalysis([], raw1); > plot(avg1.time, avg1.avg); % plot the timecourse > % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % do a dipole fit of the first simulated dataset > cfg = []; > cfg.vol = vol; % see above > cfg.elec = elec; % see above > cfg.dip.pos = [0 0 0]; % initial search position > cfg.gridsearch = 'no'; > dip1 = ft_dipolefitting(cfg, avg1); > [u,s,v] = svd(dip1.dip.mom); > if s(1,1) > s(2,2) > dipole_orientation = u(:,1); > end > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Wed Mar 23 23:52:47 2016 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Wed, 23 Mar 2016 23:52:47 +0100 Subject: [FieldTrip] ft_volumereslice shifts the brain Message-ID: <56F31E3F.1050200@uni-tuebingen.de> Hi everyone, I have a problem with ft_volumereslice, applied to Nifti MRIs (haven't tested it on other formats). The function shifts the image to bring the brain in the center, as announced in the documentation. However, this is done a) in a way that the nose of my MRI is cut off (s. below), which is suboptimal since I register EEG electrodes and fiducials in relation to the MRI and the cut is done close to the nasion, b) in contrast to the documentation it shifts the brain whether or not a coordinate system (.coordsys) is given. I guess this happens during ft_sourceinterpolate which is called inside ft_volumereslice (line 180). The shift that could be done in ft_volumereslice (line 103ff) is not performed if there is no .coordsys, but the shift in the returned MRI is still there. Before and After (without an mri.coordsys): Sure I can just increase the dimensions of the MRI, then I get the nose back, but I was wondering if anyone can explain this behavior of ft_volumereslice and whether it is a genuine bug or not. Thanks and greetings, Jens -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 187055 bytes Desc: not available URL: From mick.lehmann at uzh.ch Thu Mar 24 10:48:57 2016 From: mick.lehmann at uzh.ch (Mick Lehmann) Date: Thu, 24 Mar 2016 10:48:57 +0100 Subject: [FieldTrip] Time Frequency Analysis of <1 Hz Message-ID: <686D5E56-B948-4C9C-9EAB-B56D8EF5F5D6@uzh.ch> Dear FT community, I'm currently analyzing sleep EEG data and therefore I'm also interested in frequency ranges around 0.5/1 Hz. However, when I plot the data, it starts only from 1.25Hz and the cluster-based permutation can't be conducted when I include frequency ranges below 1.5 Hz. Any ideas on this issue based on the information provided blow? Best regards, Mick The raw data was read using the following script: VP = dir('*.dat'); cfg = []; cfg.dataset = (VP.name); % dataset cfg.trialdef.eventtype = 'Comment'; cfg.trialdef.prestim = 3; cfg.trialdef.poststim = 5; cfg.trialdef.eventvalue = {'HitHitReakt_LL' 'GainReakt_LL'}; cfg = ft_definetrial(cfg); cfg.demean = 'yes'; cfg.baselinewindow = [-1 -.1]; HH_SlowOsc = ft_preprocessing(cfg); HH_SlowOsc = renamechannels(HH_SlowOsc); save HH_SlowOsc HH_SlowOsc Afterwards, TF analysis was conducted using this script: load HH_SlowOsc cfg = []; cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.with = 2; HERE, I'VE TRIED 2 AND 7 CYCLES. BOTH DIDN'T WORK cfg.output = 'pow'; cfg.foi = 0.5:0.5:25; % Analysis from 2 to 30 Hz in 0.5 Hz steps cfg.toi = -3:0.05:5; % time window "slides" from -1 to 2 sec in steps of 0.05 sec (50 ms) % cfg.keeptrials = 'yes'; % für Single Trial Analysen TF_HH_SlowOsc = ft_freqanalysis(cfg, HH_SlowOsc); save TF_HH_SlowOsc TF_HH_SlowOsc; -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.pflug at musterkind.eu Thu Mar 24 12:12:27 2016 From: anja.pflug at musterkind.eu (Anja Pflug) Date: Thu, 24 Mar 2016 12:12:27 +0100 (CET) Subject: [FieldTrip] 1. Time Frequency Analysis of <1 Hz (Mick Lehmann) In-Reply-To: References: Message-ID: <1026761282.13417.70730d6f-540f-4503-a1c1-cd834547f92e.open-xchange@email.1und1.de> An HTML attachment was scrubbed... URL: From gina.joue at univr.it Thu Mar 24 12:30:48 2016 From: gina.joue at univr.it (gj) Date: Thu, 24 Mar 2016 12:30:48 +0100 Subject: [FieldTrip] Error with interpn when calling ft_sourceinterpolate Message-ID: <56F3CFE8.5050706@univr.it> Hi FieldTrip community, I am using FieldTrip ver.20160309 and am getting the error: Error using interpn (line 152) Wrong number of input arguments. Error in ft_sourceinterpolate>my_interpn (line 673) av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html Here is my code leading to the error when calling ft_sourceinterpolate: %-- snippet--% % sensor level Fourier spectra cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 13; freqsens = ft_freqanalysis(cfg, data); % source reconstruction cfg = []; cfg.frequency = freqsens.freq; cfg.elec = elec; cfg.method = 'eloreta'; cfg.grid = lf; cfg.vol = vol; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; source = ft_sourceanalysis(cfg, freqsens); % project to direction explaining most source variance cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); source_proj.dim = template_grid.sourcemodel.dim; source_proj.pos = template_grid.sourcemodel.pos; %%....... interpolate onto the MNI template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.pow'; cfg.interpmethod = 'nearest'; source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); %-- end snippet--% Any help greatly appreciated! Gina From eva.patai at psych.ox.ac.uk Thu Mar 24 13:15:00 2016 From: eva.patai at psych.ox.ac.uk (Zita Eva Patai) Date: Thu, 24 Mar 2016 12:15:00 +0000 Subject: [FieldTrip] ft_freqstatistics error when averaged over channels Message-ID: Dear FT-ers I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. Is there an easy way to fix this? I am using the FT inside SPM12. Thanks very much, zita -------------- next part -------------- An HTML attachment was scrubbed... URL: From bushra.riaz at gu.se Thu Mar 24 13:38:07 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Thu, 24 Mar 2016 12:38:07 +0000 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: <1457937054408.48754@gu.se> References: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE>, <1457937054408.48754@gu.se> Message-ID: <1458823086980.47671@gu.se> Hello, I found the problem with reading epoched fif files This code snippet cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); was giving the following error Error using fiff_read_epochs (line 46) Could not find epochs data This error was caused by this line of code (line 43 in fiff_read_epochs) ep = fiff_dir_tree_find(meas, FIFF.FIFFB_EPOCHS); because the returned structure ep was empty The value of this constant FIFF.FIFFB_EPOCHS is 122 , and in meas there was no block with such id therefore ep was empty The epoched data was in the block with the id 373 By changing line 43 in fiff_read_epochs by this ep = fiff_dir_tree_find(meas, 373); I am able to load the epoched data Kind regards Bushra Riaz ? ________________________________ From: Bushra Riaz Syeda Sent: Monday, March 14, 2016 7:30 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] error in reading epoched fif files My bad. I should have explained the problem I am using this code to read epoched fif files created with latest version of mne-python as was explained in fieldtrip tutorial (http://www.fieldtriptoolbox.org/development/integrate_with_mne) The sample epoched file can be downloaded from this link https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0? cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); and I am getting the following error Error using fiff_read_epochs (line 46) Could not find epochs data Error in fiff_read_epochs (line 46) error(me,'Could not find epochs data'); Error in ft_read_header (line 1601) epochs = fiff_read_epochs(filename); Error in ft_preprocessing (line 397) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Fri Mar 25 01:32:43 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Fri, 25 Mar 2016 00:32:43 +0000 (UTC) Subject: [FieldTrip] Simulated EEG with Cz as a reference References: <929834747.4959069.1458865963362.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <929834747.4959069.1458865963362.JavaMail.yahoo@mail.yahoo.com> I would like to simulate EEG with Cz as a reference. In the example http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit If I understand correctly, the function 'ft_dipolesimulation'  yields reference free simulated EEG. If I need Cz referenced EEG, would it be simulated EEG - Cz? BestSrini -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Mar 25 09:58:27 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 08:58:27 +0000 Subject: [FieldTrip] Error in ft_sourceinterpolate References: Message-ID: Hi Fosco, What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = ‘avg.nai’;? Best, Jan-Mathijs On 18 Mar 2016, at 16:49, fosco bernasconi > wrote: Dear all, I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate: Reference to non-existent field 'avg'. Error in getsubfield (line 45) s = s.(t{k}); Error in ft_sourceinterpolate (line 209) if ~iscell(getsubfield(functional, cfg.parameter{i})) If I check my source structure I do have the avg field. source = freq: 10 cumtapcnt: [157x1 double] dim: [18 21 18] inside: [6804x1 logical] pos: [6804x3 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] Any suggestion? Thank you for your help! Best, fosco here the rest of my code: load('standard_bem.mat'); load('standard_sourcemodel3d10mm.mat'); templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; template_mri = ft_read_mri(templatefile); template_mri = ft_convert_units(template_mri,'mm'); template_mri.coordsys = 'spm'; cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = template_mri; sourcemodel = ft_prepare_sourcemodel(cfg,freq); sourcemodel = ft_convert_units(sourcemodel,'mm'); cfg = []; cfg.elec = sens; cfg.channel = sens.label; cfg.headmodel = vol; cfg.grid = sourcemodel; cfg.grid.unit = 'mm';% same unit as above, i.e. in cm lf = ft_prepare_leadfield(cfg,freq); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft{1,1}); % compute source reconstruction cfg = []; cfg.frequency = freq.freq; cfg.method = 'pcc'; cfg.grid = lf; cfg.headmodel = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); % and provide mni template source_proj.dim = sourcemodel.dim; source_proj.pos = sourcemodel.pos; cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.nai'; source_int = ft_sourceinterpolate(cfg,source,template_mri); _______________________________________________ fieldtrip 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 Fri Mar 25 10:16:12 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 09:16:12 +0000 Subject: [FieldTrip] Error with interpn when calling ft_sourceinterpolate In-Reply-To: <56F3CFE8.5050706@univr.it> References: <56F3CFE8.5050706@univr.it> Message-ID: Hi Gina, What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151…., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) Best, Jan-Mathijs > On 24 Mar 2016, at 12:30, gj wrote: > > Hi FieldTrip community, > > I am using FieldTrip ver.20160309 and am getting the error: > > Error using interpn (line 152) > Wrong number of input arguments. > > Error in ft_sourceinterpolate>my_interpn (line 673) > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > > Here is my code leading to the error when calling ft_sourceinterpolate: > > %-- snippet--% > % sensor level Fourier spectra > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 13; > freqsens = ft_freqanalysis(cfg, data); > > % source reconstruction > cfg = []; > cfg.frequency = freqsens.freq; > cfg.elec = elec; > cfg.method = 'eloreta'; > cfg.grid = lf; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.rawtrial = 'yes'; > source = ft_sourceanalysis(cfg, freqsens); > > % project to direction explaining most source variance > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > source_proj.dim = template_grid.sourcemodel.dim; > source_proj.pos = template_grid.sourcemodel.pos; > > %%....... interpolate onto the MNI template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > > %-- end snippet--% > > > Any help greatly appreciated! > Gina > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Fri Mar 25 10:18:30 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 09:18:30 +0000 Subject: [FieldTrip] ft_volumereslice shifts the brain References: <8C87A3FE-177D-4864-B2F4-686E2D9D8FBF@donders.ru.nl> Message-ID: Hi Jens, If not instructed otherwise, ft_volumereslice attempts to realign the ‘box-with-anatomical-data’ in such a way that the origin of the coordinate system (as specified in the .transform of the input image) is in the centre of the volume. In your image it seems that the origin is in the posterior commissure, which does not leave sufficient space toward the nose to fit the whole head. Had your origin been in the anterior commissure instead, 128 1mm voxels towards the front would probably have been sufficient to include the nose. You can specify a bounding box in the cfg to get the origin off-center. Otherwise (and I suspect that this was your intention from the start) you should first realign your input image to a proper AC-origin based coordinate system, and put the origin where it should be according to convention. This can of course be achieved with ft_volumerealign. With respect to the documentation, could you give a suggestion for a revised chunk of text which is more clear in your view? Best, Jan-Mathijs On 23 Mar 2016, at 23:52, Jens Klinzing, Universität Tübingen wrote: > > Hi everyone, > I have a problem with ft_volumereslice, applied to Nifti MRIs (haven't tested it on other formats). The function shifts the image to bring the brain in the center, as announced in the documentation. > > However, this is done > a) in a way that the nose of my MRI is cut off (s. below), which is suboptimal since I register EEG electrodes and fiducials in relation to the MRI and the cut is done close to the nasion, > b) in contrast to the documentation it shifts the brain whether or not a coordinate system (.coordsys) is given. I guess this happens during ft_sourceinterpolate which is called inside ft_volumereslice (line 180). The shift that could be done in ft_volumereslice (line 103ff) is not performed if there is no .coordsys, but the shift in the returned MRI is still there. > > Before and After (without an mri.coordsys): > > > Sure I can just increase the dimensions of the MRI, then I get the nose back, but I was wondering if anyone can explain this behavior of ft_volumereslice and whether it is a genuine bug or not. > > Thanks and greetings, > Jens > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gina.joue at univr.it Fri Mar 25 13:29:21 2016 From: gina.joue at univr.it (gj) Date: Fri, 25 Mar 2016 13:29:21 +0100 Subject: [FieldTrip] Error with interpn when calling, ft_sourceinterpolate Message-ID: <56F52F21.1010900@univr.it> Hi Jan-Mathijs, Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? Thanks! Gina > > Message: 7 > Date: Fri, 25 Mar 2016 09:16:12 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling > ft_sourceinterpolate > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Gina, > > What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) > > Best, > Jan-Mathijs > > > >> On 24 Mar 2016, at 12:30, gj wrote: >> >> Hi FieldTrip community, >> >> I am using FieldTrip ver.20160309 and am getting the error: >> >> Error using interpn (line 152) >> Wrong number of input arguments. >> >> Error in ft_sourceinterpolate>my_interpn (line 673) >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >> >> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html >> >> Here is my code leading to the error when calling ft_sourceinterpolate: >> >> %-- snippet--% >> % sensor level Fourier spectra >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.output = 'fourier'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 2; >> cfg.foi = 13; >> freqsens = ft_freqanalysis(cfg, data); >> >> % source reconstruction >> cfg = []; >> cfg.frequency = freqsens.freq; >> cfg.elec = elec; >> cfg.method = 'eloreta'; >> cfg.grid = lf; >> cfg.vol = vol; >> cfg.keeptrials = 'yes'; >> cfg.rawtrial = 'yes'; >> source = ft_sourceanalysis(cfg, freqsens); >> >> % project to direction explaining most source variance >> cfg = []; >> cfg.projectmom = 'yes'; >> source_proj = ft_sourcedescriptives(cfg,source); >> >> source_proj.dim = template_grid.sourcemodel.dim; >> source_proj.pos = template_grid.sourcemodel.pos; >> >> %%....... interpolate onto the MNI template brain >> cfg = []; >> cfg.voxelcoord = 'no'; >> cfg.parameter = 'avg.pow'; >> cfg.interpmethod = 'nearest'; >> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); >> >> %-- end snippet--% >> >> >> Any help greatly appreciated! >> Gina >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From jan.schoffelen at donders.ru.nl Fri Mar 25 14:38:57 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 13:38:57 +0000 Subject: [FieldTrip] Error with interpn when calling, ft_sourceinterpolate References: Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6@donders.ru.nl> Hi Gina, What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? Specifically, what’s size(source_proj.pos,1) and source_proj.dim? Best, Jan-Mathijs > On 25 Mar 2016, at 13:29, gj wrote: > > Hi Jan-Mathijs, > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? > > Thanks! > Gina > > >> >> Message: 7 >> Date: Fri, 25 Mar 2016 09:16:12 +0000 >> From: "Schoffelen, J.M. (Jan Mathijs)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Error with interpn when calling >> ft_sourceinterpolate >> Message-ID: >> Content-Type: text/plain; charset="utf-8" >> >> Hi Gina, >> >> What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) >> >> Best, >> Jan-Mathijs >> >> >> >>> On 24 Mar 2016, at 12:30, gj wrote: >>> >>> Hi FieldTrip community, >>> >>> I am using FieldTrip ver.20160309 and am getting the error: >>> >>> Error using interpn (line 152) >>> Wrong number of input arguments. >>> >>> Error in ft_sourceinterpolate>my_interpn (line 673) >>> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >>> >>> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html >>> >>> Here is my code leading to the error when calling ft_sourceinterpolate: >>> >>> %-- snippet--% >>> % sensor level Fourier spectra >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'fourier'; >>> cfg.keeptrials = 'yes'; >>> cfg.tapsmofrq = 2; >>> cfg.foi = 13; >>> freqsens = ft_freqanalysis(cfg, data); >>> >>> % source reconstruction >>> cfg = []; >>> cfg.frequency = freqsens.freq; >>> cfg.elec = elec; >>> cfg.method = 'eloreta'; >>> cfg.grid = lf; >>> cfg.vol = vol; >>> cfg.keeptrials = 'yes'; >>> cfg.rawtrial = 'yes'; >>> source = ft_sourceanalysis(cfg, freqsens); >>> >>> % project to direction explaining most source variance >>> cfg = []; >>> cfg.projectmom = 'yes'; >>> source_proj = ft_sourcedescriptives(cfg,source); >>> >>> source_proj.dim = template_grid.sourcemodel.dim; >>> source_proj.pos = template_grid.sourcemodel.pos; >>> >>> %%....... interpolate onto the MNI template brain >>> cfg = []; >>> cfg.voxelcoord = 'no'; >>> cfg.parameter = 'avg.pow'; >>> cfg.interpmethod = 'nearest'; >>> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); >>> >>> %-- end snippet--% >>> >>> >>> Any help greatly appreciated! >>> Gina >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hibafouani123 at hotmail.com Sat Mar 26 12:21:58 2016 From: hibafouani123 at hotmail.com (hiba fouani) Date: Sat, 26 Mar 2016 11:21:58 +0000 Subject: [FieldTrip] .dat file In-Reply-To: References: Message-ID: Dear Fieldtripper, How to convert from .dat file to .mat? Thank you Hiba > From: fieldtrip-request at science.ru.nl > Subject: fieldtrip Digest, Vol 64, Issue 32 > To: fieldtrip at science.ru.nl > Date: Sat, 26 Mar 2016 12:00:01 +0100 > > 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. Re: Error with interpn when calling, ft_sourceinterpolate (gj) > 2. Re: Error with interpn when calling, ft_sourceinterpolate > (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Mar 2016 13:29:21 +0100 > From: gj > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <56F52F21.1010900 at univr.it> > Content-Type: text/plain; charset=utf-8; format=flowed > > Hi Jan-Mathijs, > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in > Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must > have made some error in the steps leading up to source interpolation -- > are there perhaps data checks I can do to narrow down what it could be? > > Thanks! > Gina > > > > > > Message: 7 > > Date: Fri, 25 Mar 2016 09:16:12 +0000 > > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Error with interpn when calling > > ft_sourceinterpolate > > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > > > Hi Gina, > > > > What version of MATLAB and operating system are you using? I cannot > get your error reproduced, and from the message it seems a low-level > MATLAB thing, because it complains about the number of input arguments > to a function that is provided by MATLAB. (by the way, the error message > that you got refers to line 152 in interpn, the same error check is done > in my version of interpn at line 151?., which suggests a different > version of the m-file. I was using matlab2014b on a windows machine) > > > > Best, > > Jan-Mathijs > > > > > > > >> On 24 Mar 2016, at 12:30, gj wrote: > >> > >> Hi FieldTrip community, > >> > >> I am using FieldTrip ver.20160309 and am getting the error: > >> > >> Error using interpn (line 152) > >> Wrong number of input arguments. > >> > >> Error in ft_sourceinterpolate>my_interpn (line 673) > >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > >> > >> while trying to interpolate onto a template brain after having done > source reconstruction. This question had been posted before several > years ago but don't know how to "fix" the problem: > >> > >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > >> > >> Here is my code leading to the error when calling ft_sourceinterpolate: > >> > >> %-- snippet--% > >> % sensor level Fourier spectra > >> cfg = []; > >> cfg.method = 'mtmfft'; > >> cfg.output = 'fourier'; > >> cfg.keeptrials = 'yes'; > >> cfg.tapsmofrq = 2; > >> cfg.foi = 13; > >> freqsens = ft_freqanalysis(cfg, data); > >> > >> % source reconstruction > >> cfg = []; > >> cfg.frequency = freqsens.freq; > >> cfg.elec = elec; > >> cfg.method = 'eloreta'; > >> cfg.grid = lf; > >> cfg.vol = vol; > >> cfg.keeptrials = 'yes'; > >> cfg.rawtrial = 'yes'; > >> source = ft_sourceanalysis(cfg, freqsens); > >> > >> % project to direction explaining most source variance > >> cfg = []; > >> cfg.projectmom = 'yes'; > >> source_proj = ft_sourcedescriptives(cfg,source); > >> > >> source_proj.dim = template_grid.sourcemodel.dim; > >> source_proj.pos = template_grid.sourcemodel.pos; > >> > >> %%....... interpolate onto the MNI template brain > >> cfg = []; > >> cfg.voxelcoord = 'no'; > >> cfg.parameter = 'avg.pow'; > >> cfg.interpmethod = 'nearest'; > >> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > >> > >> %-- end snippet--% > >> > >> > >> Any help greatly appreciated! > >> Gina > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------------ > > Message: 2 > Date: Fri, 25 Mar 2016 13:38:57 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > > Hi Gina, > > What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? > Specifically, what?s size(source_proj.pos,1) and source_proj.dim? > > Best, > Jan-Mathijs > > > On 25 Mar 2016, at 13:29, gj wrote: > > > > Hi Jan-Mathijs, > > > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? > > > > Thanks! > > Gina > > > > > >> > >> Message: 7 > >> Date: Fri, 25 Mar 2016 09:16:12 +0000 > >> From: "Schoffelen, J.M. (Jan Mathijs)" > >> To: FieldTrip discussion list > >> Subject: Re: [FieldTrip] Error with interpn when calling > >> ft_sourceinterpolate > >> Message-ID: > >> Content-Type: text/plain; charset="utf-8" > >> > >> Hi Gina, > >> > >> What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) > >> > >> Best, > >> Jan-Mathijs > >> > >> > >> > >>> On 24 Mar 2016, at 12:30, gj wrote: > >>> > >>> Hi FieldTrip community, > >>> > >>> I am using FieldTrip ver.20160309 and am getting the error: > >>> > >>> Error using interpn (line 152) > >>> Wrong number of input arguments. > >>> > >>> Error in ft_sourceinterpolate>my_interpn (line 673) > >>> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > >>> > >>> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: > >>> > >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > >>> > >>> Here is my code leading to the error when calling ft_sourceinterpolate: > >>> > >>> %-- snippet--% > >>> % sensor level Fourier spectra > >>> cfg = []; > >>> cfg.method = 'mtmfft'; > >>> cfg.output = 'fourier'; > >>> cfg.keeptrials = 'yes'; > >>> cfg.tapsmofrq = 2; > >>> cfg.foi = 13; > >>> freqsens = ft_freqanalysis(cfg, data); > >>> > >>> % source reconstruction > >>> cfg = []; > >>> cfg.frequency = freqsens.freq; > >>> cfg.elec = elec; > >>> cfg.method = 'eloreta'; > >>> cfg.grid = lf; > >>> cfg.vol = vol; > >>> cfg.keeptrials = 'yes'; > >>> cfg.rawtrial = 'yes'; > >>> source = ft_sourceanalysis(cfg, freqsens); > >>> > >>> % project to direction explaining most source variance > >>> cfg = []; > >>> cfg.projectmom = 'yes'; > >>> source_proj = ft_sourcedescriptives(cfg,source); > >>> > >>> source_proj.dim = template_grid.sourcemodel.dim; > >>> source_proj.pos = template_grid.sourcemodel.pos; > >>> > >>> %%....... interpolate onto the MNI template brain > >>> cfg = []; > >>> cfg.voxelcoord = 'no'; > >>> cfg.parameter = 'avg.pow'; > >>> cfg.interpmethod = 'nearest'; > >>> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > >>> > >>> %-- end snippet--% > >>> > >>> > >>> Any help greatly appreciated! > >>> Gina > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> 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 > > End of fieldtrip Digest, Vol 64, Issue 32 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Mar 27 12:17:21 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 27 Mar 2016 11:17:21 +0100 Subject: [FieldTrip] .dat file Message-ID: Hello Hiba, .dat files can be imported into MATLAB using the 'import data' GUI; you can also use that GUI to generate code for importing, and then you can modify the code to suit your needs. There are also plenty of other low-level functions for reading .dat files, e.g., http://uk.mathworks.com/matlabcentral/answers/79885-reading-dat-files-into-matlab, http://web.cecs.pdx.edu/~gerry/MATLAB/plotting/loadingPlotData.html, etc., you can find many more examples like this online. Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 1 > Date: Sat, 26 Mar 2016 11:21:58 +0000 > From: hiba fouani > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] .dat file > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > Dear Fieldtripper, > > How to convert from .dat file to .mat? > > Thank you > Hiba > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Mon Mar 28 15:41:46 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Mon, 28 Mar 2016 13:41:46 +0000 (UTC) Subject: [FieldTrip] Dipole Simuation and Fitting References: <1410856922.1013069.1459172506243.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1410856922.1013069.1459172506243.JavaMail.yahoo@mail.yahoo.com>   In ‘ft_dipolesimulation.m’, what is the coordinate systemwhen considering dipole position in the example?  http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit I would like to see the dipole position and momentum in theMRI template for the dipole I simulate. I came across this link http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefittingI understand that the accuracy of source localization isdepends on the selection of Left and Right Pre Auricular points.  The ‘interactive’ method in ‘ft_volumerealign’could result mislocalization of LPA and RPA. Is there any demo or video of choosingpre auricular points in an anatomical MRI?  What would be the best way if I have to do spatially alignan anatomical MRI with head coordinates for each individual subject, given theoptions ‘interactive’, ‘fiducial’,’headshape’,’SPM’ and ‘FSL’?  I work with newborn EEG, are there any standard MRItemplates for newborns? Thank youSrini -------------- next part -------------- An HTML attachment was scrubbed... URL: From fosco.bernasconi at gmail.com Mon Mar 28 16:37:57 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Mon, 28 Mar 2016 16:37:57 +0200 Subject: [FieldTrip] Error in ft_sourceinterpolate In-Reply-To: References: Message-ID: Hi Jan-Mathijs, this is exactly what I end up using. Alternatively, I also created source.nai = avg.nai, which is working as well. I do have another short question, when using the ft_source2full I have some matab errors (which I guess it may be due to the changes in the source structure occurred in 2015, could it be?), I decided to skip ft_source2sparse and therefore ft_source2full (because I have the computational power to do so), this should not affect my connectivity results, right? Thanks a lot! fosco 2016-03-25 9:58 GMT+01:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > Hi Fosco, > > What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = > ‘avg.nai’;? > Best, > Jan-Mathijs > > On 18 Mar 2016, at 16:49, fosco bernasconi > wrote: > > Dear all, > > I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I > have an error when calling ft_sourceinterpolate: > > > > > > * Reference to non-existent field 'avg'. Error in getsubfield (line 45) > s = s.(t{k}); Error in ft_sourceinterpolate (line 209) if > ~iscell(getsubfield(functional, cfg.parameter{i}))* > > > If I check my source structure I do have the avg field. > > source = > freq: 10 > cumtapcnt: [157x1 double] > dim: [18 21 18] > inside: [6804x1 logical] > pos: [6804x3 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > > Any suggestion? > > Thank you for your help! > Best, > fosco > > > here the rest of my code: > > > load('standard_bem.mat'); > load('standard_sourcemodel3d10mm.mat'); > > templatefile = > '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; > template_mri = ft_read_mri(templatefile); > template_mri = ft_convert_units(template_mri,'mm'); > template_mri.coordsys = 'spm'; > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = template_mri; > sourcemodel = ft_prepare_sourcemodel(cfg,freq); > sourcemodel = ft_convert_units(sourcemodel,'mm'); > > cfg = []; > cfg.elec = sens; > cfg.channel = sens.label; > cfg.headmodel = vol; > cfg.grid = sourcemodel; > cfg.grid.unit = 'mm';% same unit as above, i.e. in cm > lf = ft_prepare_leadfield(cfg,freq); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 10; > freq = ft_freqanalysis(cfg,dataft{1,1}); > > % compute source reconstruction > cfg = []; > cfg.frequency = freq.freq; > cfg.method = 'pcc'; > cfg.grid = lf; > cfg.headmodel = vol; > cfg.keeptrials = 'yes'; > cfg.pcc.lambda = '5%'; > cfg.pcc.projectnoise = 'yes'; > source = ft_sourceanalysis(cfg,freq); > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > % and provide mni template > source_proj.dim = sourcemodel.dim; > source_proj.pos = sourcemodel.pos; > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.nai'; > source_int = ft_sourceinterpolate(cfg,source,template_mri); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 gina.joue at univr.it Tue Mar 29 09:16:29 2016 From: gina.joue at univr.it (gj) Date: Tue, 29 Mar 2016 09:16:29 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 64, Issue 32 In-Reply-To: References: Message-ID: <56FA2BCD.7010201@univr.it> Hi Jan-Mathijs, Before replacing them with the values from the template grid, source_proj.dim is 1-row matrix = [15,18,13] and source_proj.pos a 3510x3 matrix of doubles After, it's source_proj.dim is a 1-row matrix = [32,39,34] and source_proj.pos is a 42432x3 matrix of doubles Thanks! Gina > ------------------------------ > > Message: 2 > Date: Fri, 25 Mar 2016 13:38:57 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > > Hi Gina, > > What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? > Specifically, what?s size(source_proj.pos,1) and source_proj.dim? > > Best, > Jan-Mathijs > From jan.schoffelen at donders.ru.nl Tue Mar 29 09:50:05 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 29 Mar 2016 07:50:05 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 64, Issue 32 In-Reply-To: <56FA2BCD.7010201@univr.it> References: <56FA2BCD.7010201@univr.it> Message-ID: Hi Gina, That’s what I was afraid of. By replacing the .pos and .dim you made the data structure inconsistent. The number of source positions should be kept constant, i.e. you need to use a ‘template grid’ that is defined at the same approximate spatial resolution as your individual grids. The reason for this is that the numeric data (e.g. in source.avg.pow) should have the same number of elements as the size(source.pos,1). Best, Jan-Mathijs > On 29 Mar 2016, at 09:16, gj wrote: > > Hi Jan-Mathijs, > > Before replacing them with the values from the template grid, > source_proj.dim is 1-row matrix = [15,18,13] > and > source_proj.pos a 3510x3 matrix of doubles > > > After, it's > source_proj.dim is a 1-row matrix = [32,39,34] > and > source_proj.pos is a 42432x3 matrix of doubles > > Thanks! > Gina > >> ------------------------------ >> >> Message: 2 >> Date: Fri, 25 Mar 2016 13:38:57 +0000 >> From: "Schoffelen, J.M. (Jan Mathijs)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Error with interpn when calling, >> ft_sourceinterpolate >> Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> >> Content-Type: text/plain; charset="utf-8" >> >> >> Hi Gina, >> >> What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? >> Specifically, what?s size(source_proj.pos,1) and source_proj.dim? >> >> Best, >> Jan-Mathijs >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From laetitia.lalla at inserm.fr Tue Mar 29 10:50:46 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Tue, 29 Mar 2016 10:50:46 +0200 Subject: [FieldTrip] Pb with ft_freqstatistics when averaged over channels : NaNs In-Reply-To: References: Message-ID: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> Dear FieldTrip community, I have a similar problem that may be of help here. It's my first message on this mailing list so, first of all, thank you very much for this free toolbox and the help you're providing. I'm a PhD student in Marseille (France) and I'm doing LFP recordings with tetrodes or silicon probes in freely moving rats. (I apologize in advance for this very detailed - and long - email). I'm trying to compare the power in a certain frequency range between 2 conditions (Trial and Baseline). I can see a clear rising during the trial and I want to run the statistics now. Like Zita, I'd like to run a cluster permutation test on data with frequency and time information, and my signal is averaged over channels. I followed this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics. [1]Based on this, this is what I did : 1) I cut epochs of 6s (trials), filter [0.1 250Hz] and average over channels to have an averaged signal per probe (32 channels = 4 shanks = 1 probe). 2) I do the same for the baseline. 3) I create a structure data_all which gather all the epochs, with the appropriate design matrix (0 if baseline, 1 if trial). 4) I do a Time Frequency Transform averaged over time with ft_freqanalysis, 'mtmfft', with keeptrials='yes'. It give me, for each trial, a profile Power=f(Freq) averaged during the time of the epoch. The difference in my frequency range is very clear when I plot the profiles. 5) I use ft_freqstatistics like this : cfg = []; cfg.channel = 'Str'; cfg.design = data_all.designmatrix; cfg.method = 'montecarlo'; cfg.numrandomization = 500; cfg.statistic = 'indepsamplesT'; cfg.ivar = 1; cfg.correctm = 'cluster'; cfg.neighbours = []; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; [stat]=ft_freqstatistics(cfg, FR_alltrials) And this is not working because I have only NaNs... stat = stat: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] prob: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] cirange: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] mask: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] ref: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] dimord: 'chan_freq' freq: [1x25 double] label: {'Str'} cfg: [1x1 struct] Would you have an idea to resolve my problem ? Maybe I forgot to precise a parameter somewhere ? Thank you for your help! Best regards, Laetitia On 24-03-2016 13:15, Zita Eva Patai wrote: > Dear FT-ers > > I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. > > I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. > > If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. > > Is there an easy way to fix this? > > I am using the FT inside SPM12. > > Thanks very much, > zita > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Links: ------ [1] http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Tue Mar 29 12:08:10 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Tue, 29 Mar 2016 12:08:10 +0200 Subject: [FieldTrip] Pb with ft_freqstatistics when averaged over channels : NaNs In-Reply-To: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> Message-ID: <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> Hello again, I actually solved my problem... It was pretty silly... I needed to put 1 and 2 in my design matrix instead of 0 and 1... It's in the code here : in ft_statfun_indepsamplesT.m row 77 % perform some checks on the design sel1 = find(design(cfg.ivar,:)==1); sel2 = find(design(cfg.ivar,:)==2); Sorry about that... But maybe it can help other people ? Have a nice day, Laetitia On 29-03-2016 10:50, laetitia.lalla at inserm.fr wrote: > Dear FieldTrip community, > > I have a similar problem that may be of help here. > > It's my first message on this mailing list so, first of all, thank you very much for this free toolbox and the help you're providing. I'm a PhD student in Marseille (France) and I'm doing LFP recordings with tetrodes or silicon probes in freely moving rats. (I apologize in advance for this very detailed - and long - email). > > I'm trying to compare the power in a certain frequency range between 2 conditions (Trial and Baseline). I can see a clear rising during the trial and I want to run the statistics now. > > Like Zita, I'd like to run a cluster permutation test on data with frequency and time information, and my signal is averaged over channels. > > I followed this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics. [1]Based on this, this is what I did : > > 1) I cut epochs of 6s (trials), filter [0.1 250Hz] and average over channels to have an averaged signal per probe (32 channels = 4 shanks = 1 probe). > > 2) I do the same for the baseline. > > 3) I create a structure data_all which gather all the epochs, with the appropriate design matrix (0 if baseline, 1 if trial). > > 4) I do a Time Frequency Transform averaged over time with ft_freqanalysis, 'mtmfft', with keeptrials='yes'. It give me, for each trial, a profile Power=f(Freq) averaged during the time of the epoch. The difference in my frequency range is very clear when I plot the profiles. > > 5) I use ft_freqstatistics like this : > > cfg = []; > > cfg.channel = 'Str'; > > cfg.design = data_all.designmatrix; > > cfg.method = 'montecarlo'; > > cfg.numrandomization = 500; > > cfg.statistic = 'indepsamplesT'; > > cfg.ivar = 1; > > cfg.correctm = 'cluster'; > > cfg.neighbours = []; > > cfg.alpha=0.05; > > cfg.tail=0; > > cfg.correcttail='alpha'; > > [stat]=ft_freqstatistics(cfg, FR_alltrials) > > And this is not working because I have only NaNs... > > stat = > > stat: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] > > prob: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] > > cirange: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] > > mask: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] > > ref: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] > > dimord: 'chan_freq' > > freq: [1x25 double] > > label: {'Str'} > > cfg: [1x1 struct] > > Would you have an idea to resolve my problem ? Maybe I forgot to precise a parameter somewhere ? > > Thank you for your help! > > Best regards, > > Laetitia > > On 24-03-2016 13:15, Zita Eva Patai wrote: > >> Dear FT-ers >> >> I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. >> >> I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. >> >> If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. >> >> Is there an easy way to fix this? >> >> I am using the FT inside SPM12. >> >> Thanks very much, >> zita >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Links: ------ [1] http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Wed Mar 30 03:19:01 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Tue, 29 Mar 2016 21:19:01 -0400 Subject: [FieldTrip] please help! sourcemodel and grid don't match Message-ID: Hi all, When I plot the sourcemodel and the headmodel, the sourcemodel is many magnitudes larger than the headmodel. Not sure if it has anything to do with my code so attaching that below. Also attaching the jpgs. %% read the parameters %% Parameter 2.2 mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; mritype='MNI'; realign='realigned'; volumereslicing='volumeresliced'; brainthresh=0.5; scalpthresh=0.10; scalpsmooth='scalp_smooth'; scalp_smooth.parameter=9; scalpvertices=1000; skullvertices=1000; brainvertices=1000; meshmethod='projectmesh'; headmodel_method='dipoli'; subjnum='915'; time='pre'; timetype='hassan'; timewindow=[0 .1]; gridtype='template10'; beamformer='lcmv'; sourcemodeltype= 'templatebased'; identifier='Parameter2-2'; =================================== %%read in mri switch mritype case 'MNI' [mri] = ft_read_mri(mrifile); mri.coordsys ='MNI'; case 'Analyze' [mri] = ft_read_mri(mrifile); mri.coordsys ='Analyze'; case 'SPM' [mri] = ft_read_mri(mrifile); mri.coordsys = 'SPM'; end save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') cfg=[]; ft_sourceplot(cfg,mri) ============================== %% realigning switch realign case 'realigned' cfg=[]; cfg.method='fiducial'; cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; mri_realigned=ft_volumerealign(cfg,mri); ft_sourceplot(cfg,mri_realigned) save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') case 'notrealigned' %do nothing end ========================= %% volume reslicing switch volumereslicing case 'volumeresliced' cfg = []; cfg.resolution = 1; mri_resliced = ft_volumereslice(cfg, mri); save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') case 'notresliced' %do nothing end ft_sourceplot(cfg,mri_resliced) ============================== %% segmentation parameters switch scalpsmooth case 'noscalpsmooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); case 'scalp_smooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.scalpsmooth = scalp_smooth.parameter; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); end seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; cfg.maskparameter=cfg.funparameter; ft_sourceplot(cfg,seg) save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') ================================= %% prepare mesh cfg = []; cfg.method= meshmethod; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [scalpvertices skullvertices brainvertices]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001; bnd(2).pnt = bnd(2).pnt.*1; bnd(3).pnt = bnd(3).pnt.*0.999; figure; ft_plot_mesh(bnd(1))%scalp figure; ft_plot_mesh(bnd(2))%skull figure; ft_plot_mesh(bnd(3))%brain %% save mesh save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') ============================================= %% build headmodel switch headmodel_method case 'dipoli' cfg = []; cfg.method = 'dipoli'; case 'bemcp' cfg = []; cfg.method = 'bemcp'; end headmodel = ft_prepare_headmodel(cfg, bnd); headmodel = ft_convert_units(headmodel,'cm'); save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); ==================================== %% adding electrodes to headmodel elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') ================================= %most likely they are not aligned, so for aligning electrodes cfg = []; cfg.method = 'interactive';%can try the 'fiducial' method but is very %likely not to fix it cfg.elec = elec; % nas=mri_realigned.cfg.fiducial.nas; % lpa=mri_realigned.cfg.fiducial.lpa; % rpa=mri_realigned.cfg.fiducial.rpa; cfg.headshape = headmodel.bnd(1);%scalp elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') ================================== %% load EEG data load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6w') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM0') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3W') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bw') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bb') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6b') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6') ==================================== %% timelock data cfg = []; cfg.refef= 'yes'; %added at 2-5 same = dataM0; same.trial = [dataM0.trial dataM3W.trial]; same.time = [dataM0.time dataM3W.time]; diff = dataM6; diff.trial = [dataM3Bb.trial dataM6.trial]; diff.time = [dataM3Bb.time dataM6.time]; switch timetype case 'simple' timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); case 'hassan' cfg.vartrllength = 0; %was changed to 0 from 2 cfg.covariance = 'yes'; cfg.covariancewindow = timewindow; cfg.keeptrials = 'yes'; timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); end save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') ============================ %% make sourcemodel switch sourcemodeltype case 'templatebased' template=load('standard_sourcemodel3d10mm.mat'); elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file cfg = []; cfg.headmodel = headmodel; cfg.mri=mri; cfg.grid.warpmni = 'yes'; cfg.grid.template = template.sourcemodel; cfg.grid.nonlinear = 'yes'; cfg.resolution = 2; % resolution of the template grid in mm cfg.moveinward = 1; % actually uses vol mesh cfg.grid.unit ='mm'; cfg.inwardshift = 0; % needs to be expressed to work with moveinward cfg.elec = elec; % cfg.headshape=('cortex_5124.surf.gii'); mysourcemodel = ft_prepare_sourcemodel(cfg); case 'individual' load('standard_sourcemodel3d5mm.mat'); cfg = []; cfg.grid.warpmni = 'yes'; cfg.resolution = 5; % resolution of the template grid in mm cfg.grid.nonlinear = 'yes'; % use non linear normalization cfg.mri = mri; % use subject's mri in mni coordinates cfg.grid.unit = 'mm'; mysourcemodel = ft_prepare_sourcemodel(cfg); case 'template' mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work end save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') ======================= %% Plot the single subject'e head model and grid positions figure hold on ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); ======================== %% Double check that source model is aligned to the segmented volume and to the electrodes *HERE IS WHERE I SEE THE ERROR* figure hold on plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); ======================================== %% make leadfield switch gridtype case 'individual' cfg = []; cfg.elec = elec; cfg.headmodel = headmodel; cfg.normalize = 'yes'; cfg.reducerank= 3; cfg.grid.unit = 'cm';% same unit as above, i.e. in cm [grid] = ft_prepare_leadfield(cfg); case 'templatebased' load('standard_sourcemodel3d10mm.mat') cfg = []; cfg.elec = elec; cfg.template = sourcemodel.cfg.grid; cfg.grid=mysourcemodel.cfg.grid; cfg.headmodel = headmodel; cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG cfg.channel = 'all'; cfg.normalize= 'yes'; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; [grid] = ft_prepare_leadfield(cfg); case 'template10' load('standard_sourcemodel3d10mm.mat') cfg.normalize='yes'; [grid]=sourcemodel.cfg.grid; end save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') =========================== %% Interpolate cfg = []; cfg.interpmethod = 'linear'; cfg.parameter = 'pow'; sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); % save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') ================================= %%beamforming cfg = []; cfg.method = 'slice'; % cfg.slicedim= 1; cfg.funcolormap = 'jet'; % cfg.method = 'ortho'; % cfg.funcolorlim = 'zeromax'; % cfg.funcolorlim = [0.01 0.2]; cfg.funparameter= 'pow'; test2=sourceinterp_diff; test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); test=sourceinterp_diff; test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; ft_sourceplot(cfg,test) ft_sourceplot(cfg,test2) ft_sourceplot(cfg,sourceinterp_same); ft_sourceplot(cfg,sourceinterp_diff); ft_sourceplot(cfg,sourceinterp_m0); ft_sourceplot(cfg,sourceinterp_m6); ft_sourceplot(cfg,sourceinterp_m3w); ft_sourceplot(cfg,sourceinterp_m3b); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figforfilegrid.jpg Type: image/jpeg Size: 37427 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figforemail.jpg Type: image/jpeg Size: 28140 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: combinedforemail.jpg Type: image/jpeg Size: 41474 bytes Desc: not available URL: From mi_mayer at gmx.de Wed Mar 30 13:44:08 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Wed, 30 Mar 2016 13:44:08 +0200 Subject: [FieldTrip] Shift triggers Message-ID: An HTML attachment was scrubbed... URL: From carsten.wolters at uni-muenster.de Wed Mar 30 12:14:11 2016 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 30 Mar 2016 12:14:11 +0200 Subject: [FieldTrip] PhD position available: EEG/MEG inverse problem in presurgical epilepy diagnosis Message-ID: <56FBA6F3.4010808@uni-muenster.de> Doctoral Student *Neuroscientist with focus on the EEG/MEG inverse problem in presurgical epilepsy diagnosis * The *medical faculty of the University of Münster*, Germany, invites applications for a Doctoral Student Ref.: 10937 for a TVL13, 65%, three year position to work on the combined Electro- (EEG) and Magneto-encephalography (MEG) inverse problem in presurgical epilepsy diagnosis using calibrated realistic finite element volume conductor models of the patients heads within a DFG-funded project. The successful applicant holds a Master’s degree (or equivalent) in a relevant academic area such as *applied mathematics, computer science, physics, biomedical or electrical engineering or similar disciplines.* Good programming expertise (C++, Matlab, Fortran or equivalent) and experience with the Linux operating system is expected, because large software toolboxes are used and further developed. The working language at the institute is English. Experience with the measurement and analysis of brain signals is advantageous, but not essential. The applicant’s merits are assessed on the basis of the quality of Master’s level studies and thesis, previous experience with inverse problems, numerical mathematics, software development, motivation and research interests. The location for this research will mainly be the workgroups “Methods in bioelectromagnetism” of Dr. Wolters at the Institute for Biomagnetism and Biosignalanalysis (IBB) and “Imaging” of Prof. Dr. Martin Burger at the Institute for Computational and Applied Mathematics, both at the University of Münster in Germany. Expected close collaborations and visits are with the Department of Neurosurgery at the University of Erlangen (Dr.med. Stefan Rampp) and with the epilepsy centers Münster-Osnabrück (Dr. Gabriel Möddel; PD Dr.med. Christoph Kellinghaus) and Bochum (Prof. Dr.med. Jörg Wellmer). The application should include a statement of research interests and reasons for applying to the project, a curriculum vitae (max. 4 pages) composed according to good scientific practice, a certificate of Master’s degree, copy of the master’s thesis and grades of Master’s level studies, the names and e-mail addresses of two referees and a proof of proficiency in English. The position will be open until filled. To apply for the position, please send the above documents as pdfs until 20.04.2016 to *PD Dr. rer.nat. Carsten Wolters*, Institute for Biomagnetism and Biosignalanalysis, University of Münster, Malmedyweg 15, 48149 Münster, Germany, or by Email to *carsten.wolters(at)­uni-muenster(dot)­de . For additional information please contact PD Dr. Carsten Wolters (Email: carsten.wolters(at)­uni-muenster(dot)­de *, Phone: +49 (0)251 83-56904). Applications of women are specifically invited. In the case of similar qualifications, competence, and specific achievements, women will be considered on preferential terms within the framework of the legal possibilities. Handicapped candidates with equivalent qualifications will be given preference. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From carsten.wolters at uni-muenster.de Wed Mar 30 12:16:03 2016 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 30 Mar 2016 12:16:03 +0200 Subject: [FieldTrip] PhD position available: EEG/MEG forward problem in presurgical epilepy diagnosis Message-ID: <56FBA763.8050207@uni-muenster.de> Doctoral Student *Neuroscientist with focus on the EEG/MEG forward problem in presurgical epilepsy diagnosis* The *medical faculty of the University of Münster*, Germany, invites applications for a Doctoral Student Ref.: 10939 for a TVL13, 65%, three year position to work on the combined Electro- (EEG) and Magneto-encephalography (MEG) forward problem in presurgical epilepsy diagnosis using calibrated realistic finite element volume conductor models of the patients heads within a DFG-funded project. The successful applicant holds a Master’s degree (or equivalent) in a relevant academic area such as *applied* *mathematics, computer science, physics, biomedical or electrical engineering or similar disciplines. *Good programming expertise (C++, Matlab, Fortran or equivalent) and experience with the Linux operating system is expected, because large software toolboxes (DUNE-PDELab, see http://www.dune-project.org/) are used and further developed. The working language at the institute is English. Experience with finite element method based simulation and the analysis of brain signals is advantageous, but not essential. The applicant’s merits are assessed on the basis of the quality of Master’s level studies and thesis, previous experience with the numerical solution of partial differential equations, numerical mathematics, inverse problems, software development, motivation and research interests. The location for this research will mainly be the workgroups “Methods in bioelectromagnetism” of PD Dr. Wolters at the Institute for Biomagnetism and Biosignalanalysis (IBB) and “Applications of partial differential equations” of Prof. Dr. Christian Engwer at the Institute for Computational and Applied Mathematics, both at the University of Münster in Germany. Expected close collaborations and visits are with the Department of Neurosurgery at the University of Erlangen (Dr.med. Stefan Rampp) and with the epilepsy centers Münster-Osnabrück (Dr. Gabriel Möddel; PD Dr.med. Christoph Kellinghaus) and Bochum (Prof. Dr.med. Jörg Wellmer). The application should include a statement of research interests and reasons for applying to the project, a curriculum vitae (max. 4 pages) composed according to good scientific practice, a certificate of Master’s degree, copy of the master’s thesis and grades of Master’s level studies, the names and e-mail addresses of two referees and a proof of proficiency in English. The position will be open until filled. To apply for the position, please send the above documents as pdfs until 20.04.2016 to*PD Dr.rer.nat. Carsten Wolters*, Institute for Biomagnetism and Biosignalanalysis, University of Münster, Malmedyweg 15, 48149 Münster, Germany, or by Email to *carsten.wolters(at)­uni-muenster(dot)­de *. For additional information please contact*PD Dr. Carsten Wolters (Email: carsten.wolters(at)­uni-muenster(dot)­de *, Phone: +49 (0)251 83-56904). Applications of women are specifically invited. In the case of similar qualifications, competence, and specific achievements, women will be considered on preferential terms within the framework of the legal possibilities. Handicapped candidates with equivalent qualifications will be given preference. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Mar 30 15:17:31 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 30 Mar 2016 13:17:31 +0000 Subject: [FieldTrip] Shift triggers In-Reply-To: References: Message-ID: <883F387F-B82E-4511-B31A-49B924EB02ED@donders.ru.nl> Hi Sophia, If you would like to stick to the default ft_trialfun_general, you could update the 3d column in your cfg_trl.trl matrix. This column contains the ‘offset’ for each trial, which specifies for the first sample in each trial the number of samples prior to what is defined as ‘time point zero’ for that trial. You should subtract or add round(0.015.*the-sampling-rate), depending on the intended direction of the shift. I leave it as exercise to you to determine whether to add or subtract. Best, Jan-Mathijs On 30 Mar 2016, at 13:44, Irene Sophia Mayer > wrote: Dear Fieldtrippers, I am defining my trials with the following code: cfg = []; cfg.dataset = infile; cfg.trialdef.eventtype = 'Stimulus'; cfg.trialdef.eventvalue = 'S 1'; cfg.trialdef.prestim = .1; cfg.trialdef.poststim = 2.2; cfg_trl = ft_definetrial(cfg); However, I have measured that my stimulus appeared 15ms late. Is there a way of shifting the triggers or the trials? Meaning, that trialdef does not take the actual time of the event but adds 15ms. Then this new value is considered for the prestimulus and poststimulus time as the new point zero. Cheers, Sophia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Mar 30 15:55:53 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 30 Mar 2016 15:55:53 +0200 Subject: [FieldTrip] please help! sourcemodel and grid don't match In-Reply-To: References: Message-ID: <94637D12-7261-4751-A3FE-A763E552D458@gmail.com> Hi Hassan, have you double-checked that all your input units are in the same in all elements (i.e. electrodes, volume, mri, grid all have the same .unit and .pos values in the same ballpark)? You can use ft_convert_units to fix possible differences. Good luck, Julian Am 30.03.2016 um 03:19 schrieb Hassan Aleem: > Hi all, > > When I plot the sourcemodel and the headmodel, the sourcemodel is many magnitudes larger than the headmodel. Not sure if it has anything to do with my code so attaching that below. Also attaching the jpgs. > > %% read the parameters > > %% Parameter 2.2 > > mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; > mritype='MNI'; > realign='realigned'; > volumereslicing='volumeresliced'; > brainthresh=0.5; > scalpthresh=0.10; > scalpsmooth='scalp_smooth'; > scalp_smooth.parameter=9; > scalpvertices=1000; > skullvertices=1000; > brainvertices=1000; > meshmethod='projectmesh'; > headmodel_method='dipoli'; > subjnum='915'; > time='pre'; > timetype='hassan'; > timewindow=[0 .1]; > gridtype='template10'; > beamformer='lcmv'; > sourcemodeltype= 'templatebased'; > identifier='Parameter2-2'; > =================================== > %%read in mri > > switch mritype > case 'MNI' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='MNI'; > case 'Analyze' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='Analyze'; > case 'SPM' > [mri] = ft_read_mri(mrifile); > mri.coordsys = 'SPM'; > end > save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') > cfg=[]; > ft_sourceplot(cfg,mri) > ============================== > > %% realigning > switch realign > case 'realigned' > cfg=[]; > cfg.method='fiducial'; > cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; > cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; > cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; > mri_realigned=ft_volumerealign(cfg,mri); > ft_sourceplot(cfg,mri_realigned) > save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') > case 'notrealigned' > %do nothing > end > > ========================= > %% volume reslicing > switch volumereslicing > case 'volumeresliced' > cfg = []; > cfg.resolution = 1; > mri_resliced = ft_volumereslice(cfg, mri); > save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') > case 'notresliced' > %do nothing > end > ft_sourceplot(cfg,mri_resliced) > ============================== > > %% segmentation parameters > switch scalpsmooth > case 'noscalpsmooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > case 'scalp_smooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.scalpsmooth = scalp_smooth.parameter; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > end > > seg.anatomy = mri.anatomy; > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > cfg.maskparameter=cfg.funparameter; > ft_sourceplot(cfg,seg) > > save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') > ================================= > %% prepare mesh > > cfg = []; > cfg.method= meshmethod; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [scalpvertices skullvertices brainvertices]; > bnd = ft_prepare_mesh(cfg, seg); > % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001; > bnd(2).pnt = bnd(2).pnt.*1; > bnd(3).pnt = bnd(3).pnt.*0.999; > > figure; > ft_plot_mesh(bnd(1))%scalp > figure; > ft_plot_mesh(bnd(2))%skull > figure; > ft_plot_mesh(bnd(3))%brain > > %% save mesh > save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') > ============================================= > > %% build headmodel > > switch headmodel_method > case 'dipoli' > cfg = []; > cfg.method = 'dipoli'; > case 'bemcp' > cfg = []; > cfg.method = 'bemcp'; > end > > headmodel = ft_prepare_headmodel(cfg, bnd); > headmodel = ft_convert_units(headmodel,'cm'); > > save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); > > ==================================== > %% adding electrodes to headmodel > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file > % visualize head surface (scalp) > figure; > ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > ================================= > %most likely they are not aligned, so for aligning electrodes > cfg = []; > cfg.method = 'interactive';%can try the 'fiducial' method but is very > %likely not to fix it > cfg.elec = elec; > % nas=mri_realigned.cfg.fiducial.nas; > % lpa=mri_realigned.cfg.fiducial.lpa; > % rpa=mri_realigned.cfg.fiducial.rpa; > cfg.headshape = headmodel.bnd(1);%scalp > elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes > > save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') > ================================== > %% load EEG data > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6w') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM0') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3W') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bw') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bb') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6b') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6') > ==================================== > %% timelock data > > cfg = []; > cfg.refef= 'yes'; %added at 2-5 > > > same = dataM0; > same.trial = [dataM0.trial dataM3W.trial]; > same.time = [dataM0.time dataM3W.time]; > > diff = dataM6; > diff.trial = [dataM3Bb.trial dataM6.trial]; > diff.time = [dataM3Bb.time dataM6.time]; > > switch timetype > case 'simple' > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > case 'hassan' > cfg.vartrllength = 0; %was changed to 0 from 2 > cfg.covariance = 'yes'; > cfg.covariancewindow = timewindow; > cfg.keeptrials = 'yes'; > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > > end > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') > > ============================ > %% make sourcemodel > > switch sourcemodeltype > case 'templatebased' > template=load('standard_sourcemodel3d10mm.mat'); > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file > cfg = []; > cfg.headmodel = headmodel; > cfg.mri=mri; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.resolution = 2; % resolution of the template grid in mm > cfg.moveinward = 1; % actually uses vol mesh > cfg.grid.unit ='mm'; > cfg.inwardshift = 0; % needs to be expressed to work with moveinward > cfg.elec = elec; > % cfg.headshape=('cortex_5124.surf.gii'); > mysourcemodel = ft_prepare_sourcemodel(cfg); > > case 'individual' > load('standard_sourcemodel3d5mm.mat'); > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 5; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > mysourcemodel = ft_prepare_sourcemodel(cfg); > case 'template' > mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work > end > > > > save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') > ======================= > %% Plot the single subject'e head model and grid positions > > figure > hold on > ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); > ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); > ======================== > %% Double check that source model is aligned to the segmented volume and to the electrodes > HERE IS WHERE I SEE THE ERROR > figure > hold on > plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); > ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); > ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); > ======================================== > %% make leadfield > > > switch gridtype > case 'individual' > cfg = []; > cfg.elec = elec; > cfg.headmodel = headmodel; > cfg.normalize = 'yes'; > cfg.reducerank= 3; > cfg.grid.unit = 'cm';% same unit as above, i.e. in cm > [grid] = ft_prepare_leadfield(cfg); > case 'templatebased' > load('standard_sourcemodel3d10mm.mat') > cfg = []; > cfg.elec = elec; > cfg.template = sourcemodel.cfg.grid; > cfg.grid=mysourcemodel.cfg.grid; > cfg.headmodel = headmodel; > cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG > cfg.channel = 'all'; > cfg.normalize= 'yes'; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > [grid] = ft_prepare_leadfield(cfg); > case 'template10' > load('standard_sourcemodel3d10mm.mat') > cfg.normalize='yes'; > [grid]=sourcemodel.cfg.grid; > end > > > save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') > =========================== > %% Interpolate > cfg = []; > cfg.interpmethod = 'linear'; > cfg.parameter = 'pow'; > sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); > sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); > sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); > sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); > sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); > sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); > > > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') > ================================= > > %%beamforming > > cfg = []; > cfg.method = 'slice'; > % cfg.slicedim= 1; > cfg.funcolormap = 'jet'; > % cfg.method = 'ortho'; > % cfg.funcolorlim = 'zeromax'; > % cfg.funcolorlim = [0.01 0.2]; > cfg.funparameter= 'pow'; > > > test2=sourceinterp_diff; > test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); > test=sourceinterp_diff; > test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; > ft_sourceplot(cfg,test) > ft_sourceplot(cfg,test2) > ft_sourceplot(cfg,sourceinterp_same); > ft_sourceplot(cfg,sourceinterp_diff); > ft_sourceplot(cfg,sourceinterp_m0); > ft_sourceplot(cfg,sourceinterp_m6); > ft_sourceplot(cfg,sourceinterp_m3w); > ft_sourceplot(cfg,sourceinterp_m3b); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From sreenivasan.r.nadar at gmail.com Wed Mar 30 16:39:26 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Wed, 30 Mar 2016 10:39:26 -0400 Subject: [FieldTrip] please help! sourcemodel and grid don't match In-Reply-To: References: Message-ID: Hi Hasan, The problem is probably related to dimensions (units: mm, cm) and same could be changed by using the command: headmodel = ft_convert_units(headmodel, 'cm'). Good luck! Vasan On Tue, Mar 29, 2016 at 9:19 PM, Hassan Aleem wrote: > Hi all, > > When I plot the sourcemodel and the headmodel, the sourcemodel is many > magnitudes larger than the headmodel. Not sure if it has anything to do > with my code so attaching that below. Also attaching the jpgs. > > %% read the parameters > > %% Parameter 2.2 > > mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; > mritype='MNI'; > realign='realigned'; > volumereslicing='volumeresliced'; > brainthresh=0.5; > scalpthresh=0.10; > scalpsmooth='scalp_smooth'; > scalp_smooth.parameter=9; > scalpvertices=1000; > skullvertices=1000; > brainvertices=1000; > meshmethod='projectmesh'; > headmodel_method='dipoli'; > subjnum='915'; > time='pre'; > timetype='hassan'; > timewindow=[0 .1]; > gridtype='template10'; > beamformer='lcmv'; > sourcemodeltype= 'templatebased'; > identifier='Parameter2-2'; > =================================== > %%read in mri > > switch mritype > case 'MNI' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='MNI'; > case 'Analyze' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='Analyze'; > case 'SPM' > [mri] = ft_read_mri(mrifile); > mri.coordsys = 'SPM'; > end > save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') > cfg=[]; > ft_sourceplot(cfg,mri) > ============================== > > %% realigning > switch realign > case 'realigned' > cfg=[]; > cfg.method='fiducial'; > cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; > cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; > cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; > mri_realigned=ft_volumerealign(cfg,mri); > ft_sourceplot(cfg,mri_realigned) > > save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') > case 'notrealigned' > %do nothing > end > > ========================= > %% volume reslicing > switch volumereslicing > case 'volumeresliced' > cfg = []; > cfg.resolution = 1; > mri_resliced = ft_volumereslice(cfg, mri); > > save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') > case 'notresliced' > %do nothing > end > ft_sourceplot(cfg,mri_resliced) > ============================== > > %% segmentation parameters > switch scalpsmooth > case 'noscalpsmooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > case 'scalp_smooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.scalpsmooth = scalp_smooth.parameter; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > end > > seg.anatomy = mri.anatomy; > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > cfg.maskparameter=cfg.funparameter; > ft_sourceplot(cfg,seg) > > save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') > ================================= > %% prepare mesh > > cfg = []; > cfg.method= meshmethod; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [scalpvertices skullvertices brainvertices]; > bnd = ft_prepare_mesh(cfg, seg); > % i enlarged / reduced the boundary mesh a little bit, because they were > causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001; > bnd(2).pnt = bnd(2).pnt.*1; > bnd(3).pnt = bnd(3).pnt.*0.999; > > figure; > ft_plot_mesh(bnd(1))%scalp > figure; > ft_plot_mesh(bnd(2))%skull > figure; > ft_plot_mesh(bnd(3))%brain > > %% save mesh > > save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') > ============================================= > > %% build headmodel > > switch headmodel_method > case 'dipoli' > cfg = []; > cfg.method = 'dipoli'; > case 'bemcp' > cfg = []; > cfg.method = 'bemcp'; > end > > headmodel = ft_prepare_headmodel(cfg, bnd); > headmodel = ft_convert_units(headmodel,'cm'); > > > save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); > > ==================================== > %% adding electrodes to headmodel > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode > file > % visualize head surface (scalp) > figure; > ft_plot_mesh(headmodel.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > ================================= > %most likely they are not aligned, so for aligning electrodes > cfg = []; > cfg.method = 'interactive';%can try the 'fiducial' method but is very > %likely not to fix it > cfg.elec = elec; > % nas=mri_realigned.cfg.fiducial.nas; > % lpa=mri_realigned.cfg.fiducial.lpa; > % rpa=mri_realigned.cfg.fiducial.rpa; > cfg.headshape = headmodel.bnd(1);%scalp > elec_aligned = ft_electroderealign(cfg);%use the gui to manually align > the electrodes > > save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') > ================================== > %% load EEG data > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6w') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM0') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3W') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3Bw') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3Bb') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6b') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6') > ==================================== > %% timelock data > > cfg = []; > cfg.refef= 'yes'; %added at 2-5 > > > same = dataM0; > same.trial = [dataM0.trial dataM3W.trial]; > same.time = [dataM0.time dataM3W.time]; > > diff = dataM6; > diff.trial = [dataM3Bb.trial dataM6.trial]; > diff.time = [dataM3Bb.time dataM6.time]; > > switch timetype > case 'simple' > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > case 'hassan' > cfg.vartrllength = 0; %was changed to 0 from 2 > cfg.covariance = 'yes'; > cfg.covariancewindow = timewindow; > cfg.keeptrials = 'yes'; > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > > end > > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') > > ============================ > %% make sourcemodel > > switch sourcemodeltype > case 'templatebased' > template=load('standard_sourcemodel3d10mm.mat'); > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load > electrode file > cfg = []; > cfg.headmodel = headmodel; > cfg.mri=mri; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.resolution = 2; % resolution of the template grid in mm > cfg.moveinward = 1; % actually uses vol mesh > cfg.grid.unit ='mm'; > cfg.inwardshift = 0; % needs to be expressed to work with > moveinward > cfg.elec = elec; > % cfg.headshape=('cortex_5124.surf.gii'); > mysourcemodel = ft_prepare_sourcemodel(cfg); > > case 'individual' > load('standard_sourcemodel3d5mm.mat'); > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 5; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > mysourcemodel = ft_prepare_sourcemodel(cfg); > case 'template' > mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work > end > > > > > save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') > ======================= > %% Plot the single subject'e head model and grid positions > > figure > hold on > ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); > ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); > ======================== > %% Double check that source model is aligned to the segmented volume and > to the electrodes > *HERE IS WHERE I SEE THE ERROR* > figure > hold on > > plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); > > ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); > ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); > ======================================== > %% make leadfield > > > switch gridtype > case 'individual' > cfg = []; > cfg.elec = elec; > cfg.headmodel = headmodel; > cfg.normalize = 'yes'; > cfg.reducerank= 3; > cfg.grid.unit = 'cm';% same unit as above, i.e. in cm > [grid] = ft_prepare_leadfield(cfg); > case 'templatebased' > load('standard_sourcemodel3d10mm.mat') > cfg = []; > cfg.elec = elec; > cfg.template = sourcemodel.cfg.grid; > cfg.grid=mysourcemodel.cfg.grid; > cfg.headmodel = headmodel; > cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG > cfg.channel = 'all'; > cfg.normalize= 'yes'; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > [grid] = ft_prepare_leadfield(cfg); > case 'template10' > load('standard_sourcemodel3d10mm.mat') > cfg.normalize='yes'; > [grid]=sourcemodel.cfg.grid; > end > > > save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') > =========================== > %% Interpolate > cfg = []; > cfg.interpmethod = 'linear'; > cfg.parameter = 'pow'; > sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); > sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); > sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); > sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); > sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); > sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); > > > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') > ================================= > > %%beamforming > > cfg = []; > cfg.method = 'slice'; > % cfg.slicedim= 1; > cfg.funcolormap = 'jet'; > % cfg.method = 'ortho'; > % cfg.funcolorlim = 'zeromax'; > % cfg.funcolorlim = [0.01 0.2]; > cfg.funparameter= 'pow'; > > > test2=sourceinterp_diff; > > test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); > test=sourceinterp_diff; > test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; > ft_sourceplot(cfg,test) > ft_sourceplot(cfg,test2) > ft_sourceplot(cfg,sourceinterp_same); > ft_sourceplot(cfg,sourceinterp_diff); > ft_sourceplot(cfg,sourceinterp_m0); > ft_sourceplot(cfg,sourceinterp_m6); > ft_sourceplot(cfg,sourceinterp_m3w); > ft_sourceplot(cfg,sourceinterp_m3b); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Thu Mar 31 13:11:31 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Thu, 31 Mar 2016 13:11:31 +0200 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> Message-ID: Dear FielTrip community, Sorry to bother you again... I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... This is my story : - It's a single-subject study - I want to compare two sets of trials observed in different conditions. - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the "unequal sample size problem". - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). Based on the paper, I could refer myself to the point "2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin". - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. - And I can perform the montecarlo simulation. My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? This is what I did : 1) Extract and preprocess the signal from my condition 1. 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → 3) coh1= ft_connectivityanalysis(cfg, freq1) I did the same thing for the other condition → coh2. And then for the statistics : cfg = []; cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) cfg.parameter='cohspctrm'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; stat=ft_freqstatistics(cfg, coh1, coh2); And it gives me the following error : Error using ft_checkconfig (line 153) The field cfg.design is required. Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? Any help will be appreciated ! Thanks a lot for your time, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Thu Mar 31 13:47:19 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Thu, 31 Mar 2016 11:47:19 +0000 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr>, Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> Hi Laetitia, If you only have one subject you do need individual trial data, otherwise you can't do statistics like this. You need multiple observations (either subjects or trials). Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of laetitia.lalla at inserm.fr [laetitia.lalla at inserm.fr] Sent: Thursday, March 31, 2016 1:11 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question about coherence statistics Dear FielTrip community, Sorry to bother you again... I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... This is my story : - It's a single-subject study - I want to compare two sets of trials observed in different conditions. - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the “unequal sample size problem”. - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). Based on the paper, I could refer myself to the point “2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin”. - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. - And I can perform the montecarlo simulation. My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? This is what I did : 1) Extract and preprocess the signal from my condition 1. 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → 3) coh1= ft_connectivityanalysis(cfg, freq1) I did the same thing for the other condition → coh2. And then for the statistics : cfg = []; cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) cfg.parameter='cohspctrm'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; stat=ft_freqstatistics(cfg, coh1, coh2); And it gives me the following error : Error using ft_checkconfig (line 153) The field cfg.design is required. Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? Any help will be appreciated ! Thanks a lot for your time, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Thu Mar 31 15:22:31 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Thu, 31 Mar 2016 15:22:31 +0200 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr>, <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, thank you very much for your fast answer ! I'm not sure I understand what you mean though... Maybe i did not express myself correctly. I do have individual trial data : I have 26 observations for condition 1 and 26 observations for condition 2. They appear : - In my structure "data" (output of ft_preprocessing) : data.trial is a cell {1 x nbtrials} (in my case : {1, 26}) - in my structure "freq" (output of ft_freqanalysis) : freq.powspctrm is a matrix of dimension : nbtrials X nbchannel X nbfreq (in my case 26x2x25) But I don't have this information anymore in the structure "coh" (output of ft_connectivityanalysis) : coh.cospctrm is a matrix of dimension nbchannelcmb x nbfreq (in my case 1x25) since the coherence is calculated by averaging over trials... You may mean I should give the "freq" structures as inputs to the fonction ft_freqstatistics ? I just tried that : I created a structure data_all by concatenated data1.trial and data2.trial (and every other appropriate attribute). I took the Time Frequency Representation with ft_freqanalysis (with keeptrials='yes') to obtain a structure TFR_all (following this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics This is actually how I did the statistics for the Power). But then, if I give this as an input to ft_freqstatistics, like this : cfg = []; cfg.statistic = 'diff'; cfg.parameter='cohspctrm'; cfg.design= [ones(1,nbtrial)) 2*ones(1, nbtrial))]; %same nb of trials for both condition cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; >> stat=ft_freqstatistics(cfg, FR_alltrials); I have the following error : Error using getdimord (line 15) field "cohspctrm" not present in data which makes a lot of sense, since I did not gave coherence as an input... I gave Frequency representations.. I was hoping that maybe the function would calculate the coherence itself for the statistics ? ^^ But it's clearly not the way to go. Could you be a bit more explicit about what you meant ? Thanks a lot. Best, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France On 31-03-2016 13:47, Snijders, T.M. (Tineke) wrote: > Hi Laetitia, > > If you only have one subject you do need individual trial data, otherwise you can't do statistics like this. > You need multiple observations (either subjects or trials). > > Best, > Tineke > > ------------------------- > > FROM: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of laetitia.lalla at inserm.fr [laetitia.lalla at inserm.fr] > SENT: Thursday, March 31, 2016 1:11 PM > TO: fieldtrip at science.ru.nl > SUBJECT: [FieldTrip] Question about coherence statistics > > Dear FielTrip community, > > Sorry to bother you again... > > I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) > > I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... > > This is my story : > > - It's a single-subject study > > - I want to compare two sets of trials observed in different conditions. > > - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the "unequal sample size problem". > > - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). > > Based on the paper, I could refer myself to the point "2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin". > > - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. > > - And I can perform the montecarlo simulation. > > My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? > > This is what I did : > > 1) Extract and preprocess the signal from my condition 1. > > 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → > > 3) coh1= ft_connectivityanalysis(cfg, freq1) > > I did the same thing for the other condition → coh2. > > And then for the statistics : > > cfg = []; > > cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) > > cfg.parameter='cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.numrandomization = 1000; > > cfg.ivar = 1; > > cfg.alpha=0.05; > > cfg.tail=0; > > cfg.correcttail='alpha'; > > stat=ft_freqstatistics(cfg, coh1, coh2); > > And it gives me the following error : > > Error using ft_checkconfig (line 153) > > The field cfg.design is required. > > Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... > > Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? > > Any help will be appreciated ! > > Thanks a lot for your time, > > Laetitia Lalla > > PhD student in Neurosciences > > INMED, Marseille, France > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From runna90 at 126.com Tue Mar 1 09:23:48 2016 From: runna90 at 126.com (CRN) Date: Tue, 1 Mar 2016 16:23:48 +0800 Subject: [FieldTrip] where is the trial information after doing ft_timelockgrandaverage using within method Message-ID: <971DC9DB-D127-4553-9524-F662A6CA90D3@126.com> Dear all, I am new to field trip and I encountered a lot problems when I analyzing the MEG data. Looking forward to your help! My data structure is like this, 3 subjects x 3 conditions x 2 blocks. Now I want to do time-locked permutation test between trialsI. Here is my procedure: preprocessing-define trials-timelockanalysis-timelockgrandaverage. The problem occurred in the forth step, the trial information was depreciated when I used the ft_timelockgrandaverage function. I got a warning: Warning: depreciating trial field: using the avg to compute the grand average. But it is required when I do permutation test. What should I do? Thank you for your time! Best wishes, Runnan runna90 at 126.com Institute of Biophysics, Chinese Academy of Science, Beijing, China -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Tue Mar 1 10:44:16 2016 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Tue, 1 Mar 2016 10:44:16 +0100 Subject: [FieldTrip] How to plot sourcedata at the cortical surface In-Reply-To: <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> References: <347287188.845797.1456776718141.JavaMail.yahoo.ref@mail.yahoo.com> <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> Message-ID: <005f01d1739e$ec0347c0$c409d740$@artinis.com> Hi Diljit, I hope you are doing fine. Have you seen this tutorial, which explains the processing of anatomical data? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate It’s a somewhat cumbersome work including some freesurfer action. With best regards, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of D I L J I T Sent: Monday, February 29, 2016 21:12 To: fieldtrip at science.ru.nl Subject: [FieldTrip] How to plot sourcedata at the cortical surface Hi All, We have done the MEG source analysis using fieltrip. We want to plot the the source data at the surface. We want to have the individual surface. Can anyone please guide us how to prepare them(i.e. surface_white_both.mat etc). Thanks alot in advance, Warm Regards DJ Diljit Singh Kajal ------------------------------------ Ph.D Research Scholar, International Max Planck Research School, Graduate Training Centre for Neuroscience, Institute for Medical Psychology & Behavioural Neurobiology, MEG Centre, Room number 202, Otfried-Müller-Str. 47, University of Tübingen, Tübingen-72076, Germany. +49-176-88262138(M), +49-7071-2981196(O) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Mar 1 11:02:08 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 1 Mar 2016 10:02:08 +0000 Subject: [FieldTrip] How to plot sourcedata at the cortical surface In-Reply-To: <005f01d1739e$ec0347c0$c409d740$@artinis.com> References: <347287188.845797.1456776718141.JavaMail.yahoo.ref@mail.yahoo.com> <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> <005f01d1739e$ec0347c0$c409d740$@artinis.com> Message-ID: An alternative to Jorn’s suggestion would be to register the source reconstructed data to MNI space, and use the template surface for visualisation. Best, Jan-Mathijs On 01 Mar 2016, at 10:44, Jörn M. Horschig > wrote: Hi Diljit, I hope you are doing fine. Have you seen this tutorial, which explains the processing of anatomical data? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate It’s a somewhat cumbersome work including some freesurfer action. With best regards, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of D I L J I T Sent: Monday, February 29, 2016 21:12 To: fieldtrip at science.ru.nl Subject: [FieldTrip] How to plot sourcedata at the cortical surface Hi All, We have done the MEG source analysis using fieltrip. We want to plot the the source data at the surface. We want to have the individual surface. Can anyone please guide us how to prepare them(i.e. surface_white_both.mat etc). Thanks alot in advance, Warm Regards DJ Diljit Singh Kajal ------------------------------------ Ph.D Research Scholar, International Max Planck Research School, Graduate Training Centre for Neuroscience, Institute for Medical Psychology & Behavioural Neurobiology, MEG Centre, Room number 202, Otfried-Müller-Str. 47, University of Tübingen, Tübingen-72076, Germany. +49-176-88262138(M), +49-7071-2981196(O) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Tue Mar 1 11:51:17 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Tue, 1 Mar 2016 10:51:17 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth Message-ID: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 From stephen.politzer-ahles at ling-phil.ox.ac.uk Tue Mar 1 12:14:50 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Tue, 1 Mar 2016 11:14:50 +0000 Subject: [FieldTrip] MEG sensors statistics Message-ID: Hello Elana, This depends a lot on what statistical test you did and how your data were acquired and processed. e.g., to take the simplest example: if you simply do t-tests at each sensor and don't correct for multiple comparisons, this certainly is 'false power' (it's extremely anti-conservative: it will get a lot of false positives). However, if you use cluster-based statistics, this is less of a concern, since sensors showing related activity likely get grouped together. The fieldtrip tutorial on cluster-based permutation testing has more information. Even with that, there still are potentially related issues, for instance, if you recorded with axial gradiometers then a single dipole might show up as two clusters of sensors, whereas if you recorded with planar gradiometers (or transformed the data to the planar gradient) then a single dipole should only show up as one cluster. What you are describing in your message is also possible (it's similar to calculating global field power, which people do do), but it throws away any spatial information from the signal. Which analysis is most appropriate for you really depends on the nature of the hypotheses you want to test. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 8 > Date: Mon, 29 Feb 2016 20:20:17 +0000 > From: "Harris, Elana" > To: FieldTrip discussion list > Cc: "Shahana, Nasrin \(Nasrin Shahana\)" > Subject: [FieldTrip] MEG sensors statistics > Message-ID: > < > B622DB18EE766C4BBAA34EA95310C34C5021AA68 at MCEXMB3.chmccorp.cchmc.org> > Content-Type: text/plain; charset="utf-8" > > Dear All, > > I have the minimum, maximum and mean alpha power for each MEG sensor > (found using MEGProcessor developed by Jing Xiang, MD, PhD) for 16 > subjects, 8 of whom have a psychiatric condition and 8 are healthy > comparison subjects. > > We find statistical significance when comparing the set all of the MLF or > MRO sensors, for instance, between the groups (healthy and pathological), > however, I am wondering if this is false statistical power as all of the > sensors likely represent once source generator and not truly, multiple, > separate, non-independent recordings. Would it be best to summarize each > subject?s data with one number to represent the maximum alpha power for the > group of MLF sensors and then compare the two groups of subjects? > > I welcome your advice. > > Thank you. > > Elana > > Elana Harris, MD, PhD > Assistant Professor > Division of Child & Adolescent Psychiatry > Cincinnati Children?s Hospital Medical Center > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160229/598ee99d/attachment-0001.html > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Tue Mar 1 15:52:12 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Tue, 1 Mar 2016 09:52:12 -0500 Subject: [FieldTrip] volume conduction model Message-ID: Fieldtripers, What is the best volume conduction model that compute all sources (entire grid) that are within the brain volume? I am doing resting state analysis and wish to extract source time series for all the grids within the brain volume. I am using singleshell volume conduction model and lcmv and eloreta source models. Unfortunately, for large number of grids i.e, the source.avg.filter are empty. Please let me know if there are ways to deal with this problem. Thank you in advance. -Vasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.pedrosa at ndcn.ox.ac.uk Tue Mar 1 16:21:36 2016 From: david.pedrosa at ndcn.ox.ac.uk (David Pedrosa) Date: Tue, 1 Mar 2016 15:21:36 +0000 Subject: [FieldTrip] Question on coherence stats at sensor level Message-ID: Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Mar 1 17:06:25 2016 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 1 Mar 2016 17:06:25 +0100 Subject: [FieldTrip] volume conduction model In-Reply-To: References: Message-ID: Dear Vasan, the choice of your volume conduction model depends on the data you want to analyze. Do you use MEG or EEG? If you state, a large number of grid points are empty, do you refer to the "inside" grid points, i.e. the elements of your grid falling into the the brain volume, or do you refer to all grid points? If the latter is the case, that is the correct behavior, as grid points outside your brain volume should not contain data. Hope this helps, Julian On Tue, Mar 1, 2016 at 3:52 PM, Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com> wrote: > Fieldtripers, > > What is the best volume conduction model that compute all sources (entire > grid) that are within the brain volume? I am doing resting state analysis > and wish to extract source time series for all the grids within the brain > volume. I am using singleshell volume conduction model and lcmv and eloreta > source models. Unfortunately, for large number of grids i.e, the > source.avg.filter are empty. Please let me know if there are ways to deal > with this problem. > > Thank you in advance. > > -Vasan > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Tue Mar 1 17:20:34 2016 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Tue, 1 Mar 2016 17:20:34 +0100 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: References: Message-ID: <012d01d173d6$48b804b0$da280e10$@artinis.com> Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.Nieuwland at ed.ac.uk Tue Mar 1 21:04:08 2016 From: M.Nieuwland at ed.ac.uk (NIEUWLAND Mante) Date: Tue, 1 Mar 2016 20:04:08 +0000 Subject: [FieldTrip] colored or grey output from ft_singleplotTFR 'mask' Message-ID: Dear Fieldtrip users, With the same singleplotTFR script (see below), which masks the differenceplot of two conditions using the statistical result, I seem to get the expected color output in one dataset (1c1d.pdf) but unexpectedly grey output in another dataset (3c3d.pdf) *irrespective of how I set the z-lim*. I've also tried changing. Does anyone have an idea how this can happen? Cheers, Mante chan = {'C3'}; % channel to plot cfg = []; cfg.interactive = 'yes'; cfg.layout = 'elec_30layout.lay'; cfg.zlim = [.9 1.1]; cfg.ylim = [30 90]; cfg.xlim = [-.5 1.5]; cfg.colorbar = 'yes'; cfg.colormap = jet; cfg.renderer = 'painters'; %, 'painters', 'zbuffer',' opengl' or 'none' (default = []) cfg.channel = chan; figure; [other subplots] figure; cfg.zlim = [-.2 0.2]; % singlechan effect subplot(2, 1, 1) ft_singleplotTFR(cfg,grandavg_hi_131_132); title({''},'fontsize',15); linehandle = line([0 0], [30 90],'Color','b'); % line at zero set(linehandle, 'Color', 'k'); set(gca,'fontsize', 15); cfg.zlim = [-.2 0.2]; grandavg_hi_131_132.mask = logical(zeros(size(grandavg_hi_131_132.powspctrm))); grandavg_hi_131_132.mask(:,3:27,121:251) = statisTFR_hi_131_132.mask; cfg.maskstyle = 'saturation'; % 'saturation'; % 'outline'; % opacity cfg.maskparameter = 'mask'; subplot(2,1,2) ft_singleplotTFR(cfg,grandavg_hi_131_132); title(' ','fontsize',15); linehandle = line([0 0], [30 90],'Color','b'); set(linehandle, 'Color', 'k'); set(gca,'fontsize', 15); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1c1d.pdf Type: application/pdf Size: 15821 bytes Desc: 1c1d.pdf URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3c3d.pdf Type: application/pdf Size: 17214 bytes Desc: 3c3d.pdf URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From david.pedrosa at ndcn.ox.ac.uk Wed Mar 2 12:39:17 2016 From: david.pedrosa at ndcn.ox.ac.uk (David Pedrosa) Date: Wed, 2 Mar 2016 11:39:17 +0000 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: <012d01d173d6$48b804b0$da280e10$@artinis.com> References: , <012d01d173d6$48b804b0$da280e10$@artinis.com> Message-ID: Hi Jorn, thanks for the fast help! It was as you suggested. Now, I have a different issue someone might be able to help me with. When I do the analyses as explained, fieldtrip tells me that cluster stats are not possible as there are no labels in the data. This of course makes sense as it is coherence data with a labelcmb instead of label structure. Is there a way to do the cluster correction in fieldtrip with coherence data anyway? Or would it make more sense to take the raw fourier data into ft_freqstatistics and do the stats as desired in a custom statfun function with the corrections as wanted, e.g. similar to indepsamplesZcoh but for between subjects analyses? Best David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Jörn M. Horschig [jorn at artinis.com] Gesendet: Dienstag, 1. März 2016 16:20 An: 'FieldTrip discussion list' Betreff: Re: [FieldTrip] Question on coherence stats at sensor level Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Wed Mar 2 13:13:55 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 2 Mar 2016 12:13:55 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Message-ID: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel > On 01.03.2016, at 11:51, Hähnke, Daniel wrote: > > Dear FieldTrip users, > > I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. > However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. > > I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. > > Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. > > Does anyone know how to objectively choose the bandwidth parameter? > > Best, > > Daniel > -- > Daniel Hähnke > PhD student > > Technische Universität München > Institute of Neuroscience > Translational NeuroCognition Laboratory > Biedersteiner Straße 29, Bau 601 > 80802 Munich > Germany > > Email: daniel.haehnke at tum.de > Phone: +49 89 4140 3356 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed Mar 2 14:05:43 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 2 Mar 2016 13:05:43 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Message-ID: <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 daniel.haehnke at tum.de Wed Mar 2 15:08:24 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 2 Mar 2016 14:08:24 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> Message-ID: <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 fosco.bernasconi at gmail.com Wed Mar 2 15:29:53 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Wed, 2 Mar 2016 15:29:53 +0100 Subject: [FieldTrip] Beamformer source localization for EEG, template MRI & standard BEM Message-ID: Dear all, I'm trying to compute source localization (to eventually do some connectivity in the source space) on my EEG data, using template mri and standard bem. I have few errors: 1. When computing the leadfield: Warning: dipole lies on boundary of volume model > In forward/private/inf_medium_leadfield at 54 In forward/private/eeg_leadfieldb at 93 In ft_compute_leadfield at 442 In ft_prepare_leadfield at 222 2. I tried to discard this error, I cannot compute the source localization: Error using svd Input to SVD must not contain NaN or Inf. Error in beamformer_dics>pinv (line 643) [U,S,V] = svd(A,0); Error in beamformer_dics (line 336) filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 657) dip(i) = beamformer_dics(grid, sens, headmodel, [], squeeze(Cf(i,:,:)), optarg{:}); According to previous posts, the second error might be due to labeling of the electrodes. But the labels are ok, and I can make everything work when using the mne (by adapting the script of course) instead of beamforming. Therefore, I think the problem is more related to some of the previous steps. Here my code: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2 cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft); % read electrodes elec = ft_read_sens('/home/sv/Matlabtoolboxes/fieldtrip-20160223/template/electrode/biosemi64_1.sfp'); elec = ft_convert_units(elec,'cm'); % Load mri: mri = ft_read_mri('/home/sv/Matlabtoolboxes/fieldtrip-20160223/external/spm8/templates/T1.nii'); mri = ft_convert_units(mri,elec.unit); % Load headmodel: load('/home/sv/Matlabtoolboxes/fieldtrip-20160223//template/headmodel/standard_bem.mat'); vol = ft_convert_units(vol,elec.unit); [vol, sens] = ft_prepare_vol_sens(vol,elec); % Load sourcemodel: load('standard_sourcemodel3d8mm.mat'); % Compute LeadField cfg = []; cfg.channel = 'eeg'; cfg.elec = sens; cfg.headmodel = vol; grid = ft_prepare_leadfield(cfg,freq); % Compute Source: cfg = []; cfg.method = 'dics'; cfg.grid = grid; cfg.vol = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); any help is appreciated thanks a lot! fosco -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Wed Mar 2 17:54:28 2016 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Wed, 02 Mar 2016 11:54:28 -0500 Subject: [FieldTrip] TMS-EEG tutorial error Message-ID: <56D6D474020000DC00018FF5@MPRC.UMARYLAND.EDU> Dear all, I am trying to run the scripts on TMS-EEG tutorial (http://www.fieldtriptoolbox.org/tutorial/tms-eeg). However, when reject ICA components, it gave me an error message. Specifically, when I ran this command in Matlab: data_tms_clean_segmented = ft_rejectcomponent(cfg, comp_tms); The error message is : Error using cat Dimensions of matrices being concatenated are not consistent. Error in ft_apply_montage (line 245) tmp = cat(1, data_unused.trial{:}); Error in ft_rejectcomponent (line 184) data = ft_apply_montage(data, montage, 'keepunused', keepunused, 'feedback', cfg.feedback); It went through when I added an input data for ft_rejectcomponent like this data_tms_clean_segmented = ft_rejectcomponent(cfg, comp_tms, data_tms_segmented); Although the results I got look similar to the figures on the webpage, please let me know if there are some fundamental issues of adding the data-input. Any suggestions will be appreciated!Xiaoming -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Thu Mar 3 15:00:58 2016 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Thu, 3 Mar 2016 15:00:58 +0100 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: References: , <012d01d173d6$48b804b0$da280e10$@artinis.com> Message-ID: <012301d17555$1d578540$58068fc0$@artinis.com> Hi David, If I remember correctly you can call ft_checkdata with the key-value pair ‘cmbrepresentation’, ‘full’ if you want to switch back from data.labelcmb to data.label (or ‘sparse’ for the reverse way). Best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Wednesday, March 2, 2016 12:39 To: FieldTrip discussion list Subject: Re: [FieldTrip] Question on coherence stats at sensor level Hi Jorn, thanks for the fast help! It was as you suggested. Now, I have a different issue someone might be able to help me with. When I do the analyses as explained, fieldtrip tells me that cluster stats are not possible as there are no labels in the data. This of course makes sense as it is coherence data with a labelcmb instead of label structure. Is there a way to do the cluster correction in fieldtrip with coherence data anyway? Or would it make more sense to take the raw fourier data into ft_freqstatistics and do the stats as desired in a custom statfun function with the corrections as wanted, e.g. similar to indepsamplesZcoh but for between subjects analyses? Best David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ _____ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Jörn M. Horschig [jorn at artinis.com] Gesendet: Dienstag, 1. März 2016 16:20 An: 'FieldTrip discussion list' Betreff: Re: [FieldTrip] Question on coherence stats at sensor level Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.schreiner at psychologie.uzh.ch Thu Mar 3 21:22:29 2016 From: thomas.schreiner at psychologie.uzh.ch (thomas.schreiner at psychologie.uzh.ch) Date: Thu, 3 Mar 2016 21:22:29 +0100 Subject: [FieldTrip] open PhD position in sleep/memory research Message-ID: Hi all, please find attached a link leading to the details of an open PhD position.  The successful candidate will work on the project „Oscillatory mechanisms underlying memory retention and reactivation during sleep” under supervision of Björn Rasch at the University of Fribourg, Switzerland.  Feel free to share!  Best, Thomas --- University of Zurich Dr. Thomas Schreiner Department of Psychology Biopsychology Binzmuehlestr. 14 / Box 5 CH - 8050 Zuerich Tel. +41 44 635 7467 www.psychologie.uzh.ch thomas.schreiner at psychologie.uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.schreiner at psychologie.uzh.ch Thu Mar 3 23:00:27 2016 From: thomas.schreiner at psychologie.uzh.ch (thomas.schreiner at psychologie.uzh.ch) Date: Thu, 3 Mar 2016 23:00:27 +0100 Subject: [FieldTrip] open PhD position sleep/memory Message-ID: Hi again, here now the link concerning the sleep / memory PhD position... http://www.unifr.ch/psycho/assets/files/CogPsy/Open_PhD_Position_SleepMemory.pdf Best, Thomas --- University of Zurich Dr. Thomas Schreiner Department of Psychology Biopsychology Binzmuehlestr. 14 / Box 5 CH - 8050 Zuerich Tel. +41 44 635 7467 www.psychologie.uzh.ch thomas.schreiner at psychologie.uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 4 06:28:18 2016 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Thu, 3 Mar 2016 21:28:18 -0800 Subject: [FieldTrip] issue at interpolation after source analysis Message-ID: <56D91CF2.5080604@gmail.com> Hi everyone, I'm working with clinical MEG data for which part of the source pipeline has been conducted by someone else as part of a clinical protocol. I don't have full access to what has been done to the MRI that I'm getting, so I'm trying to put bits and pieces of code together to arrive at a source reconstruction. The rest of my pipeline is the pretty standard tutorial beamforming. I was hoping someone could help me figure out where my source analysis is going wrong by looking at this figure. On the left, the subject's headmodel seems to be fine (after warping to MNI). On the right, I'm plotting the source result without interpolating with any structural data. In the middle you see what happens when I interpolate the source with the "single_subj_T1.nii" structural image. It doesn't seem to be a matter of scaling (like mm to cm), but rather it being kinda upside down + something else? Does anyone know by looking at this whether the error emerges because of an unsuccessful interpolation or because something more fundamental is going wrong earlier on? Thanks so much, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: djijjfaf.png Type: image/png Size: 104874 bytes Desc: not available URL: From a.stolk8 at gmail.com Fri Mar 4 07:18:54 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 3 Mar 2016 22:18:54 -0800 Subject: [FieldTrip] issue at interpolation after source analysis In-Reply-To: <56D91CF2.5080604@gmail.com> References: <56D91CF2.5080604@gmail.com> Message-ID: Hey Vitoria, Hard to tell without seeing any code, but my hunch is that the plot on the left is subject space whereas the middle is subject spaced data plotted in MNI space. If the sourcemodel/grid on the left is truly MNI-aligned (but the regular spacing suggests otherwise) than it may be an instance of forgetting to copy over the dim and pos fields from the MNI template to the subject mri structure. You can check whether this is case by comparing the dim and pos fields of the template with those of the subject. They should be the same (after alignment). Hopefully that solves it. Otherwise you'd probably need to provide some code. Arjen 2016-03-03 21:28 GMT-08:00 Vitória Piai : > Hi everyone, > > I'm working with clinical MEG data for which part of the source pipeline > has been conducted by someone else as part of a clinical protocol. I don't > have full access to what has been done to the MRI that I'm getting, so I'm > trying to put bits and pieces of code together to arrive at a source > reconstruction. The rest of my pipeline is the pretty standard tutorial > beamforming. > > I was hoping someone could help me figure out where my source analysis is > going wrong by looking at this figure. On the left, the subject's headmodel > seems to be fine (after warping to MNI). On the right, I'm plotting the > source result without interpolating with any structural data. In the middle > you see what happens when I interpolate the source with the > "single_subj_T1.nii" structural image. > It doesn't seem to be a matter of scaling (like mm to cm), but rather it > being kinda upside down + something else? Does anyone know by looking at > this whether the error emerges because of an unsuccessful interpolation or > because something more fundamental is going wrong earlier on? > > Thanks so much, > Vitoria > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: djijjfaf.png Type: image/png Size: 104874 bytes Desc: not available URL: From andrea.brovelli at univ-amu.fr Fri Mar 4 09:21:18 2016 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Fri, 4 Mar 2016 09:21:18 +0100 Subject: [FieldTrip] Brain Connectivity Workshop 2016 Message-ID: <56D9457E.2000500@univ-amu.fr> Dear all, I thought it may interest some people from the list. Andrea -------------------------------------------------------------------------------------------------------------- ** *Brain Connectivity Workshop 2016, Marseille (France)* Registration is open now! (reduced rates until March 30^th ) When: 22nd to 24th June, 2016 Link to official website: http://bcw2016.org We are happy to announce the 15th edition of the *Brain Connectivity Workshop* (BCW) to take place in Marseille from the 22nd to the 24th of June 2016. The Brain Connectivity Workshop (BCW) is a well-established workshop series, which has been held annually in Europe, USA, Australia and Asia for the last 14 years. BCW is an official satellite of the annual meeting of OHBM, which is held in Geneva, Switzerland in 2016. BCW attracts every year a public of 100-200 participants working in cognitive, computational and clinical neurosciences. The discussions are centered on all themes around brain connectivity including structural and functional imaging, modeling, brain function and clinics. BCW is highly influential in the field due to the traditionally high quality of speakers and a long track record of innovation. For instance, both, the Connectome and The Virtual Brain have been born within the BCW community. The typical BCW format —a first educational day of lectures held by international authorities in their fields, followed by two days of shorter talks with ample time for discussion provides a unique forum for creativity, controversy and brainstorming. BCW 2016, introduced by a first day of tutorials by experts in their field, will feature focused sessions on themes such as perturbing the brain, mapping the brain, and brain dynamics in function (cognition) and dysfunction (epilepsy). *NB: Please note that European Cup of Football will be held in France during this period and hotels are going to be booked fast! * Confirmed educational lecturers (day 1) and workshop speakers (days 2-3) include: • Fabrice Bartolomei (Aix-Marseille University, Marseille, France) • Michael Breakspear (QIMR, Brisbane, Australia) • Vince Calhoun (University Of New Mexico, Albuquerque, NM) • Karl Friston (UCL, London, UK) • Jorge Gonzalez-Martinez (Cleveland Clinic, Cleveland, OH) • Marc Goodfellow (University of Exeter, Exeter, UK) • Charles Gray (Montana State University, Bozeman, MT) • Claudius Gros (Goethe University, Frankfurt am Main, Germany) • Sean Hill (EPFL, Lausanne, Switzerland) • Martin Hoffman-Apitius (Fraunhofer Institute SCAI, St Augustin, Germany) • Esther Krook-Magnuson (University of Minnesota, Minneapolis, MN) • Pierre Luppi (Lyon Neuroscience Research Center, Lyon, France) • Randy McIntosh (Baycrest Research Center, Toronto, ON) • Lionel Naccache (ICM, Paris, France) • Ivan Soltesz (UC Irvine, CA) • Olaf Sporns (Indiana University, Bloomington, IN) • William Stacey (University of Michigan, Ann Arbor, MI) • Gregor Thut (University of Glasgow, Glasgow, UK) • Stephan Van Gils (University of Twente, Ae Enschede, The Netherlands) • Michael Wibral (Goethe University, Frankfurt am Main, Germany) A special evening lecture will be delivered by Patrick Chauvel (Aix-Marseille University, Marseille, France). A detailed program is coming soon. Organizing committee Viktor Jirsa, Chair (INS, Aix-Marseille University, UMR 1106 INSERM) Demian Battaglia, Christian Bénar, Mireille Bonnard, Monique Esclapez (INS, Aix-Marseille University) Andrea Brovelli (INT, Aix-Marseille University), Maxime Guye (CRMBM, Aix-Marseille University, UMR 7339 CNRS & APHM) Ingo Bojak (University of Reading, UK). An event sponsored by: University Aix-Marseille, Brain Products, Bionics, Springer EPJ Nonlinear Biomedical Physics Journal, Codebox, Institute of System Neuroscience Inserm, Institute of Neuroscience Timone, Center for Magnetic Resonance in Biology and Medicine, Mediterranean Society of Neuroscience (IBRO member) -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 4 17:09:01 2016 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Fri, 4 Mar 2016 08:09:01 -0800 Subject: [FieldTrip] issue at interpolation after source analysis In-Reply-To: References: <56D91CF2.5080604@gmail.com> Message-ID: <56D9B31D.8060003@gmail.com> Thanks, Arjen! I know for sure dim and pos fields are the same as in the template because I do copy them from the template grid. So I'll try going back to make sure the alignment is really happening. If I can't figure it out, I'll post some code with it. Cheers, Vitoria On 3/3/2016 10:18 PM, Arjen Stolk wrote: > Hey Vitoria, > > Hard to tell without seeing any code, but my hunch is that the plot on > the left is subject space whereas the middle is subject spaced data > plotted in MNI space. If the sourcemodel/grid on the left is truly > MNI-aligned (but the regular spacing suggests otherwise) than it may > be an instance of forgetting to copy over the dim and pos fields from > the MNI template to the subject mri structure. You can check whether > this is case by comparing the dim and pos fields of the template with > those of the subject. They should be the same (after alignment). > > Hopefully that solves it. Otherwise you'd probably need to provide > some code. > Arjen > > 2016-03-03 21:28 GMT-08:00 Vitória Piai >: > > Hi everyone, > > I'm working with clinical MEG data for which part of the source > pipeline has been conducted by someone else as part of a clinical > protocol. I don't have full access to what has been done to the > MRI that I'm getting, so I'm trying to put bits and pieces of code > together to arrive at a source reconstruction. The rest of my > pipeline is the pretty standard tutorial beamforming. > > I was hoping someone could help me figure out where my source > analysis is going wrong by looking at this figure. On the left, > the subject's headmodel seems to be fine (after warping to MNI). > On the right, I'm plotting the source result without interpolating > with any structural data. In the middle you see what happens when > I interpolate the source with the "single_subj_T1.nii" structural > image. > It doesn't seem to be a matter of scaling (like mm to cm), but > rather it being kinda upside down + something else? Does anyone > know by looking at this whether the error emerges because of an > unsuccessful interpolation or because something more fundamental > is going wrong earlier on? > > Thanks so much, > Vitoria > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 104874 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Mon Mar 7 10:02:03 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 7 Mar 2016 09:02:03 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> Message-ID: <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 bushra.riaz at gu.se Mon Mar 7 10:18:21 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Mon, 7 Mar 2016 09:18:21 +0000 Subject: [FieldTrip] EEG position information not read properly from fif file Message-ID: <1457342301486.91257@gu.se> Hello, I am reading fif files with only EEG data (no MEG data)in fieldtrip . When my sensor locations are more than 60 than the positions in the elec.elecpos are not written Digging a bit deeper into this showed me that in mne2grad.m file line number 420 ( fieldtrip-20160306?) is the cause of the problem kChan = 0; for n = chn_eeg kChan = kChan+1; if nEEG<=60 % this if condition is the reason position was not written properly elec.elecpos(kChan,1:3) = orig.chs(n).eeg_loc(1:3); else if kChan<=numel(dig_eeg) elec.elecpos(kChan,1:3) = orig.dig(dig_eeg(kChan)).r; else ft_warning('not all EEG channel positions have been digitized'); elec.elecpos(kChan,1:3) = nan; end end elec.label{kChan} = deblank(orig.ch_names{n}); end I haven't read the whole source code for mne2grad.m to understand why this condition is important and why the limit is of 60 channels. I am solving my problem by changing this condition, I hope this will not effect rest of my processing Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Mon Mar 7 10:51:34 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Mon, 7 Mar 2016 17:51:34 +0800 Subject: [FieldTrip] common filter with more than two conditions Message-ID: Dear community, I'm trying to do lcmv beamformer source analysis with a common filter for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I am interested in both the main effect of A (A1 vs. A2) as well as the simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). My question is how to build the common filter. I could combine all the four conditions to obtain a common filter for the contrast of A1 vs. A2. Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I have to build a different common filter (to combine the A1B1 and A2B1 conditions) for the contrast of A1B1 vs. A2B1? Thanks for your help in advance! Best, Lin -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Mon Mar 7 13:04:00 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Mon, 7 Mar 2016 12:04:00 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Jan-Mathijs, thanks for sharing your thoughts about problems with using non-equidistant frequency bins. Also thanks for pointing out the possible problems in Granger causality. I actually computed the GC using non-parametric factorization and equidistant frequency bins, since the code gives an error if you don’t. As I wrote, these values from equidistant frequency bins look pretty similar to those PSI values from non-equidistant frequency bins. Best, Daniel On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Mon Mar 7 17:09:18 2016 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Mon, 7 Mar 2016 17:09:18 +0100 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Daniel and Jan-Mathis, since I also have tried to play around with PSI, I have an additional issue regarding the frequency bandwidth configuration. I found that with using linear equidistant frequency bins, the low frequency oscillation has narrower bandwidth compared to high frequencies. So if I took 5 Hz frequency bandwidth and compute the PSI to check the low frequency (i.e alpha) coupling direction, low frequency coupling may not have sufficient neighboring frequencies. In some cases PSI could also mixed up both the positive and negative phase slope, then the summation result from n-frequency bins can be spuriously positive or negative. Regarding the mixing of slope information, possibly this is one of methodological disadvantage. But for fairer frequency slope summation, I also have the same thought whether the logarithmic frequency step might be more proper in computing PSI.. Please someone correct me if I am wrong in interpreting these, I am trying to figure out how FieldTrip's PSI works. Thanks! Best, Sandhy ----------- Prasandhya A. Yusuf PhD student *Medizinische Hochschule Hannover* VIANNA - Institute of AudioNeuroTechnology On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel wrote: > Hi Jan-Mathijs, > > thanks for sharing your thoughts about problems with using non-equidistant > frequency bins. > > Also thanks for pointing out the possible problems in Granger causality. I > actually computed the GC using non-parametric factorization and equidistant > frequency bins, since the code gives an error if you don’t. As I wrote, > these values from equidistant frequency bins look pretty similar to those > PSI values from non-equidistant frequency bins. > > Best, > > Daniel > > > On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Daniel, > > I am not an expert on PSI theory either, and here I would like to stay on > the safe side. Even if it may be possible to vary the number of integration > bins across frequencies, and include some normalisation step on top if it, > I think it is very tricky, and rather won’t support this. The normalisation > is probably quite arbitrary, because it could also involve some > extrapolation of the underlying coherence spectrum. Also, using non > equidistant frequency spacing increases the risk of the user having > specified frequency specific smoothing, which further complicates > integration of phase and coherence estimates across neighbouring frequency > bins. Long story short, I will build in an explicit check about > equidistance of frequency bins in ft_connectivityanalysis, to return an > explicit error if this is not the case. This update will be a general clean > up of the psi functionality, which also will include better error handling > if the user happens to forget the bandwidth argument in the cfg. This will > address bug 3084 on bugzilla.fieldtriptoolbox.org. > > While I am at it, you mentioned that your psi results look very much like > the Granger you have computed. I am not sure how you have computed the > Granger causality, but (if you have used non parametric factorisation of > the cod matrix to get your spectral transfer matrices) it may be relevant > to know that it is incorrect to compute it from freq data with > non-equidistant frequency bins. The non-parametric spectral factorisation > code assumes the data to be represented on equidistant frequency bins. > > Best, > Jan-Mathijs > > > > On 02 Mar 2016, at 15:08, Hähnke, Daniel wrote: > > Hi Jan-Mathijs, > > never underestimate the creativity of scientists ;) > > Why do you think I can’t expect meaningful results from using > logarithmically spaced frequency bins? At least when comparing my Granger > results with the PSI values, they look pretty similar. > I know that the phase slope is dependent on the step size between > frequencies, so I could miss or aberrantly pick up non-monotonicity in the > phase slope if I use non-equidistant bins. > But if I assume that the slope changes monotonically across frequencies > (which, if I’m not mistaken, is also assumed for equidistant frequency > bins), a normalization by the bandwidth should be possible. > > Please correct me if I’m wrong. I’m obviously no expert in PSI theory and > would be glad to learn more. > > Best, > > Daniel > > On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Daniel > I have never in my life considered that people would be so creative as to > expect meaningful results when inputting the function with logarithmically > spaced frequency bins. I should have known better, but I would be strongly > in favour of checking for equidistant frequency bins, and if not: throw an > error*. *I am opposed to using ‘bins’ as a unit, because FieldTrip should > work wherever possible with physical units, rather than with unit-less > units. > > Best, > Jan-Mathijs > > > On 02 Mar 2016, at 13:13, Hähnke, Daniel wrote: > > Hi all, > > since only a few people seem to be using the PSI, I went into the code to > see what it actually does. I would like to point out that there are some > issues with the current implementation if you’re using logarithmically > spaced frequency axes. > > The parameter cfg.bandwidth (in Hz) is used to calculate the number of > frequency bins that is used to calculate the PSI. This calculation, > however, is only done once using the frequency from the lowest frequency > bin. If the chosen bandwidth is not an integer multiple of a frequency bin > step, this computation leads to a changed bandwidth. > If your frequency axis is not evenly spaced this leads to various > bandwidths across the frequency axis, since the code only uses a fixed > number of frequency bins across which to compute the PSI. > > I think it would be useful to change the cfg.bandwidth input from Hz to > number of bins. Also, people should be aware of the fact that the PSI value > is correlated with the bandwidth. So, if you use a logarithmically spaced > frequency axis, you should normalize your PSI values by the bandwidth > corresponding to each frequency bin. > > Best, > > Daniel > > On 01.03.2016, at 11:51, Hähnke, Daniel wrote: > > Dear FieldTrip users, > > I currently want to double-check the results I got from a non-parametric > Granger-causality analysis with another measure of directed communication, > phase slope index. > However, after having read Nolte et al.’s paper from 2008 that introduced > the PSI, I still don’t understand how to best choose the parameter > cfg.bandwidth. > > I tried out different values and got something qualitatively very similar > to my Granger results. But this is rather fitting the parameter to the > Granger results and kind of undermines my purpose of double-checking. > > Furthermore, I am using a logarithmic (to base 2) frequency axis. > Consequently, my frequency bins are not evenly spaced. I have the feeling > that I would rather need different bandwidths for the individual frequency > bins. > > Does anyone know how to objectively choose the bandwidth parameter? > > Best, > > Daniel > -- > Daniel Hähnke > PhD student > > Technische Universität München > Institute of Neuroscience > Translational NeuroCognition Laboratory > Biedersteiner Straße 29, Bau 601 > 80802 Munich > Germany > > Email: daniel.haehnke at tum.de > Phone: +49 89 4140 3356 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Mar 7 17:19:14 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 7 Mar 2016 08:19:14 -0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hey Lin, Provided that there are no systematic confounds (e.g. head position) across conditions, you could construct a common filter based on data from all conditions. I would leave any statistical comparison to after source-reconstruction. Does that answer your question? Arjen 2016-03-07 1:51 GMT-08:00 Lin Wang : > Dear community, > > I'm trying to do lcmv beamformer source analysis with a common filter for > more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I > am interested in both the main effect of A (A1 vs. A2) as well as the > simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). > > My question is how to build the common filter. I could combine all the > four conditions to obtain a common filter for the contrast of A1 vs. A2. > Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I > have to build a different common filter (to combine the A1B1 and A2B1 > conditions) for the contrast of A1B1 vs. A2B1? > > Thanks for your help in advance! > > Best, > Lin > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at nbt-analytics.com Mon Mar 7 18:03:01 2016 From: poil.simonshlomo at nbt-analytics.com (Simon-Shlomo Poil) Date: Mon, 7 Mar 2016 18:03:01 +0100 Subject: [FieldTrip] NBT Analytics is looking for a lead programmer Message-ID: Dear all, NBT Analytics is looking for a lead programmer. This Amsterdam based startup focuses on offering comprehensive EEG analyses for clinical trials, with the aim of improving drug development for CNS disorders. Get in touch if interested! Please read more here: http://www.nbt-analytics.com/#career Best regards, -- Dr. Simon-Shlomo Poil Co-founder / Chief Technology Officer NBT Analytics BV Amsterdam Health and Technology Center Paasheuvelweg 25 1105BP Amsterdam The Netherlands Website: https://www.nbt-analytics.com -- NBT Analytics BV http://www.nbt-analytics.com IMPORTANT: This message and any attachments are intended for the individual or entity named above. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, you must not read, copy, use or disclose this communication to others; also please notify the sender by replying to this message, and then delete it from your system. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logosmall.png Type: image/png Size: 2855 bytes Desc: not available URL: From fosco.bernasconi at gmail.com Mon Mar 7 18:10:19 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Mon, 7 Mar 2016 18:10:19 +0100 Subject: [FieldTrip] Use precomputed common filter problem Message-ID: Dear community, I'm computing the beamformer filters based on the entire eeg data (based on templates headmodel). But when I use the precomputed common filter to calculate the sources for each condition independently I have the following error: Subselecting/reordering the channels in the precomputed filters Bad cell reference operation. Error in ft_sourceanalysis (line 510) grid.filter{k} = grid.filter{k}(:, i2); Here my code: cfg = []; cfg.method = 'pcc'; cfg.channel = sens.label; cfg.grid = grid; cfg.vol = vol; cfg.grid.filter = source.avg.filter; source_C1 = ft_sourceanalysis(cfg,freq{isub,1}); -------------- next part -------------- An HTML attachment was scrubbed... URL: From vic.schroeder2 at gmail.com Mon Mar 7 21:47:07 2016 From: vic.schroeder2 at gmail.com (victoria schroeder) Date: Mon, 7 Mar 2016 20:47:07 +0000 Subject: [FieldTrip] ft_combineplanar after ft_channelrepair Message-ID: Hey Fieldtrip users, I am working with neuromag data 306 channels. I would like to interpolate channels using ft_channelrepair. Afterwards it would be good to combine the gradiometers to create planar gradients. However, unfortunately i get an error message when trying to use ft_combineplanar when i have used ft_channelrepair. Without using ft_channelrepair things work well. Can these two functions not be used on the same data? (See the code and the error message below) Thank you a lot Victoria %prepare neighbours cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'neuromag306all.lay'; neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig); % Interpolate and put into new data structure cfg = []; cfg.badchannel = { 'MEG1122', 'MEG1312','MEG1411'}; cfg.layout = 'neuromag306all.lay'; cfg.method = 'nearest'; cfg.neighbours = neighbours; Chan_clean = ft_channelrepair(cfg,data_orig); data=Chan_clean; %time frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'MEGGRAD'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [2:2:30]; cfg.toi = [-1.3:0.05:1]; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.keeptrials = 'yes'; cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128); freq = ft_freqanalysis(cfg, data); %time frequency baselined cfg=[]; cfg.baseline = [-0.5 0]; cfg.baselinetype = 'absolute'; Base = ft_freqbaseline(cfg, freq); %Combine planar Comb = ft_combineplanar([],Base); Error! Reference to non-existent field 'chanori'. Error in ft_combineplanar (line 293) newgrad.chanori = data.grad.chanori(sel,:); -------------- next part -------------- An HTML attachment was scrubbed... URL: From changa5 at mcmaster.ca Mon Mar 7 22:41:52 2016 From: changa5 at mcmaster.ca (Andrew Chang) Date: Mon, 7 Mar 2016 16:41:52 -0500 Subject: [FieldTrip] naive questions about resampling and ICA Message-ID: Dear all, I am very new to this toolbox, and still trying to figure out how to prepare my data for analyzing it in Fieldtrip. I am following the tutorial of this document ( http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts), and trying to adapt it to my own data. I got two problems, one is about resampling and another is about running ICA. Here is my script: cfg2 = []; cfg2.dataset = 'data\Andrew_EEG_continous1224\SS_CC_1.raw'; cfg2.trialdef.eventtype = 'trigger'; cfg2 = ft_definetrial(cfg2); cfg2.channel = 'EEG'; cfg2.continuous = 'yes'; data2 = ft_preprocessing(cfg2); The above part seems working, although I am not sure the information in the cfg2 or data2 was sufficient for subsequent analyses. Here is the printscreen of these 2 objects: [image: Inline image 1] Then run the resampling % downsample the data to speed up the next step cfg2 = []; cfg2.resamplefs = 300; cfg2.detrend = 'no'; data2 = ft_resampledata(cfg2, data2); I got the error message if the 'resamplefs' does not equal to 500, but 500 Hz was my original sampling rate: Matrix dimensions must agree. Error in ft_resampledata (line 226) data.trial{itr} = data.trial{itr} + bsl(:,ones(1,numel(data.time{itr}))); Skipping the resampling and run the ICA directly: % perform the independent component analysis (i.e., decompose the data) cfg2 = []; cfg2.method = 'runica'; % this is the default and uses the implementation from EEGLAB comp = ft_componentanalysis(cfg2,data2); Here is what MATLAB returns: the input is raw data with 257 channels and 203 trials the call to "ft_selectdata" took 0 seconds baseline correcting data no scaling applied, since factor is 0 concatenating data............... concatenated data matrix size 257x203 starting decomposition using runica runica(): data length (203) < data channels (257)! Output argument "sphere" (and maybe others) not assigned during call to "runica". Error in ft_componentanalysis (line 488) [weights, sphere] = runica(dat, optarg{:}); Some additional information: I am using MATLAB 2015b with Fieldtrip version 20160304 Any help is much appreciated! Thank you all Best, Andrew -- Andrew Chang Ph.D. Candidate Auditory Development Lab Department of Psychology, Neuroscience & Behaviour McMaster University http://changa5.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 144915 bytes Desc: not available URL: From murphyk5 at aston.ac.uk Mon Mar 7 22:56:10 2016 From: murphyk5 at aston.ac.uk (Murphy, Kelly (Research Student)) Date: Mon, 7 Mar 2016 21:56:10 +0000 Subject: [FieldTrip] ft_combineplanar after ft_channelrepair In-Reply-To: References: Message-ID: Hi Victoria, I don’t know if this will address your problem; but I think it might depend on the order of your pipeline because if you use PCA at any point before interpolating, you will be reducing the dimensionality of your data; and interpolation (and presumably combining gradiometers) relies on the data from neighbouring channels to be linearly related. In my pipeline, I’ve visually rejected trials and channels, then run ICA, then interpolated; I don’t know if that would address your issues? Hope you get it sorted Kelly From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of victoria schroeder Sent: 07 March 2016 20:47 To: FieldTrip discussion list Subject: [FieldTrip] ft_combineplanar after ft_channelrepair Hey Fieldtrip users, I am working with neuromag data 306 channels. I would like to interpolate channels using ft_channelrepair. Afterwards it would be good to combine the gradiometers to create planar gradients. However, unfortunately i get an error message when trying to use ft_combineplanar when i have used ft_channelrepair. Without using ft_channelrepair things work well. Can these two functions not be used on the same data? (See the code and the error message below) Thank you a lot Victoria %prepare neighbours cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'neuromag306all.lay'; neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig); % Interpolate and put into new data structure cfg = []; cfg.badchannel = { 'MEG1122', 'MEG1312','MEG1411'}; cfg.layout = 'neuromag306all.lay'; cfg.method = 'nearest'; cfg.neighbours = neighbours; Chan_clean = ft_channelrepair(cfg,data_orig); data=Chan_clean; %time frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'MEGGRAD'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [2:2:30]; cfg.toi = [-1.3:0.05:1]; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.keeptrials = 'yes'; cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128); freq = ft_freqanalysis(cfg, data); %time frequency baselined cfg=[]; cfg.baseline = [-0.5 0]; cfg.baselinetype = 'absolute'; Base = ft_freqbaseline(cfg, freq); %Combine planar Comb = ft_combineplanar([],Base); Error! Reference to non-existent field 'chanori'. Error in ft_combineplanar (line 293) newgrad.chanori = data.grad.chanori(sel,:); -------------- next part -------------- An HTML attachment was scrubbed... URL: From changa5 at mcmaster.ca Mon Mar 7 23:28:04 2016 From: changa5 at mcmaster.ca (Andrew Chang) Date: Mon, 7 Mar 2016 17:28:04 -0500 Subject: [FieldTrip] "not enough input" probelm in ft_artifact_zvalue tutorial code Message-ID: Dear all, Sorry for asking another naive question. I am following the tutorial code of this: http://www.fieldtriptoolbox.org/tutorial/automatic_artifact_rejection I used the ArtifactMEG.ds data, which is used in tutorial, and used the exact same code. However, I am unable to run the ft_artifact_zvalue function. I am running this code on MATLAB2015b with fieldtrip version 20160304. I got the same problem even I changed the MATLAB version into 2013a. I am really confused since I am running the exact same code as tutorial, but I got many warnings and MATLAB returned error too. Here is the script: cfg = []; cfg.dataset = 'ArtifactMEG.ds'; cfg.headerformat = 'ctf_ds'; cfg.dataformat = 'ctf_ds'; cfg.trialdef.eventtype = 'trial'; cfg = ft_definetrial(cfg); trl = cfg.trl(1:50,:); %% jump cfg = []; cfg.trl = trl; cfg.datafile = 'ArtifactMEG.ds'; cfg.headerfile = 'ArtifactMEG.ds'; cfg.continuous = 'yes'; % channel selection, cutoff and padding cfg.artfctdef.zvalue.channel = 'MEG'; cfg.artfctdef.zvalue.cutoff = 20; cfg.artfctdef.zvalue.trlpadding = 0; cfg.artfctdef.zvalue.artpadding = 0; cfg.artfctdef.zvalue.fltpadding = 0; % algorithmic parameters cfg.artfctdef.zvalue.cumulative = 'yes'; cfg.artfctdef.zvalue.medianfilter = 'yes'; cfg.artfctdef.zvalue.medianfiltord = 9; cfg.artfctdef.zvalue.absdiff = 'yes'; % make the process interactive cfg.artfctdef.zvalue.interactive = 'yes'; [cfg, artifact_jump] = ft_artifact_zvalue(cfg); Here are what MATLAB return to me: Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial (line 138) evaluating trialfunction 'ft_trialfun_general' getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_trialfun_general (line 78) In ft_definetrial (line 177) reading the events from 'ArtifactMEG.ds\ArtifactMEG.res4' getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_read_event (line 511) In ft_trialfun_general (line 86) In ft_definetrial (line 177) found 76 events created 76 trials the call to "ft_definetrial" took 1 seconds ans = [] getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_artifact_zvalue (line 195) searching for artifacts in 139 channels searching in trial 50 from 50 Not enough input arguments. Error in ft_artifact_zvalue (line 481) opt.data = data; Any comments are appreciated! Thank you all! Best, Andrew -- Andrew Chang Ph.D. Candidate Auditory Development Lab Department of Psychology, Neuroscience & Behaviour McMaster University http://changa5.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Tue Mar 8 01:16:27 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Tue, 8 Mar 2016 08:16:27 +0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hi Arjen, Yes, it answers my question. Thank! :-) Then a further question is: is it better to include as many trials as possible to have a good estimation of the covariance matrix (provided that the signals are good for all trials)? For example, there are two experimental conditions, with 20 trials per condition. There are also 40 filler trials with a similar structure as the experimental conditions. In this case, can I combine all the conditions to build the common filter and then only compare the two experimental conditions later? The cognitive processes might be different between the experimental conditions and the fillers, so I'm not sure whether combining them has any influence on the spatial filter. Best, Lin On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: > Hey Lin, > > Provided that there are no systematic confounds (e.g. head position) > across conditions, you could construct a common filter based on data from > all conditions. I would leave any statistical comparison to after > source-reconstruction. > > Does that answer your question? > Arjen > > 2016-03-07 1:51 GMT-08:00 Lin Wang : > >> Dear community, >> >> I'm trying to do lcmv beamformer source analysis with a common filter for >> more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I >> am interested in both the main effect of A (A1 vs. A2) as well as the >> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >> >> My question is how to build the common filter. I could combine all the >> four conditions to obtain a common filter for the contrast of A1 vs. A2. >> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >> have to build a different common filter (to combine the A1B1 and A2B1 >> conditions) for the contrast of A1B1 vs. A2B1? >> >> Thanks for your help in advance! >> >> Best, >> Lin >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Mar 8 01:28:11 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 7 Mar 2016 16:28:11 -0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hey Lin, Overall the more data (i.e. covariance matrices) the spatial filter is constructed from the better it'll be able to describe the spatiotemporal patterns present in the data (cf. ERPs, being smoother with more averaging). The latter indeed may be condition-specific, and since I do not know anything about your conditions, I'll refrain from having an opinion there. :) Arjen 2016-03-07 16:16 GMT-08:00 Lin Wang : > Hi Arjen, > > Yes, it answers my question. Thank! :-) > > Then a further question is: is it better to include as many trials as > possible to have a good estimation of the covariance matrix (provided that > the signals are good for all trials)? > > For example, there are two experimental conditions, with 20 trials per > condition. There are also 40 filler trials with a similar structure as the > experimental conditions. In this case, can I combine all the conditions to > build the common filter and then only compare the two experimental > conditions later? > > The cognitive processes might be different between the experimental > conditions and the fillers, so I'm not sure whether combining them has any > influence on the spatial filter. > > Best, > Lin > > On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: > >> Hey Lin, >> >> Provided that there are no systematic confounds (e.g. head position) >> across conditions, you could construct a common filter based on data from >> all conditions. I would leave any statistical comparison to after >> source-reconstruction. >> >> Does that answer your question? >> Arjen >> >> 2016-03-07 1:51 GMT-08:00 Lin Wang : >> >>> Dear community, >>> >>> I'm trying to do lcmv beamformer source analysis with a common filter >>> for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and >>> I am interested in both the main effect of A (A1 vs. A2) as well as the >>> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >>> >>> My question is how to build the common filter. I could combine all the >>> four conditions to obtain a common filter for the contrast of A1 vs. A2. >>> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >>> have to build a different common filter (to combine the A1B1 and A2B1 >>> conditions) for the contrast of A1B1 vs. A2B1? >>> >>> Thanks for your help in advance! >>> >>> Best, >>> Lin >>> >>> >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 wanglinsisi at gmail.com Tue Mar 8 07:16:15 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Tue, 8 Mar 2016 14:16:15 +0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hi Arjen, Thanks for your help. :-) Best, Lin On Tue, Mar 8, 2016 at 8:28 AM, Arjen Stolk wrote: > Hey Lin, > > Overall the more data (i.e. covariance matrices) the spatial filter is > constructed from the better it'll be able to describe the spatiotemporal > patterns present in the data (cf. ERPs, being smoother with more > averaging). The latter indeed may be condition-specific, and since I do not > know anything about your conditions, I'll refrain from having an opinion > there. :) > > Arjen > > 2016-03-07 16:16 GMT-08:00 Lin Wang : > >> Hi Arjen, >> >> Yes, it answers my question. Thank! :-) >> >> Then a further question is: is it better to include as many trials as >> possible to have a good estimation of the covariance matrix (provided that >> the signals are good for all trials)? >> >> For example, there are two experimental conditions, with 20 trials per >> condition. There are also 40 filler trials with a similar structure as the >> experimental conditions. In this case, can I combine all the conditions to >> build the common filter and then only compare the two experimental >> conditions later? >> >> The cognitive processes might be different between the experimental >> conditions and the fillers, so I'm not sure whether combining them has any >> influence on the spatial filter. >> >> Best, >> Lin >> >> On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: >> >>> Hey Lin, >>> >>> Provided that there are no systematic confounds (e.g. head position) >>> across conditions, you could construct a common filter based on data from >>> all conditions. I would leave any statistical comparison to after >>> source-reconstruction. >>> >>> Does that answer your question? >>> Arjen >>> >>> 2016-03-07 1:51 GMT-08:00 Lin Wang : >>> >>>> Dear community, >>>> >>>> I'm trying to do lcmv beamformer source analysis with a common filter >>>> for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and >>>> I am interested in both the main effect of A (A1 vs. A2) as well as the >>>> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >>>> >>>> My question is how to build the common filter. I could combine all the >>>> four conditions to obtain a common filter for the contrast of A1 vs. A2. >>>> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >>>> have to build a different common filter (to combine the A1B1 and A2B1 >>>> conditions) for the contrast of A1B1 vs. A2B1? >>>> >>>> Thanks for your help in advance! >>>> >>>> Best, >>>> Lin >>>> >>>> >>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 daniel.haehnke at tum.de Tue Mar 8 10:57:26 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Tue, 8 Mar 2016 09:57:26 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Sandhy, that’s interesting. Can you describe how you found out about the bandwidth being narrower for lower frequencies? When I read the code, I had the impression that the bandwidth parameter is used once to calculate one bandwidth parameter in frequency bins that is subsequently used for the whole spectrum. Best, Daniel On 07.03.2016, at 17:09, Prasandhya Astagiri Yusuf > wrote: Hi Daniel and Jan-Mathis, since I also have tried to play around with PSI, I have an additional issue regarding the frequency bandwidth configuration. I found that with using linear equidistant frequency bins, the low frequency oscillation has narrower bandwidth compared to high frequencies. So if I took 5 Hz frequency bandwidth and compute the PSI to check the low frequency (i.e alpha) coupling direction, low frequency coupling may not have sufficient neighboring frequencies. In some cases PSI could also mixed up both the positive and negative phase slope, then the summation result from n-frequency bins can be spuriously positive or negative. Regarding the mixing of slope information, possibly this is one of methodological disadvantage. But for fairer frequency slope summation, I also have the same thought whether the logarithmic frequency step might be more proper in computing PSI.. Please someone correct me if I am wrong in interpreting these, I am trying to figure out how FieldTrip's PSI works. Thanks! Best, Sandhy ----------- Prasandhya A. Yusuf PhD student Medizinische Hochschule Hannover VIANNA - Institute of AudioNeuroTechnology On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel > wrote: Hi Jan-Mathijs, thanks for sharing your thoughts about problems with using non-equidistant frequency bins. Also thanks for pointing out the possible problems in Granger causality. I actually computed the GC using non-parametric factorization and equidistant frequency bins, since the code gives an error if you don’t. As I wrote, these values from equidistant frequency bins look pretty similar to those PSI values from non-equidistant frequency bins. Best, Daniel On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eva.patai at psych.ox.ac.uk Tue Mar 8 18:05:21 2016 From: eva.patai at psych.ox.ac.uk (Zita Eva Patai) Date: Tue, 8 Mar 2016 17:05:21 +0000 Subject: [FieldTrip] ft_definetrial using data structure in workspace In-Reply-To: References: Message-ID: Dear FT-ers I would like to epoch my data, but as it is in a format not supported by Fieldtrip (.xdf), I used Eeglab to convert it, and then converted between Eeglab and FT with the eeg2fieldtrip function. Now i have a FT data structure. The data structure looks fine, but it seems that to use ft_definetrial, i need to specify a path to a file to be processed. Is there any way to change this so i can use something in the workspace? Many thanks On Tue, Mar 8, 2016 at 4:57 PM, Zita Eva Patai wrote: > Dear FT-ers > > I would like to epoch my data, but as it is in a format not supported by > Fieldtrip (.xdf), I used Eeglab to convert it, and then converted between > Eeglab and FT with the eeg2fieldtrip function. Now i have a FT data > structure. > > The data structure looks fine, but it seems that to use ft_definetrial, i > need to specify a path to a file to be processed. Is there any way to > change this so i can use something in the workspace? > > Many thanks > zita > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzuchenlung at gmail.com Wed Mar 9 04:34:59 2016 From: tzuchenlung at gmail.com (Jane Lung) Date: Wed, 9 Mar 2016 11:34:59 +0800 Subject: [FieldTrip] question about head model preparing Message-ID: Dear all, I am currently explore how to do the source reconstruction, my data come from Yokogawa160, and I use fieldtrip_20150708 after following the direction of the website: http://www.fieldtriptoolbox.org/getting_started/yokogawa I've met some problem preparing Head model: 1. after sourceplot three fiducial positions, these locations didn't stored automatically in a "marker-coregis.txt" file, as website mentioned. 2. so, I copy their locations from command window manually. for the next step, I also copy the marker's location from another marker location file (.hsp file), and define them in grad.fid.pnt(). Howerver, when I run the ft_sensorrealign, the error happened: Warning: use cfg.target instead of cfg.template > In ft_checkconfig (line 120) In ft_sensorrealign (line 135) using the fiducials instead of the sensor positions converting units from 'mm' to 'cm' Subscripted assignment between dissimilar structures. Error in ft_sensorrealign (line 228) tmp(i) = ft_convert_units(template(i), elec.unit); % ensure that the units are consistent with the electrodes I'll be really appreciated if I can get any comment ! Sincerely Tzu-Chen ---------------------------- Tzu-Chen Lung, M.S. Research Assistant, Institute of Cognitive Neuroscience, National Central University, Taiwan (R.O.C) -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Wed Mar 9 09:49:07 2016 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Wed, 9 Mar 2016 09:49:07 +0100 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Daniel, I mean it is known that the EEG bands have different frequency bandwidth, like: - Theta 4-7 Hz -> 4 Hz bandwidth - Alpha 8-15 Hz -> 8 Hz bandwidth - Beta 16-31 Hz -> 16 Hz bandwidth So in my opinion, I think it's not really fair to have (in example) 5 Hz bandwidth configuration in measuring PSI for Theta, even Delta, since it (probably) mixed other oscillation band together. In Field Trip's PSI, I found that the cross spectra S(f) are multiplied with the conjugate cross spectra of the neighboring-higher-frequency bin S*((f+1) to have phase lag difference between neighboring frequency bins (or yields frequency slope if divided by the frequency resolution). Then it sums together the results within 2 Hz above and 2 Hz below (for 5 Hz bandwidth example). Finally it takes the imaginary part from the result. If the phase lag difference between neighboring frequency bins (or the frequency slope) are consistent for all results within this 5 Hz bandwidth, then it yields high value. If they are inconsistent, they should not yield high value. But what if the result is quite high that we then interpret as a directionality, but it was only due to mixed up of positive and negative values..? I still cannot answer this one. Maybe someone could help. Best, Sandhy On Tue, Mar 8, 2016 at 10:57 AM, Hähnke, Daniel wrote: > Hi Sandhy, > > that’s interesting. Can you describe how you found out about the bandwidth > being narrower for lower frequencies? When I read the code, I had the > impression that the bandwidth parameter is used once to calculate one > bandwidth parameter in frequency bins that is subsequently used for the > whole spectrum. > > Best, > > Daniel > > > On 07.03.2016, at 17:09, Prasandhya Astagiri Yusuf < > prasandhya.a.yusuf at gmail.com> wrote: > > Hi Daniel and Jan-Mathis, > > since I also have tried to play around with PSI, I have an additional > issue regarding the frequency bandwidth configuration. > > I found that with using linear equidistant frequency bins, the low > frequency oscillation has narrower bandwidth compared to high frequencies. > So if I took 5 Hz frequency bandwidth and compute the PSI to check the low > frequency (i.e alpha) coupling direction, low frequency coupling may not > have sufficient neighboring frequencies. In some cases PSI could also mixed > up both the positive and negative phase slope, then the summation result > from n-frequency bins can be spuriously positive or negative. > > Regarding the mixing of slope information, possibly this is one of > methodological disadvantage. But for fairer frequency slope summation, I > also have the same thought whether the logarithmic frequency step might be > more proper in computing PSI.. > > Please someone correct me if I am wrong in interpreting these, I am trying > to figure out how FieldTrip's PSI works. > > Thanks! > > Best, > Sandhy > > ----------- > > Prasandhya A. Yusuf > > PhD student > > *Medizinische Hochschule Hannover* > VIANNA - Institute of AudioNeuroTechnology > > > > On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel > wrote: > >> Hi Jan-Mathijs, >> >> thanks for sharing your thoughts about problems with using >> non-equidistant frequency bins. >> >> Also thanks for pointing out the possible problems in Granger causality. >> I actually computed the GC using non-parametric factorization and >> equidistant frequency bins, since the code gives an error if you don’t. As >> I wrote, these values from equidistant frequency bins look pretty similar >> to those PSI values from non-equidistant frequency bins. >> >> Best, >> >> Daniel >> >> >> On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >> Hi Daniel, >> >> I am not an expert on PSI theory either, and here I would like to stay on >> the safe side. Even if it may be possible to vary the number of integration >> bins across frequencies, and include some normalisation step on top if it, >> I think it is very tricky, and rather won’t support this. The normalisation >> is probably quite arbitrary, because it could also involve some >> extrapolation of the underlying coherence spectrum. Also, using non >> equidistant frequency spacing increases the risk of the user having >> specified frequency specific smoothing, which further complicates >> integration of phase and coherence estimates across neighbouring frequency >> bins. Long story short, I will build in an explicit check about >> equidistance of frequency bins in ft_connectivityanalysis, to return an >> explicit error if this is not the case. This update will be a general clean >> up of the psi functionality, which also will include better error handling >> if the user happens to forget the bandwidth argument in the cfg. This will >> address bug 3084 on bugzilla.fieldtriptoolbox.org. >> >> While I am at it, you mentioned that your psi results look very much like >> the Granger you have computed. I am not sure how you have computed the >> Granger causality, but (if you have used non parametric factorisation of >> the cod matrix to get your spectral transfer matrices) it may be relevant >> to know that it is incorrect to compute it from freq data with >> non-equidistant frequency bins. The non-parametric spectral factorisation >> code assumes the data to be represented on equidistant frequency bins. >> >> Best, >> Jan-Mathijs >> >> >> >> On 02 Mar 2016, at 15:08, Hähnke, Daniel wrote: >> >> Hi Jan-Mathijs, >> >> never underestimate the creativity of scientists ;) >> >> Why do you think I can’t expect meaningful results from using >> logarithmically spaced frequency bins? At least when comparing my Granger >> results with the PSI values, they look pretty similar. >> I know that the phase slope is dependent on the step size between >> frequencies, so I could miss or aberrantly pick up non-monotonicity in the >> phase slope if I use non-equidistant bins. >> But if I assume that the slope changes monotonically across frequencies >> (which, if I’m not mistaken, is also assumed for equidistant frequency >> bins), a normalization by the bandwidth should be possible. >> >> Please correct me if I’m wrong. I’m obviously no expert in PSI theory and >> would be glad to learn more. >> >> Best, >> >> Daniel >> >> On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >> Hi Daniel >> I have never in my life considered that people would be so creative as to >> expect meaningful results when inputting the function with logarithmically >> spaced frequency bins. I should have known better, but I would be strongly >> in favour of checking for equidistant frequency bins, and if not: throw an >> error*. *I am opposed to using ‘bins’ as a unit, because FieldTrip >> should work wherever possible with physical units, rather than with >> unit-less units. >> >> Best, >> Jan-Mathijs >> >> >> On 02 Mar 2016, at 13:13, Hähnke, Daniel wrote: >> >> Hi all, >> >> since only a few people seem to be using the PSI, I went into the code to >> see what it actually does. I would like to point out that there are some >> issues with the current implementation if you’re using logarithmically >> spaced frequency axes. >> >> The parameter cfg.bandwidth (in Hz) is used to calculate the number of >> frequency bins that is used to calculate the PSI. This calculation, >> however, is only done once using the frequency from the lowest frequency >> bin. If the chosen bandwidth is not an integer multiple of a frequency bin >> step, this computation leads to a changed bandwidth. >> If your frequency axis is not evenly spaced this leads to various >> bandwidths across the frequency axis, since the code only uses a fixed >> number of frequency bins across which to compute the PSI. >> >> I think it would be useful to change the cfg.bandwidth input from Hz to >> number of bins. Also, people should be aware of the fact that the PSI value >> is correlated with the bandwidth. So, if you use a logarithmically spaced >> frequency axis, you should normalize your PSI values by the bandwidth >> corresponding to each frequency bin. >> >> Best, >> >> Daniel >> >> On 01.03.2016, at 11:51, Hähnke, Daniel wrote: >> >> Dear FieldTrip users, >> >> I currently want to double-check the results I got from a non-parametric >> Granger-causality analysis with another measure of directed communication, >> phase slope index. >> However, after having read Nolte et al.’s paper from 2008 that introduced >> the PSI, I still don’t understand how to best choose the parameter >> cfg.bandwidth. >> >> I tried out different values and got something qualitatively very similar >> to my Granger results. But this is rather fitting the parameter to the >> Granger results and kind of undermines my purpose of double-checking. >> >> Furthermore, I am using a logarithmic (to base 2) frequency axis. >> Consequently, my frequency bins are not evenly spaced. I have the feeling >> that I would rather need different bandwidths for the individual frequency >> bins. >> >> Does anyone know how to objectively choose the bandwidth parameter? >> >> Best, >> >> Daniel >> -- >> Daniel Hähnke >> PhD student >> >> Technische Universität München >> Institute of Neuroscience >> Translational NeuroCognition Laboratory >> Biedersteiner Straße 29, Bau 601 >> 80802 Munich >> Germany >> >> Email: daniel.haehnke at tum.de >> Phone: +49 89 4140 3356 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Wed Mar 9 11:57:44 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Wed, 9 Mar 2016 13:57:44 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. Message-ID: Pipeline for sourceanalysis with individualize grip Dear field trippers, I have a question related to pipeline for sourceanalysis with individualize grid. Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. Best Regards, Olga. % 1. load template grid, e.g. load( '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' ); template_grid = sourcemodel; %2. Make the individual subjects' grid %a) Load individual subject mri, e.g. [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); %b) construct individual grid by projecting to template grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); % 3. Make source reconstruction, using individualized grid and* template? or individual headmodel* %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); template_vol = vol; cfg = []; cfg.grid = grid_ind{Subj_i}; *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* cfg.channel = {'MEG'}; cfg.grad = freq_cmb{Subj_i}.grad; sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with individual or template headmodel?* *cfg.vol = vol_K0012_cm; **% individual or template vol???* cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed Mar 9 12:43:58 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 9 Mar 2016 12:43:58 +0100 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Dear Olga, > Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? I would use the individual head model based on the MRI as it provides more information for your source analysis. This should provide more accurate results. > Actually I tried both ways for one subject and did not notice any difference in the results. It seems to that this is due to this line of code, but I’m not quite sure about that: > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_cm{Subj_i}; > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); I think with this configuration the source model that is prepared is only based on the cfg.grid.template, and completely ignores the MRI (which you are interested in). This might explain why you see no difference. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: > > Pipeline for sourceanalysis with individualize grip > > > Dear field trippers, > > I have a question related to pipeline for sourceanalysis with individualize grid. > Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. > Best Regards, > Olga. > > % 1. load template grid, e.g. > > load('/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat'); > template_grid = sourcemodel; > > <>%2. Make the individual subjects' grid > %a) Load individual subject mri, e.g. > > [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); > mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); > > %b) construct individual grid by projecting to template grid > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_cm{Subj_i}; > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > % 3. Make source reconstruction, using individualized grid and template? or individual headmodel > %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); > template_vol = vol; > > cfg = []; > cfg.grid = grid_ind{Subj_i}; > cfg.vol = vol_K0012_cm; % individual or template vol??? > cfg.channel = {'MEG'}; > cfg.grad = freq_cmb{Subj_i}.grad; > sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); > > cfg = []; > cfg.frequency = freq_cmb{Subj_i}.freq; > cfg.grad = freq_cmb{Subj_i}.grad; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf{Subj_i}; % sourcemodel after leadfield with individual or template headmodel? > cfg.vol = vol_K0012_cm; % individual or template vol??? > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.taesler at uke.uni-hamburg.de Wed Mar 9 13:12:34 2016 From: p.taesler at uke.uni-hamburg.de (Philipp Taesler) Date: Wed, 9 Mar 2016 13:12:34 +0100 Subject: [FieldTrip] ft_definetrial using data structure in workspace In-Reply-To: References: Message-ID: <56E01332.5050506@uke.uni-hamburg.de> Hi Zita, if you have the info about which samples belong to your trials (e.g. extracted from some kind of marker file) you should be able to do this by using ft_redefinetrial. Basically you need a trial definition of the form described in the help to ft_definetrial (a Nx3 vector with start-sample, end-sample and zero-point offset). Then you might try something like: cfg = []; cfg.trl = *your Nx3 trial vector*; segmented_data = ft_redefinetrial(cfg, imported_data); Hope this works out for you. All the best, Phil Am 08.03.2016 um 18:05 schrieb Zita Eva Patai: > Dear FT-ers > > I would like to epoch my data, but as it is in a format not supported by > Fieldtrip (.xdf), I used Eeglab to convert it, and then converted > between Eeglab and FT with the eeg2fieldtrip function. Now i have a FT > data structure. > > The data structure looks fine, but it seems that to use ft_definetrial, > i need to specify a path to a file to be processed. Is there any way to > change this so i can use something in the workspace? > > Many thanks > > > -- Philipp Taesler Department of Systems Neuroscience University Medical Center Hamburg-Eppendorf Martinistr. 52, W34, 20248 Hamburg, Germany Phone: +49-40-7410-59902 Fax: +49-40-7410-59955 Email: p.taesler at uke.uni-hamburg.de -- _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From olga.v.sysoeva at gmail.com Wed Mar 9 17:18:11 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Wed, 9 Mar 2016 19:18:11 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the answer, but I think that this code should "create the subject specific grid, using the template grid" as specified in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. " % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid .warpmni = 'yes'; cfg.grid .template = template_grid; cfg.grid .nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.grid .unit ='mm';grid = ft_prepare_sourcemodel(cfg); I believe it "align/project" the template grid with individual mri using non-linear transformation. Correct me if I'm wrong. I'll be more than happy to get more comments on this. Best Regards, Olga. On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle wrote: > Dear Olga, > > Should I use template or subject-specific headmodel with “projected to > template grid individualized grid”? > > > I would use the individual head model based on the MRI as it provides more > information for your source analysis. This should provide more accurate > results. > > Actually I tried both ways for one subject and did not notice any > difference in the results. > > > It seems to that this is due to this line of code, but I’m not quite sure > about that: > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.grid.template = template_grid; > > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > > cfg.mri = mri_cm{Subj_i}; > > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > > I think with this configuration the source model that is prepared is only > based on the cfg.grid.template, and completely ignores the MRI (which you > are interested in). This might explain why you see no difference. > > Bests, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: > > Pipeline for sourceanalysis with individualize grip > > > > Dear field trippers, > > > I have a question related to pipeline for sourceanalysis with > individualize grid. > > Should I use template or subject-specific headmodel with “projected to > template grid individualized grid”? Below is my pipeline with details of > what I mean. Actually I tried both ways for one subject and did not notice > any difference in the results. Does it mean that I do not need to constract > headmodel for each subject? That's indeed save a lot of time, but I'd like > to get your green light on this. > > Best Regards, > > Olga. > > > % 1. load template grid, e.g. > > > load( > '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' > ); > > template_grid = sourcemodel; > > > %2. Make the individual subjects' grid > > %a) Load individual subject mri, e.g. > > > [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); > > mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); > > > %b) construct individual grid by projecting to template grid > > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.grid.template = template_grid; > > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > > cfg.mri = mri_cm{Subj_i}; > > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > > % 3. Make source reconstruction, using individualized grid and* template? > or individual headmodel* > > %a) load template volume > load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); > > template_vol = vol; > > > cfg = []; > > cfg.grid = grid_ind{Subj_i}; > > *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* > > cfg.channel = {'MEG'}; > > cfg.grad = freq_cmb{Subj_i}.grad; > > sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); > > > cfg = []; > > cfg.frequency = freq_cmb{Subj_i}.freq; > > cfg.grad = freq_cmb{Subj_i}.grad; > > cfg.method = 'dics'; > > cfg.keeptrials = 'yes'; > > *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with > individual or template headmodel?* > > *cfg.vol = vol_K0012_cm; **% individual or template vol???* > > cfg.keeptrials = 'yes'; > > cfg.dics.lambda = '5%'; > > cfg.dics.keepfilter = 'yes'; > > cfg.dics.fixedori = 'yes'; > > cfg.dics.realfilter = 'yes'; > > source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 ha438 at georgetown.edu Wed Mar 9 21:26:36 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 9 Mar 2016 15:26:36 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 Message-ID: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; *ft_sourceplot(cfg,seg)* I get the error: *Error using textscan* First input can not be empty. Expected a non-empty string or a valid file-id. *Error in issubfield (line 44)* t = textscan(f,'%s','delimiter','.'); *Error in ft_sourceplot (line 460)* hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan -------------- next part -------------- An HTML attachment was scrubbed... URL: From seymourr at aston.ac.uk Wed Mar 9 21:38:57 2016 From: seymourr at aston.ac.uk (Seymour, Robert (Research Student)) Date: Wed, 9 Mar 2016 20:38:57 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 Message-ID: Hi Hassan, Is there any reason you want to use the FSL template brain? If not, it might be worth trying SPM template like so: [mri] = ft_read_mri('~pathtofieldtrip/template/anatomy/single_subj_T1'); mri.coordsys ='SPM' Hope this works out for you, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Wed Mar 9 21:46:33 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 9 Mar 2016 15:46:33 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: Message-ID: Hi Robert, Thanks for your reply. I am looking to use both, but I have had the same issue with the SPM also. I feel that the problem is not datatype dependent. Best, Hassan On Mar 9, 2016 3:39 PM, "Seymour, Robert (Research Student)" < seymourr at aston.ac.uk> wrote: > Hi Hassan, > > > Is there any reason you want to use the FSL template brain? If not, it might > be worth trying SPM template like so: > > > [mri] = ft_read_mri('~pathtofieldtrip/template/anatomy/single_subj_T1'); > > mri.coordsys ='SPM' > > > Hope this works out for you, > > Rob > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Wed Mar 9 21:49:48 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 9 Mar 2016 13:49:48 -0700 Subject: [FieldTrip] Moving window peak-to-peak artifact correction Message-ID: Hi fieldtrippers, ERPlab has a method of artifact detection which, within an epoch, will take a moving window of a defined size, measure peak-to-peak amplitude difference, and reject the trial based on a defined threshold. http://erpinfo.org/erplab/erplab-documentation/manual_4/Artifact_Detection.html I would like to implement a similar method in fieldtrip, but the closest I can find is ft_artifact_threshold. As I understand it, the range or min-max is the peak-to-peak amplitude difference, but as best as I can tell there is no way to do this over a moving window, only across the whole trial. Is there a way to implement this in fieldtrip? On a related note, why is it that (nearly) all of the fieldtrip artifact rejection methods require the .trl matrix, even with epoched data? Is there a specific reason why artifacts can't just be rejected by trial, besides the fact that allowing for rejection by .trl matrices allows for partial trial rejection? That would be a reasonable explanation, but there have been times where, for various reasons, having to reject by the .trl matrix has created complications (usually due to lack of foresight on my part, but nonetheless frustrating). Thanks, Max -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Thu Mar 10 01:40:56 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Thu, 10 Mar 2016 01:40:56 +0100 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space Message-ID: Dear FieldTrip users, I have a few questions regarding source localisation and statistics: 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. Thank you! Best regards, Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Mar 10 08:55:54 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Mar 2016 07:55:54 +0000 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Hi Olga, The ‘template grid’ refers to a so-called source model, i.e. the set of positions that you use to model your sources. The headmodel refers to the volume conduction model of the head. The inverse warping is intended to facilitate group comparisons after the source reconstruction. For the source reconstruction you can use these ‘inverse warped template grids’, but it is advisable to always use a volume conduction model based on the participant’s anatomy, as Simon already suggested in his reply. Best wishes, Jan-Mathijs On 09 Mar 2016, at 17:18, Olga Sysoeva > wrote: Dear Simon, Thank you very much for the answer, but I think that this code should "create the subject specific grid, using the template grid" as specified in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. " % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.grid.unit ='mm'; grid = ft_prepare_sourcemodel(cfg); I believe it "align/project" the template grid with individual mri using non-linear transformation. Correct me if I'm wrong. I'll be more than happy to get more comments on this. Best Regards, Olga. On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle > wrote: Dear Olga, Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? I would use the individual head model based on the MRI as it provides more information for your source analysis. This should provide more accurate results. Actually I tried both ways for one subject and did not notice any difference in the results. It seems to that this is due to this line of code, but I’m not quite sure about that: cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); I think with this configuration the source model that is prepared is only based on the cfg.grid.template, and completely ignores the MRI (which you are interested in). This might explain why you see no difference. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 On 09 Mar 2016, at 11:57, Olga Sysoeva > wrote: Pipeline for sourceanalysis with individualize grip Dear field trippers, I have a question related to pipeline for sourceanalysis with individualize grid. Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. Best Regards, Olga. % 1. load template grid, e.g. load('/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat'); template_grid = sourcemodel; %2. Make the individual subjects' grid %a) Load individual subject mri, e.g. [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); %b) construct individual grid by projecting to template grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); % 3. Make source reconstruction, using individualized grid and template? or individual headmodel %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); template_vol = vol; cfg = []; cfg.grid = grid_ind{Subj_i}; cfg.vol = vol_K0012_cm; % individual or template vol??? cfg.channel = {'MEG'}; cfg.grad = freq_cmb{Subj_i}.grad; sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf{Subj_i}; % sourcemodel after leadfield with individual or template headmodel? cfg.vol = vol_K0012_cm; % individual or template vol??? cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 10 09:00:09 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Mar 2016 08:00:09 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: Message-ID: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Hassan, Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use? Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with. Best, Jan-Mathijs On 09 Mar 2016, at 21:26, Hassan Aleem > wrote: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; ft_sourceplot(cfg,seg) I get the error: Error using textscan First input can not be empty. Expected a non-empty string or a valid file-id. Error in issubfield (line 44) t = textscan(f,'%s','delimiter','.'); Error in ft_sourceplot (line 460) hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Thu Mar 10 12:44:53 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Thu, 10 Mar 2016 14:44:53 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Thank you Jan-Mathijs for clarification. Therefore, I think it is better for me to change my pipeline to more conventional. Like this? 1.read individual mri (I do have it in .fif format adjusted in Graph to sensor position) [mri{subj_i}] = ft_read_mri(filename{subj_i}); 2. perform the segmentation cfg = []; cfg.output = 'brain'; segmentedmri{subj_i} = ft_volumesegment(cfg, mri{subj_i}); 3. create a headmodel cfg = []; cfg.method='singleshell'; vol{subj_i} = ft_prepare_headmodel(cfg, segmentedmri{subj_i}); 4. create a leadfield (do I need to do it twice – sourcemodel first and than leadfield?). Which resolution is better to use? 1 cm – to coarse? cfg = []; cfg.grad = freqPost{Subj_i} .grad; cfg.vol = vol{Subj_i} ; cfg.reducerank = 2; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; [grid{Subj_i} ] = ft_prepare_leadfield(cfg); 5. do source reconstraction cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; *cfg.grid = **grid{Subj_i};* *cfg.vol = vol**{Subj_i};* cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; *source {Subj_i} = ft_sourceanalysis(cfg, freq_cmb{Subj_i});* How does it look for experienced sourcemodeller? Best Regards, Olga. On Thu, Mar 10, 2016 at 10:55 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Olga, > > The ‘template grid’ refers to a so-called source model, i.e. the set of > positions that you use to model your sources. > The headmodel refers to the volume conduction model of the head. > > The inverse warping is intended to facilitate group comparisons after the > source reconstruction. > > For the source reconstruction you can use these ‘inverse warped template > grids’, but it is advisable to always use a volume conduction model based > on the participant’s anatomy, as Simon already suggested in his reply. > > Best wishes, > Jan-Mathijs > > > > On 09 Mar 2016, at 17:18, Olga Sysoeva wrote: > > Dear Simon, > > Thank you very much for the answer, but I think that this code should > "create the subject specific grid, using the template grid" as specified > in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. > " > > % create the subject specific grid, using the template grid that has just been created > cfg = []; > cfg.grid .warpmni = 'yes'; > cfg.grid .template = template_grid; > cfg.grid .nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > cfg.grid .unit ='mm';grid = ft_prepare_sourcemodel(cfg); > > I believe it "align/project" the template grid with individual mri using > non-linear transformation. > > Correct me if I'm wrong. > I'll be more than happy to get more comments on this. > > Best Regards, > Olga. > > On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle > wrote: > >> Dear Olga, >> >> Should I use template or subject-specific headmodel with “projected to >> template grid individualized grid”? >> >> >> I would use the individual head model based on the MRI as it provides >> more information for your source analysis. This should provide more >> accurate results. >> >> Actually I tried both ways for one subject and did not notice any >> difference in the results. >> >> >> It seems to that this is due to this line of code, but I’m not quite sure >> about that: >> >> cfg = []; >> >> cfg.grid.warpmni = 'yes'; >> >> cfg.grid.template = template_grid; >> >> cfg.grid.nonlinear = 'yes'; % use non-linear normalization >> >> cfg.mri = mri_cm{Subj_i}; >> >> grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); >> >> >> I think with this configuration the source model that is prepared is only >> based on the cfg.grid.template, and completely ignores the MRI (which you >> are interested in). This might explain why you see no difference. >> >> Bests, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: >> >> Pipeline for sourceanalysis with individualize grip >> >> >> >> Dear field trippers, >> >> >> I have a question related to pipeline for sourceanalysis with >> individualize grid. >> >> Should I use template or subject-specific headmodel with “projected to >> template grid individualized grid”? Below is my pipeline with details of >> what I mean. Actually I tried both ways for one subject and did not notice >> any difference in the results. Does it mean that I do not need to constract >> headmodel for each subject? That's indeed save a lot of time, but I'd like >> to get your green light on this. >> >> Best Regards, >> >> Olga. >> >> >> % 1. load template grid, e.g. >> >> >> load( >> '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' >> ); >> >> template_grid = sourcemodel; >> >> >> %2. Make the individual subjects' grid >> >> %a) Load individual subject mri, e.g. >> >> >> [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); >> >> mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); >> >> >> %b) construct individual grid by projecting to template grid >> >> >> cfg = []; >> >> cfg.grid.warpmni = 'yes'; >> >> cfg.grid.template = template_grid; >> >> cfg.grid.nonlinear = 'yes'; % use non-linear normalization >> >> cfg.mri = mri_cm{Subj_i}; >> >> grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); >> >> >> % 3. Make source reconstruction, using individualized grid and* >> template? or individual headmodel* >> >> %a) load template volume >> load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); >> >> template_vol = vol; >> >> >> cfg = []; >> >> cfg.grid = grid_ind{Subj_i}; >> >> *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* >> >> cfg.channel = {'MEG'}; >> >> cfg.grad = freq_cmb{Subj_i}.grad; >> >> sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); >> >> >> cfg = []; >> >> cfg.frequency = freq_cmb{Subj_i}.freq; >> >> cfg.grad = freq_cmb{Subj_i}.grad; >> >> cfg.method = 'dics'; >> >> cfg.keeptrials = 'yes'; >> >> *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with >> individual or template headmodel?* >> >> *cfg.vol = vol_K0012_cm; **% individual or template vol???* >> >> cfg.keeptrials = 'yes'; >> >> cfg.dics.lambda = '5%'; >> >> cfg.dics.keepfilter = 'yes'; >> >> cfg.dics.fixedori = 'yes'; >> >> cfg.dics.realfilter = 'yes'; >> >> source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 laxmi.shaw22 at gmail.com Thu Mar 10 14:41:59 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Thu, 10 Mar 2016 19:11:59 +0530 Subject: [FieldTrip] Issue in topographs Message-ID: Dear Fieldtrip users, Can anybody is having complete manual book of fieldtrip toolbox. Actually i am facing problem in simple topographic plot. I am using fieldtrip-20051231 and my data set is in .xls files.Can anybody help in this regard. Thanks in advance Regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur India Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Fri Mar 11 01:02:54 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Thu, 10 Mar 2016 19:02:54 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Hi J.M, I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux operating system. However the problem appears also on my windows 10 OS. I am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot does not work with the same complaint as with trying to plot the source interpolation, I assume that's what you mean by checking them. Let me post the script to give you more information. ( the headmodel part of the script was modified from robert bauer) *%reading mri* [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' ----------------------------------- *%segmentation* cfg = []; cfg.brainthreshold = 0.5; cfg.scalpthreshold = 0.15; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); ---------------------------------- %plotting segmentation cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; ft_sourceplot(cfg,seg) *this does not work, same error.* ------------------------------------------ *%building mesh* cfg = []; cfg.method= 'projectmesh'; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [1000 1000 1000]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001 bnd(2).pnt = bnd(2).pnt.*1 bnd(3).pnt = bnd(3).pnt.*0.999 ft_plot_mesh(bnd(1))%scalp ft_plot_mesh(bnd(2))%skull ft_plot_mesh(bnd(3))%brain ---------------------------------------------------------- *%preparing headmodel* cfg = []; cfg.method = 'dipoli'; headmodel = ft_prepare_headmodel(cfg, bnd); -------------------------------------------------------- *%adding electrodes to headmodel* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') % aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp st_elec_aligned = ft_electroderealign(cfg); ----------------------------------------------- *%using the standard template sourcemodel from fieldtrip.* load('standard_sourcemodel3d5mm.mat') ------------------------------------- *%% timelock data* cfg = []; m0 = ft_timelockanalysis(cfg, dataM0); -------------------------------------- *%% perform source analysis* cfg = []; cfg.method = 'lcmv'; cfg.lcmv.lambda='5%'; cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD source_m0=ft_sourceanalysis(cfg,m0); ------------------------------ *%% source interpolation* cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; cfg.grid=sourcemodel.cfg.grid; sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); ---------------------------------------------- *%plotting* cfg = []; cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg, sourceinterp_m0); This is where it gives me the error. Please let me know if you need more information. I also had a question about making a 'source' it seems that the fieldtrip tutorial does not use a 'sourcemodel' but instead use a dipolefitting source, is this comparable. Thank you for the help in advance. Best, Hassan On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hassan, > Can you please provide a bit more information with respect to what version > of fieldtrip, matlab and operating system you use? > Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? > We need more information to work with. > Best, > Jan-Mathijs > > > > On 09 Mar 2016, at 21:26, Hassan Aleem wrote: > > Hi everyone, > > I have a question that is possibly very easy to solve but is evading me. I > am unable to get ft_sourceplot to work. For example when I run the code: > > [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); > mri.coordsys ='MNI' > > cfg = []; > cfg.output = {'brain' 'scalp' 'skull'}; > seg = ft_volumesegment(cfg, mri); > seg.anatomy = mri.anatomy; > > cfg = []; > cfg.funparameter = 'brain'; > *ft_sourceplot(cfg,seg)* > > I get the error: > > *Error using textscan* > First input can not be empty. Expected a non-empty string or a valid > file-id. > > * Error in issubfield (line 44)* > t = textscan(f,'%s','delimiter','.'); > > * Error in ft_sourceplot (line 460)* > hasmsk = issubfield(functional, cfg.maskparameter); > > This is happening regardless of what stage I use ft_sourceplot. > > Thanks for your consideration! > > Hassan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 Fri Mar 11 07:36:17 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Mar 2016 06:36:17 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: I cannot reproduce your problem. It seems that you are using an incorrect/outdated copy of issubfield. The line number you report in your error message does not line up with the current version. Please ensure that your matlab path is set correctly, in particular try to avoid copies of SPM or eeglab taking precedence. These may have old versions of FT code that can cause all kinds of erratic behaviour. Best wishes, Jan-Mathijs On 11 Mar 2016, at 01:02, Hassan Aleem > wrote: Hi J.M, I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux operating system. However the problem appears also on my windows 10 OS. I am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot does not work with the same complaint as with trying to plot the source interpolation, I assume that's what you mean by checking them. Let me post the script to give you more information. ( the headmodel part of the script was modified from robert bauer) %reading mri [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' ----------------------------------- %segmentation cfg = []; cfg.brainthreshold = 0.5; cfg.scalpthreshold = 0.15; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); ---------------------------------- %plotting segmentation cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; ft_sourceplot(cfg,seg) this does not work, same error. ------------------------------------------ %building mesh cfg = []; cfg.method= 'projectmesh'; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [1000 1000 1000]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001 bnd(2).pnt = bnd(2).pnt.*1 bnd(3).pnt = bnd(3).pnt.*0.999 ft_plot_mesh(bnd(1))%scalp ft_plot_mesh(bnd(2))%skull ft_plot_mesh(bnd(3))%brain ---------------------------------------------------------- %preparing headmodel cfg = []; cfg.method = 'dipoli'; headmodel = ft_prepare_headmodel(cfg, bnd); -------------------------------------------------------- %adding electrodes to headmodel elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') % aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp st_elec_aligned = ft_electroderealign(cfg); ----------------------------------------------- %using the standard template sourcemodel from fieldtrip. load('standard_sourcemodel3d5mm.mat') ------------------------------------- %% timelock data cfg = []; m0 = ft_timelockanalysis(cfg, dataM0); -------------------------------------- %% perform source analysis cfg = []; cfg.method = 'lcmv'; cfg.lcmv.lambda='5%'; cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD source_m0=ft_sourceanalysis(cfg,m0); ------------------------------ %% source interpolation cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; cfg.grid=sourcemodel.cfg.grid; sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); ---------------------------------------------- %plotting cfg = []; cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg, sourceinterp_m0); This is where it gives me the error. Please let me know if you need more information. I also had a question about making a 'source' it seems that the fieldtrip tutorial does not use a 'sourcemodel' but instead use a dipolefitting source, is this comparable. Thank you for the help in advance. Best, Hassan On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hassan, Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use? Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with. Best, Jan-Mathijs On 09 Mar 2016, at 21:26, Hassan Aleem > wrote: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; ft_sourceplot(cfg,seg) I get the error: Error using textscan First input can not be empty. Expected a non-empty string or a valid file-id. Error in issubfield (line 44) t = textscan(f,'%s','delimiter','.'); Error in ft_sourceplot (line 460) hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ha438 at georgetown.edu Fri Mar 11 07:46:18 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Fri, 11 Mar 2016 01:46:18 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Thanks for your response J.M. That makes sense. I will remove all eeglab/spm/fieldtrip and reinstall,making sure to keep fieldtrip separate. On Mar 11, 2016 1:40 AM, "Schoffelen, J.M. (Jan Mathijs)" < jan.schoffelen at donders.ru.nl> wrote: > I cannot reproduce your problem. It seems that you are using an > incorrect/outdated copy of issubfield. The line number you report in your > error message does not line up with the current version. Please ensure that > your matlab path is set correctly, in particular try to avoid copies of SPM > or eeglab taking precedence. These may have old versions of FT code that > can cause all kinds of erratic behaviour. > > Best wishes, > Jan-Mathijs > > > > > > > > On 11 Mar 2016, at 01:02, Hassan Aleem wrote: > > Hi J.M, > > I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux > operating system. However the problem appears also on my windows 10 OS. I > am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot > does not work with the same complaint as with trying to plot the source > interpolation, I assume that's what you mean by checking them. Let me post > the script to give you more information. ( the headmodel part of the script > was modified from robert bauer) > > *%reading mri* > [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); > mri.coordsys ='MNI' > ----------------------------------- > *%segmentation* > > cfg = []; > cfg.brainthreshold = 0.5; > cfg.scalpthreshold = 0.15; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'scalp' 'skull'}; > seg = ft_volumesegment(cfg, mri); > ---------------------------------- > %plotting segmentation > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > ft_sourceplot(cfg,seg) *this does not work, same error.* > ------------------------------------------ > *%building mesh* > cfg = []; > cfg.method= 'projectmesh'; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [1000 1000 1000]; > bnd = ft_prepare_mesh(cfg, seg); > > % i enlarged / reduced the boundary mesh a little bit, because they were > causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001 > bnd(2).pnt = bnd(2).pnt.*1 > bnd(3).pnt = bnd(3).pnt.*0.999 > > ft_plot_mesh(bnd(1))%scalp > ft_plot_mesh(bnd(2))%skull > ft_plot_mesh(bnd(3))%brain > > ---------------------------------------------------------- > *%preparing headmodel* > cfg = []; > cfg.method = 'dipoli'; > headmodel = ft_prepare_headmodel(cfg, bnd); > -------------------------------------------------------- > > * %adding electrodes to headmodel* > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode > file > > % visualize head surface (scalp) > > figure; > ft_plot_mesh(headmodel.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > > % aligning electrodes > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = headmodel.bnd(1);%scalp > st_elec_aligned = ft_electroderealign(cfg); > ----------------------------------------------- > *%using the standard template sourcemodel from fieldtrip.* > > load('standard_sourcemodel3d5mm.mat') > ------------------------------------- > *%% timelock data* > cfg = []; > m0 = ft_timelockanalysis(cfg, dataM0); > -------------------------------------- > > *%% perform source analysis * > cfg = []; > cfg.method = 'lcmv'; > cfg.lcmv.lambda='5%'; > cfg.grid = sourcemodel.cfg.grid;---this is the standard template from > fieldtrip > cfg.headmodel = headmodel; > cfg.lcmv.keepfilter = 'yes'; > cfg.lcmv.projectnoise='yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > source_m0=ft_sourceanalysis(cfg,m0); > ------------------------------ > *%% source interpolation* > > cfg = []; > cfg.interpmethod = 'nearest'; > cfg.parameter = 'pow'; > cfg.grid=sourcemodel.cfg.grid; > sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); > ---------------------------------------------- > *%plotting* > > cfg = []; > cfg.method = 'ortho'; > cfg.funcolorlim = 'maxabs'; > cfg.funparameter= 'pow'; > ft_sourceplot(cfg, sourceinterp_m0); > > This is where it gives me the error. Please let me know if you need more > information. I also had a question about making a 'source' it seems that > the fieldtrip tutorial does not use a 'sourcemodel' but instead use a > dipolefitting source, is this comparable. Thank you for the help in advance. > > Best, > > Hassan > > On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hassan, >> Can you please provide a bit more information with respect to what >> version of fieldtrip, matlab and operating system you use? >> Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? >> We need more information to work with. >> Best, >> Jan-Mathijs >> >> >> >> On 09 Mar 2016, at 21:26, Hassan Aleem wrote: >> >> Hi everyone, >> >> I have a question that is possibly very easy to solve but is evading me. >> I am unable to get ft_sourceplot to work. For example when I run the code: >> >> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >> mri.coordsys ='MNI' >> >> cfg = []; >> cfg.output = {'brain' 'scalp' 'skull'}; >> seg = ft_volumesegment(cfg, mri); >> seg.anatomy = mri.anatomy; >> >> cfg = []; >> cfg.funparameter = 'brain'; >> *ft_sourceplot(cfg,seg)* >> >> I get the error: >> >> *Error using textscan* >> First input can not be empty. Expected a non-empty string or a valid >> file-id. >> >> * Error in issubfield (line 44)* >> t = textscan(f,'%s','delimiter','.'); >> >> * Error in ft_sourceplot (line 460)* >> hasmsk = issubfield(functional, cfg.maskparameter); >> >> This is happening regardless of what stage I use ft_sourceplot. >> >> Thanks for your consideration! >> >> Hassan >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 bushra.riaz at gu.se Fri Mar 11 12:00:21 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Fri, 11 Mar 2016 11:00:21 +0000 Subject: [FieldTrip] error in reading epoched fif files Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> Hello, I am getting an error in reading epoched fiff files created with the latest stable version of mne Is there a quick fix to this problem? Thank you Kind regards Bushra Riaz? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri Mar 11 12:10:25 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 11 Mar 2016 11:10:25 +0000 Subject: [FieldTrip] Issue in topographs Message-ID: Hello Laxmi, The tutorials within the Fieldtrip wiki online, as well as the reference documentation and FAQs on the wiki, are the manual. You can find tutorials there for how to get your data into Fieldtrip, and examples for how to plot. There are also some video tutorials. If you have more specific questions then people here on the e-mail list might be able to help. But you would need to provide more details, such as, what is the format of your data in .xls files (is it averages, grand averages, epochs, continuous data, etc...?). If you search the archives of this mailing list I think you can find some previous messages about how to "hack" data from unsupported file formats into the proper MATLAB structure to be compatible with the fieldtrip functions. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 2 > Date: Thu, 10 Mar 2016 19:11:59 +0530 > From: Laxmi Shaw > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Issue in topographs > Message-ID: > < > CABWJU2Sk5qG_4G63EbYXkySo9wcOFfZxdqmsQ6i9mRMLQBSJkg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fieldtrip users, > Can anybody is having complete manual book of fieldtrip toolbox. Actually i > am facing problem in simple topographic plot. I am using > fieldtrip-20051231 and my data set is in .xls files.Can anybody help in > this regard. > > > > Thanks in advance > > > Regards > > -- > Laxmi Shaw > Research Scholar(PhD) > IIT Kharagpur > India > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Fri Mar 11 22:59:58 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Fri, 11 Mar 2016 21:59:58 +0000 Subject: [FieldTrip] DICS between two frequencies? Message-ID: Hi FieldTrip list, When doing source analysis using DICS the help document refers to cfg.foi as a single value, but the workshop notes (http://www.fieldtriptoolbox.org/workshop/meg-uk-2015/fieldtrip-beamformer-demo) use two values. So possibly silly question, but does ft_source analysis function normally using two values? Also, does it require wavelet transform data or would using fft data over a large frequency range then inputting the required bands be OK to do? Thanks, Peter From runna90 at 126.com Sat Mar 12 01:02:40 2016 From: runna90 at 126.com (runna90 at 126.com) Date: Sat, 12 Mar 2016 08:02:40 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: Message-ID: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Dear Harold, I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here . Source model: Co-registration of the source space to the sensor-based head coordinate system, I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? Best regards, Runnan > 在 2016年3月10日,08:40,Harold Cavendish 写道: > > Dear FieldTrip users, > > I have a few questions regarding source localisation and statistics: > > 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). > > What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? > > 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? > > I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. > > Thank you! > > Best regards, > Harold > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sat Mar 12 12:12:27 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sat, 12 Mar 2016 11:12:27 +0000 Subject: [FieldTrip] error in reading epoched fif files Message-ID: Hello Bushra, You will be more likely to get helpful advice if you can provide more details about your problem. See http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 1 > Date: Fri, 11 Mar 2016 11:00:21 +0000 > From: Bushra Riaz Syeda > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] error in reading epoched fif files > Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b at EXCH03-P.GU.GU.SE> > Content-Type: text/plain; charset="iso-8859-1" > > Hello, > > I am getting an error in reading epoched fiff files created with the > latest stable version of mne > Is there a quick fix to this problem? > > Thank you > Kind regards > Bushra Riaz? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Sat Mar 12 15:06:38 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Sat, 12 Mar 2016 15:06:38 +0100 Subject: [FieldTrip] Head model for EEG source localization - Possible bug in BEMCP? Message-ID: Dear all, I am working on EEG source localization of a very simple fist clenching task (right hand, 10 seconds of contraction alternated to 10 seconds of relaxation to be used as contrast condition) using DICS beamformer (frequency 10 Hz). I have the individial MRI and EEG electrode positions of my participants, so I wrote a script to create the individual forward model following the tutorials on the fieldtrip webpage and some useful discussions on the mailing list. Below I report the full code used for the forward model and the code used for the source analysis. Attached, you find the results of the source localization and ​some ​ figures of different steps in the computation of the forward model. According to my task, I expect to identify a desynchronization on the left motor cortex, but what I am getting are very weird results(see attachment ​s)​ . I tryed to use the standard MRI in template\headmodel\standard_mri, and I get similar results. After a full day of self-debugging, I managed to get the result I expect (attached) using the method "concentricspheres" instead of "bemcp" in the computation of the head model, both with the MRI of my participants and with the standard MRI. I assume there must be something wrong with "bemcp", also becasue when I use the standard bem headmodel (template\headmodel\standard_bem) created with the method "dipoli", everything looks fine again. Did anybody experienced a similar issue before? Is there anything wrong I am doing in the pipeline? Thanks a lot in advace for your support! Best, Debora Fieldtrip version: 20150828 Matlab version: R2015a (64 bit) OS: Windows 8 (64 bit) %%%% --------------------- Code for Forward Model ---------------- %%% %% Read MRI data (DICOM) mri = ft_read_mri(experiment.mri); % experiment.mri contains the path to individual MRIs %% Convert anatomical MRI to MNI coordinate system (= RAS) cfg = []; cfg.method = 'interactive'; cfg.coordsys = 'spm'; % MNI coordinate system (=RAS) cfg.viewmode = 'ortho'; mri_spm = ft_volumerealign(cfg,mri); %% Re-slice the MRI volume so that all the 3 dimensions have the same number of voxels cfg = []; cfg.resolution = 1; % 1 mm thick slices cfg.dim = [256 256 256]; mri_spm = ft_volumereslice(cfg,mri_spm); %% Visualize MRI data to check that everything is ok cfg = []; cfg.method = 'ortho'; ft_sourceplot(cfg,mri_spm) %% Segment the anatomical data cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; cfg.brainsmooth = 2; cfg.brainthreshold = 0.25; cfg.scalpthreshold = 0.025; mri_seg = ft_volumesegment(cfg, mri_spm); %% Check segmentation brain cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'brain'; ft_sourceplot(cfg,mri_seg) %% Check segmentation skull cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'skull'; ft_sourceplot(cfg,mri_seg) %% Check segmentation scalp cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'scalp'; ft_sourceplot(cfg,mri_seg) %% Prepare mesh: creates surfaces at the boarders of the different tissue-types cfg = []; cfg.method = 'projectmesh'; cfg.tissue = {'brain' 'skull' 'scalp'}; cfg.numvertices = [6000 4000 2000]; bnd = ft_prepare_mesh(cfg, mri_seg); %% Visualize surfaces figure ft_plot_mesh(bnd(1),'facecolor','none') % brain figure ft_plot_mesh(bnd(2),'facecolor','none') % skull figure ft_plot_mesh(bnd(3),'facecolor','none') % scalp %% Visualize full mesh figure ft_plot_mesh(bnd(3), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(bnd(1),'edgecolor','none','facecolor',[0.4 0.6 0.4]); %% Prepare head model (volume conduction model) cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg,bnd); %% % --------------------- Align the EEG electrodes!!!-------------------%%% %% (1) Read electrode position from Localizer file elec = ft_read_sens(experiment.electrodes); % experiment.electrodes contains the path to the individual electrode positions %% (2) Check if alignment is necessary figure %plot scalp ft_plot_mesh(headmodel.bnd(3),'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]) hold on % plot electrodes ft_plot_sens(elec,'style','sk') %% (3) If the electrodes are not aligned to the head surface, interactively align them cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(3); % scalp elec_aligned = ft_electroderealign(cfg); %% Load hdr and order elec_aligned accordign to original order of signal acquisition %%% This is necessary because the eeg elctrod eposition shave been acquired %%% in a different order with respect to theorder of the signal recording load([experiment.path '\Data'],'hdr') % hdr contains some information about the original order of the channels and so on... [~, original_order] = ismember(hdr.elec.label,elec_aligned.label); elec_aligned.chanpos = elec_aligned.chanpos(original_order,:); elec_aligned.elecpos = elec_aligned.elecpos(original_order,:); elec_aligned.label = elec_aligned.label(original_order); %% Check if the alignment is ok figure %plot scalp ft_plot_mesh(headmodel.bnd(3),'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]) hold on % plot electrodes ft_plot_sens(elec_aligned,'style','sk') %% -------------------------------- Source model -------------------------%% %% Make the individual subject's grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.resolution = 6; % resolution of the template grid in mm cfg.grid.nonlinear = 'yes'; % use non linear normalization cfg.mri = mri_spm; % use subject's mri in mni coordinates cfg.grid.unit = 'mm'; sourcemodel = ft_prepare_sourcemodel(cfg); %% Plot the single subject'e head model and grid positions figure hold on ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); ft_plot_mesh(sourcemodel.pos(sourcemodel.inside,:)); %% Double check that source model is aligned to the segmented volume and to the electrodes figure hold on plot3(sourcemodel.pos(sourcemodel.inside,1),sourcemodel.pos(sourcemodel.inside,2),sourcemodel.pos(sourcemodel.inside,3),'.'); ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); %% ---------------------- FORWARD SOLUTION ------------------------ %% %% Prepare leadfield cfg = []; cfg.elec = elec_aligned; cfg.grid = sourcemodel; cfg.headmodel = headmodel; leadfield = ft_prepare_leadfield(cfg); %% Test sourc elocalization load([experiment.path '\DATA'], 'preexperiment_freqsource') % preexperiment_freqsource contains the output of ft_freqanalysis cfg = []; cfg.elec = elec_aligned; cfg.method = 'dics'; cfg.frequency = 10; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.dics.keepfilter = 'yes'; cfg.dics.lambda = '10%'; src = ft_sourceanalysis(cfg, preexperiment_freqsource); filter = src.avg.filter; markers = [224 192]; % markers are some number in the trialinfo, 224 is related to fist clenching, 192 to relaxation for mm = 1:length(markers) cfg = []; cfg.trials = find(preexperiment_freqsource.trialinfo == markers(mm)); data = ft_selectdata(cfg,preexperiment_freqsource); %%% DICS cfg = []; cfg.elec = elec_aligned; cfg.method = 'dics'; cfg.frequency = 10; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '10%'; cfg.grid.filter = filter; Source{mm} = ft_sourceanalysis(cfg, data); end %% Interpolate results to anatomy source = Source{1}; source1 = Source{1}; %clenching source2 = Source{2}; % release source.avg.cont = (source2.avg.pow./source1.avg.pow)-1; cfg = []; cfg.parameter = 'cont'; source = ft_sourceinterpolate(cfg, source, mri_spm); %% Plot surface cfg = []; cfg.method = 'surface'; cfg.funparameter = 'cont'; cfg.funcolormap = 'jet'; ft_sourceplot(cfg, source) -------------------------------------------------------------------- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_CONCENTRICSPHERES_Results_Source.PNG Type: image/png Size: 126346 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0_IndividualMRI_spm.PNG Type: image/png Size: 80674 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1_Segmentaiton_BrainSkullScalp.PNG Type: image/png Size: 41612 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2a_Output ft_plot_mesh_BrainSkullScalp.PNG Type: image/png Size: 66519 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2b_Output ft_plot_mesh_allSurfaces.PNG Type: image/png Size: 40960 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3_BEMCP_SourceModel.PNG Type: image/png Size: 19959 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3_CONCENTRICSPHERES_SourceModel.PNG Type: image/png Size: 19714 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_BEMCP_Alignment_HeadModel_SourceModel_Electrodes.PNG Type: image/png Size: 58428 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_CONCENTRICSPHERES_Alignment_HeadModel_SourceModel_Electrodes.PNG Type: image/png Size: 67775 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_BEMCP_Results_Source.PNG Type: image/png Size: 143105 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Sat Mar 12 15:42:59 2016 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sat, 12 Mar 2016 14:42:59 +0000 Subject: [FieldTrip] BEMCP Message-ID: Deb: I have had problems with BEMCP. 1—one of the practical / technical problems is that if the compartments overlap, or even come close, then the procedure would not work—the ft_sourceanlaysis crashed. 2—There are a couple of studies comparing BEMCP and dipoli, among other methods. The BEMCP method does not fare well, the dipoli fares better, E. g., among three or four studies I have seen. Gramfort, A., et al. (2010). "OpenMEEG: opensource software for quasistatic bioelectromagnetics." Biomed Eng Online 9: 45. Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput Intell Neurosci 2011: 923703. 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, and the Simbio FEM model, by correlating results from each model (e.g., correlations of all the dipole CDR estimates; or correlations across anatomical ROIs). The BEMCP and concentric spheres work similarly, and the dipoli and Simbio-FEM work similarly. This was with infants using participant-computed realistic models for the compartments and the FEM. I am not claiming from this and superiority of the dipoli (or FEM) models over the BEMCP, but I suggest looking at the research literature formally comparing these methods before going much further with BEMCP. John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Sat Mar 12 16:30:12 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Sat, 12 Mar 2016 16:30:12 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear John, thanks a lot for your promt reply and your suggestion. I guess that I was sticking to the BEM head model just because I read the tutorial for EEG BEM head model first, but going quickly through the studies you have mentioned and considering the tests you have performed, I may also consider to switch to the FEM head model or to simply use the concentric spheres (which appeared to work similar to BEMCP in your comparisons). I am relatively new to source localization and had no crash/errors in my pipeline, and this combination makes always difficult to find possible pitfalls. As soon as I have them ready, I will post the results obtained with the FEM head model as well, maybe they will be useful for some other users :) Thanks again for your support! All the best, Debora On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN wrote: > Deb: > > I have had problems with BEMCP. > > 1—one of the practical / technical problems is that if the compartments > overlap, or even come close, then the procedure would not work—the > ft_sourceanlaysis crashed. > > 2—There are a couple of studies comparing BEMCP and dipoli, among other > methods. The BEMCP method does not fare well, the dipoli fares better, > > E. g., among three or four studies I have seen. > Gramfort, A., et al. (2010). "OpenMEEG: opensource software for > quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. > > Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput > Intell Neurosci *2011*: 923703. > > 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, > and the Simbio FEM model, by correlating results from each model (e.g., > correlations of all the dipole CDR estimates; or correlations across > anatomical ROIs). The BEMCP and concentric spheres work similarly, and the > dipoli and Simbio-FEM work similarly. This was with infants using > participant-computed realistic models for the compartments and the FEM. > > I am not claiming from this and superiority of the dipoli (or FEM) models > over the BEMCP, but I suggest looking at the research literature formally > comparing these methods before going much further with BEMCP. > > John > > *********************************************** > John E. Richards Carolina Distinguished Professor > Department of Psychology > University of South Carolina > Columbia, SC 29208 > Dept Phone: 803 777 2079 > Fax: 803 777 9558 > Email: richards-john at sc.edu > HTTP: jerlab.psych.sc.edu > *********************************************** > > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Sat Mar 12 17:14:40 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sat, 12 Mar 2016 16:14:40 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Debora, The critical thing with BEMCP is that your sources are not too close to the inner skull boundary. When they are closer than the safe distance the solution you get is completely wrong. When they are not too close, the solution is OK and comparable at least to concentric spheres. The safe distance is is more or less the average edge length in your skull mesh. In SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option cfg.moveinward that corrects the mesh to ensure that it is not too close. It would be interesting if you use this option and report whether this resolves your problem. This issue should occur in any BEM but depending on the implementation the critical distance might be shorter. Best, Vladimir On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri wrote: > Dear John, > thanks a lot for your promt reply and your suggestion. I guess that I was > sticking to the BEM head model just because I read the tutorial for EEG BEM > head model first, but going quickly through the studies you have mentioned > and considering the tests you have performed, I may also consider to switch > to the FEM head model or to simply use the concentric spheres (which > appeared to work similar to BEMCP in your comparisons). I am relatively new > to source localization and had no crash/errors in my pipeline, and this > combination makes always difficult to find possible pitfalls. > > As soon as I have them ready, I will post the results obtained with the > FEM head model as well, maybe they will be useful for some other users :) > > Thanks again for your support! > All the best, > Debora > > On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN > wrote: > >> Deb: >> >> I have had problems with BEMCP. >> >> 1—one of the practical / technical problems is that if the compartments >> overlap, or even come close, then the procedure would not work—the >> ft_sourceanlaysis crashed. >> >> 2—There are a couple of studies comparing BEMCP and dipoli, among other >> methods. The BEMCP method does not fare well, the dipoli fares better, >> >> E. g., among three or four studies I have seen. >> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >> >> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >> Intell Neurosci *2011*: 923703. >> >> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >> and the Simbio FEM model, by correlating results from each model (e.g., >> correlations of all the dipole CDR estimates; or correlations across >> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >> dipoli and Simbio-FEM work similarly. This was with infants using >> participant-computed realistic models for the compartments and the FEM. >> >> I am not claiming from this and superiority of the dipoli (or FEM) models >> over the BEMCP, but I suggest looking at the research literature formally >> comparing these methods before going much further with BEMCP. >> >> John >> >> *********************************************** >> John E. Richards Carolina Distinguished Professor >> Department of Psychology >> University of South Carolina >> Columbia, SC 29208 >> Dept Phone: 803 777 2079 >> Fax: 803 777 9558 >> Email: richards-john at sc.edu >> HTTP: jerlab.psych.sc.edu >> *********************************************** >> >> > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Sun Mar 13 13:20:16 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Sun, 13 Mar 2016 13:20:16 +0100 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Runnan, I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. *Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue.* Best regards, Harold On 12 March 2016 at 01:02, wrote: > Dear Harold, > I am very sorry that I am not writing to reply your question but to > request you something about minimum norm estimate because I am a rather new > fieldtripper. I noticed that you have got results applying MNE, thus I > think you must be more experienced! I followed the tutorial at > http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did > source reconstruction with MEG data acquired from ctf 275 system. But I > got stuck in here > . Source model: Co-registration of the source space to the sensor-based > head coordinate system, > I could not find the file named ‘orig-nomask.mgz’ under the mir folder. > Would you tell me in which step should this file be created? And how to > create this file? > > Best regards, > > Runnan > > > > > > > 在 2016年3月10日,08:40,Harold Cavendish 写道: > > > Dear FieldTrip users, > > > I have a few questions regarding source localisation and statistics: > > > 1. Suppose I'm doing source reconstruction of ERP using minimum-norm > estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() > and getting rather meaningful results which I visualise via ft_plot_mesh(). > > > What is the validity of this result? I understand there are many > individual dipoles spread over the cortical sheet and we're estimating best > fit to the data given the conductance model while minimising overall power, > but what does this actually tell us? If I find an area with higher power, > what conclusions can I draw? > > > 2. Can I compute a correlation between the result in the source space and > a behavioural variable? Perhaps even specify a region of interest? If yes, > is this approach considered to be valid? > > > I want to see if e.g. the power of the reconstructed activity in the > source space averaged over a time window correlates with my behavioural > variable. > > > Thank you! > > > Best regards, > > Harold > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > 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 alexandre.gramfort at telecom-paristech.fr Sun Mar 13 18:16:47 2016 From: alexandre.gramfort at telecom-paristech.fr (Alexandre Gramfort) Date: Sun, 13 Mar 2016 18:16:47 +0100 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: References: Message-ID: hi, Basically the MNE code has been updated and the fieldtrip code has not been updated to be able to read the new epochs files MNE produces. Bushra you should share a file and code snippet to replicate the problem. HTH Alex On Sat, Mar 12, 2016 at 12:12 PM, Stephen Politzer-Ahles wrote: > Hello Bushra, > > You will be more likely to get helpful advice if you can provide more > details about your problem. See > http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > > >> >> Message: 1 >> Date: Fri, 11 Mar 2016 11:00:21 +0000 >> From: Bushra Riaz Syeda >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] error in reading epoched fif files >> Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b at EXCH03-P.GU.GU.SE> >> Content-Type: text/plain; charset="iso-8859-1" >> >> >> Hello, >> >> I am getting an error in reading epoched fiff files created with the >> latest stable version of mne >> Is there a quick fix to this problem? >> >> Thank you >> Kind regards >> Bushra Riaz? >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From ha438 at georgetown.edu Sun Mar 13 20:42:06 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Sun, 13 Mar 2016 15:42:06 -0400 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Just to put this out there for reference. I was able to solve the problem by replacing the 'issubfield' function with its Matlab equivalent 'isfield'. On Fri, Mar 11, 2016 at 1:46 AM, Hassan Aleem wrote: > Thanks for your response J.M. That makes sense. I will remove all > eeglab/spm/fieldtrip and reinstall,making sure to keep fieldtrip separate. > On Mar 11, 2016 1:40 AM, "Schoffelen, J.M. (Jan Mathijs)" < > jan.schoffelen at donders.ru.nl> wrote: > >> I cannot reproduce your problem. It seems that you are using an >> incorrect/outdated copy of issubfield. The line number you report in your >> error message does not line up with the current version. Please ensure that >> your matlab path is set correctly, in particular try to avoid copies of SPM >> or eeglab taking precedence. These may have old versions of FT code that >> can cause all kinds of erratic behaviour. >> >> Best wishes, >> Jan-Mathijs >> >> >> >> >> >> >> >> On 11 Mar 2016, at 01:02, Hassan Aleem wrote: >> >> Hi J.M, >> >> I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux >> operating system. However the problem appears also on my windows 10 OS. I >> am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot >> does not work with the same complaint as with trying to plot the source >> interpolation, I assume that's what you mean by checking them. Let me post >> the script to give you more information. ( the headmodel part of the script >> was modified from robert bauer) >> >> *%reading mri* >> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >> mri.coordsys ='MNI' >> ----------------------------------- >> *%segmentation* >> >> cfg = []; >> cfg.brainthreshold = 0.5; >> cfg.scalpthreshold = 0.15; >> cfg.downsample = 1; %no downsampling >> cfg.output = {'brain' 'scalp' 'skull'}; >> seg = ft_volumesegment(cfg, mri); >> ---------------------------------- >> %plotting segmentation >> cfg = []; >> cfg.funparameter = 'trishells'; >> cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; >> ft_sourceplot(cfg,seg) *this does not work, same error.* >> ------------------------------------------ >> *%building mesh* >> cfg = []; >> cfg.method= 'projectmesh'; >> cfg.tissue = {'scalp', 'skull', 'brain'}; >> cfg.numvertices = [1000 1000 1000]; >> bnd = ft_prepare_mesh(cfg, seg); >> >> % i enlarged / reduced the boundary mesh a little bit, because they were >> causing errors, probably due to overlapping >> bnd(1).pnt = bnd(1).pnt.*1.001 >> bnd(2).pnt = bnd(2).pnt.*1 >> bnd(3).pnt = bnd(3).pnt.*0.999 >> >> ft_plot_mesh(bnd(1))%scalp >> ft_plot_mesh(bnd(2))%skull >> ft_plot_mesh(bnd(3))%brain >> >> ---------------------------------------------------------- >> *%preparing headmodel* >> cfg = []; >> cfg.method = 'dipoli'; >> headmodel = ft_prepare_headmodel(cfg, bnd); >> -------------------------------------------------------- >> >> * %adding electrodes to headmodel* >> elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load >> electrode file >> >> % visualize head surface (scalp) >> >> figure; >> ft_plot_mesh(headmodel.bnd(1), >> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); >> hold on; >> % plot electrodes >> ft_plot_sens(elec,'style', 'sk') >> >> % aligning electrodes >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = headmodel.bnd(1);%scalp >> st_elec_aligned = ft_electroderealign(cfg); >> ----------------------------------------------- >> *%using the standard template sourcemodel from fieldtrip.* >> >> load('standard_sourcemodel3d5mm.mat') >> ------------------------------------- >> *%% timelock data* >> cfg = []; >> m0 = ft_timelockanalysis(cfg, dataM0); >> -------------------------------------- >> >> *%% perform source analysis * >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.lcmv.lambda='5%'; >> cfg.grid = sourcemodel.cfg.grid;---this is the standard template from >> fieldtrip >> cfg.headmodel = headmodel; >> cfg.lcmv.keepfilter = 'yes'; >> cfg.lcmv.projectnoise='yes'; >> cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD >> source_m0=ft_sourceanalysis(cfg,m0); >> ------------------------------ >> *%% source interpolation* >> >> cfg = []; >> cfg.interpmethod = 'nearest'; >> cfg.parameter = 'pow'; >> cfg.grid=sourcemodel.cfg.grid; >> sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); >> ---------------------------------------------- >> *%plotting* >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funcolorlim = 'maxabs'; >> cfg.funparameter= 'pow'; >> ft_sourceplot(cfg, sourceinterp_m0); >> >> This is where it gives me the error. Please let me know if you need more >> information. I also had a question about making a 'source' it seems that >> the fieldtrip tutorial does not use a 'sourcemodel' but instead use a >> dipolefitting source, is this comparable. Thank you for the help in advance. >> >> Best, >> >> Hassan >> >> On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hassan, >>> Can you please provide a bit more information with respect to what >>> version of fieldtrip, matlab and operating system you use? >>> Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? >>> We need more information to work with. >>> Best, >>> Jan-Mathijs >>> >>> >>> >>> On 09 Mar 2016, at 21:26, Hassan Aleem wrote: >>> >>> Hi everyone, >>> >>> I have a question that is possibly very easy to solve but is evading me. >>> I am unable to get ft_sourceplot to work. For example when I run the code: >>> >>> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >>> mri.coordsys ='MNI' >>> >>> cfg = []; >>> cfg.output = {'brain' 'scalp' 'skull'}; >>> seg = ft_volumesegment(cfg, mri); >>> seg.anatomy = mri.anatomy; >>> >>> cfg = []; >>> cfg.funparameter = 'brain'; >>> *ft_sourceplot(cfg,seg)* >>> >>> I get the error: >>> >>> *Error using textscan* >>> First input can not be empty. Expected a non-empty string or a valid >>> file-id. >>> >>> * Error in issubfield (line 44)* >>> t = textscan(f,'%s','delimiter','.'); >>> >>> * Error in ft_sourceplot (line 460)* >>> hasmsk = issubfield(functional, cfg.maskparameter); >>> >>> This is happening regardless of what stage I use ft_sourceplot. >>> >>> Thanks for your consideration! >>> >>> Hassan >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 pgoodin at swin.edu.au Mon Mar 14 05:59:43 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 14 Mar 2016 04:59:43 +0000 Subject: [FieldTrip] Striations in stats? Message-ID: Hi Fieldtrip list (and apologies for two posts in 4 days), I've run source analysis using DICS and the method outlined on the extended beamformer tutorial (http://www.fieldtriptoolbox.org/tutorial/beamformingextended) and am happy with the outcome, except after running permutation stats there's striations the the output (see attached). Any ideas on where this is coming from and how it could possibly be fixed (if at all) would be really appreciated. Just in case I've attached the code used to run the source analysis and stats. Thanks, Peter Source analysis on individuals (using common filter): %Source analysis of conditions and baselines cfg=[]; cfg.grad=grad; cfg.frequency=foi; %foi is taken from a peak at ~18Hz with 9Hz smoothing cfg.method='dics'; cfg.grid=leadfield; cfg.grid.filter=common; %Common filter computed from adding 4 conditions together. cfg.headmodel=hdm; cfg.dics.lambda=reg; %reg is 0 (due to having ~500 trials per condition). cfg.dics.keepfilter='no'; cfg.dics.fixedori='yes'; cfg.dics.realfilter='yes'; source_bsl=ft_sourceanalysis(cfg, bl_freqs); source_cond=ft_sourceanalysis(cfg, av_freqs); source_diff=source_cond; source_diff.avg.pow = (source_cond.avg.pow ./ source_bsl.avg.pow) -1; %Replace subject source grid locations with MNI positions. source_diff.pos = template.sourcemodel.pos; source_diff.dim = template.sourcemodel.dim; source_cond.pos = template.sourcemodel.pos; source_cond.dim = template.sourcemodel.dim; source_bsl.pos = template.sourcemodel.pos; source_bsl.dim = template.sourcemodel.dim; cfg.parameter='pow'; cfg.interpmethod='spline'; source_diff=ft_sourceinterpolate(cfg, source_diff, mnimri); source_cond=ft_sourceinterpolate(cfg, source_cond, mnimri); source_bsl=ft_sourceinterpolate(cfg, source_bsl, mnimri); *****Average source (source_diff) calculated using ft_sourcegrandaverage***** Stats (13 subs, repeated measures t-test): subj=size(cond,2); design=zeros(2,2*subj); for i=1:subj design(1,i)=i; end for i=1:subj design(1,subj+i)=i; end design(2,1:subj)=1; design(2,subj+1:2*subj)=2; cfg=[]; cfg.parameter='pow'; cfg.method='montecarlo'; cfg.statistic='ft_statfun_depsamplesT'; cfg.correctm='cluster'; cfg.numrandomization=rand; %rand = 2000 cfg.clustertail=0; cfg.alpha=0.025; cfg.design=design; cfg.uvar=1; cfg.ivar=2; %stat=ft_sourcestatistics(cfg, cond_ga{:},bsl_ga{:}); stat=ft_sourcestatistics(cfg, cond{:},bsl{:}); Plotting (average source masked by stats <.05): cfg=[]; cfg.method='slice'; cfg.funparameter='pow'; cfg.anaparameter='anatomy'; cfg.maskparameter='mask'; source_diff.mask=stat.prob <.05; ft_sourceplot(cfg, source_diff); _______________________ Dr Peter Goodin, Brain and Psychological Sciences Research Centre (BPsyC) Swinburne University, Hawthorn, Vic, 3122 -------------- next part -------------- A non-text attachment was scrubbed... Name: beta.jpg Type: image/jpeg Size: 251484 bytes Desc: beta.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: beta_sig.jpg Type: image/jpeg Size: 282748 bytes Desc: beta_sig.jpg URL: From bushra.riaz at gu.se Mon Mar 14 07:30:47 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Mon, 14 Mar 2016 06:30:47 +0000 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> References: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> Message-ID: <1457937054408.48754@gu.se> My bad. I should have explained the problem I am using this code to read epoched fif files created with latest version of mne-python as was explained in fieldtrip tutorial (http://www.fieldtriptoolbox.org/development/integrate_with_mne) The sample epoched file can be downloaded from this link https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0? cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); and I am getting the following error Error using fiff_read_epochs (line 46) Could not find epochs data Error in fiff_read_epochs (line 46) error(me,'Could not find epochs data'); Error in ft_read_header (line 1601) epochs = fiff_read_epochs(filename); Error in ft_preprocessing (line 397) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 14 09:40:36 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 14 Mar 2016 08:40:36 +0000 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Hi Runnan, Sorry for the confusion. The part of the documentation you are working with is currently being improved, but not finalized yet. In particular, the part you refer to ‘Source model: co-registration of the source space to the sensor-based coordinate system’ needs a heavy update. I would assume that you have done the tutorial up until there. In particular, if you have done the preprocessing of the anatomical MRI, where you have created 2 transformation matrices (using the same anatomical volume), you’re almost there. So please forget about the orig.mgz, either nomask or not, and please be a bit patient until we (i.e. I) find time to update the documentation. This is how you get the appropriate coregistration: (Note: I assume that all the objects are defined in ‘mm’, otherwise it won’t work. To get all things in ‘mm’, use ft_convert_units). Preliminaries: -we know how to get from an arbitrary voxel-space to the sensor-based coordinate system: transform_vox2ctf -we know how to get to the ‘mni’ coordinate system from the same arbitrary voxel-space: transform_vox2spm -we know that the sourcespace is expressed in the ‘mni’ coordinate system (check the units, is it mm?) Based on the first two points above, we can easily construct a transformation matrix that goes from ‘mni’ to ‘ctf’: T = transform_vox2ctf/transform_vox2spm We can now use T to transform the sourcespace: sourcespace = ft_transform_geometry(T, sourcespace); I am pretty sure that this will do the trick. Best, Jan-Mathijs On 13 Mar 2016, at 13:20, Harold Cavendish > wrote: Dear Runnan, I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. Best regards, Harold On 12 March 2016 at 01:02, > wrote: Dear Harold, I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here . Source model: Co-registration of the source space to the sensor-based head coordinate system, I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? Best regards, Runnan 在 2016年3月10日,08:40,Harold Cavendish > 写道: Dear FieldTrip users, I have a few questions regarding source localisation and statistics: 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. Thank you! Best regards, Harold _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 deb.desideri at gmail.com Mon Mar 14 11:46:36 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Mon, 14 Mar 2016 11:46:36 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir, thanks for your explanation. I tryed to use the option cfg.moveinward in ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this did not solve the issue. As you can see from the attachment the cortex is now partially uncovered. I am not sure I am using this option properly, maybe there is a combination of values for cfg.moveinward and cfg.inwardshift that works fine. I tryed several, but none of them gave me the source localization that I expect. I don't know whether the fact that some dipoles fall outside the brain matters. For the attached figures I had no dipoles outside the brain, whilst for some of the others attempts I had. I actually found this post on the mailinglist where both you and John already pointed out this issue using BEM: http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html Also I don't know whether this link (still under construction/discussion) may be of interest in this contex: http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed Furthermore, this other page (also under construction), uses the option cfg.inwardshift for the template grid to be used in the creation of the individual subject's grid, but without an explanation of why the option is/should be used: http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) provided by Fiedltrip, I don't know whether craeting my own template_grid using the cfg.inwardshift option would actually fix the problem. I would like to perform some further attempts, as soon as I have some time to go through the function and understand how this options actually interplay. Meanwhile, I am still working on producing the results using the FEM head model. It is much more time-consuming than the BEM, and maybe that's one of the reasons to choose BEM models. As soon as they are ready I will post them as well :) Anyway, thanks so much for your help. It was actually quite useful and instructive! All the best wishes, Debora On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak wrote: > Dear Debora, > > The critical thing with BEMCP is that your sources are not too close to > the inner skull boundary. When they are closer than the safe distance the > solution you get is completely wrong. When they are not too close, the > solution is OK and comparable at least to concentric spheres. The safe > distance is is more or less the average edge length in your skull mesh. In > SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option > cfg.moveinward that corrects the mesh to ensure that it is not too close. > It would be interesting if you use this option and report whether this > resolves your problem. > > This issue should occur in any BEM but depending on the implementation the > critical distance might be shorter. > > Best, > > Vladimir > > On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri > wrote: > >> Dear John, >> thanks a lot for your promt reply and your suggestion. I guess that I was >> sticking to the BEM head model just because I read the tutorial for EEG BEM >> head model first, but going quickly through the studies you have mentioned >> and considering the tests you have performed, I may also consider to switch >> to the FEM head model or to simply use the concentric spheres (which >> appeared to work similar to BEMCP in your comparisons). I am relatively new >> to source localization and had no crash/errors in my pipeline, and this >> combination makes always difficult to find possible pitfalls. >> >> As soon as I have them ready, I will post the results obtained with the >> FEM head model as well, maybe they will be useful for some other users :) >> >> Thanks again for your support! >> All the best, >> Debora >> >> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN >> wrote: >> >>> Deb: >>> >>> I have had problems with BEMCP. >>> >>> 1—one of the practical / technical problems is that if the compartments >>> overlap, or even come close, then the procedure would not work—the >>> ft_sourceanlaysis crashed. >>> >>> 2—There are a couple of studies comparing BEMCP and dipoli, among other >>> methods. The BEMCP method does not fare well, the dipoli fares better, >>> >>> E. g., among three or four studies I have seen. >>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>> >>> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >>> Intell Neurosci *2011*: 923703. >>> >>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >>> and the Simbio FEM model, by correlating results from each model (e.g., >>> correlations of all the dipole CDR estimates; or correlations across >>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>> dipoli and Simbio-FEM work similarly. This was with infants using >>> participant-computed realistic models for the compartments and the FEM. >>> >>> I am not claiming from this and superiority of the dipoli (or FEM) >>> models over the BEMCP, but I suggest looking at the research literature >>> formally comparing these methods before going much further with BEMCP. >>> >>> John >>> >>> *********************************************** >>> John E. Richards Carolina Distinguished Professor >>> Department of Psychology >>> University of South Carolina >>> Columbia, SC 29208 >>> Dept Phone: 803 777 2079 >>> Fax: 803 777 9558 >>> Email: richards-john at sc.edu >>> HTTP: jerlab.psych.sc.edu >>> *********************************************** >>> >>> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ResultSource_moveinward6mm.PNG Type: image/png Size: 144542 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SourceModel_moveinward6mm.PNG Type: image/png Size: 12143 bytes Desc: not available URL: From litvak.vladimir at gmail.com Mon Mar 14 12:11:36 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Mon, 14 Mar 2016 11:11:36 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Debora, cfg.moveinward option is useful when your source space is a mesh as it actually deforms the mesh to push it inwards. When your source space is a grid you should use cfg.inwardshift to just exclude the points that are closer than 6 mm to the boundary. It might be a useful exercise for you to compute the lead fields with concentric spheres and with a BEM for the same grid and then look at correlations between these lead fields. You should see that the correlations should be high at depth but might be low for some points close to the surface. Once you hit the right value of inwardshift the low correlations should disappear. Best, Vladimir On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri wrote: > Dear Vladimir, > thanks for your explanation. I tryed to use the option cfg.moveinward in > ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this > did not solve the issue. As you can see from the attachment the cortex is > now partially uncovered. I am not sure I am using this option properly, > maybe there is a combination of values for cfg.moveinward and > cfg.inwardshift that works fine. I tryed several, but none of them gave me > the source localization that I expect. > I don't know whether the fact that some dipoles fall outside the brain > matters. For the attached figures I had no dipoles outside the brain, > whilst for some of the others attempts I had. > > I actually found this post on the mailinglist where both you and John > already pointed out this issue using BEM: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html > > Also I don't know whether this link (still under construction/discussion) > may be of interest in this contex: > > > http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed > > Furthermore, this other page (also under construction), uses the option > cfg.inwardshift for the template grid to be used in the creation of the > individual subject's grid, but without an explanation of why the option > is/should be used: > > > http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space > > In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) > provided by Fiedltrip, I don't know whether craeting my own template_grid > using the cfg.inwardshift option would actually fix the problem. I would > like to perform some further attempts, as soon as I have some time to go > through the function and understand how this options actually interplay. > > Meanwhile, I am still working on producing the results using the FEM head > model. It is much more time-consuming than the BEM, and maybe that's one of > the reasons to choose BEM models. As soon as they are ready I will post > them as well :) > > Anyway, thanks so much for your help. It was actually quite useful and > instructive! > > All the best wishes, > Debora > > > > On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < > litvak.vladimir at gmail.com> wrote: > >> Dear Debora, >> >> The critical thing with BEMCP is that your sources are not too close to >> the inner skull boundary. When they are closer than the safe distance the >> solution you get is completely wrong. When they are not too close, the >> solution is OK and comparable at least to concentric spheres. The safe >> distance is is more or less the average edge length in your skull mesh. In >> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >> cfg.moveinward that corrects the mesh to ensure that it is not too close. >> It would be interesting if you use this option and report whether this >> resolves your problem. >> >> This issue should occur in any BEM but depending on the implementation >> the critical distance might be shorter. >> >> Best, >> >> Vladimir >> >> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri >> wrote: >> >>> Dear John, >>> thanks a lot for your promt reply and your suggestion. I guess that I >>> was sticking to the BEM head model just because I read the tutorial for EEG >>> BEM head model first, but going quickly through the studies you have >>> mentioned and considering the tests you have performed, I may also consider >>> to switch to the FEM head model or to simply use the concentric spheres >>> (which appeared to work similar to BEMCP in your comparisons). I am >>> relatively new to source localization and had no crash/errors in my >>> pipeline, and this combination makes always difficult to find possible >>> pitfalls. >>> >>> As soon as I have them ready, I will post the results obtained with the >>> FEM head model as well, maybe they will be useful for some other users :) >>> >>> Thanks again for your support! >>> All the best, >>> Debora >>> >>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN >> > wrote: >>> >>>> Deb: >>>> >>>> I have had problems with BEMCP. >>>> >>>> 1—one of the practical / technical problems is that if the >>>> compartments overlap, or even come close, then the procedure would not >>>> work—the ft_sourceanlaysis crashed. >>>> >>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>> better, >>>> >>>> E. g., among three or four studies I have seen. >>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>> >>>> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >>>> Intell Neurosci *2011*: 923703. >>>> >>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >>>> and the Simbio FEM model, by correlating results from each model (e.g., >>>> correlations of all the dipole CDR estimates; or correlations across >>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>> participant-computed realistic models for the compartments and the FEM. >>>> >>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>> models over the BEMCP, but I suggest looking at the research literature >>>> formally comparing these methods before going much further with BEMCP. >>>> >>>> John >>>> >>>> *********************************************** >>>> John E. Richards Carolina Distinguished Professor >>>> Department of Psychology >>>> University of South Carolina >>>> Columbia, SC 29208 >>>> Dept Phone: 803 777 2079 >>>> Fax: 803 777 9558 >>>> Email: richards-john at sc.edu >>>> HTTP: jerlab.psych.sc.edu >>>> *********************************************** >>>> >>>> >>> >>> >>> -- >>> >>> Debora Desideri, PhD Student >>> BNP Lab - Neurology Department >>> University Hospital Tübingen >>> Eberhard Karls University Tübingen >>> Hoppe-Seyler Str. 3 >>> D-72076 Tübingen >>> Tel: +49 7071/29 80478 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Mon Mar 14 16:12:12 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Mon, 14 Mar 2016 15:12:12 +0000 Subject: [FieldTrip] Subsample spike structure Message-ID: <04263829-3D34-463B-AA84-61862B33445C@tum.de> Dear all, is it possible to subsample spikes from a spike structure according to trials-of-interest? I have an existing spike structure containing spikes at all trials, but I want to analyze only spikes specific to a subset of trials. Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 From recasensmarc at gmail.com Mon Mar 14 23:09:36 2016 From: recasensmarc at gmail.com (Marc Recasens) Date: Mon, 14 Mar 2016 22:09:36 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> Message-ID: Dear Jan-Mathijs, Sara and FT community, I'd like to bring up this old thread which I think might be of interest us all. I don't know if there's been any new development on the MNE approach (?) since this thread was started one year ago. Anyway, in order to get template-registered surfaces that allow for inter-subject comparison/averaging, I tried using Jan-Mathijs suggestion to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR . - I managed to get the .coord and .topo files using CARET - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico -6") registered to the template (fsaverage I assume) using the following files. Actually I'm not 100% sure these are the correct files I should read (the output seems to make sense though): ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for rh/lh.orig ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for rh/lh.white (JM did not say anything about rh/lh.white but mne_setup_source_space required it) - I got the resulting template-registered sourcespace properly co-registered in the correct coordinate system (individual sensor space) - and successfully applied MNE on the template-registered sourcespace. Sources make sense are meshes are exchangeable across subjects (which I think makes sense since they're all registered to a template). HOWEVER, I'm stuck in what I think should be a rather straight forward step, which is the creation of a template sourcemodel/grid (from the fsaverage or Colins brain) that I can use in the same way as the MNI-aligned template grid is used; that is a Talairach aligned surface with 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the lines below, but without success (because of MNI instead of TAL aligned?): template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); bnd.pnt = template_sourcemodel.pnt; bnd.tri = template_sourcemodel.tri; Any ideas about how to get such a template mesh will be highly appreciated! Best wishes Marc On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Sara, > > What you need are some of the .coord files, and the .topo files. > > Specifically, the midthickness_orig and the sphere files should be > converted into a format that the mne-software can work with. > The only way I managed this, was to convert the gifti files back into > freesurfer’s format: > > tmp = ft_read_headshape({‘something-something.topo.gii’ > ‘somethingelse-.L.midthickness_orig.coord.gii’}); > ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); > > and likewise for the right hemisphere, as well as for the spheres. > > Then, you can proceed with using mne_setup_source_space to create the 8196 > mesh. The final tricky thing eventually is to get the stuff properly > co-registered in the correct coordinate system again, but this should > proceed in the same way as when you would have used non-surface registered > meshes. > > The creation of the volume conduction model is a separate step (and does > not require the cortical meshes). > > Best, > Jan-Mathijs > > > On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe wrote: > > > Dear Jan Mathijs, > > > > Thank you very much for your quick and detailed answer! > > > > As suggested, I post-processed the surface of one of my subjects based > on the recipe on the link. > > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, > .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), > > but at this point I am not sure about how to proceed. So I have now > several questions: > > > > - Do you know which are the files containing the registered data for the > creation of the meshes? > > How should I create them given the current format? most are .gii files. > > - Once creating the meshes, should I follow with the creation of the > volume conduction model > > and analysis of the functional data as described in the tutorial? > http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > > > > Apologize for all these specific questions but it is being a little bit > confusing to me. > > So if anyone has experienced the same and/or have any suggestion, any > comment would be very welcomed. > > > > Thanks a lot in advance, > > > > Best, > > > > Sara > > > > > > > > > > > > > > > > ----- Original Message ----- > > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: "FieldTrip discussion list" > > Sent: Wednesday, September 30, 2015 9:33:03 AM > > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage > with MNE > > > > Hi Sara, > > > > I think that in this case there is no absolutely ‘correct’ approach, > although some approaches may make more sense than others. > > At this point in time it is indeed not well documented how to proceed > from individual subject results source-reconstructed onto an individual > cortically constrained mesh to a group analysis. > > In the past, we have been working with a procedure where the surface > data were interpolated onto a 3D-grid so that we could use volumetric > normalization techniques in order to get the subjects into a common space > to allow for group statistics. So, here the order of the steps would be to > call ft_sourceinterpolate, followed by ft_volumenormalise, or to > interpolate the functional data directly onto a MNI-warped grid ( > http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > ). > > In the code you pasted in your e-mail message, there is also reference > to ft_volumerealign, but I am not sure I understand why this is a required > step at this point in the pipeline. > > > > All the above being said, nowadays I would advocate a slightly different > approach, which bypasses the volumetric interpolation, where per subject I > would use cortical meshes that is surface-registered to a template mesh, > which as a consequence allows for direct comparison of source locations > across subjects. The way to achieve this would be to post-process the > surfaces that come out of the freesurfer pipeline according to the recipe > described on > http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. > After this registration step, the low-resolution (i.e. in this case the > 8196-vertex) meshes can be created. > > > > Best wishes, > > Jan-Mathijs > > > > > > > > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > > > Max Planck Institute for Psycholinguistics > > Donders Centre for Cognitive Neuroimaging > > > > E-mail: j.schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.fieldtriptoolbox.org > > http://www.hettaligebrein.nl > > > > > > > > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe > wrote: > > > >> Dear all, > >> > >> I am working on the source analysis of ERF data from ElektaNeuromag > system, with individual T1s, using minimum-norm estimate as described in > the following tutorial: > >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > >> I am exactly following the suggested steps, and so got the source > estimation for each of my subjects (bellow the output for one subject), > which i can nicely plot with the ft_plot_mesh function: > >> > >> sourceest = > >> > >> time: [1x1401 double] > >> inside: [8196x1 logical] > >> pos: [8196x3 double] > >> method: 'average' > >> avg: [1x1 struct] > >> cfg: [1x1 struct] > >> > >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, > >> I am trying to normalise (ft_volumenormalise) and interpolate > (ft_sourceinterpolate) the functional and anatomical data. > >> > >> However, I am struggling in this two last steps. > >> Since I did not find a clear pipeline/tutorial about the exact approach > (am I missing something?) > >> and after trying several options (bellow I copy the code I am using), > it is not clear to me: > >> > >> - which is the exact input data for each of these last two functions, > and > >> - in which order they should be called. > >> > >> Now, I would highly appreciate if anyone could give me any cue about > which the correct approach is. > >> > >> Thank you in advance, > >> > >> All the best, > >> > >> Sara > >> > >> > >> > >> %%%%%%%%%%%% > >> > >> % Inverse solution > >> cfg = []; > >> cfg.method = 'mne'; > >> cfg.grid = leadfield; > >> cfg.vol = vol; > >> cfg.mne.prewhiten = 'yes'; > >> cfg.mne.lambda = 3; > >> cfg.mne.scalesourcecov = 'yes'; > >> cfg.senstype = 'MEG'; > >> > >> sourceest = ft_sourceanalysis(cfg,erf); > >> > >> % read T1 volume - coords in scanner space > >> mri = ft_read_mri('s01.nii'); > >> mri.coordsys = 'neuromag'; > >> > >> % read headshape - Neuromag coords > >> hsf = 's01.fif'; > >> [headshape] = ft_read_headshape(hsf); > >> > >> % align T1 with head posiiton in MEG > >> cfg = []; > >> cfg.method = 'headshape'; > >> cfg.parameter = 'anatomy'; > >> cfg.headshape.headshape = headshape; > >> cfg.headshape.interactive = 'no'; > >> > >> mri_real = ft_volumerealign(cfg,mri); > >> > >> % normalize the realinged individual MRI to SPM template > >> cfg = []; > >> cfg.spmversion = 'spm8'; > >> % cfg.template='T1.nii'; % when enabling this field, an incoming error > message indicates that the template is not in the spm coordinate system. > >> % However, is the one used by default in this > function (as mentioned in the reference) so it is confusing to me > >> > >> norm_mri = ft_volumenormalise(cfg,mri_real); > >> > >> % interpolate Source with MEG-aligned T1 > >> cfg = []; > >> cfg.parameter = 'all'; > >> cfg.downsample = 2; > >> > >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); > >> > >> %%%%%%%%%%%%%% > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> 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 > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From runna90 at 126.com Tue Mar 15 09:45:16 2016 From: runna90 at 126.com (CRN) Date: Tue, 15 Mar 2016 16:45:16 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Jan-Mathijs, Thank you very much for your reply! I have been halted in this problem for a few days… And I am really looking forward urgently to get the source localization result. So I am sorry to bother you again! But there is still something wrong with followed steps in this page. 1. The built of volume conduction model. I noticed that it is required to create the volume model with same coordinate system as MEG sensor positions were defined. The ‘or-nomask.mgz’ file was asked to provide again to be used as anatomical data. I chose to replace this file with ‘orig.mgz’ first, but I got bad outcome as displayed below: the code I applied was copied from the web: mri_nom = ft_read_mri('orig.mgz'); cfg = []; cfg.coordsys = 'spm'; cfg.output = {'brain'}; seg = ft_volumesegment(cfg, mri_nom); seg = ft_convert_units(seg,'cm'); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg,seg); vol.bnd = ft_transform_geometry(T, vol.bnd); save vol vol; So should I use the mri data with ctf coordinate system to build the model and then transform it to spm system with the ’T’ metric? 2. When I did Forward solution, I could not find sourcespace.pnt, parameters I got in the sourcespace as below: what is the definition of ‘.pnt’? Why it was lost in my sourcespace data? Thank you for your help! Best Runnan > On Mar 14, 2016, at 16:40, Schoffelen, J.M. (Jan Mathijs) wrote: > > Hi Runnan, > > Sorry for the confusion. The part of the documentation you are working with is currently being improved, but not finalized yet. > In particular, the part you refer to ‘Source model: co-registration of the source space to the sensor-based coordinate system’ needs a heavy update. I would assume that you have done the tutorial up until there. In particular, if you have done the preprocessing of the anatomical MRI, where you have created 2 transformation matrices (using the same anatomical volume), you’re almost there. So please forget about the orig.mgz, either nomask or not, and please be a bit patient until we (i.e. I) find time to update the documentation. > > This is how you get the appropriate coregistration: > > (Note: I assume that all the objects are defined in ‘mm’, otherwise it won’t work. To get all things in ‘mm’, use ft_convert_units). > > Preliminaries: > -we know how to get from an arbitrary voxel-space to the sensor-based coordinate system: transform_vox2ctf > -we know how to get to the ‘mni’ coordinate system from the same arbitrary voxel-space: transform_vox2spm > -we know that the sourcespace is expressed in the ‘mni’ coordinate system (check the units, is it mm?) > > Based on the first two points above, we can easily construct a transformation matrix that goes from ‘mni’ to ‘ctf’: > > T = transform_vox2ctf/transform_vox2spm > > We can now use T to transform the sourcespace: > > sourcespace = ft_transform_geometry(T, sourcespace); > > I am pretty sure that this will do the trick. > > Best, > Jan-Mathijs > > > > >> On 13 Mar 2016, at 13:20, Harold Cavendish > wrote: >> >> Dear Runnan, >> >> I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). >> >> However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. >> >> As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. >> >> Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. >> >> Best regards, >> Harold >> >> >> On 12 March 2016 at 01:02, > wrote: >> Dear Harold, >> I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here >> . Source model: Co-registration of the source space to the sensor-based head coordinate system,  <> >> I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? >> >> Best regards, >> >> Runnan >> >> >> >> >> >> >>> 在 2016年3月10日,08:40,Harold Cavendish > 写道: >>> >>> Dear FieldTrip users, >>> >>> I have a few questions regarding source localisation and statistics: >>> >>> 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). >>> >>> What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? >>> >>> 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? >>> >>> I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. >>> >>> Thank you! >>> >>> Best regards, >>> Harold >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2016-03-14 at 18.05.20.png Type: image/png Size: 82608 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2016-03-15 at 16.40.16.png Type: image/png Size: 18951 bytes Desc: not available URL: From runna90 at 126.com Tue Mar 15 09:49:56 2016 From: runna90 at 126.com (CRN) Date: Tue, 15 Mar 2016 16:49:56 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Harold, Thank you for your reply! It is very kind of you that trying to help me even though you did not do analysis following the page I mentioned. Hope the reply from Jan-Mathijs could help both of us! Best, Runnan > On Mar 13, 2016, at 20:20, Harold Cavendish wrote: > > Dear Runnan, > > I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). > > However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. > > As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. > > Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. > > Best regards, > Harold > > > On 12 March 2016 at 01:02, > wrote: > Dear Harold, > I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here > . Source model: Co-registration of the source space to the sensor-based head coordinate system,  <> > I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? > > Best regards, > > Runnan > > > > > > >> 在 2016年3月10日,08:40,Harold Cavendish > 写道: >> >> Dear FieldTrip users, >> >> I have a few questions regarding source localisation and statistics: >> >> 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). >> >> What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? >> >> 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? >> >> I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. >> >> Thank you! >> >> Best regards, >> Harold >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 Tue Mar 15 16:16:29 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 15 Mar 2016 15:16:29 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> Message-ID: <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> Marc, I would not recommend to try and create a low-resolution mesh for Colin’s brain. In some sense, Colin’s brain is not more special than any of your single subject brains. In other words, you could pick any of your single subjects, and use that for visualization. If you would like to visualize your results on a ‘average’ brain, I’d recommend the Conte69 brain, that has been developed at Washington University (the Caret people). As a side note, Caret development is discontinued by the WashU group. They have moved to connectome workbench, which has most of the functionality supported by Caret. Specfically, there’s now also a freesurfer_to_fs_LR script that uses wb_command (the command line utility of connectome workbench). Note 2: the *.coord.* and *.topo.* files are old style Caret. Nowadays, the topologies are represented in a single file *.surf.* (rather than the positions in the coord and the triangles in the topo). BEst, JM On 14 Mar 2016, at 23:09, Marc Recasens > wrote: Dear Jan-Mathijs, Sara and FT community, I'd like to bring up this old thread which I think might be of interest us all. I don't know if there's been any new development on the MNE approach (?) since this thread was started one year ago. Anyway, in order to get template-registered surfaces that allow for inter-subject comparison/averaging, I tried using Jan-Mathijs suggestion to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. - I managed to get the .coord and .topo files using CARET - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico -6") registered to the template (fsaverage I assume) using the following files. Actually I'm not 100% sure these are the correct files I should read (the output seems to make sense though): ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for rh/lh.orig ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for rh/lh.white (JM did not say anything about rh/lh.white but mne_setup_source_space required it) - I got the resulting template-registered sourcespace properly co-registered in the correct coordinate system (individual sensor space) - and successfully applied MNE on the template-registered sourcespace. Sources make sense are meshes are exchangeable across subjects (which I think makes sense since they're all registered to a template). HOWEVER, I'm stuck in what I think should be a rather straight forward step, which is the creation of a template sourcemodel/grid (from the fsaverage or Colins brain) that I can use in the same way as the MNI-aligned template grid is used; that is a Talairach aligned surface with 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the lines below, but without success (because of MNI instead of TAL aligned?): template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); bnd.pnt = template_sourcemodel.pnt; bnd.tri = template_sourcemodel.tri; Any ideas about how to get such a template mesh will be highly appreciated! Best wishes Marc On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Sara, What you need are some of the .coord files, and the .topo files. Specifically, the midthickness_orig and the sphere files should be converted into a format that the mne-software can work with. The only way I managed this, was to convert the gifti files back into freesurfer’s format: tmp = ft_read_headshape({‘something-something.topo.gii’ ‘somethingelse-.L.midthickness_orig.coord.gii’}); ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); and likewise for the right hemisphere, as well as for the spheres. Then, you can proceed with using mne_setup_source_space to create the 8196 mesh. The final tricky thing eventually is to get the stuff properly co-registered in the correct coordinate system again, but this should proceed in the same way as when you would have used non-surface registered meshes. The creation of the volume conduction model is a separate step (and does not require the cortical meshes). Best, Jan-Mathijs On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe > wrote: > Dear Jan Mathijs, > > Thank you very much for your quick and detailed answer! > > As suggested, I post-processed the surface of one of my subjects based on the recipe on the link. > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), > but at this point I am not sure about how to proceed. So I have now several questions: > > - Do you know which are the files containing the registered data for the creation of the meshes? > How should I create them given the current format? most are .gii files. > - Once creating the meshes, should I follow with the creation of the volume conduction model > and analysis of the functional data as described in the tutorial? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > > Apologize for all these specific questions but it is being a little bit confusing to me. > So if anyone has experienced the same and/or have any suggestion, any comment would be very welcomed. > > Thanks a lot in advance, > > Best, > > Sara > > > > > > > > ----- Original Message ----- > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: "FieldTrip discussion list" > > Sent: Wednesday, September 30, 2015 9:33:03 AM > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE > > Hi Sara, > > I think that in this case there is no absolutely ‘correct’ approach, although some approaches may make more sense than others. > At this point in time it is indeed not well documented how to proceed from individual subject results source-reconstructed onto an individual cortically constrained mesh to a group analysis. > In the past, we have been working with a procedure where the surface data were interpolated onto a 3D-grid so that we could use volumetric normalization techniques in order to get the subjects into a common space to allow for group statistics. So, here the order of the steps would be to call ft_sourceinterpolate, followed by ft_volumenormalise, or to interpolate the functional data directly onto a MNI-warped grid (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space). > In the code you pasted in your e-mail message, there is also reference to ft_volumerealign, but I am not sure I understand why this is a required step at this point in the pipeline. > > All the above being said, nowadays I would advocate a slightly different approach, which bypasses the volumetric interpolation, where per subject I would use cortical meshes that is surface-registered to a template mesh, which as a consequence allows for direct comparison of source locations across subjects. The way to achieve this would be to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. After this registration step, the low-resolution (i.e. in this case the 8196-vertex) meshes can be created. > > Best wishes, > Jan-Mathijs > > > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > Max Planck Institute for Psycholinguistics > Donders Centre for Cognitive Neuroimaging > > E-mail: j.schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.fieldtriptoolbox.org > http://www.hettaligebrein.nl > > > > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe > wrote: > >> Dear all, >> >> I am working on the source analysis of ERF data from ElektaNeuromag system, with individual T1s, using minimum-norm estimate as described in the following tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> I am exactly following the suggested steps, and so got the source estimation for each of my subjects (bellow the output for one subject), which i can nicely plot with the ft_plot_mesh function: >> >> sourceest = >> >> time: [1x1401 double] >> inside: [8196x1 logical] >> pos: [8196x3 double] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, >> I am trying to normalise (ft_volumenormalise) and interpolate (ft_sourceinterpolate) the functional and anatomical data. >> >> However, I am struggling in this two last steps. >> Since I did not find a clear pipeline/tutorial about the exact approach (am I missing something?) >> and after trying several options (bellow I copy the code I am using), it is not clear to me: >> >> - which is the exact input data for each of these last two functions, and >> - in which order they should be called. >> >> Now, I would highly appreciate if anyone could give me any cue about which the correct approach is. >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> >> >> %%%%%%%%%%%% >> >> % Inverse solution >> cfg = []; >> cfg.method = 'mne'; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> cfg.senstype = 'MEG'; >> >> sourceest = ft_sourceanalysis(cfg,erf); >> >> % read T1 volume - coords in scanner space >> mri = ft_read_mri('s01.nii'); >> mri.coordsys = 'neuromag'; >> >> % read headshape - Neuromag coords >> hsf = 's01.fif'; >> [headshape] = ft_read_headshape(hsf); >> >> % align T1 with head posiiton in MEG >> cfg = []; >> cfg.method = 'headshape'; >> cfg.parameter = 'anatomy'; >> cfg.headshape.headshape = headshape; >> cfg.headshape.interactive = 'no'; >> >> mri_real = ft_volumerealign(cfg,mri); >> >> % normalize the realinged individual MRI to SPM template >> cfg = []; >> cfg.spmversion = 'spm8'; >> % cfg.template='T1.nii'; % when enabling this field, an incoming error message indicates that the template is not in the spm coordinate system. >> % However, is the one used by default in this function (as mentioned in the reference) so it is confusing to me >> >> norm_mri = ft_volumenormalise(cfg,mri_real); >> >> % interpolate Source with MEG-aligned T1 >> cfg = []; >> cfg.parameter = 'all'; >> cfg.downsample = 2; >> >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); >> >> %%%%%%%%%%%%%% >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 -- Marc Recasens Tel.: +34 639 24 15 98 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Tue Mar 15 19:18:34 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Tue, 15 Mar 2016 19:18:34 +0100 Subject: [FieldTrip] Events in databrowser Message-ID: An HTML attachment was scrubbed... URL: From recasensmarc at gmail.com Wed Mar 16 01:48:16 2016 From: recasensmarc at gmail.com (Marc Recasens) Date: Wed, 16 Mar 2016 00:48:16 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> Message-ID: Dear JM Thanks for you answer! didn't know anything about Connectome Workbench, but this FieldTrip-Connectome link sounds VERY cool! I'll have a look at the wb_command and see if I can read the Conte69 *surf from there. Best wishes Marc On Tue, Mar 15, 2016 at 3:16 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Marc, > > I would not recommend to try and create a low-resolution mesh for Colin’s > brain. In some sense, Colin’s brain is not more special than any of your > single subject brains. In other words, you could pick any of your single > subjects, and use that for visualization. > If you would like to visualize your results on a ‘average’ brain, I’d > recommend the Conte69 brain, that has been developed at Washington > University (the Caret people). > > As a side note, Caret development is discontinued by the WashU group. They > have moved to connectome workbench, which has most of the functionality > supported by Caret. Specfically, there’s now also a freesurfer_to_fs_LR > script that uses wb_command (the command line utility of connectome > workbench). Note 2: the *.coord.* and *.topo.* files are old style Caret. > Nowadays, the topologies are represented in a single file *.surf.* (rather > than the positions in the coord and the triangles in the topo). > > BEst, > JM > > > > > On 14 Mar 2016, at 23:09, Marc Recasens wrote: > > Dear Jan-Mathijs, Sara and FT community, > > I'd like to bring up this old thread which I think might be of interest us > all. I don't know if there's been any new development on the MNE approach > (?) since this thread was started one year ago. Anyway, in order to get > template-registered surfaces that allow for inter-subject > comparison/averaging, I tried using Jan-Mathijs suggestion to post-process > the surfaces that come out of the freesurfer pipeline according to the > recipe described on > http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR > . > > - I managed to get the .coord and .topo files using CARET > - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico > -6") registered to the template (fsaverage I assume) using the following > files. Actually I'm not 100% sure these are the correct files I should read > (the output seems to make sense though): > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for > rh/lh.orig > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for > rh/lh.white (JM did not say anything about rh/lh.white but > mne_setup_source_space required it) > > - I got the resulting template-registered sourcespace properly > co-registered in the correct coordinate system (individual sensor space) > - and successfully applied MNE on the template-registered sourcespace. > Sources make sense are meshes are exchangeable across subjects (which I > think makes sense since they're all registered to a template). > > HOWEVER, I'm stuck in what I think should be a rather straight forward > step, which is the creation of a template sourcemodel/grid (from the > fsaverage or Colins brain) that I can use in the same way as the > MNI-aligned template grid is used; that is a Talairach aligned surface with > 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the > lines below, but without success (because of MNI instead of TAL aligned?): > > template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); > template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); > bnd.pnt = template_sourcemodel.pnt; > bnd.tri = template_sourcemodel.tri; > > Any ideas about how to get such a template mesh will be highly appreciated! > > Best wishes > Marc > > > On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Sara, >> >> What you need are some of the .coord files, and the .topo files. >> >> Specifically, the midthickness_orig and the sphere files should be >> converted into a format that the mne-software can work with. >> The only way I managed this, was to convert the gifti files back into >> freesurfer’s format: >> >> tmp = ft_read_headshape({‘something-something.topo.gii’ >> ‘somethingelse-.L.midthickness_orig.coord.gii’}); >> ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); >> >> and likewise for the right hemisphere, as well as for the spheres. >> >> Then, you can proceed with using mne_setup_source_space to create the >> 8196 mesh. The final tricky thing eventually is to get the stuff properly >> co-registered in the correct coordinate system again, but this should >> proceed in the same way as when you would have used non-surface registered >> meshes. >> >> The creation of the volume conduction model is a separate step (and does >> not require the cortical meshes). >> >> Best, >> Jan-Mathijs >> >> >> On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe wrote: >> >> > Dear Jan Mathijs, >> > >> > Thank you very much for your quick and detailed answer! >> > >> > As suggested, I post-processed the surface of one of my subjects based >> on the recipe on the link. >> > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, >> .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), >> > but at this point I am not sure about how to proceed. So I have now >> several questions: >> > >> > - Do you know which are the files containing the registered data for >> the creation of the meshes? >> > How should I create them given the current format? most are .gii files. >> > - Once creating the meshes, should I follow with the creation of the >> volume conduction model >> > and analysis of the functional data as described in the tutorial? >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> > >> > Apologize for all these specific questions but it is being a little bit >> confusing to me. >> > So if anyone has experienced the same and/or have any suggestion, any >> comment would be very welcomed. >> > >> > Thanks a lot in advance, >> > >> > Best, >> > >> > Sara >> > >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > From: "Schoffelen, J.M. (Jan Mathijs)" >> > To: "FieldTrip discussion list" >> > Sent: Wednesday, September 30, 2015 9:33:03 AM >> > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage >> with MNE >> > >> > Hi Sara, >> > >> > I think that in this case there is no absolutely ‘correct’ approach, >> although some approaches may make more sense than others. >> > At this point in time it is indeed not well documented how to proceed >> from individual subject results source-reconstructed onto an individual >> cortically constrained mesh to a group analysis. >> > In the past, we have been working with a procedure where the surface >> data were interpolated onto a 3D-grid so that we could use volumetric >> normalization techniques in order to get the subjects into a common space >> to allow for group statistics. So, here the order of the steps would be to >> call ft_sourceinterpolate, followed by ft_volumenormalise, or to >> interpolate the functional data directly onto a MNI-warped grid ( >> http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> ). >> > In the code you pasted in your e-mail message, there is also reference >> to ft_volumerealign, but I am not sure I understand why this is a required >> step at this point in the pipeline. >> > >> > All the above being said, nowadays I would advocate a slightly >> different approach, which bypasses the volumetric interpolation, where per >> subject I would use cortical meshes that is surface-registered to a >> template mesh, which as a consequence allows for direct comparison of >> source locations across subjects. The way to achieve this would be to >> post-process the surfaces that come out of the freesurfer pipeline >> according to the recipe described on >> http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. >> After this registration step, the low-resolution (i.e. in this case the >> 8196-vertex) meshes can be created. >> > >> > Best wishes, >> > Jan-Mathijs >> > >> > >> > >> > >> > Jan-Mathijs Schoffelen, MD PhD, Senior researcher >> > >> > Max Planck Institute for Psycholinguistics >> > Donders Centre for Cognitive Neuroimaging >> > >> > E-mail: j.schoffelen at donders.ru.nl >> > Telephone: +31-24-3614793 >> > >> > http://www.fieldtriptoolbox.org >> > http://www.hettaligebrein.nl >> > >> > >> > >> > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe >> wrote: >> > >> >> Dear all, >> >> >> >> I am working on the source analysis of ERF data from ElektaNeuromag >> system, with individual T1s, using minimum-norm estimate as described in >> the following tutorial: >> >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> >> I am exactly following the suggested steps, and so got the source >> estimation for each of my subjects (bellow the output for one subject), >> which i can nicely plot with the ft_plot_mesh function: >> >> >> >> sourceest = >> >> >> >> time: [1x1401 double] >> >> inside: [8196x1 logical] >> >> pos: [8196x3 double] >> >> method: 'average' >> >> avg: [1x1 struct] >> >> cfg: [1x1 struct] >> >> >> >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, >> >> I am trying to normalise (ft_volumenormalise) and interpolate >> (ft_sourceinterpolate) the functional and anatomical data. >> >> >> >> However, I am struggling in this two last steps. >> >> Since I did not find a clear pipeline/tutorial about the exact >> approach (am I missing something?) >> >> and after trying several options (bellow I copy the code I am using), >> it is not clear to me: >> >> >> >> - which is the exact input data for each of these last two functions, >> and >> >> - in which order they should be called. >> >> >> >> Now, I would highly appreciate if anyone could give me any cue about >> which the correct approach is. >> >> >> >> Thank you in advance, >> >> >> >> All the best, >> >> >> >> Sara >> >> >> >> >> >> >> >> %%%%%%%%%%%% >> >> >> >> % Inverse solution >> >> cfg = []; >> >> cfg.method = 'mne'; >> >> cfg.grid = leadfield; >> >> cfg.vol = vol; >> >> cfg.mne.prewhiten = 'yes'; >> >> cfg.mne.lambda = 3; >> >> cfg.mne.scalesourcecov = 'yes'; >> >> cfg.senstype = 'MEG'; >> >> >> >> sourceest = ft_sourceanalysis(cfg,erf); >> >> >> >> % read T1 volume - coords in scanner space >> >> mri = ft_read_mri('s01.nii'); >> >> mri.coordsys = 'neuromag'; >> >> >> >> % read headshape - Neuromag coords >> >> hsf = 's01.fif'; >> >> [headshape] = ft_read_headshape(hsf); >> >> >> >> % align T1 with head posiiton in MEG >> >> cfg = []; >> >> cfg.method = 'headshape'; >> >> cfg.parameter = 'anatomy'; >> >> cfg.headshape.headshape = headshape; >> >> cfg.headshape.interactive = 'no'; >> >> >> >> mri_real = ft_volumerealign(cfg,mri); >> >> >> >> % normalize the realinged individual MRI to SPM template >> >> cfg = []; >> >> cfg.spmversion = 'spm8'; >> >> % cfg.template='T1.nii'; % when enabling this field, an incoming error >> message indicates that the template is not in the spm coordinate system. >> >> % However, is the one used by default in this >> function (as mentioned in the reference) so it is confusing to me >> >> >> >> norm_mri = ft_volumenormalise(cfg,mri_real); >> >> >> >> % interpolate Source with MEG-aligned T1 >> >> cfg = []; >> >> cfg.parameter = 'all'; >> >> cfg.downsample = 2; >> >> >> >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); >> >> >> >> %%%%%%%%%%%%%% >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> 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 >> > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzuchenlung at gmail.com Wed Mar 16 09:52:17 2016 From: tzuchenlung at gmail.com (Jane Lung) Date: Wed, 16 Mar 2016 16:52:17 +0800 Subject: [FieldTrip] Why does dissimilar structures happen? Message-ID: Dear FieldTrip users, I have a question about preparing head model, I got an error after executing: "grad_aligned = ft_sensorrealign(cfg, grad);" the error message as follow: Subscripted assignment between dissimilar structures. Error in ft_sensorrealign (line 235) tmp(i) = ft_convert_units(template(i), elec.unit); % ensure that the units are consistent with the electrodes since my data come from Yokogawa160 I just followed the tutorial: Getting started with Yokogawa data Can anyone give me a suggestion? what might be wrong? because I'm a beginner of fieldtrip user, so please excuse me for my naive question... Sincerely Jane -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Wed Mar 16 14:44:13 2016 From: alik.widge at gmail.com (Alik Widge) Date: Wed, 16 Mar 2016 09:44:13 -0400 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: My approach has been to define my events temporarily as "artifacts" in the cfg. Mark a few artifacts manually in the data browser, then inspect the cfg you get as output, you'll see the necessary structure. Just make sure to take them back out before you call rejectartifact! On Mar 16, 2016 1:08 AM, "Irene Sophia Mayer" wrote: > Dear fieldtrippers, > > I would like to look at my data while it is still in its continuous form > with databrowser. However, it does not display my events. > > Is there a way to display data in databrowser with the events visible? > > Cheers, > Irene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Wed Mar 16 18:36:30 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Wed, 16 Mar 2016 18:36:30 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf Message-ID: Dear all, I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion? Thank you very much in advance. Bests, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Wed Mar 16 19:00:02 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Wed, 16 Mar 2016 19:00:02 +0100 Subject: [FieldTrip] Events in databrowser Message-ID: An HTML attachment was scrubbed... URL: From gina.joue at univr.it Wed Mar 16 19:07:42 2016 From: gina.joue at univr.it (gj) Date: Wed, 16 Mar 2016 19:07:42 +0100 Subject: [FieldTrip] import own format (long trials) Message-ID: <56E9A0EE.3060006@univr.it> Hi, I am trying to import EEG data preprocessed and averaged in BrainVision Analyzer. I have a 2-second segment of data per condition per subject which corresponds to the averaged signal across all trials of each condition for the subject. Is the following approach correct? Import the 4 conditions as 4 long trials (2 sec or 2000 samples with sampling freq of 1000 Hz) => data.trial is a 1x4 cell array and each cell array contains an nchan x 2000 matrix I am trying to fill in the other fields of the data structure to mimic FieldTrip's raw data but I think I am having problems with data.sampleinfo which, if I understand correctly, needs to be specified for long trials. According to the wiki, this should be an array containing [startsample endsample] to specify the position of each trial, with info for each trial on every row. However, it doesn't seem right to have data.sampleinfo = repmat([1 2000],4,1) Thanks in advance for any help! Gina From Max.Cantor at Colorado.EDU Wed Mar 16 19:40:35 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 16 Mar 2016 12:40:35 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: I currently use a neuroscan64 system, with the quickcap64 layout. Just looking at the layout, it seems like FP1 could be interpolated from FPZ and AF3, but I'd have to test (or look at my neighbours structure) to see if this would be the case. Anyway, depending on your setup, it may be the case that FP1 does not have any designated neighbours to interpolate from. You may need to try a different method than average or nearest. On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer wrote: > Dear fieldtrippers, > > I have excluded noisy channels from my data using > > data = ft_rejectvisual(cfg, data); > data = ft_rejectartifact(cfg, data); > > and now want to interpolate them. To do so, I am first defining the > neighbours using a zebris file: > > cfg = []; > cfg.method = 'template'; > cfg.layout = 'EEG1010.lay'; > cfg.feedback = 'yes'; > cfg.elec = ft_read_sens('Maque.sfp'); > neighbours = ft_prepare_neighbours(cfg,data_con); > > With data_con being the data that still has all the channels in it. This > gives me the variable neighbours that does indeed contain the 6 neighbours > for my missing channel. However, when I try to use > > cfg.method = 'average'; > cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; > cfg.neighbours = neighbours; > data = ft_channelrepair(cfg,data); > > I get the following message for each and every trial: trying to > reconstruct missing channel Fp1 - cannot reconstruct channel - no > neighbours in the original data or in the sensor position. > > Does anyone have an idea why this is not working properly? > > Cheers, > Irene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From maity_winky at yahoo.es Wed Mar 16 19:55:00 2016 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Wed, 16 Mar 2016 18:55:00 +0000 (UTC) Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: Message-ID: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best,Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion?Thank you very much in advance.Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Wed Mar 16 20:31:09 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 16 Mar 2016 13:31:09 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: Coincidentally, I just had to remove FP1 from one of my datasets, failed to check my neighbours structure ahead of time despite this conversation, and can confirm that FP1 could not be interpolated for me as well. On Wed, Mar 16, 2016 at 12:40 PM, Max Cantor wrote: > I currently use a neuroscan64 system, with the quickcap64 layout. Just > looking at the layout, it seems like FP1 could be interpolated from FPZ and > AF3, but I'd have to test (or look at my neighbours structure) to see if > this would be the case. Anyway, depending on your setup, it may be the case > that FP1 does not have any designated neighbours to interpolate from. You > may need to try a different method than average or nearest. > > On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer > wrote: > >> Dear fieldtrippers, >> >> I have excluded noisy channels from my data using >> >> data = ft_rejectvisual(cfg, data); >> data = ft_rejectartifact(cfg, data); >> >> and now want to interpolate them. To do so, I am first defining the >> neighbours using a zebris file: >> >> cfg = []; >> cfg.method = 'template'; >> cfg.layout = 'EEG1010.lay'; >> cfg.feedback = 'yes'; >> cfg.elec = ft_read_sens('Maque.sfp'); >> neighbours = ft_prepare_neighbours(cfg,data_con); >> >> With data_con being the data that still has all the channels in it. This >> gives me the variable neighbours that does indeed contain the 6 neighbours >> for my missing channel. However, when I try to use >> >> cfg.method = 'average'; >> cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; >> cfg.neighbours = neighbours; >> data = ft_channelrepair(cfg,data); >> >> I get the following message for each and every trial: trying to >> reconstruct missing channel Fp1 - cannot reconstruct channel - no >> neighbours in the original data or in the sensor position. >> >> Does anyone have an idea why this is not working properly? >> >> Cheers, >> Irene >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Graduate Student > Cognitive Neuroscience of Language Lab > University of Colorado Boulder > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Thu Mar 17 03:47:22 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 16 Mar 2016 22:47:22 -0400 Subject: [FieldTrip] please help, approaching deadline. ft_sourceanalysis line 813 Message-ID: Hi all, I have a pipeline created where at the ft_prepare_leadfield step, the grid.label and cfg.channel fields both exist, But when I run the ft_sourceanalysis, they result as empty matrices--throwing an error. they are both cells {128x1}, but at ft_sourceanalysis result in [ ] here is my code for reference. Sorry for the long post, I am very close to a deadline and would be very grateful for your help. Please scroll below to see section where the error is thrown. *%% parameters list* (just for reference) mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; mritype='MNI'; realign='realigned'; volumereslicing='volumeresliced'; brainthresh=0.5; scalpthresh=0.10; scalpsmooth='scalp_smooth'; scalp_smooth.parameter=9; scalpvertices=1000; skullvertices=1000; brainvertices=1000; meshmethod='projectmesh'; headmodel_method='bemcp'; subjnum='915'; time='pre'; timetype='simple'; gridtype='template10'; beamformer='lcmv'; identifier='Parameter2'; *%% make headmodel* switch mritype case 'MNI' [mri] = ft_read_mri(mrifile); mri.coordsys ='MNI'; case 'Analyze' [mri] = ft_read_mri(mrifile); mri.coordsys ='Analyze'; end *%% realigning* switch realign case 'realigned' cfg=[]; cfg.method='fiducial'; cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; mri_realigned=ft_volumerealign(cfg,mri); save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') case 'notrealigned' %do nothing end *%% volume reslicing* switch volumereslicing case 'volumeresliced' cfg = []; cfg.resolution = 1; mri_resliced = ft_volumereslice(cfg, mri); save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') case 'notresliced' %do nothing end *%% segmentation parameters* switch scalpsmooth case 'noscalpsmooth' cfg = []; cfg.brainthreshold = braintresh; cfg.scalpthreshold = scalpthresh; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); case 'scalp_smooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.scalpsmooth = scalp_smooth.parameter; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); end *%%prepare mesh * cfg = []; cfg.method= meshmethod; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [scalpvertices skullvertices brainvertices]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001; bnd(2).pnt = bnd(2).pnt.*1; bnd(3).pnt = bnd(3).pnt.*0.999; *%% prepare headmodel* switch headmodel_method case 'dipoli' cfg = []; cfg.method = 'dipoli'; case 'bemcp' cfg = []; cfg.method = 'bemcp'; end headmodel = ft_prepare_headmodel(cfg, bnd); headmodel = ft_convert_units(headmodel,'cm'); *%% adding electrodes to headmodel* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') %most likely they are not aligned, so for aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes nas=mri_realigned.cfg.fiducial.nas; lpa=mri_realigned.cfg.fiducial.lpa; rpa=mri_realigned.cfg.fiducial.rpa; *%% load EEG data* i can send these to any ambitiously nice person wanting to try out the script exactly *%% timelock data* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); cfg = []; same = dataM0; same.trial = [dataM0.trial dataM3W.trial]; same.time = [dataM0.time dataM3W.time]; diff = dataM6; diff.trial = [dataM3Bb.trial dataM6.trial]; diff.time = [dataM3Bb.time dataM6.time]; switch timetype case 'simple' timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); case 'hassan' cfg.vartrllength = 2; cfg.covariance = 'yes'; cfg.covariancewindow = [0 .2]; cfg.keeptrials = 'yes'; timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); *%% make sourcemodel* cfg = []; cfg.headmodel = headmodel; cfg.mri=mri; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel.cfg.grid; cfg.grid.nonlinear = 'yes'; cfg.resolution = 10; % resolution of the template grid in mm cfg.moveinward = 1; cfg.grid.unit ='mm'; cfg.inwardshift = 0; cfg.elec = elec; % cfg.headshape=('cortex_5124.surf.gii'); mysourcemodel = ft_prepare_sourcemodel(cfg); *%% make leadfield* switch gridtype case 'individual' cfg = []; cfg.elec = elec; cfg.headmodel = headmodel; cfg.grid =mysourcemodel; % cfg.grid.resolution = 2; %gives me Error using ft_prepare_sourcemodel (line 163) %You cannot specify cfg.grid.resolution and an explicit cfg.grid.xgrid simultaneously cfg.reducerank= 3; cfg.channel = elec.chanpos; cfg.grid.unit = 'cm';% same unit as above, i.e. in cm [grid] = ft_prepare_leadfield(cfg); case 'templatebased' load('standard_sourcemodel3d10mm.mat') cfg = []; cfg.elec = elec; cfg.template = sourcemodel.cfg.grid; cfg.grid=grid; cfg.headmodel = headmodel; cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG cfg.channel = 'all'; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; [grid] = ft_prepare_leadfield(cfg); case 'template10' load('standard_sourcemodel3d10mm.mat') [grid]=sourcemodel.cfg.grid; end *%% run beamformer*-* this step is what gives the error, * switch beamformer case 'lcmv' cfg = []; cfg.method = 'lcmv'; cfg.elec=elec; cfg.lcmv.lambda='5%'; cfg.grid = grid; cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD >>>>>the error is>>> *Subscript indices must either be real positive integers or logicals.Error in beamformer_lcmv (line 168) noise = noise(end);Error in ft_sourceanalysis (line 841)dip(i) = beamformer_lcmv(grid, sens, headmodel, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:});* *I suspect its because in ft_sourceanalysis (line813) [i1, i2] = match_str(cfg.channel, grid.label)* *the result is i1=[] and i2=[]. eventhough when I look up cfg.channel and grid.label in my variables they exist. after running ft_sourceanalysis the cfg.channel field disappeaers. * *%%interpolate* cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri_resliced); sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri_resliced); sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri_resliced); sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri_resliced); sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri_resliced); sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri_resliced); *%%Plot* cfg = []; cfg.method = 'surface'; cfg.funcolormap = 'jet'; % cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg,sourceinterp_diff); ft_sourceplot(cfg,sourceinterp_m0); ft_sourceplot(cfg,sourceinterp_m6); ft_sourceplot(cfg,sourceinterp_m3w); ft_sourceplot(cfg,sourceinterp_m3b); ft_sourceplot(cfg,sourceinterp_same); -------------- next part -------------- An HTML attachment was scrubbed... URL: From gunnar.norrman at biling.su.se Thu Mar 17 08:36:22 2016 From: gunnar.norrman at biling.su.se (Gunnar Norrman) Date: Thu, 17 Mar 2016 07:36:22 +0000 Subject: [FieldTrip] Epoching EEG data after downsampling Message-ID: <1458200183218.67807@biling.su.se> Hello, I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > In ft_redefinetrial (line 222) Subscripted assignment dimension mismatch. Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? Thank you! Best regards, Gunnar Norrman --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Thu Mar 17 09:40:56 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Thu, 17 Mar 2016 09:40:56 +0100 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 15:08:05 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 15:08:05 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir and John, attached you can find the results of the source localizaiton with the FEM head model. Moreover, I also report the correlation of the lead fields for the FEM and concentric spheres models and BEM and concentric spheres model (the latter one using an inwardshift of 6 mm). Unfortunately, I could not produce the correlation trend we expected (I tryed several values of inwardshifts, ranging form 1mm to 10 mm and the plot is of course not identical to the one I posted, but it is qualitatively similar). There must still be something I don't fully get probably, since the correlation between the concentric spheres lead fields and the BEM lead fields is always so low, even close to the center of the head, regardless of the inwardshift value. All considered, I would rather go for a FEM model at least for the moment being. Thanks a lot for your support! Best, Debora On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak wrote: > Dear Debora, > > cfg.moveinward option is useful when your source space is a mesh as it > actually deforms the mesh to push it inwards. When your source space is a > grid you should use cfg.inwardshift to just exclude the points that are > closer than 6 mm to the boundary. It might be a useful exercise for you to > compute the lead fields with concentric spheres and with a BEM for the same > grid and then look at correlations between these lead fields. You should > see that the correlations should be high at depth but might be low for some > points close to the surface. Once you hit the right value of inwardshift > the low correlations should disappear. > > Best, > > Vladimir > > On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri > wrote: > >> Dear Vladimir, >> thanks for your explanation. I tryed to use the option cfg.moveinward in >> ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this >> did not solve the issue. As you can see from the attachment the cortex is >> now partially uncovered. I am not sure I am using this option properly, >> maybe there is a combination of values for cfg.moveinward and >> cfg.inwardshift that works fine. I tryed several, but none of them gave me >> the source localization that I expect. >> I don't know whether the fact that some dipoles fall outside the brain >> matters. For the attached figures I had no dipoles outside the brain, >> whilst for some of the others attempts I had. >> >> I actually found this post on the mailinglist where both you and John >> already pointed out this issue using BEM: >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >> >> Also I don't know whether this link (still under construction/discussion) >> may be of interest in this contex: >> >> >> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >> >> Furthermore, this other page (also under construction), uses the option >> cfg.inwardshift for the template grid to be used in the creation of the >> individual subject's grid, but without an explanation of why the option >> is/should be used: >> >> >> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >> >> In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) >> provided by Fiedltrip, I don't know whether craeting my own template_grid >> using the cfg.inwardshift option would actually fix the problem. I would >> like to perform some further attempts, as soon as I have some time to go >> through the function and understand how this options actually interplay. >> >> Meanwhile, I am still working on producing the results using the FEM head >> model. It is much more time-consuming than the BEM, and maybe that's one of >> the reasons to choose BEM models. As soon as they are ready I will post >> them as well :) >> >> Anyway, thanks so much for your help. It was actually quite useful and >> instructive! >> >> All the best wishes, >> Debora >> >> >> >> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >> litvak.vladimir at gmail.com> wrote: >> >>> Dear Debora, >>> >>> The critical thing with BEMCP is that your sources are not too close to >>> the inner skull boundary. When they are closer than the safe distance the >>> solution you get is completely wrong. When they are not too close, the >>> solution is OK and comparable at least to concentric spheres. The safe >>> distance is is more or less the average edge length in your skull mesh. In >>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>> It would be interesting if you use this option and report whether this >>> resolves your problem. >>> >>> This issue should occur in any BEM but depending on the implementation >>> the critical distance might be shorter. >>> >>> Best, >>> >>> Vladimir >>> >>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri >> > wrote: >>> >>>> Dear John, >>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>> BEM head model first, but going quickly through the studies you have >>>> mentioned and considering the tests you have performed, I may also consider >>>> to switch to the FEM head model or to simply use the concentric spheres >>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>> relatively new to source localization and had no crash/errors in my >>>> pipeline, and this combination makes always difficult to find possible >>>> pitfalls. >>>> >>>> As soon as I have them ready, I will post the results obtained with the >>>> FEM head model as well, maybe they will be useful for some other users :) >>>> >>>> Thanks again for your support! >>>> All the best, >>>> Debora >>>> >>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>> RICHARDS at mailbox.sc.edu> wrote: >>>> >>>>> Deb: >>>>> >>>>> I have had problems with BEMCP. >>>>> >>>>> 1—one of the practical / technical problems is that if the >>>>> compartments overlap, or even come close, then the procedure would not >>>>> work—the ft_sourceanlaysis crashed. >>>>> >>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>> better, >>>>> >>>>> E. g., among three or four studies I have seen. >>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>> >>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>> >>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>> participant-computed realistic models for the compartments and the FEM. >>>>> >>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>> models over the BEMCP, but I suggest looking at the research literature >>>>> formally comparing these methods before going much further with BEMCP. >>>>> >>>>> John >>>>> >>>>> *********************************************** >>>>> John E. Richards Carolina Distinguished Professor >>>>> Department of Psychology >>>>> University of South Carolina >>>>> Columbia, SC 29208 >>>>> Dept Phone: 803 777 2079 >>>>> Fax: 803 777 9558 >>>>> Email: richards-john at sc.edu >>>>> HTTP: jerlab.psych.sc.edu >>>>> *********************************************** >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> Debora Desideri, PhD Student >>>> BNP Lab - Neurology Department >>>> University Hospital Tübingen >>>> Eberhard Karls University Tübingen >>>> Hoppe-Seyler Str. 3 >>>> D-72076 Tübingen >>>> Tel: +49 7071/29 80478 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_FEM_CONCENTRICSPHERES.png Type: image/png Size: 80143 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FEM_SourceResults.png Type: image/png Size: 117351 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_BEM_CONCENTRICSPHERES_inwardshift6mm.png Type: image/png Size: 124166 bytes Desc: not available URL: From litvak.vladimir at gmail.com Thu Mar 17 15:21:26 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 17 Mar 2016 14:21:26 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: What about correlations between local spheres and the FEM? If it's only the BEM that's broken I'd expect that you should get decent values for those. Your plots don't look so good. I did something similar a couple of years ago and got much better results. Perhaps it'd be a good idea to re-check the BEM again. Vladimir On Thu, Mar 17, 2016 at 2:08 PM, Debora Desideri wrote: > Dear Vladimir and John, > attached you can find the results of the source localizaiton with the FEM > head model. Moreover, I also report the correlation of the lead fields for > the FEM and concentric spheres models and BEM and concentric spheres model > (the latter one using an inwardshift of 6 mm). Unfortunately, I could not > produce the correlation trend we expected (I tryed several values of > inwardshifts, ranging form 1mm to 10 mm and the plot is of course not > identical to the one I posted, but it is qualitatively similar). > There must still be something I don't fully get probably, since the > correlation between the concentric spheres lead fields and the BEM lead > fields is always so low, even close to the center of the head, regardless > of the inwardshift value. > > All considered, I would rather go for a FEM model at least for the moment > being. > Thanks a lot for your support! > > Best, > Debora > > > > > On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak < > litvak.vladimir at gmail.com> wrote: > >> Dear Debora, >> >> cfg.moveinward option is useful when your source space is a mesh as it >> actually deforms the mesh to push it inwards. When your source space is a >> grid you should use cfg.inwardshift to just exclude the points that are >> closer than 6 mm to the boundary. It might be a useful exercise for you to >> compute the lead fields with concentric spheres and with a BEM for the same >> grid and then look at correlations between these lead fields. You should >> see that the correlations should be high at depth but might be low for some >> points close to the surface. Once you hit the right value of inwardshift >> the low correlations should disappear. >> >> Best, >> >> Vladimir >> >> On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri > > wrote: >> >>> Dear Vladimir, >>> thanks for your explanation. I tryed to use the option cfg.moveinward in >>> ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this >>> did not solve the issue. As you can see from the attachment the cortex is >>> now partially uncovered. I am not sure I am using this option properly, >>> maybe there is a combination of values for cfg.moveinward and >>> cfg.inwardshift that works fine. I tryed several, but none of them gave me >>> the source localization that I expect. >>> I don't know whether the fact that some dipoles fall outside the brain >>> matters. For the attached figures I had no dipoles outside the brain, >>> whilst for some of the others attempts I had. >>> >>> I actually found this post on the mailinglist where both you and John >>> already pointed out this issue using BEM: >>> >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >>> >>> Also I don't know whether this link (still under >>> construction/discussion) may be of interest in this contex: >>> >>> >>> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >>> >>> Furthermore, this other page (also under construction), uses the option >>> cfg.inwardshift for the template grid to be used in the creation of the >>> individual subject's grid, but without an explanation of why the option >>> is/should be used: >>> >>> >>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >>> >>> In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) >>> provided by Fiedltrip, I don't know whether craeting my own template_grid >>> using the cfg.inwardshift option would actually fix the problem. I would >>> like to perform some further attempts, as soon as I have some time to go >>> through the function and understand how this options actually interplay. >>> >>> Meanwhile, I am still working on producing the results using the FEM >>> head model. It is much more time-consuming than the BEM, and maybe that's >>> one of the reasons to choose BEM models. As soon as they are ready I will >>> post them as well :) >>> >>> Anyway, thanks so much for your help. It was actually quite useful and >>> instructive! >>> >>> All the best wishes, >>> Debora >>> >>> >>> >>> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >>> litvak.vladimir at gmail.com> wrote: >>> >>>> Dear Debora, >>>> >>>> The critical thing with BEMCP is that your sources are not too close to >>>> the inner skull boundary. When they are closer than the safe distance the >>>> solution you get is completely wrong. When they are not too close, the >>>> solution is OK and comparable at least to concentric spheres. The safe >>>> distance is is more or less the average edge length in your skull mesh. In >>>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>>> It would be interesting if you use this option and report whether this >>>> resolves your problem. >>>> >>>> This issue should occur in any BEM but depending on the implementation >>>> the critical distance might be shorter. >>>> >>>> Best, >>>> >>>> Vladimir >>>> >>>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri < >>>> deb.desideri at gmail.com> wrote: >>>> >>>>> Dear John, >>>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>>> BEM head model first, but going quickly through the studies you have >>>>> mentioned and considering the tests you have performed, I may also consider >>>>> to switch to the FEM head model or to simply use the concentric spheres >>>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>>> relatively new to source localization and had no crash/errors in my >>>>> pipeline, and this combination makes always difficult to find possible >>>>> pitfalls. >>>>> >>>>> As soon as I have them ready, I will post the results obtained with >>>>> the FEM head model as well, maybe they will be useful for some other users >>>>> :) >>>>> >>>>> Thanks again for your support! >>>>> All the best, >>>>> Debora >>>>> >>>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>>> RICHARDS at mailbox.sc.edu> wrote: >>>>> >>>>>> Deb: >>>>>> >>>>>> I have had problems with BEMCP. >>>>>> >>>>>> 1—one of the practical / technical problems is that if the >>>>>> compartments overlap, or even come close, then the procedure would not >>>>>> work—the ft_sourceanlaysis crashed. >>>>>> >>>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>>> better, >>>>>> >>>>>> E. g., among three or four studies I have seen. >>>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>>> >>>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>>> >>>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>>> participant-computed realistic models for the compartments and the FEM. >>>>>> >>>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>>> models over the BEMCP, but I suggest looking at the research literature >>>>>> formally comparing these methods before going much further with BEMCP. >>>>>> >>>>>> John >>>>>> >>>>>> *********************************************** >>>>>> John E. Richards Carolina Distinguished Professor >>>>>> Department of Psychology >>>>>> University of South Carolina >>>>>> Columbia, SC 29208 >>>>>> Dept Phone: 803 777 2079 >>>>>> Fax: 803 777 9558 >>>>>> Email: richards-john at sc.edu >>>>>> HTTP: jerlab.psych.sc.edu >>>>>> *********************************************** >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Debora Desideri, PhD Student >>>>> BNP Lab - Neurology Department >>>>> University Hospital Tübingen >>>>> Eberhard Karls University Tübingen >>>>> Hoppe-Seyler Str. 3 >>>>> D-72076 Tübingen >>>>> Tel: +49 7071/29 80478 >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> >>> -- >>> >>> Debora Desideri, PhD Student >>> BNP Lab - Neurology Department >>> University Hospital Tübingen >>> Eberhard Karls University Tübingen >>> Hoppe-Seyler Str. 3 >>> D-72076 Tübingen >>> Tel: +49 7071/29 80478 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 15:46:46 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 15:46:46 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir, The correlation between concentric spheres and FEM (attached) it is not so bad I think. There are quite "low" (ca. 0.4-0.5) correlaiton values closer to the surface, but it is close enough to our expectations. I used concentric spheres because I am working with EEG data, isn't the local spheres method only for MEG? I am also surprised that the correlaiton between BEM and concentric spheres lead fields is so bad. It almost looks random... Best, Debora On Thu, Mar 17, 2016 at 3:21 PM, Vladimir Litvak wrote: > What about correlations between local spheres and the FEM? If it's only > the BEM that's broken I'd expect that you should get decent values for > those. Your plots don't look so good. I did something similar a couple of > years ago and got much better results. Perhaps it'd be a good idea to > re-check the BEM again. > > Vladimir > > On Thu, Mar 17, 2016 at 2:08 PM, Debora Desideri > wrote: > >> Dear Vladimir and John, >> attached you can find the results of the source localizaiton with the FEM >> head model. Moreover, I also report the correlation of the lead fields for >> the FEM and concentric spheres models and BEM and concentric spheres model >> (the latter one using an inwardshift of 6 mm). Unfortunately, I could not >> produce the correlation trend we expected (I tryed several values of >> inwardshifts, ranging form 1mm to 10 mm and the plot is of course not >> identical to the one I posted, but it is qualitatively similar). >> There must still be something I don't fully get probably, since the >> correlation between the concentric spheres lead fields and the BEM lead >> fields is always so low, even close to the center of the head, regardless >> of the inwardshift value. >> >> All considered, I would rather go for a FEM model at least for the moment >> being. >> Thanks a lot for your support! >> >> Best, >> Debora >> >> >> >> >> On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak < >> litvak.vladimir at gmail.com> wrote: >> >>> Dear Debora, >>> >>> cfg.moveinward option is useful when your source space is a mesh as it >>> actually deforms the mesh to push it inwards. When your source space is a >>> grid you should use cfg.inwardshift to just exclude the points that are >>> closer than 6 mm to the boundary. It might be a useful exercise for you to >>> compute the lead fields with concentric spheres and with a BEM for the same >>> grid and then look at correlations between these lead fields. You should >>> see that the correlations should be high at depth but might be low for some >>> points close to the surface. Once you hit the right value of inwardshift >>> the low correlations should disappear. >>> >>> Best, >>> >>> Vladimir >>> >>> On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri < >>> deb.desideri at gmail.com> wrote: >>> >>>> Dear Vladimir, >>>> thanks for your explanation. I tryed to use the option cfg.moveinward >>>> in ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but >>>> this did not solve the issue. As you can see from the attachment the cortex >>>> is now partially uncovered. I am not sure I am using this option properly, >>>> maybe there is a combination of values for cfg.moveinward and >>>> cfg.inwardshift that works fine. I tryed several, but none of them gave me >>>> the source localization that I expect. >>>> I don't know whether the fact that some dipoles fall outside the brain >>>> matters. For the attached figures I had no dipoles outside the brain, >>>> whilst for some of the others attempts I had. >>>> >>>> I actually found this post on the mailinglist where both you and John >>>> already pointed out this issue using BEM: >>>> >>>> >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >>>> >>>> Also I don't know whether this link (still under >>>> construction/discussion) may be of interest in this contex: >>>> >>>> >>>> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >>>> >>>> Furthermore, this other page (also under construction), uses the option >>>> cfg.inwardshift for the template grid to be used in the creation of the >>>> individual subject's grid, but without an explanation of why the option >>>> is/should be used: >>>> >>>> >>>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >>>> >>>> In ft_prepare_sourcemodel I am using the standard grid (6 mm >>>> resolution) provided by Fiedltrip, I don't know whether craeting my own >>>> template_grid using the cfg.inwardshift option would actually fix the >>>> problem. I would like to perform some further attempts, as soon as I have >>>> some time to go through the function and understand how this options >>>> actually interplay. >>>> >>>> Meanwhile, I am still working on producing the results using the FEM >>>> head model. It is much more time-consuming than the BEM, and maybe that's >>>> one of the reasons to choose BEM models. As soon as they are ready I will >>>> post them as well :) >>>> >>>> Anyway, thanks so much for your help. It was actually quite useful and >>>> instructive! >>>> >>>> All the best wishes, >>>> Debora >>>> >>>> >>>> >>>> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >>>> litvak.vladimir at gmail.com> wrote: >>>> >>>>> Dear Debora, >>>>> >>>>> The critical thing with BEMCP is that your sources are not too close >>>>> to the inner skull boundary. When they are closer than the safe distance >>>>> the solution you get is completely wrong. When they are not too close, the >>>>> solution is OK and comparable at least to concentric spheres. The safe >>>>> distance is is more or less the average edge length in your skull mesh. In >>>>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>>>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>>>> It would be interesting if you use this option and report whether this >>>>> resolves your problem. >>>>> >>>>> This issue should occur in any BEM but depending on the implementation >>>>> the critical distance might be shorter. >>>>> >>>>> Best, >>>>> >>>>> Vladimir >>>>> >>>>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri < >>>>> deb.desideri at gmail.com> wrote: >>>>> >>>>>> Dear John, >>>>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>>>> BEM head model first, but going quickly through the studies you have >>>>>> mentioned and considering the tests you have performed, I may also consider >>>>>> to switch to the FEM head model or to simply use the concentric spheres >>>>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>>>> relatively new to source localization and had no crash/errors in my >>>>>> pipeline, and this combination makes always difficult to find possible >>>>>> pitfalls. >>>>>> >>>>>> As soon as I have them ready, I will post the results obtained with >>>>>> the FEM head model as well, maybe they will be useful for some other users >>>>>> :) >>>>>> >>>>>> Thanks again for your support! >>>>>> All the best, >>>>>> Debora >>>>>> >>>>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>>>> RICHARDS at mailbox.sc.edu> wrote: >>>>>> >>>>>>> Deb: >>>>>>> >>>>>>> I have had problems with BEMCP. >>>>>>> >>>>>>> 1—one of the practical / technical problems is that if the >>>>>>> compartments overlap, or even come close, then the procedure would not >>>>>>> work—the ft_sourceanlaysis crashed. >>>>>>> >>>>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>>>> better, >>>>>>> >>>>>>> E. g., among three or four studies I have seen. >>>>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>>>> >>>>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>>>> >>>>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>>>> participant-computed realistic models for the compartments and the FEM. >>>>>>> >>>>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>>>> models over the BEMCP, but I suggest looking at the research literature >>>>>>> formally comparing these methods before going much further with BEMCP. >>>>>>> >>>>>>> John >>>>>>> >>>>>>> *********************************************** >>>>>>> John E. Richards Carolina Distinguished Professor >>>>>>> Department of Psychology >>>>>>> University of South Carolina >>>>>>> Columbia, SC 29208 >>>>>>> Dept Phone: 803 777 2079 >>>>>>> Fax: 803 777 9558 >>>>>>> Email: richards-john at sc.edu >>>>>>> HTTP: jerlab.psych.sc.edu >>>>>>> *********************************************** >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> Debora Desideri, PhD Student >>>>>> BNP Lab - Neurology Department >>>>>> University Hospital Tübingen >>>>>> Eberhard Karls University Tübingen >>>>>> Hoppe-Seyler Str. 3 >>>>>> D-72076 Tübingen >>>>>> Tel: +49 7071/29 80478 >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> Debora Desideri, PhD Student >>>> BNP Lab - Neurology Department >>>> University Hospital Tübingen >>>> Eberhard Karls University Tübingen >>>> Hoppe-Seyler Str. 3 >>>> D-72076 Tübingen >>>> Tel: +49 7071/29 80478 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_FEM_CONCENTRICSPHERES.png Type: image/png Size: 80143 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Thu Mar 17 15:57:47 2016 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Thu, 17 Mar 2016 14:57:47 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> "The correlation between concentric spheres and FEM (attached) it is not so bad” . I am not sure what you are correlating. Is this over the time of a beamformer model, or over participants with a single-time model? In either case, I think the correlations for the FEM-Concentric spheres are bad, many are less < 0.8, and a number are in the range from .9 to .95. This result confirms the difference in the FEM and concentric-sphere models. These are exacerbated even further when you use a subject-specific realistic FEM model and a concentric spheres model. The results between the BEMCP and concentric spheres suggests that the BEMCP model is not working. Most of the correlations should be positive. I have not used correlations as you have, but have done ROIs in an individual, and correlated the values of the ROIs over the head for one subject, or multiple subjects. I find higher correlations for the BEMCP and Concentric sphere models, than between either of these and a FEM model. However, in my case I am not using the standard model from FT, but using subject-specific BEMCP, concentric spheres, and FEM models. If the FEM model is working for you, why not use it? John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 16:13:35 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 16:13:35 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> References: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> Message-ID: Dear John, what I am correlating are the lead field produced using subject-specific realistic FEM head model or BEM head model and concentric spheres head model. As Vladimir suggested, this should help me to find the proper inward shift to apply in order to achieve good results with the BEM model. Unfortunately, the BEM model still seems not to work properly. Anyway, given the results of the latest attempts, I will definitely use the FEM model for my analysis, even if it is takes much longer to create the head model and lead fields. Thanks again! Best, Debora On Thu, Mar 17, 2016 at 3:57 PM, RICHARDS, JOHN wrote: > "The correlation between concentric spheres and FEM (attached) it is not > so bad” . I am not sure what you are correlating. Is this over the time of > a beamformer model, or over participants with a single-time model? In > either case, I think the correlations for the FEM-Concentric spheres are > bad, many are less < 0.8, and a number are in the range from .9 to .95. > > This result confirms the difference in the FEM and concentric-sphere > models. These are exacerbated even further when you use a > subject-specific realistic FEM model and a concentric spheres model. > > The results between the BEMCP and concentric spheres suggests that the > BEMCP model is not working. Most of the correlations should be positive. > I have not used correlations as you have, but have done ROIs in an > individual, and correlated the values of the ROIs over the head for one > subject, or multiple subjects. I find higher correlations for the BEMCP > and Concentric sphere models, than between either of these and a FEM > model. However, in my case I am not using the standard model from FT, but > using subject-specific BEMCP, concentric spheres, and FEM models. > > If the FEM model is working for you, why not use it? > > John > > *********************************************** > John E. Richards Carolina Distinguished Professor > Department of Psychology > University of South Carolina > Columbia, SC 29208 > Dept Phone: 803 777 2079 > Fax: 803 777 9558 > Email: richards-john at sc.edu > HTTP: jerlab.psych.sc.edu > *********************************************** > > > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Thu Mar 17 15:55:37 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Thu, 17 Mar 2016 15:55:37 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards, Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > Hi Federica, > > If you have access to BESA, you could import txt files and export them as > edf. > > Best, > Maite > > > El Miércoles 16 de marzo de 2016 18:57, Federica Mauro < > federica.ma at gmail.com> escribió: > > > Dear all, > I'm trying to convert txt files of web recordings in the edf format, but I > didn't find a any useful solution until now. > Do you have any suggestion? > Thank you very much in advance. > Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 joseluisblues at gmail.com Thu Mar 17 20:03:41 2016 From: joseluisblues at gmail.com (Jose) Date: Thu, 17 Mar 2016 20:03:41 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel Message-ID: dear list, There might be an error in the beamformer tutorial ( http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead field and the sources, *cfg.vol* rather than *cfg.headmodel *has to be defined to determine the headmodel. Thanks for corroborating this. -- José -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Thu Mar 17 21:20:12 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Thu, 17 Mar 2016 14:20:12 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: Ya, in the past I used an equidistant cap so it was never an issue to interpolate so long as multiple neighboring channels did not all need to be interpolated. Otherwise I don't see a way around it besides using a different method such as spline. On Thursday, March 17, 2016, Irene Sophia Mayer wrote: > My problem now is that I have the neighbours structure, including the > neighbours for 'Fp1', in the form of just a list stating the neighbours. > Still, it says that there are no neighbours. I will try to use a different > method than 'average' or 'nearest' but I'm not completely happy with > that... > > *Gesendet:* Mittwoch, 16. März 2016 um 20:31 Uhr > *Von:* "Max Cantor" > *An:* "FieldTrip discussion list" > > *Betreff:* Re: [FieldTrip] Events in databrowser > Coincidentally, I just had to remove FP1 from one of my datasets, failed > to check my neighbours structure ahead of time despite this conversation, > and can confirm that FP1 could not be interpolated for me as well. > > On Wed, Mar 16, 2016 at 12:40 PM, Max Cantor > wrote: >> >> I currently use a neuroscan64 system, with the quickcap64 layout. Just >> looking at the layout, it seems like FP1 could be interpolated from FPZ and >> AF3, but I'd have to test (or look at my neighbours structure) to see if >> this would be the case. Anyway, depending on your setup, it may be the case >> that FP1 does not have any designated neighbours to interpolate from. You >> may need to try a different method than average or nearest. >> >> On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer >> wrote: >> >>> Dear fieldtrippers, >>> >>> I have excluded noisy channels from my data using >>> >>> data = ft_rejectvisual(cfg, data); >>> data = ft_rejectartifact(cfg, data); >>> >>> and now want to interpolate them. To do so, I am first defining the >>> neighbours using a zebris file: >>> >>> cfg = []; >>> cfg.method = 'template'; >>> cfg.layout = 'EEG1010.lay'; >>> cfg.feedback = 'yes'; >>> cfg.elec = ft_read_sens('Maque.sfp'); >>> neighbours = ft_prepare_neighbours(cfg,data_con); >>> >>> With data_con being the data that still has all the channels in it. This >>> gives me the variable neighbours that does indeed contain the 6 neighbours >>> for my missing channel. However, when I try to use >>> >>> cfg.method = 'average'; >>> cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; >>> cfg.neighbours = neighbours; >>> data = ft_channelrepair(cfg,data); >>> >>> I get the following message for each and every trial: trying to >>> reconstruct missing channel Fp1 - cannot reconstruct channel - no >>> neighbours in the original data or in the sensor position. >>> >>> Does anyone have an idea why this is not working properly? >>> >>> Cheers, >>> Irene >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Max Cantor >> Graduate Student >> Cognitive Neuroscience of Language Lab >> University of Colorado Boulder >> > > > -- > Max Cantor > Graduate Student > Cognitive Neuroscience of Language Lab > University of Colorado Boulder > _______________________________________________ fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 18 08:36:18 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:36:18 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel In-Reply-To: References: Message-ID: Hi José The option cfg.vol (for “volume conduction model”) has been replaced by cfg.headmodel for quite some time (probably more than a year ago). The code is backward compatible, so cfg.vol will also still work, but the documentation reflects the current standard. I suggest you update your copy of FieldTrip to a more recent version. best regards, Robert On 17 Mar 2016, at 20:03, Jose wrote: > dear list, > > There might be an error in the beamformer tutorial (http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead field and the sources, cfg.vol rather than cfg.headmodel has to be defined to determine the headmodel. Thanks for corroborating this. > > -- > José > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 18 08:38:29 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:38:29 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> Hi Frederica, Please look at the FAQ How can I convert one dataformat into an other? best regards, Robert On 17 Mar 2016, at 15:55, Federica Mauro wrote: > Hi Maité, > > thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. > > Best regards, > Federica > > 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > Hi Federica, > > If you have access to BESA, you could import txt files and export them as edf. > > Best, > Maite > > > El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: > > > Dear all, > I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. > Do you have any suggestion? > Thank you very much in advance. > Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 r.oostenveld at donders.ru.nl Fri Mar 18 08:50:11 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:50:11 +0100 Subject: [FieldTrip] Epoching EEG data after downsampling In-Reply-To: <1458200183218.67807@biling.su.se> References: <1458200183218.67807@biling.su.se> Message-ID: Hi Gunnar, This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. cfg = [] cfg = … data_old = ft_preprocessing(cfg) data_old.label{end+1} = ‘sample’; for i=1:size(data_old.sampleinfo,1) % this works for one or more trials data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); end cfg = [] cfg = … data_new = ft_resampledata(cfg, data_old); The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. best regards, Robert On 17 Mar 2016, at 08:36, Gunnar Norrman wrote: > Hello, > > I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > > > In ft_redefinetrial (line 222) > Subscripted assignment dimension mismatch. > > Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. > > Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? > > Thank you! > > Best regards, > Gunnar Norrman > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Fri Mar 18 08:57:35 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Fri, 18 Mar 2016 07:57:35 +0000 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: <87DBECC2-4595-4D21-AA68-2C6E01A80108@cfin.au.dk> Dear Federica, To write EDF format, have you tried looking info the “swrite” function from the Biosig toolbox? http://biosig.sourceforge.net You should be able to import your text files directly into Matlab. If they are raw files with no header, simply “load -ascii filename.txt” should work. If there’s a header, you can try Matlab’s built-in tools like “uiimport” or “textread”. Cheers, Sarang On 17 Mar 2016, at 15:55, Federica Mauro > wrote: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards, Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García >: Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best, Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro > escribió: Dear all, I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion? Thank you very much in advance. Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 sarang at cfin.au.dk Fri Mar 18 11:53:08 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Fri, 18 Mar 2016 10:53:08 +0000 Subject: [FieldTrip] Postdoc/PhD positions for cortical/retinal oscillation project (Aarhus University, Denmark) In-Reply-To: <9747D2C1-584B-4665-8AEF-D4E62D8F7A74@CFIN.AU.DK> References: <9747D2C1-584B-4665-8AEF-D4E62D8F7A74@CFIN.AU.DK> Message-ID: <25362234-33E5-479A-BE81-73E09411E04E@cfin.au.dk> The Neuroelectromagnetic Oscillations (NEMO) Lab, directed by Sarang Dalal and recently relocated to Aarhus University (Denmark), is recruiting postdocs and PhD students for a large ERC-funded project. The ERC project will examine in detail how neural oscillations communicate information between the retina and cerebral cortex in humans, during presentation of various types of visual stimuli as well as during rest. This will involve several recording techniques, primarily magnetoencephalography (MEG) and electroretinography (ERG), with some components involving scalp EEG, intracranial EEG in epilepsy patients, and transcranial magnetic stimulation (TMS). Our group is part of the Center of Functionally Integrative Neuroscience at Aarhus University, which hosts lab facilities for these techniques, as well as MRI and PET. The working language of the research group and center is English. Qualified applicants will have a background in neuroimaging, systems/cognitive neuroscience, neural signal processing, retinal electrophysiology, or related fields. Start dates can be between summer 2016 and spring 2018, with an initial appointment of 2-3 years (postdoc) or 3 years (PhD student). Applications will be accepted until all positions are filled. For more details, please get in touch with Sarang: sarang at cfin.au.dk . Please feel free to forward to anybody who might be interested! From gunnar.norrman at biling.su.se Fri Mar 18 15:17:51 2016 From: gunnar.norrman at biling.su.se (Gunnar Norrman) Date: Fri, 18 Mar 2016 14:17:51 +0000 Subject: [FieldTrip] Epoching EEG data after downsampling In-Reply-To: References: <1458200183218.67807@biling.su.se>, Message-ID: <1458310671610.29705@biling.su.se> Thank you, Robert, this looks like a nice solution, I will try it out! Best, Gunnar --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Robert Oostenveld Sent: Friday, March 18, 2016 08:50 To: FieldTrip discussion list Subject: Re: [FieldTrip] Epoching EEG data after downsampling Hi Gunnar, This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. cfg = [] cfg = ... data_old = ft_preprocessing(cfg) data_old.label{end+1} = 'sample'; for i=1:size(data_old.sampleinfo,1) % this works for one or more trials data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); end cfg = [] cfg = ... data_new = ft_resampledata(cfg, data_old); The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. best regards, Robert On 17 Mar 2016, at 08:36, Gunnar Norrman > wrote: Hello, I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > In ft_redefinetrial (line 222) Subscripted assignment dimension mismatch. Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? Thank you! Best regards, Gunnar Norrman --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From paolo.belardinelli at gmail.com Fri Mar 18 15:35:54 2016 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 18 Mar 2016 15:35:54 +0100 Subject: [FieldTrip] Problem with Template Model for Source Reconstruction In-Reply-To: <56C58A7A.9000207@uni-konstanz.de> References: <56C58A7A.9000207@uni-konstanz.de> Message-ID: Dear Britta, I was deeply involved in the processing and I forgot to update this post. Thank you: it worked out! Eliminating the bias from MRI images (using light/very light regularization) leads to more accurate grids and correct results. Best, Paolo On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < britta.westner at uni-konstanz.de> wrote: > Dear Paolo, > > I experienced similar problems and found that correcting the field bias in > the participant's MRI (e.g. doing a "bias correction" with SPM) can help. > My explanation would be that the field bias either leads to small > inaccuracies in the segmentation and volume which then "get visible" when > warping the grid based on the non-segmented MRI, or that the warping > algorithm itself is affected by this bias. Maybe you can give that a try! > > Hope this helps, > Britta > > > > > Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: > > Dear Fieldtrippers, > we are encountering a problem with a template model for source > reconstruction. In particular, we are warping (non linearly) a template > grid to the individual subject's MRI. > Doing that, it appears that the very top of the brain is not fully covered > by dipole locations. > We found that this issue has been already reported: > > http://www.fieldtriptoolbox.org/template/sourcemodel > > Apparently, since March 7th 2013, this issue has been fixed. > However we are using August 28th 2015 Fieldtrip version and we are still > dealing with the same issue. > Any suggestions? > Here are our code lines: > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 6; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri_spm; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > sourcemodel = ft_prepare_sourcemodel(cfg); > > Thank you in advance. > > Paolo > > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Britta Westner, M.Sc. > Neuroelectromagnetic Oscillations Laboratory > > Fachbereich Psychologie > Universität Konstanz > Postfach 905 > 78457 Konstanz > > Telefon: +49-(0)7531-88-5703 > Fax: +49-(0)7531-88-5709 > www.psychologie.uni-konstanz.de/nemo-lab > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Paolo Belardinelli, PhD Neurology Department University Hospital Tuebingen Eberhard Karls University Tuebingen Hoppe-Seyler Str. 3 D-72076 Tuebingen Tel: +49 7071 / 29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Fri Mar 18 16:12:01 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Fri, 18 Mar 2016 16:12:01 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> Message-ID: Dear Sarang and Robert, thank you for youe suggestions. I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. Namely, when I try to construct the header with hdr = ft_fetch_header(data) it says: Error using ft_checkdata (line 464) This function requires raw data as input. Error in ft_fetch_header (line 32) data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes'); Thank you again for any suggestion. Cheers, Federica 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > Hi Frederica, > > Please look at the FAQ How can I convert one dataformat into an other? > > > best regards, > Robert > > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > Hi Maité, > > thank you for the suggestion. I don't have the access to BESA now, so I > wished I could work it out with Matlab and related toolboxes. > > Best regards, > Federica > > 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > >> Hi Federica, >> >> If you have access to BESA, you could import txt files and export them as >> edf. >> >> Best, >> Maite >> >> >> El Miércoles 16 de marzo de 2016 18:57, Federica Mauro < >> federica.ma at gmail.com> escribió: >> >> >> Dear all, >> I'm trying to convert txt files of web recordings in the edf format, but >> I didn't find a any useful solution until now. >> Do you have any suggestion? >> Thank you very much in advance. >> Bests, >> Federica >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 olga.v.sysoeva at gmail.com Fri Mar 18 16:29:10 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Fri, 18 Mar 2016 18:29:10 +0300 Subject: [FieldTrip] source grand average problem Message-ID: Dear FieldTrippers, I face the problem with source grand average. I use data after volumenormalization, but sourcegrandaverage function report that input files are vary in inside field? Why it might be the case? Best Regards, Olga Sysoeva. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maity_winky at yahoo.es Fri Mar 18 16:48:33 2016 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Fri, 18 Mar 2016 15:48:33 +0000 (UTC) Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: Message-ID: <484823217.1695076.1458316113761.JavaMail.yahoo@mail.yahoo.com> Hi Federica, when you open the .txt file in notepad, does it have any additional information apart from numeric values? If yes, then you should try another Matlab function for importing the data. If not, then you should find out relevant information, such as sampling rate, time, the labels of the channels, the number of trials, etc. Then, you could build your own data structure inside Matlab and save this file as edf with Fieldtrip. El Viernes 18 de marzo de 2016 16:33, Federica Mauro escribió: Dear Sarang and Robert, thank you for youe suggestions. I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. Namely, when I try to construct the header with hdr = ft_fetch_header(data) it says: Error using ft_checkdata (line 464) This function requires raw data as input. Error in ft_fetch_header (line 32) data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes'); Thank you again for any suggestion. Cheers, Federica 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : Hi Frederica, Please look at the FAQ How can I convert one dataformat into an other? best regards,Robert On 17 Mar 2016, at 15:55, Federica Mauro wrote: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards,Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García : Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best,Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion?Thank you very much in advance.Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From fosco.bernasconi at gmail.com Fri Mar 18 16:49:33 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Fri, 18 Mar 2016 16:49:33 +0100 Subject: [FieldTrip] Error in ft_sourceinterpolate Message-ID: Dear all, I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate: * Reference to non-existent field 'avg'.Error in getsubfield (line 45) s = s.(t{k});Error in ft_sourceinterpolate (line 209) if ~iscell(getsubfield(functional, cfg.parameter{i}))* If I check my source structure I do have the avg field. source = freq: 10 cumtapcnt: [157x1 double] dim: [18 21 18] inside: [6804x1 logical] pos: [6804x3 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] Any suggestion? Thank you for your help! Best, fosco here the rest of my code: load('standard_bem.mat'); load('standard_sourcemodel3d10mm.mat'); templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; template_mri = ft_read_mri(templatefile); template_mri = ft_convert_units(template_mri,'mm'); template_mri.coordsys = 'spm'; cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = template_mri; sourcemodel = ft_prepare_sourcemodel(cfg,freq); sourcemodel = ft_convert_units(sourcemodel,'mm'); cfg = []; cfg.elec = sens; cfg.channel = sens.label; cfg.headmodel = vol; cfg.grid = sourcemodel; cfg.grid.unit = 'mm';% same unit as above, i.e. in cm lf = ft_prepare_leadfield(cfg,freq); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft{1,1}); % compute source reconstruction cfg = []; cfg.frequency = freq.freq; cfg.method = 'pcc'; cfg.grid = lf; cfg.headmodel = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); % and provide mni template source_proj.dim = sourcemodel.dim; source_proj.pos = sourcemodel.pos; cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.nai'; source_int = ft_sourceinterpolate(cfg,source,template_mri); -------------- next part -------------- An HTML attachment was scrubbed... URL: From gina.joue at univr.it Fri Mar 18 19:08:42 2016 From: gina.joue at univr.it (gj) Date: Fri, 18 Mar 2016 19:08:42 +0100 Subject: [FieldTrip] import own format (long trials) In-Reply-To: <56E9A0EE.3060006@univr.it> References: <56E9A0EE.3060006@univr.it> Message-ID: <56EC442A.50605@univr.it> In case anyone else is having the same problem, my mistake was how I set "data.time". According to the FT Wiki, "data.time" should be a "cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1*Nsamples vector" but it should be in seconds and I had specified it in number of samples instead, which triggered the error Error using ft_specest_mtmfft (line 96) "the padding that you specified is shorter than the data On 16/03/16 19:07, gj wrote: > Hi, > > I am trying to import EEG data preprocessed and averaged in BrainVision > Analyzer. I have a 2-second segment of data per condition per subject > which corresponds to the averaged signal across all trials of each > condition for the subject. > > Is the following approach correct? > > Import the 4 conditions as 4 long trials (2 sec or 2000 samples with > sampling freq of 1000 Hz) > => data.trial is a 1x4 cell array > and each cell array contains an nchan x 2000 matrix > > I am trying to fill in the other fields of the data structure to mimic > FieldTrip's raw data but I think I am having problems with > data.sampleinfo > which, if I understand correctly, needs to be specified for long trials. > > According to the wiki, this should be an array containing [startsample > endsample] to specify the position of each trial, with info for each > trial on every row. However, it doesn't seem right to have > data.sampleinfo = repmat([1 2000],4,1) > > Thanks in advance for any help! > Gina From hibafouani123 at hotmail.com Sun Mar 20 13:29:43 2016 From: hibafouani123 at hotmail.com (hiba fouani) Date: Sun, 20 Mar 2016 12:29:43 +0000 Subject: [FieldTrip] Mechanical localization In-Reply-To: References: Message-ID: Dear Fieldtripper, Is there a tool for localized the mechanical activity in another word does there is a mechanical forward problem and mechanical inverse problem? thank you Hiba > From: fieldtrip-request at science.ru.nl > Subject: fieldtrip Digest, Vol 64, Issue 25 > To: fieldtrip at science.ru.nl > Date: Sat, 19 Mar 2016 12:00:02 +0100 > > 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. Re: Epoching EEG data after downsampling (Gunnar Norrman) > 2. Re: Problem with Template Model for Source Reconstruction > (Paolo Belardinelli) > 3. Re: EEG txt files conversion to .Edf (Federica Mauro) > 4. source grand average problem (Olga Sysoeva) > 5. Re: EEG txt files conversion to .Edf (Mait? Crespo Garc?a) > 6. Error in ft_sourceinterpolate (fosco bernasconi) > 7. Re: import own format (long trials) (gj) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Mar 2016 14:17:51 +0000 > From: Gunnar Norrman > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Epoching EEG data after downsampling > Message-ID: <1458310671610.29705 at biling.su.se> > Content-Type: text/plain; charset="iso-8859-1" > > Thank you, Robert, this looks like a nice solution, I will try it out! > > > Best, > > Gunnar > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > ________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of Robert Oostenveld > Sent: Friday, March 18, 2016 08:50 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Epoching EEG data after downsampling > > Hi Gunnar, > > This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. > > However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. > > cfg = [] > cfg = ... > data_old = ft_preprocessing(cfg) > > data_old.label{end+1} = 'sample'; > for i=1:size(data_old.sampleinfo,1) > % this works for one or more trials > data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); > end > > cfg = [] > cfg = ... > data_new = ft_resampledata(cfg, data_old); > > The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. > > best regards, > Robert > > > > > On 17 Mar 2016, at 08:36, Gunnar Norrman > wrote: > > Hello, > > I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > > > In ft_redefinetrial (line 222) > Subscripted assignment dimension mismatch. > > Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. > > Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? > > Thank you! > > Best regards, > Gunnar Norrman > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Fri, 18 Mar 2016 15:35:54 +0100 > From: Paolo Belardinelli > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Template Model for Source > Reconstruction > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Britta, > I was deeply involved in the processing and I forgot to update this post. > Thank you: it worked out! > Eliminating the bias from MRI images (using light/very light > regularization) leads to more accurate grids and correct results. > > Best, > > Paolo > > > > On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < > britta.westner at uni-konstanz.de> wrote: > > > Dear Paolo, > > > > I experienced similar problems and found that correcting the field bias in > > the participant's MRI (e.g. doing a "bias correction" with SPM) can help. > > My explanation would be that the field bias either leads to small > > inaccuracies in the segmentation and volume which then "get visible" when > > warping the grid based on the non-segmented MRI, or that the warping > > algorithm itself is affected by this bias. Maybe you can give that a try! > > > > Hope this helps, > > Britta > > > > > > > > > > Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: > > > > Dear Fieldtrippers, > > we are encountering a problem with a template model for source > > reconstruction. In particular, we are warping (non linearly) a template > > grid to the individual subject's MRI. > > Doing that, it appears that the very top of the brain is not fully covered > > by dipole locations. > > We found that this issue has been already reported: > > > > http://www.fieldtriptoolbox.org/template/sourcemodel > > > > Apparently, since March 7th 2013, this issue has been fixed. > > However we are using August 28th 2015 Fieldtrip version and we are still > > dealing with the same issue. > > Any suggestions? > > Here are our code lines: > > > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.resolution = 6; % resolution of the template grid in mm > > cfg.grid.nonlinear = 'yes'; % use non linear normalization > > cfg.mri = mri_spm; % use subject's mri in mni coordinates > > cfg.grid.unit = 'mm'; > > sourcemodel = ft_prepare_sourcemodel(cfg); > > > > Thank you in advance. > > > > Paolo > > > > > > > > > > -- > > -- > > Paolo Belardinelli, PhD > > Neurology Department > > University Hospital Tuebingen > > Eberhard Karls University Tuebingen > > Hoppe-Seyler Str. 3 > > D-72076 Tuebingen > > Tel: +49 7071 / 29 80478 > > > > > > > > _______________________________________________ > > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Britta Westner, M.Sc. > > Neuroelectromagnetic Oscillations Laboratory > > > > Fachbereich Psychologie > > Universit?t Konstanz > > Postfach 905 > > 78457 Konstanz > > > > Telefon: +49-(0)7531-88-5703 > > Fax: +49-(0)7531-88-5709 > > www.psychologie.uni-konstanz.de/nemo-lab > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Fri, 18 Mar 2016 16:12:01 +0100 > From: Federica Mauro > To: FieldTrip discussion list > Subject: Re: [FieldTrip] EEG txt files conversion to .Edf > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Sarang and Robert, > > thank you for youe suggestions. > > I've been working on them, but it seems that my main problem is I don't > have an header for my data. And at the moment I don't have any clue on how > to get it. > > Basically, when I success in load the data matrix on Matlab, it has the > dimensions of <5192001x5 double>, and this doesn't fit with any format > recognized by Fieldtrip. > Namely, when I try to construct the header with > > hdr = ft_fetch_header(data) > > it says: Error using ft_checkdata (line 464) > This function requires raw data as input. > > Error in ft_fetch_header (line 32) > data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', > 'yes'); > > Thank you again for any suggestion. > > Cheers, > > Federica > > > 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > > > Hi Frederica, > > > > Please look at the FAQ How can I convert one dataformat into an other? > > > > > > best regards, > > Robert > > > > > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > > > Hi Mait?, > > > > thank you for the suggestion. I don't have the access to BESA now, so I > > wished I could work it out with Matlab and related toolboxes. > > > > Best regards, > > Federica > > > > 2016-03-16 19:55 GMT+01:00 Mait? Crespo Garc?a : > > > >> Hi Federica, > >> > >> If you have access to BESA, you could import txt files and export them as > >> edf. > >> > >> Best, > >> Maite > >> > >> > >> El Mi?rcoles 16 de marzo de 2016 18:57, Federica Mauro < > >> federica.ma at gmail.com> escribi?: > >> > >> > >> Dear all, > >> I'm trying to convert txt files of web recordings in the edf format, but > >> I didn't find a any useful solution until now. > >> Do you have any suggestion? > >> Thank you very much in advance. > >> Bests, > >> Federica > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> 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: > > ------------------------------ > > Message: 4 > Date: Fri, 18 Mar 2016 18:29:10 +0300 > From: Olga Sysoeva > To: FieldTrip discussion list > Subject: [FieldTrip] source grand average problem > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear FieldTrippers, > > I face the problem with source grand average. I use data after > volumenormalization, but sourcegrandaverage function report that input > files are vary in inside field? Why it might be the case? > > Best Regards, > Olga Sysoeva. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 5 > Date: Fri, 18 Mar 2016 15:48:33 +0000 (UTC) > From: Mait? Crespo Garc?a > To: FieldTrip discussion list > Subject: Re: [FieldTrip] EEG txt files conversion to .Edf > Message-ID: > <484823217.1695076.1458316113761.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Federica, > when you open the .txt file in notepad, does it have any additional information apart from numeric values? If yes, then you should try another Matlab function for importing the data. If not, then you should find out relevant information, such as sampling rate, time, the labels of the channels, the number of trials, etc. Then, you could build your own data structure inside Matlab and save this file as edf with Fieldtrip. > > > El Viernes 18 de marzo de 2016 16:33, Federica Mauro escribi?: > > > Dear Sarang and Robert, > > thank you for youe suggestions. > > I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. > > Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. > Namely, when I try to construct the header with > hdr = ft_fetch_header(data) > > it says: Error using ft_checkdata (line 464) > This function requires raw data as input. > > Error in ft_fetch_header (line 32) > data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', > 'yes'); > > Thank you again for any suggestion. > > Cheers, > Federica > > 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > > Hi Frederica, > Please look at the FAQ?How can I convert one dataformat into an other? > best regards,Robert > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > Hi Mait?, > thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. > Best regards,Federica > 2016-03-16 19:55 GMT+01:00 Mait? Crespo Garc?a : > > Hi Federica, > If you have access to BESA, you could import txt files and export them as edf. > Best,Maite > > > El Mi?rcoles 16 de marzo de 2016 18:57, Federica Mauro escribi?: > > > Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. > Do you have any suggestion?Thank you very much in advance.Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 6 > Date: Fri, 18 Mar 2016 16:49:33 +0100 > From: fosco bernasconi > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Error in ft_sourceinterpolate > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I > have an error when calling ft_sourceinterpolate: > > > > > > * Reference to non-existent field 'avg'.Error in getsubfield (line 45) s = > s.(t{k});Error in ft_sourceinterpolate (line 209) if > ~iscell(getsubfield(functional, cfg.parameter{i}))* > > > If I check my source structure I do have the avg field. > > source = > freq: 10 > cumtapcnt: [157x1 double] > dim: [18 21 18] > inside: [6804x1 logical] > pos: [6804x3 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > > Any suggestion? > > Thank you for your help! > Best, > fosco > > > here the rest of my code: > > > load('standard_bem.mat'); > load('standard_sourcemodel3d10mm.mat'); > > templatefile = > '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; > template_mri = ft_read_mri(templatefile); > template_mri = ft_convert_units(template_mri,'mm'); > template_mri.coordsys = 'spm'; > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = template_mri; > sourcemodel = ft_prepare_sourcemodel(cfg,freq); > sourcemodel = ft_convert_units(sourcemodel,'mm'); > > cfg = []; > cfg.elec = sens; > cfg.channel = sens.label; > cfg.headmodel = vol; > cfg.grid = sourcemodel; > cfg.grid.unit = 'mm';% same unit as above, i.e. in cm > lf = ft_prepare_leadfield(cfg,freq); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 10; > freq = ft_freqanalysis(cfg,dataft{1,1}); > > % compute source reconstruction > cfg = []; > cfg.frequency = freq.freq; > cfg.method = 'pcc'; > cfg.grid = lf; > cfg.headmodel = vol; > cfg.keeptrials = 'yes'; > cfg.pcc.lambda = '5%'; > cfg.pcc.projectnoise = 'yes'; > source = ft_sourceanalysis(cfg,freq); > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > % and provide mni template > source_proj.dim = sourcemodel.dim; > source_proj.pos = sourcemodel.pos; > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.nai'; > source_int = ft_sourceinterpolate(cfg,source,template_mri); > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 7 > Date: Fri, 18 Mar 2016 19:08:42 +0100 > From: gj > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] import own format (long trials) > Message-ID: <56EC442A.50605 at univr.it> > Content-Type: text/plain; charset=utf-8; format=flowed > > In case anyone else is having the same problem, my mistake was how I set > "data.time". > > According to the FT Wiki, "data.time" should be a "cell-array containing > a time axis for each trial (1 X Ntrial), each time axis is a 1*Nsamples > vector" > > but it should be in seconds and I had specified it in number of samples > instead, which triggered the error > > Error using ft_specest_mtmfft (line 96) > "the padding that you specified is shorter than the data > > > On 16/03/16 19:07, gj wrote: > > Hi, > > > > I am trying to import EEG data preprocessed and averaged in BrainVision > > Analyzer. I have a 2-second segment of data per condition per subject > > which corresponds to the averaged signal across all trials of each > > condition for the subject. > > > > Is the following approach correct? > > > > Import the 4 conditions as 4 long trials (2 sec or 2000 samples with > > sampling freq of 1000 Hz) > > => data.trial is a 1x4 cell array > > and each cell array contains an nchan x 2000 matrix > > > > I am trying to fill in the other fields of the data structure to mimic > > FieldTrip's raw data but I think I am having problems with > > data.sampleinfo > > which, if I understand correctly, needs to be specified for long trials. > > > > According to the wiki, this should be an array containing [startsample > > endsample] to specify the position of each trial, with info for each > > trial on every row. However, it doesn't seem right to have > > data.sampleinfo = repmat([1 2000],4,1) > > > > Thanks in advance for any help! > > Gina > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 64, Issue 25 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Sun Mar 20 16:19:50 2016 From: jens.klinzing at uni-tuebingen.de (=?UTF-8?B?IkplbnMgS2xpbnppbmcsIFVuaXZlcnNpdMOkdCBUw7xiaW5nZW4i?=) Date: Sun, 20 Mar 2016 16:19:50 +0100 Subject: [FieldTrip] Elements have wrong orientation or are degenerated In-Reply-To: References: Message-ID: <56EEBF96.7000805@uni-tuebingen.de> Hi Andreas, I got the same error but it was resolved by applying ft_volumereslice to the mri before segmentation. This is also what they do in the FEM tutorial: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_fem ...however I didn't do it at first because the segmentation looked fine even without it. Another difference between your and my code is that you directly call ft_headmodel_simbio while I call the higher-level function ft_prepare_headmodel but I didn't check whether that makes a difference. I also don't know if the solution applies to your particular case (restriction to a subvolume with two tissue types). All the best, Jens Horn, Andreas wrote: > Hello everybody, > > I am new to fieldtrip and want to use it (and simbio) to forward model the current spread of a known dipole. I consider only a small cubic fraction of brain tissue which I so far have divided in gray and white matter. I pass that cubic volume into ft_prepare_mesh and get a hexahedral mesh without error. ft_plot_mesh also shows the correct mesh. However, once I pass the mesh into ft_headmodel_simbio, I get the error > > ‘Elements have wrong orientation or are degenerated’ > > Does anyone have an idea of why this could happen and how I could potentially fix the issue? > > Thanks a lot, > > Andreas > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From paolo.belardinelli at gmail.com Sun Mar 20 19:25:36 2016 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Sun, 20 Mar 2016 19:25:36 +0100 Subject: [FieldTrip] Problem with Template Model for Source Reconstruction In-Reply-To: References: <56C58A7A.9000207@uni-konstanz.de> Message-ID: Dear Britta, I have been working with the bias correction of my subject's MRI these days, and while working extremely well for some of them, some others appear to be even worse after correction. I don't have much experience with MRI images, so maybe the combination of parameters that I am setting may be not optimal. At the moment, I am playing around with the Bias correction parameter (from extremely light to no correction) and the FWHM bias (from 30mm to 150mm). In the original images I can see some non-uniformity in terms of contrast and usually they look quite smooth/low frequency to me. After correction I can observe an improvement in the MRI images themselves, but no improvement or even worsening in terms of not covered surface in the source localization. Do you have any suggestion how to find some quantificable parameters to help me out in this procedure? How can I quickly check whether the quality of the image is enough to guarantee that the cortex is fully covered, without going through the whole forward model production? Sometimes, even though the grid is well positioned, I still have the aforementioned problem. Best wishes, Paolo On Fri, Mar 18, 2016 at 3:35 PM, Paolo Belardinelli < paolo.belardinelli at gmail.com> wrote: > Dear Britta, > I was deeply involved in the processing and I forgot to update this post. > Thank you: it worked out! > Eliminating the bias from MRI images (using light/very light > regularization) leads to more accurate grids and correct results. > > Best, > > Paolo > > > > On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < > britta.westner at uni-konstanz.de> wrote: > >> Dear Paolo, >> >> I experienced similar problems and found that correcting the field bias >> in the participant's MRI (e.g. doing a "bias correction" with SPM) can >> help. My explanation would be that the field bias either leads to small >> inaccuracies in the segmentation and volume which then "get visible" when >> warping the grid based on the non-segmented MRI, or that the warping >> algorithm itself is affected by this bias. Maybe you can give that a try! >> >> Hope this helps, >> Britta >> >> >> >> >> Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: >> >> Dear Fieldtrippers, >> we are encountering a problem with a template model for source >> reconstruction. In particular, we are warping (non linearly) a template >> grid to the individual subject's MRI. >> Doing that, it appears that the very top of the brain is not fully >> covered by dipole locations. >> We found that this issue has been already reported: >> >> http://www.fieldtriptoolbox.org/template/sourcemodel >> >> Apparently, since March 7th 2013, this issue has been fixed. >> However we are using August 28th 2015 Fieldtrip version and we are still >> dealing with the same issue. >> Any suggestions? >> Here are our code lines: >> >> cfg = []; >> cfg.grid.warpmni = 'yes'; >> cfg.resolution = 6; % resolution of the template grid in mm >> cfg.grid.nonlinear = 'yes'; % use non linear normalization >> cfg.mri = mri_spm; % use subject's mri in mni coordinates >> cfg.grid.unit = 'mm'; >> sourcemodel = ft_prepare_sourcemodel(cfg); >> >> Thank you in advance. >> >> Paolo >> >> >> >> >> -- >> -- >> Paolo Belardinelli, PhD >> Neurology Department >> University Hospital Tuebingen >> Eberhard Karls University Tuebingen >> Hoppe-Seyler Str. 3 >> D-72076 Tuebingen >> Tel: +49 7071 / 29 80478 >> >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Britta Westner, M.Sc. >> Neuroelectromagnetic Oscillations Laboratory >> >> Fachbereich Psychologie >> Universität Konstanz >> Postfach 905 >> 78457 Konstanz >> >> Telefon: +49-(0)7531-88-5703 >> Fax: +49-(0)7531-88-5709 >> www.psychologie.uni-konstanz.de/nemo-lab >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > > -- -- Paolo Belardinelli, PhD Neurology Department University Hospital Tuebingen Eberhard Karls University Tuebingen Hoppe-Seyler Str. 3 D-72076 Tuebingen Tel: +49 7071 / 29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Mon Mar 21 12:57:53 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Mon, 21 Mar 2016 12:57:53 +0100 Subject: [FieldTrip] Correlation with a behavioural variable in the source space? Message-ID: Dear FieldTrip users, can I do a correlation test with a behavioural variable in the source space using ft_statfun_correlationT? I want to do the same as in sensor space but use voxels instead of electrodes. How can I define a region of interest to limit the number of tests? My current approach is to compute the inverse solution using cfg = []; cfg.method = 'mne'; cfg.grid = leadfield; cfg.headmodel = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; cfg.rawtrial = 'yes'; cfg.keeptrial = 'yes'; source = ft_sourceanalysis(cfg, timelock); and then simply call cfg = []; cfg.statistic = 'ft_statfun_correlationT'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.design = [1.457 1.214 2.477 5.441 …]; cfg.ivar = 1; cfg.alpha = 0.05; cfg.tail = 0; cfg.correcttail = 'alpha'; stat = ft_sourcestatistics(cfg, source); but Matlab just remains busy and nothing happens. Thank you. Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Mon Mar 21 17:08:51 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 12:08:51 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space Message-ID: Hi All, Is there any standard procedure (in Fieldtrip) for extracting virtual (source) time series from ROIs in Talariach or MNI space? Thank you -Vasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Mar 21 17:35:52 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 09:35:52 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hey Vasan, This page ("Extract the virtual channel time-series" section) provides an example: http://www.fieldtriptoolbox.org/tutorial/connectivity Arjen 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi All, > > Is there any standard procedure (in Fieldtrip) for extracting virtual > (source) time series from ROIs in Talariach or MNI space? > > Thank you > > -Vasan > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Mon Mar 21 17:40:37 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 12:40:37 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hi Arjen, The example scripts are for on the individual "subject space". I want to do the source analysis and also extracting time series for any ROIs in MNI space. -Vasan On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: > Hey Vasan, > > This page ("Extract the virtual channel time-series" section) provides an > example: > http://www.fieldtriptoolbox.org/tutorial/connectivity > > Arjen > > 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi All, >> >> Is there any standard procedure (in Fieldtrip) for extracting virtual >> (source) time series from ROIs in Talariach or MNI space? >> >> Thank you >> >> -Vasan >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 a.stolk8 at gmail.com Mon Mar 21 17:51:55 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 09:51:55 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hey Vasan, One way to do that is by 'normalizing' the subject's grid such that its points relate to specific points in MNI space. The procedure is described here: http://www.fieldtriptoolbox.org/tutorial/sourcemodel Using ft_volumelookup you can subsequently find the subject's grid points (now in MNI space) belonging to ROIs. Hope that helps, Arjen 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi Arjen, > > The example scripts are for on the individual "subject space". I want to > do the source analysis and also extracting time series for any ROIs in MNI > space. > > -Vasan > > On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: > >> Hey Vasan, >> >> This page ("Extract the virtual channel time-series" section) provides an >> example: >> http://www.fieldtriptoolbox.org/tutorial/connectivity >> >> Arjen >> >> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >> sreenivasan.r.nadar at gmail.com>: >> >>> Hi All, >>> >>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>> (source) time series from ROIs in Talariach or MNI space? >>> >>> Thank you >>> >>> -Vasan >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 sreenivasan.r.nadar at gmail.com Mon Mar 21 18:17:39 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 13:17:39 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hi Arjen, Thank you. I tried the method give in that link with ft_volumelookup for ROIs in MNI space and make a new leadfield for the ROIs and use the following commands for visualization: figure; hold on; ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); However, this method doesn't work properly as the grid sometime do not fall in the expected anatomical location. -Vasan On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: > Hey Vasan, > > One way to do that is by 'normalizing' the subject's grid such that its > points relate to specific points in MNI space. The procedure is described > here: > http://www.fieldtriptoolbox.org/tutorial/sourcemodel > > Using ft_volumelookup you can subsequently find the subject's grid points > (now in MNI space) belonging to ROIs. > > Hope that helps, > Arjen > > 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi Arjen, >> >> The example scripts are for on the individual "subject space". I want to >> do the source analysis and also extracting time series for any ROIs in MNI >> space. >> >> -Vasan >> >> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: >> >>> Hey Vasan, >>> >>> This page ("Extract the virtual channel time-series" section) provides >>> an example: >>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>> >>> Arjen >>> >>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>> sreenivasan.r.nadar at gmail.com>: >>> >>>> Hi All, >>>> >>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>> (source) time series from ROIs in Talariach or MNI space? >>>> >>>> Thank you >>>> >>>> -Vasan >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 a.stolk8 at gmail.com Mon Mar 21 18:37:00 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 10:37:00 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> References: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> Message-ID: Hi Vasan, Hard to tell based on this information, but did you copy over the template's dim and pos fields after normalization and/or check for (mis-)matches in geometric units (cm vs. mm) between grids and ROIs? Arjen 2016-03-21 10:17 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi Arjen, > > Thank you. I tried the method give in that link with ft_volumelookup for > ROIs in MNI space and make a new leadfield for the ROIs and use the > following commands for visualization: > > figure; hold on; > ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); > ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); > > However, this method doesn't work properly as the grid sometime do not > fall in the expected anatomical location. > > -Vasan > > On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: > >> Hey Vasan, >> >> One way to do that is by 'normalizing' the subject's grid such that its >> points relate to specific points in MNI space. The procedure is described >> here: >> http://www.fieldtriptoolbox.org/tutorial/sourcemodel >> >> Using ft_volumelookup you can subsequently find the subject's grid points >> (now in MNI space) belonging to ROIs. >> >> Hope that helps, >> Arjen >> >> 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >> sreenivasan.r.nadar at gmail.com>: >> >>> Hi Arjen, >>> >>> The example scripts are for on the individual "subject space". I want to >>> do the source analysis and also extracting time series for any ROIs in MNI >>> space. >>> >>> -Vasan >>> >>> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk >>> wrote: >>> >>>> Hey Vasan, >>>> >>>> This page ("Extract the virtual channel time-series" section) provides >>>> an example: >>>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>>> >>>> Arjen >>>> >>>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>>> sreenivasan.r.nadar at gmail.com>: >>>> >>>>> Hi All, >>>>> >>>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>>> (source) time series from ROIs in Talariach or MNI space? >>>>> >>>>> Thank you >>>>> >>>>> -Vasan >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> 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 joseluisblues at gmail.com Tue Mar 22 11:19:38 2016 From: joseluisblues at gmail.com (Jose) Date: Tue, 22 Mar 2016 11:19:38 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel Message-ID: Thanks Robert, It runs better. Still I would like to check some errors I got... When I run "ft_prepare_leadfield" I get: Warning: the selected value 18 should be within the range of the array from 17.8808 to 17.8808 When I run "ft_sourceinterpolate" I get: Warning: could not reshape freq to the expected dimensions Is this something I should worry about?, Or there is something I need to pay attention when I define my FOI?, best, Jose Luis ------------------------------ > > Message: 5 > Date: Fri, 18 Mar 2016 08:36:18 +0100 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] beamforming tutorial - cfg.headmodel > Message-ID: > Content-Type: text/plain; charset="windows-1252" > > Hi Jos? > > The option cfg.vol (for ?volume conduction model?) has been replaced by > cfg.headmodel for quite some time (probably more than a year ago). The code > is backward compatible, so cfg.vol will also still work, but the > documentation reflects the current standard. I suggest you update your copy > of FieldTrip to a more recent version. > > best regards, > Robert > > On 17 Mar 2016, at 20:03, Jose wrote: > > > dear list, > > > > There might be an error in the beamformer tutorial ( > http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead > field and the sources, cfg.vol rather than cfg.headmodel has to be defined > to determine the headmodel. Thanks for corroborating this. > > > > -- > > Jos? > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160318/0074e3e9/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Mar 22 15:48:40 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 22 Mar 2016 15:48:40 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel In-Reply-To: References: Message-ID: <26A274A1-34A4-4520-89AB-200521B53BFA@donders.ru.nl> Hi Jose Luis yes, you should worry about that. I don’t know whether it leads to errors, but it suggests that you are specifying things in the cfg that cannot be achieved with the data. You want to analyze 18 Hz, whereas the nearest frequency appears to be 17.8808 Hz, which is more than 2Hz off. Please check the frequency axis of your input data. You can always open (in the MATLAB editor) the code that issues the warning, and you can look at the code to try to understand it better. Robert On 22 Mar 2016, at 11:19, Jose wrote: > Thanks Robert, > It runs better. Still I would like to check some errors I got... > > When I run "ft_prepare_leadfield" I get: > Warning: the selected value 18 should be within the range of the array from 17.8808 to 17.8808 > > When I run "ft_sourceinterpolate" I get: > Warning: could not reshape freq to the expected dimensions > > Is this something I should worry about?, Or there is something I need to pay attention when I define my FOI?, > > best, > Jose Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Tue Mar 22 16:32:01 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Tue, 22 Mar 2016 11:32:01 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> Message-ID: Hi Arjen, Thank you. It worked well after I changed the template grid resolution. Vasan On Mon, Mar 21, 2016 at 1:37 PM, Arjen Stolk wrote: > Hi Vasan, > > Hard to tell based on this information, but did you copy over the > template's dim and pos fields after normalization and/or check for > (mis-)matches in geometric units (cm vs. mm) between grids and ROIs? > > Arjen > > 2016-03-21 10:17 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi Arjen, >> >> Thank you. I tried the method give in that link with ft_volumelookup for >> ROIs in MNI space and make a new leadfield for the ROIs and use the >> following commands for visualization: >> >> figure; hold on; >> ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); >> ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); >> >> However, this method doesn't work properly as the grid sometime do not >> fall in the expected anatomical location. >> >> -Vasan >> >> On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: >> >>> Hey Vasan, >>> >>> One way to do that is by 'normalizing' the subject's grid such that its >>> points relate to specific points in MNI space. The procedure is described >>> here: >>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel >>> >>> Using ft_volumelookup you can subsequently find the subject's grid >>> points (now in MNI space) belonging to ROIs. >>> >>> Hope that helps, >>> Arjen >>> >>> 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>> sreenivasan.r.nadar at gmail.com>: >>> >>>> Hi Arjen, >>>> >>>> The example scripts are for on the individual "subject space". I want >>>> to do the source analysis and also extracting time series for any ROIs in >>>> MNI space. >>>> >>>> -Vasan >>>> >>>> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk >>>> wrote: >>>> >>>>> Hey Vasan, >>>>> >>>>> This page ("Extract the virtual channel time-series" section) provides >>>>> an example: >>>>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>>>> >>>>> Arjen >>>>> >>>>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>>>> sreenivasan.r.nadar at gmail.com>: >>>>> >>>>>> Hi All, >>>>>> >>>>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>>>> (source) time series from ROIs in Talariach or MNI space? >>>>>> >>>>>> Thank you >>>>>> >>>>>> -Vasan >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Tue Mar 22 20:09:06 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Tue, 22 Mar 2016 19:09:06 +0000 (UTC) Subject: [FieldTrip] Dipole Moment Question from forward simulated data example References: <1602509026.3378850.1458673747178.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> I am working on simulated data example provided in the fieldtrip toolbox webpage. When I find the dipole moment after dipole fitting is [-1 0 0], where as original dipole mom was [1 0 0]. I was not sure if I am calculated dipole moment correctly. Any help would be appreciated.Thank you. Srinivas % http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % create a set of electrodes, randomly placed on the sphereelec = [];elec.pnt = randn(128,3);dum = sqrt(sum(elec.pnt.^2,2));elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit spherefor i=1:128 elec.label{i} = sprintf('%03d', i);end vol = [];vol.r = [0.88 0.92 1.00]; % radii of spheresvol.cond = [1 1/80 1]; % conductivityvol.o = [0 0 0]; % center of sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % create a dipole simulation with one dipole and a 10Hz sine wavecfg = [];cfg.vol = vol; % see abovecfg.elec = elec; % see abovecfg.dip.pos = [0 0.5 0.3];cfg.dip.mom = [1 0 0]'; % note, it should be transposedcfg.dip.frequency = 10;cfg.ntrials = 1;cfg.triallength = 1; % secondscfg.fsample = 250; % Hzraw1 = ft_dipolesimulation(cfg);avg1 = ft_timelockanalysis([], raw1);plot(avg1.time, avg1.avg); % plot the timecourse % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % do a dipole fit of the first simulated datasetcfg = [];cfg.vol = vol; % see abovecfg.elec = elec; % see abovecfg.dip.pos = [0 0 0]; % initial search positioncfg.gridsearch = 'no';dip1 = ft_dipolefitting(cfg, avg1); [u,s,v] = svd(dip1.dip.mom); if s(1,1) > s(2,2) dipole_orientation = u(:,1); end -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed Mar 23 10:35:10 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 23 Mar 2016 10:35:10 +0100 Subject: [FieldTrip] Dipole Moment Question from forward simulated data example In-Reply-To: <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> References: <1602509026.3378850.1458673747178.JavaMail.yahoo.ref@mail.yahoo.com> <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> Message-ID: Dear Srinivas Kota, So what you did here is simulate a dipole which changes its moment over time (refer to help ft_dipolesimulation) So the resulting dipole position it computed is something like [5.2523e-08 0.5000 0.3000]. However if you look at dip1.dip.mom you see it as [3x250 double] matrix. The first entry is the [1 0 0] which you were looking for and all the the other describe the moment at a different timepoint. If you have a quick look at plot(dip1.dip.mom(1,:)) you see the oscillation of the dipole. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 22 Mar 2016, at 20:09, Srinivas Kota wrote: > > I am working on simulated data example provided in the fieldtrip toolbox webpage. When I find the dipole moment after dipole fitting is [-1 0 0], where as original dipole mom was [1 0 0]. I was not sure if I am calculated dipole moment correctly. Any help would be appreciated. > Thank you. > Srinivas > > % http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % create a set of electrodes, randomly placed on the sphere > elec = []; > elec.pnt = randn(128,3); > dum = sqrt(sum(elec.pnt.^2,2)); > elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit sphere > for i=1:128 > elec.label{i} = sprintf('%03d', i); > end > > vol = []; > vol.r = [0.88 0.92 1.00]; % radii of spheres > vol.cond = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; % center of sphere > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % create a dipole simulation with one dipole and a 10Hz sine wave > cfg = []; > cfg.vol = vol; % see above > cfg.elec = elec; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; % note, it should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 1; > cfg.triallength = 1; % seconds > cfg.fsample = 250; % Hz > raw1 = ft_dipolesimulation(cfg); > avg1 = ft_timelockanalysis([], raw1); > plot(avg1.time, avg1.avg); % plot the timecourse > % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % do a dipole fit of the first simulated dataset > cfg = []; > cfg.vol = vol; % see above > cfg.elec = elec; % see above > cfg.dip.pos = [0 0 0]; % initial search position > cfg.gridsearch = 'no'; > dip1 = ft_dipolefitting(cfg, avg1); > [u,s,v] = svd(dip1.dip.mom); > if s(1,1) > s(2,2) > dipole_orientation = u(:,1); > end > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Wed Mar 23 23:52:47 2016 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Wed, 23 Mar 2016 23:52:47 +0100 Subject: [FieldTrip] ft_volumereslice shifts the brain Message-ID: <56F31E3F.1050200@uni-tuebingen.de> Hi everyone, I have a problem with ft_volumereslice, applied to Nifti MRIs (haven't tested it on other formats). The function shifts the image to bring the brain in the center, as announced in the documentation. However, this is done a) in a way that the nose of my MRI is cut off (s. below), which is suboptimal since I register EEG electrodes and fiducials in relation to the MRI and the cut is done close to the nasion, b) in contrast to the documentation it shifts the brain whether or not a coordinate system (.coordsys) is given. I guess this happens during ft_sourceinterpolate which is called inside ft_volumereslice (line 180). The shift that could be done in ft_volumereslice (line 103ff) is not performed if there is no .coordsys, but the shift in the returned MRI is still there. Before and After (without an mri.coordsys): Sure I can just increase the dimensions of the MRI, then I get the nose back, but I was wondering if anyone can explain this behavior of ft_volumereslice and whether it is a genuine bug or not. Thanks and greetings, Jens -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 187055 bytes Desc: not available URL: From mick.lehmann at uzh.ch Thu Mar 24 10:48:57 2016 From: mick.lehmann at uzh.ch (Mick Lehmann) Date: Thu, 24 Mar 2016 10:48:57 +0100 Subject: [FieldTrip] Time Frequency Analysis of <1 Hz Message-ID: <686D5E56-B948-4C9C-9EAB-B56D8EF5F5D6@uzh.ch> Dear FT community, I'm currently analyzing sleep EEG data and therefore I'm also interested in frequency ranges around 0.5/1 Hz. However, when I plot the data, it starts only from 1.25Hz and the cluster-based permutation can't be conducted when I include frequency ranges below 1.5 Hz. Any ideas on this issue based on the information provided blow? Best regards, Mick The raw data was read using the following script: VP = dir('*.dat'); cfg = []; cfg.dataset = (VP.name); % dataset cfg.trialdef.eventtype = 'Comment'; cfg.trialdef.prestim = 3; cfg.trialdef.poststim = 5; cfg.trialdef.eventvalue = {'HitHitReakt_LL' 'GainReakt_LL'}; cfg = ft_definetrial(cfg); cfg.demean = 'yes'; cfg.baselinewindow = [-1 -.1]; HH_SlowOsc = ft_preprocessing(cfg); HH_SlowOsc = renamechannels(HH_SlowOsc); save HH_SlowOsc HH_SlowOsc Afterwards, TF analysis was conducted using this script: load HH_SlowOsc cfg = []; cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.with = 2; HERE, I'VE TRIED 2 AND 7 CYCLES. BOTH DIDN'T WORK cfg.output = 'pow'; cfg.foi = 0.5:0.5:25; % Analysis from 2 to 30 Hz in 0.5 Hz steps cfg.toi = -3:0.05:5; % time window "slides" from -1 to 2 sec in steps of 0.05 sec (50 ms) % cfg.keeptrials = 'yes'; % für Single Trial Analysen TF_HH_SlowOsc = ft_freqanalysis(cfg, HH_SlowOsc); save TF_HH_SlowOsc TF_HH_SlowOsc; -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.pflug at musterkind.eu Thu Mar 24 12:12:27 2016 From: anja.pflug at musterkind.eu (Anja Pflug) Date: Thu, 24 Mar 2016 12:12:27 +0100 (CET) Subject: [FieldTrip] 1. Time Frequency Analysis of <1 Hz (Mick Lehmann) In-Reply-To: References: Message-ID: <1026761282.13417.70730d6f-540f-4503-a1c1-cd834547f92e.open-xchange@email.1und1.de> An HTML attachment was scrubbed... URL: From gina.joue at univr.it Thu Mar 24 12:30:48 2016 From: gina.joue at univr.it (gj) Date: Thu, 24 Mar 2016 12:30:48 +0100 Subject: [FieldTrip] Error with interpn when calling ft_sourceinterpolate Message-ID: <56F3CFE8.5050706@univr.it> Hi FieldTrip community, I am using FieldTrip ver.20160309 and am getting the error: Error using interpn (line 152) Wrong number of input arguments. Error in ft_sourceinterpolate>my_interpn (line 673) av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html Here is my code leading to the error when calling ft_sourceinterpolate: %-- snippet--% % sensor level Fourier spectra cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 13; freqsens = ft_freqanalysis(cfg, data); % source reconstruction cfg = []; cfg.frequency = freqsens.freq; cfg.elec = elec; cfg.method = 'eloreta'; cfg.grid = lf; cfg.vol = vol; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; source = ft_sourceanalysis(cfg, freqsens); % project to direction explaining most source variance cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); source_proj.dim = template_grid.sourcemodel.dim; source_proj.pos = template_grid.sourcemodel.pos; %%....... interpolate onto the MNI template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.pow'; cfg.interpmethod = 'nearest'; source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); %-- end snippet--% Any help greatly appreciated! Gina From eva.patai at psych.ox.ac.uk Thu Mar 24 13:15:00 2016 From: eva.patai at psych.ox.ac.uk (Zita Eva Patai) Date: Thu, 24 Mar 2016 12:15:00 +0000 Subject: [FieldTrip] ft_freqstatistics error when averaged over channels Message-ID: Dear FT-ers I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. Is there an easy way to fix this? I am using the FT inside SPM12. Thanks very much, zita -------------- next part -------------- An HTML attachment was scrubbed... URL: From bushra.riaz at gu.se Thu Mar 24 13:38:07 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Thu, 24 Mar 2016 12:38:07 +0000 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: <1457937054408.48754@gu.se> References: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE>, <1457937054408.48754@gu.se> Message-ID: <1458823086980.47671@gu.se> Hello, I found the problem with reading epoched fif files This code snippet cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); was giving the following error Error using fiff_read_epochs (line 46) Could not find epochs data This error was caused by this line of code (line 43 in fiff_read_epochs) ep = fiff_dir_tree_find(meas, FIFF.FIFFB_EPOCHS); because the returned structure ep was empty The value of this constant FIFF.FIFFB_EPOCHS is 122 , and in meas there was no block with such id therefore ep was empty The epoched data was in the block with the id 373 By changing line 43 in fiff_read_epochs by this ep = fiff_dir_tree_find(meas, 373); I am able to load the epoched data Kind regards Bushra Riaz ? ________________________________ From: Bushra Riaz Syeda Sent: Monday, March 14, 2016 7:30 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] error in reading epoched fif files My bad. I should have explained the problem I am using this code to read epoched fif files created with latest version of mne-python as was explained in fieldtrip tutorial (http://www.fieldtriptoolbox.org/development/integrate_with_mne) The sample epoched file can be downloaded from this link https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0? cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); and I am getting the following error Error using fiff_read_epochs (line 46) Could not find epochs data Error in fiff_read_epochs (line 46) error(me,'Could not find epochs data'); Error in ft_read_header (line 1601) epochs = fiff_read_epochs(filename); Error in ft_preprocessing (line 397) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Fri Mar 25 01:32:43 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Fri, 25 Mar 2016 00:32:43 +0000 (UTC) Subject: [FieldTrip] Simulated EEG with Cz as a reference References: <929834747.4959069.1458865963362.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <929834747.4959069.1458865963362.JavaMail.yahoo@mail.yahoo.com> I would like to simulate EEG with Cz as a reference. In the example http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit If I understand correctly, the function 'ft_dipolesimulation'  yields reference free simulated EEG. If I need Cz referenced EEG, would it be simulated EEG - Cz? BestSrini -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Mar 25 09:58:27 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 08:58:27 +0000 Subject: [FieldTrip] Error in ft_sourceinterpolate References: Message-ID: Hi Fosco, What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = ‘avg.nai’;? Best, Jan-Mathijs On 18 Mar 2016, at 16:49, fosco bernasconi > wrote: Dear all, I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate: Reference to non-existent field 'avg'. Error in getsubfield (line 45) s = s.(t{k}); Error in ft_sourceinterpolate (line 209) if ~iscell(getsubfield(functional, cfg.parameter{i})) If I check my source structure I do have the avg field. source = freq: 10 cumtapcnt: [157x1 double] dim: [18 21 18] inside: [6804x1 logical] pos: [6804x3 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] Any suggestion? Thank you for your help! Best, fosco here the rest of my code: load('standard_bem.mat'); load('standard_sourcemodel3d10mm.mat'); templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; template_mri = ft_read_mri(templatefile); template_mri = ft_convert_units(template_mri,'mm'); template_mri.coordsys = 'spm'; cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = template_mri; sourcemodel = ft_prepare_sourcemodel(cfg,freq); sourcemodel = ft_convert_units(sourcemodel,'mm'); cfg = []; cfg.elec = sens; cfg.channel = sens.label; cfg.headmodel = vol; cfg.grid = sourcemodel; cfg.grid.unit = 'mm';% same unit as above, i.e. in cm lf = ft_prepare_leadfield(cfg,freq); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft{1,1}); % compute source reconstruction cfg = []; cfg.frequency = freq.freq; cfg.method = 'pcc'; cfg.grid = lf; cfg.headmodel = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); % and provide mni template source_proj.dim = sourcemodel.dim; source_proj.pos = sourcemodel.pos; cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.nai'; source_int = ft_sourceinterpolate(cfg,source,template_mri); _______________________________________________ fieldtrip 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 Fri Mar 25 10:16:12 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 09:16:12 +0000 Subject: [FieldTrip] Error with interpn when calling ft_sourceinterpolate In-Reply-To: <56F3CFE8.5050706@univr.it> References: <56F3CFE8.5050706@univr.it> Message-ID: Hi Gina, What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151…., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) Best, Jan-Mathijs > On 24 Mar 2016, at 12:30, gj wrote: > > Hi FieldTrip community, > > I am using FieldTrip ver.20160309 and am getting the error: > > Error using interpn (line 152) > Wrong number of input arguments. > > Error in ft_sourceinterpolate>my_interpn (line 673) > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > > Here is my code leading to the error when calling ft_sourceinterpolate: > > %-- snippet--% > % sensor level Fourier spectra > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 13; > freqsens = ft_freqanalysis(cfg, data); > > % source reconstruction > cfg = []; > cfg.frequency = freqsens.freq; > cfg.elec = elec; > cfg.method = 'eloreta'; > cfg.grid = lf; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.rawtrial = 'yes'; > source = ft_sourceanalysis(cfg, freqsens); > > % project to direction explaining most source variance > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > source_proj.dim = template_grid.sourcemodel.dim; > source_proj.pos = template_grid.sourcemodel.pos; > > %%....... interpolate onto the MNI template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > > %-- end snippet--% > > > Any help greatly appreciated! > Gina > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Fri Mar 25 10:18:30 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 09:18:30 +0000 Subject: [FieldTrip] ft_volumereslice shifts the brain References: <8C87A3FE-177D-4864-B2F4-686E2D9D8FBF@donders.ru.nl> Message-ID: Hi Jens, If not instructed otherwise, ft_volumereslice attempts to realign the ‘box-with-anatomical-data’ in such a way that the origin of the coordinate system (as specified in the .transform of the input image) is in the centre of the volume. In your image it seems that the origin is in the posterior commissure, which does not leave sufficient space toward the nose to fit the whole head. Had your origin been in the anterior commissure instead, 128 1mm voxels towards the front would probably have been sufficient to include the nose. You can specify a bounding box in the cfg to get the origin off-center. Otherwise (and I suspect that this was your intention from the start) you should first realign your input image to a proper AC-origin based coordinate system, and put the origin where it should be according to convention. This can of course be achieved with ft_volumerealign. With respect to the documentation, could you give a suggestion for a revised chunk of text which is more clear in your view? Best, Jan-Mathijs On 23 Mar 2016, at 23:52, Jens Klinzing, Universität Tübingen wrote: > > Hi everyone, > I have a problem with ft_volumereslice, applied to Nifti MRIs (haven't tested it on other formats). The function shifts the image to bring the brain in the center, as announced in the documentation. > > However, this is done > a) in a way that the nose of my MRI is cut off (s. below), which is suboptimal since I register EEG electrodes and fiducials in relation to the MRI and the cut is done close to the nasion, > b) in contrast to the documentation it shifts the brain whether or not a coordinate system (.coordsys) is given. I guess this happens during ft_sourceinterpolate which is called inside ft_volumereslice (line 180). The shift that could be done in ft_volumereslice (line 103ff) is not performed if there is no .coordsys, but the shift in the returned MRI is still there. > > Before and After (without an mri.coordsys): > > > Sure I can just increase the dimensions of the MRI, then I get the nose back, but I was wondering if anyone can explain this behavior of ft_volumereslice and whether it is a genuine bug or not. > > Thanks and greetings, > Jens > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gina.joue at univr.it Fri Mar 25 13:29:21 2016 From: gina.joue at univr.it (gj) Date: Fri, 25 Mar 2016 13:29:21 +0100 Subject: [FieldTrip] Error with interpn when calling, ft_sourceinterpolate Message-ID: <56F52F21.1010900@univr.it> Hi Jan-Mathijs, Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? Thanks! Gina > > Message: 7 > Date: Fri, 25 Mar 2016 09:16:12 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling > ft_sourceinterpolate > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Gina, > > What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) > > Best, > Jan-Mathijs > > > >> On 24 Mar 2016, at 12:30, gj wrote: >> >> Hi FieldTrip community, >> >> I am using FieldTrip ver.20160309 and am getting the error: >> >> Error using interpn (line 152) >> Wrong number of input arguments. >> >> Error in ft_sourceinterpolate>my_interpn (line 673) >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >> >> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html >> >> Here is my code leading to the error when calling ft_sourceinterpolate: >> >> %-- snippet--% >> % sensor level Fourier spectra >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.output = 'fourier'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 2; >> cfg.foi = 13; >> freqsens = ft_freqanalysis(cfg, data); >> >> % source reconstruction >> cfg = []; >> cfg.frequency = freqsens.freq; >> cfg.elec = elec; >> cfg.method = 'eloreta'; >> cfg.grid = lf; >> cfg.vol = vol; >> cfg.keeptrials = 'yes'; >> cfg.rawtrial = 'yes'; >> source = ft_sourceanalysis(cfg, freqsens); >> >> % project to direction explaining most source variance >> cfg = []; >> cfg.projectmom = 'yes'; >> source_proj = ft_sourcedescriptives(cfg,source); >> >> source_proj.dim = template_grid.sourcemodel.dim; >> source_proj.pos = template_grid.sourcemodel.pos; >> >> %%....... interpolate onto the MNI template brain >> cfg = []; >> cfg.voxelcoord = 'no'; >> cfg.parameter = 'avg.pow'; >> cfg.interpmethod = 'nearest'; >> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); >> >> %-- end snippet--% >> >> >> Any help greatly appreciated! >> Gina >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From jan.schoffelen at donders.ru.nl Fri Mar 25 14:38:57 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 13:38:57 +0000 Subject: [FieldTrip] Error with interpn when calling, ft_sourceinterpolate References: Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6@donders.ru.nl> Hi Gina, What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? Specifically, what’s size(source_proj.pos,1) and source_proj.dim? Best, Jan-Mathijs > On 25 Mar 2016, at 13:29, gj wrote: > > Hi Jan-Mathijs, > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? > > Thanks! > Gina > > >> >> Message: 7 >> Date: Fri, 25 Mar 2016 09:16:12 +0000 >> From: "Schoffelen, J.M. (Jan Mathijs)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Error with interpn when calling >> ft_sourceinterpolate >> Message-ID: >> Content-Type: text/plain; charset="utf-8" >> >> Hi Gina, >> >> What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) >> >> Best, >> Jan-Mathijs >> >> >> >>> On 24 Mar 2016, at 12:30, gj wrote: >>> >>> Hi FieldTrip community, >>> >>> I am using FieldTrip ver.20160309 and am getting the error: >>> >>> Error using interpn (line 152) >>> Wrong number of input arguments. >>> >>> Error in ft_sourceinterpolate>my_interpn (line 673) >>> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >>> >>> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html >>> >>> Here is my code leading to the error when calling ft_sourceinterpolate: >>> >>> %-- snippet--% >>> % sensor level Fourier spectra >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'fourier'; >>> cfg.keeptrials = 'yes'; >>> cfg.tapsmofrq = 2; >>> cfg.foi = 13; >>> freqsens = ft_freqanalysis(cfg, data); >>> >>> % source reconstruction >>> cfg = []; >>> cfg.frequency = freqsens.freq; >>> cfg.elec = elec; >>> cfg.method = 'eloreta'; >>> cfg.grid = lf; >>> cfg.vol = vol; >>> cfg.keeptrials = 'yes'; >>> cfg.rawtrial = 'yes'; >>> source = ft_sourceanalysis(cfg, freqsens); >>> >>> % project to direction explaining most source variance >>> cfg = []; >>> cfg.projectmom = 'yes'; >>> source_proj = ft_sourcedescriptives(cfg,source); >>> >>> source_proj.dim = template_grid.sourcemodel.dim; >>> source_proj.pos = template_grid.sourcemodel.pos; >>> >>> %%....... interpolate onto the MNI template brain >>> cfg = []; >>> cfg.voxelcoord = 'no'; >>> cfg.parameter = 'avg.pow'; >>> cfg.interpmethod = 'nearest'; >>> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); >>> >>> %-- end snippet--% >>> >>> >>> Any help greatly appreciated! >>> Gina >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hibafouani123 at hotmail.com Sat Mar 26 12:21:58 2016 From: hibafouani123 at hotmail.com (hiba fouani) Date: Sat, 26 Mar 2016 11:21:58 +0000 Subject: [FieldTrip] .dat file In-Reply-To: References: Message-ID: Dear Fieldtripper, How to convert from .dat file to .mat? Thank you Hiba > From: fieldtrip-request at science.ru.nl > Subject: fieldtrip Digest, Vol 64, Issue 32 > To: fieldtrip at science.ru.nl > Date: Sat, 26 Mar 2016 12:00:01 +0100 > > 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. Re: Error with interpn when calling, ft_sourceinterpolate (gj) > 2. Re: Error with interpn when calling, ft_sourceinterpolate > (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Mar 2016 13:29:21 +0100 > From: gj > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <56F52F21.1010900 at univr.it> > Content-Type: text/plain; charset=utf-8; format=flowed > > Hi Jan-Mathijs, > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in > Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must > have made some error in the steps leading up to source interpolation -- > are there perhaps data checks I can do to narrow down what it could be? > > Thanks! > Gina > > > > > > Message: 7 > > Date: Fri, 25 Mar 2016 09:16:12 +0000 > > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Error with interpn when calling > > ft_sourceinterpolate > > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > > > Hi Gina, > > > > What version of MATLAB and operating system are you using? I cannot > get your error reproduced, and from the message it seems a low-level > MATLAB thing, because it complains about the number of input arguments > to a function that is provided by MATLAB. (by the way, the error message > that you got refers to line 152 in interpn, the same error check is done > in my version of interpn at line 151?., which suggests a different > version of the m-file. I was using matlab2014b on a windows machine) > > > > Best, > > Jan-Mathijs > > > > > > > >> On 24 Mar 2016, at 12:30, gj wrote: > >> > >> Hi FieldTrip community, > >> > >> I am using FieldTrip ver.20160309 and am getting the error: > >> > >> Error using interpn (line 152) > >> Wrong number of input arguments. > >> > >> Error in ft_sourceinterpolate>my_interpn (line 673) > >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > >> > >> while trying to interpolate onto a template brain after having done > source reconstruction. This question had been posted before several > years ago but don't know how to "fix" the problem: > >> > >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > >> > >> Here is my code leading to the error when calling ft_sourceinterpolate: > >> > >> %-- snippet--% > >> % sensor level Fourier spectra > >> cfg = []; > >> cfg.method = 'mtmfft'; > >> cfg.output = 'fourier'; > >> cfg.keeptrials = 'yes'; > >> cfg.tapsmofrq = 2; > >> cfg.foi = 13; > >> freqsens = ft_freqanalysis(cfg, data); > >> > >> % source reconstruction > >> cfg = []; > >> cfg.frequency = freqsens.freq; > >> cfg.elec = elec; > >> cfg.method = 'eloreta'; > >> cfg.grid = lf; > >> cfg.vol = vol; > >> cfg.keeptrials = 'yes'; > >> cfg.rawtrial = 'yes'; > >> source = ft_sourceanalysis(cfg, freqsens); > >> > >> % project to direction explaining most source variance > >> cfg = []; > >> cfg.projectmom = 'yes'; > >> source_proj = ft_sourcedescriptives(cfg,source); > >> > >> source_proj.dim = template_grid.sourcemodel.dim; > >> source_proj.pos = template_grid.sourcemodel.pos; > >> > >> %%....... interpolate onto the MNI template brain > >> cfg = []; > >> cfg.voxelcoord = 'no'; > >> cfg.parameter = 'avg.pow'; > >> cfg.interpmethod = 'nearest'; > >> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > >> > >> %-- end snippet--% > >> > >> > >> Any help greatly appreciated! > >> Gina > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------------ > > Message: 2 > Date: Fri, 25 Mar 2016 13:38:57 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > > Hi Gina, > > What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? > Specifically, what?s size(source_proj.pos,1) and source_proj.dim? > > Best, > Jan-Mathijs > > > On 25 Mar 2016, at 13:29, gj wrote: > > > > Hi Jan-Mathijs, > > > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? > > > > Thanks! > > Gina > > > > > >> > >> Message: 7 > >> Date: Fri, 25 Mar 2016 09:16:12 +0000 > >> From: "Schoffelen, J.M. (Jan Mathijs)" > >> To: FieldTrip discussion list > >> Subject: Re: [FieldTrip] Error with interpn when calling > >> ft_sourceinterpolate > >> Message-ID: > >> Content-Type: text/plain; charset="utf-8" > >> > >> Hi Gina, > >> > >> What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) > >> > >> Best, > >> Jan-Mathijs > >> > >> > >> > >>> On 24 Mar 2016, at 12:30, gj wrote: > >>> > >>> Hi FieldTrip community, > >>> > >>> I am using FieldTrip ver.20160309 and am getting the error: > >>> > >>> Error using interpn (line 152) > >>> Wrong number of input arguments. > >>> > >>> Error in ft_sourceinterpolate>my_interpn (line 673) > >>> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > >>> > >>> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: > >>> > >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > >>> > >>> Here is my code leading to the error when calling ft_sourceinterpolate: > >>> > >>> %-- snippet--% > >>> % sensor level Fourier spectra > >>> cfg = []; > >>> cfg.method = 'mtmfft'; > >>> cfg.output = 'fourier'; > >>> cfg.keeptrials = 'yes'; > >>> cfg.tapsmofrq = 2; > >>> cfg.foi = 13; > >>> freqsens = ft_freqanalysis(cfg, data); > >>> > >>> % source reconstruction > >>> cfg = []; > >>> cfg.frequency = freqsens.freq; > >>> cfg.elec = elec; > >>> cfg.method = 'eloreta'; > >>> cfg.grid = lf; > >>> cfg.vol = vol; > >>> cfg.keeptrials = 'yes'; > >>> cfg.rawtrial = 'yes'; > >>> source = ft_sourceanalysis(cfg, freqsens); > >>> > >>> % project to direction explaining most source variance > >>> cfg = []; > >>> cfg.projectmom = 'yes'; > >>> source_proj = ft_sourcedescriptives(cfg,source); > >>> > >>> source_proj.dim = template_grid.sourcemodel.dim; > >>> source_proj.pos = template_grid.sourcemodel.pos; > >>> > >>> %%....... interpolate onto the MNI template brain > >>> cfg = []; > >>> cfg.voxelcoord = 'no'; > >>> cfg.parameter = 'avg.pow'; > >>> cfg.interpmethod = 'nearest'; > >>> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > >>> > >>> %-- end snippet--% > >>> > >>> > >>> Any help greatly appreciated! > >>> Gina > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> 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 > > End of fieldtrip Digest, Vol 64, Issue 32 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Mar 27 12:17:21 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 27 Mar 2016 11:17:21 +0100 Subject: [FieldTrip] .dat file Message-ID: Hello Hiba, .dat files can be imported into MATLAB using the 'import data' GUI; you can also use that GUI to generate code for importing, and then you can modify the code to suit your needs. There are also plenty of other low-level functions for reading .dat files, e.g., http://uk.mathworks.com/matlabcentral/answers/79885-reading-dat-files-into-matlab, http://web.cecs.pdx.edu/~gerry/MATLAB/plotting/loadingPlotData.html, etc., you can find many more examples like this online. Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 1 > Date: Sat, 26 Mar 2016 11:21:58 +0000 > From: hiba fouani > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] .dat file > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > Dear Fieldtripper, > > How to convert from .dat file to .mat? > > Thank you > Hiba > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Mon Mar 28 15:41:46 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Mon, 28 Mar 2016 13:41:46 +0000 (UTC) Subject: [FieldTrip] Dipole Simuation and Fitting References: <1410856922.1013069.1459172506243.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1410856922.1013069.1459172506243.JavaMail.yahoo@mail.yahoo.com>   In ‘ft_dipolesimulation.m’, what is the coordinate systemwhen considering dipole position in the example?  http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit I would like to see the dipole position and momentum in theMRI template for the dipole I simulate. I came across this link http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefittingI understand that the accuracy of source localization isdepends on the selection of Left and Right Pre Auricular points.  The ‘interactive’ method in ‘ft_volumerealign’could result mislocalization of LPA and RPA. Is there any demo or video of choosingpre auricular points in an anatomical MRI?  What would be the best way if I have to do spatially alignan anatomical MRI with head coordinates for each individual subject, given theoptions ‘interactive’, ‘fiducial’,’headshape’,’SPM’ and ‘FSL’?  I work with newborn EEG, are there any standard MRItemplates for newborns? Thank youSrini -------------- next part -------------- An HTML attachment was scrubbed... URL: From fosco.bernasconi at gmail.com Mon Mar 28 16:37:57 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Mon, 28 Mar 2016 16:37:57 +0200 Subject: [FieldTrip] Error in ft_sourceinterpolate In-Reply-To: References: Message-ID: Hi Jan-Mathijs, this is exactly what I end up using. Alternatively, I also created source.nai = avg.nai, which is working as well. I do have another short question, when using the ft_source2full I have some matab errors (which I guess it may be due to the changes in the source structure occurred in 2015, could it be?), I decided to skip ft_source2sparse and therefore ft_source2full (because I have the computational power to do so), this should not affect my connectivity results, right? Thanks a lot! fosco 2016-03-25 9:58 GMT+01:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > Hi Fosco, > > What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = > ‘avg.nai’;? > Best, > Jan-Mathijs > > On 18 Mar 2016, at 16:49, fosco bernasconi > wrote: > > Dear all, > > I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I > have an error when calling ft_sourceinterpolate: > > > > > > * Reference to non-existent field 'avg'. Error in getsubfield (line 45) > s = s.(t{k}); Error in ft_sourceinterpolate (line 209) if > ~iscell(getsubfield(functional, cfg.parameter{i}))* > > > If I check my source structure I do have the avg field. > > source = > freq: 10 > cumtapcnt: [157x1 double] > dim: [18 21 18] > inside: [6804x1 logical] > pos: [6804x3 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > > Any suggestion? > > Thank you for your help! > Best, > fosco > > > here the rest of my code: > > > load('standard_bem.mat'); > load('standard_sourcemodel3d10mm.mat'); > > templatefile = > '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; > template_mri = ft_read_mri(templatefile); > template_mri = ft_convert_units(template_mri,'mm'); > template_mri.coordsys = 'spm'; > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = template_mri; > sourcemodel = ft_prepare_sourcemodel(cfg,freq); > sourcemodel = ft_convert_units(sourcemodel,'mm'); > > cfg = []; > cfg.elec = sens; > cfg.channel = sens.label; > cfg.headmodel = vol; > cfg.grid = sourcemodel; > cfg.grid.unit = 'mm';% same unit as above, i.e. in cm > lf = ft_prepare_leadfield(cfg,freq); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 10; > freq = ft_freqanalysis(cfg,dataft{1,1}); > > % compute source reconstruction > cfg = []; > cfg.frequency = freq.freq; > cfg.method = 'pcc'; > cfg.grid = lf; > cfg.headmodel = vol; > cfg.keeptrials = 'yes'; > cfg.pcc.lambda = '5%'; > cfg.pcc.projectnoise = 'yes'; > source = ft_sourceanalysis(cfg,freq); > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > % and provide mni template > source_proj.dim = sourcemodel.dim; > source_proj.pos = sourcemodel.pos; > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.nai'; > source_int = ft_sourceinterpolate(cfg,source,template_mri); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 gina.joue at univr.it Tue Mar 29 09:16:29 2016 From: gina.joue at univr.it (gj) Date: Tue, 29 Mar 2016 09:16:29 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 64, Issue 32 In-Reply-To: References: Message-ID: <56FA2BCD.7010201@univr.it> Hi Jan-Mathijs, Before replacing them with the values from the template grid, source_proj.dim is 1-row matrix = [15,18,13] and source_proj.pos a 3510x3 matrix of doubles After, it's source_proj.dim is a 1-row matrix = [32,39,34] and source_proj.pos is a 42432x3 matrix of doubles Thanks! Gina > ------------------------------ > > Message: 2 > Date: Fri, 25 Mar 2016 13:38:57 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > > Hi Gina, > > What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? > Specifically, what?s size(source_proj.pos,1) and source_proj.dim? > > Best, > Jan-Mathijs > From jan.schoffelen at donders.ru.nl Tue Mar 29 09:50:05 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 29 Mar 2016 07:50:05 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 64, Issue 32 In-Reply-To: <56FA2BCD.7010201@univr.it> References: <56FA2BCD.7010201@univr.it> Message-ID: Hi Gina, That’s what I was afraid of. By replacing the .pos and .dim you made the data structure inconsistent. The number of source positions should be kept constant, i.e. you need to use a ‘template grid’ that is defined at the same approximate spatial resolution as your individual grids. The reason for this is that the numeric data (e.g. in source.avg.pow) should have the same number of elements as the size(source.pos,1). Best, Jan-Mathijs > On 29 Mar 2016, at 09:16, gj wrote: > > Hi Jan-Mathijs, > > Before replacing them with the values from the template grid, > source_proj.dim is 1-row matrix = [15,18,13] > and > source_proj.pos a 3510x3 matrix of doubles > > > After, it's > source_proj.dim is a 1-row matrix = [32,39,34] > and > source_proj.pos is a 42432x3 matrix of doubles > > Thanks! > Gina > >> ------------------------------ >> >> Message: 2 >> Date: Fri, 25 Mar 2016 13:38:57 +0000 >> From: "Schoffelen, J.M. (Jan Mathijs)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Error with interpn when calling, >> ft_sourceinterpolate >> Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> >> Content-Type: text/plain; charset="utf-8" >> >> >> Hi Gina, >> >> What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? >> Specifically, what?s size(source_proj.pos,1) and source_proj.dim? >> >> Best, >> Jan-Mathijs >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From laetitia.lalla at inserm.fr Tue Mar 29 10:50:46 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Tue, 29 Mar 2016 10:50:46 +0200 Subject: [FieldTrip] Pb with ft_freqstatistics when averaged over channels : NaNs In-Reply-To: References: Message-ID: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> Dear FieldTrip community, I have a similar problem that may be of help here. It's my first message on this mailing list so, first of all, thank you very much for this free toolbox and the help you're providing. I'm a PhD student in Marseille (France) and I'm doing LFP recordings with tetrodes or silicon probes in freely moving rats. (I apologize in advance for this very detailed - and long - email). I'm trying to compare the power in a certain frequency range between 2 conditions (Trial and Baseline). I can see a clear rising during the trial and I want to run the statistics now. Like Zita, I'd like to run a cluster permutation test on data with frequency and time information, and my signal is averaged over channels. I followed this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics. [1]Based on this, this is what I did : 1) I cut epochs of 6s (trials), filter [0.1 250Hz] and average over channels to have an averaged signal per probe (32 channels = 4 shanks = 1 probe). 2) I do the same for the baseline. 3) I create a structure data_all which gather all the epochs, with the appropriate design matrix (0 if baseline, 1 if trial). 4) I do a Time Frequency Transform averaged over time with ft_freqanalysis, 'mtmfft', with keeptrials='yes'. It give me, for each trial, a profile Power=f(Freq) averaged during the time of the epoch. The difference in my frequency range is very clear when I plot the profiles. 5) I use ft_freqstatistics like this : cfg = []; cfg.channel = 'Str'; cfg.design = data_all.designmatrix; cfg.method = 'montecarlo'; cfg.numrandomization = 500; cfg.statistic = 'indepsamplesT'; cfg.ivar = 1; cfg.correctm = 'cluster'; cfg.neighbours = []; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; [stat]=ft_freqstatistics(cfg, FR_alltrials) And this is not working because I have only NaNs... stat = stat: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] prob: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] cirange: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] mask: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] ref: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] dimord: 'chan_freq' freq: [1x25 double] label: {'Str'} cfg: [1x1 struct] Would you have an idea to resolve my problem ? Maybe I forgot to precise a parameter somewhere ? Thank you for your help! Best regards, Laetitia On 24-03-2016 13:15, Zita Eva Patai wrote: > Dear FT-ers > > I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. > > I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. > > If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. > > Is there an easy way to fix this? > > I am using the FT inside SPM12. > > Thanks very much, > zita > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Links: ------ [1] http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Tue Mar 29 12:08:10 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Tue, 29 Mar 2016 12:08:10 +0200 Subject: [FieldTrip] Pb with ft_freqstatistics when averaged over channels : NaNs In-Reply-To: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> Message-ID: <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> Hello again, I actually solved my problem... It was pretty silly... I needed to put 1 and 2 in my design matrix instead of 0 and 1... It's in the code here : in ft_statfun_indepsamplesT.m row 77 % perform some checks on the design sel1 = find(design(cfg.ivar,:)==1); sel2 = find(design(cfg.ivar,:)==2); Sorry about that... But maybe it can help other people ? Have a nice day, Laetitia On 29-03-2016 10:50, laetitia.lalla at inserm.fr wrote: > Dear FieldTrip community, > > I have a similar problem that may be of help here. > > It's my first message on this mailing list so, first of all, thank you very much for this free toolbox and the help you're providing. I'm a PhD student in Marseille (France) and I'm doing LFP recordings with tetrodes or silicon probes in freely moving rats. (I apologize in advance for this very detailed - and long - email). > > I'm trying to compare the power in a certain frequency range between 2 conditions (Trial and Baseline). I can see a clear rising during the trial and I want to run the statistics now. > > Like Zita, I'd like to run a cluster permutation test on data with frequency and time information, and my signal is averaged over channels. > > I followed this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics. [1]Based on this, this is what I did : > > 1) I cut epochs of 6s (trials), filter [0.1 250Hz] and average over channels to have an averaged signal per probe (32 channels = 4 shanks = 1 probe). > > 2) I do the same for the baseline. > > 3) I create a structure data_all which gather all the epochs, with the appropriate design matrix (0 if baseline, 1 if trial). > > 4) I do a Time Frequency Transform averaged over time with ft_freqanalysis, 'mtmfft', with keeptrials='yes'. It give me, for each trial, a profile Power=f(Freq) averaged during the time of the epoch. The difference in my frequency range is very clear when I plot the profiles. > > 5) I use ft_freqstatistics like this : > > cfg = []; > > cfg.channel = 'Str'; > > cfg.design = data_all.designmatrix; > > cfg.method = 'montecarlo'; > > cfg.numrandomization = 500; > > cfg.statistic = 'indepsamplesT'; > > cfg.ivar = 1; > > cfg.correctm = 'cluster'; > > cfg.neighbours = []; > > cfg.alpha=0.05; > > cfg.tail=0; > > cfg.correcttail='alpha'; > > [stat]=ft_freqstatistics(cfg, FR_alltrials) > > And this is not working because I have only NaNs... > > stat = > > stat: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] > > prob: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] > > cirange: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] > > mask: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] > > ref: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] > > dimord: 'chan_freq' > > freq: [1x25 double] > > label: {'Str'} > > cfg: [1x1 struct] > > Would you have an idea to resolve my problem ? Maybe I forgot to precise a parameter somewhere ? > > Thank you for your help! > > Best regards, > > Laetitia > > On 24-03-2016 13:15, Zita Eva Patai wrote: > >> Dear FT-ers >> >> I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. >> >> I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. >> >> If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. >> >> Is there an easy way to fix this? >> >> I am using the FT inside SPM12. >> >> Thanks very much, >> zita >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Links: ------ [1] http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Wed Mar 30 03:19:01 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Tue, 29 Mar 2016 21:19:01 -0400 Subject: [FieldTrip] please help! sourcemodel and grid don't match Message-ID: Hi all, When I plot the sourcemodel and the headmodel, the sourcemodel is many magnitudes larger than the headmodel. Not sure if it has anything to do with my code so attaching that below. Also attaching the jpgs. %% read the parameters %% Parameter 2.2 mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; mritype='MNI'; realign='realigned'; volumereslicing='volumeresliced'; brainthresh=0.5; scalpthresh=0.10; scalpsmooth='scalp_smooth'; scalp_smooth.parameter=9; scalpvertices=1000; skullvertices=1000; brainvertices=1000; meshmethod='projectmesh'; headmodel_method='dipoli'; subjnum='915'; time='pre'; timetype='hassan'; timewindow=[0 .1]; gridtype='template10'; beamformer='lcmv'; sourcemodeltype= 'templatebased'; identifier='Parameter2-2'; =================================== %%read in mri switch mritype case 'MNI' [mri] = ft_read_mri(mrifile); mri.coordsys ='MNI'; case 'Analyze' [mri] = ft_read_mri(mrifile); mri.coordsys ='Analyze'; case 'SPM' [mri] = ft_read_mri(mrifile); mri.coordsys = 'SPM'; end save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') cfg=[]; ft_sourceplot(cfg,mri) ============================== %% realigning switch realign case 'realigned' cfg=[]; cfg.method='fiducial'; cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; mri_realigned=ft_volumerealign(cfg,mri); ft_sourceplot(cfg,mri_realigned) save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') case 'notrealigned' %do nothing end ========================= %% volume reslicing switch volumereslicing case 'volumeresliced' cfg = []; cfg.resolution = 1; mri_resliced = ft_volumereslice(cfg, mri); save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') case 'notresliced' %do nothing end ft_sourceplot(cfg,mri_resliced) ============================== %% segmentation parameters switch scalpsmooth case 'noscalpsmooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); case 'scalp_smooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.scalpsmooth = scalp_smooth.parameter; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); end seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; cfg.maskparameter=cfg.funparameter; ft_sourceplot(cfg,seg) save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') ================================= %% prepare mesh cfg = []; cfg.method= meshmethod; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [scalpvertices skullvertices brainvertices]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001; bnd(2).pnt = bnd(2).pnt.*1; bnd(3).pnt = bnd(3).pnt.*0.999; figure; ft_plot_mesh(bnd(1))%scalp figure; ft_plot_mesh(bnd(2))%skull figure; ft_plot_mesh(bnd(3))%brain %% save mesh save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') ============================================= %% build headmodel switch headmodel_method case 'dipoli' cfg = []; cfg.method = 'dipoli'; case 'bemcp' cfg = []; cfg.method = 'bemcp'; end headmodel = ft_prepare_headmodel(cfg, bnd); headmodel = ft_convert_units(headmodel,'cm'); save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); ==================================== %% adding electrodes to headmodel elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') ================================= %most likely they are not aligned, so for aligning electrodes cfg = []; cfg.method = 'interactive';%can try the 'fiducial' method but is very %likely not to fix it cfg.elec = elec; % nas=mri_realigned.cfg.fiducial.nas; % lpa=mri_realigned.cfg.fiducial.lpa; % rpa=mri_realigned.cfg.fiducial.rpa; cfg.headshape = headmodel.bnd(1);%scalp elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') ================================== %% load EEG data load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6w') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM0') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3W') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bw') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bb') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6b') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6') ==================================== %% timelock data cfg = []; cfg.refef= 'yes'; %added at 2-5 same = dataM0; same.trial = [dataM0.trial dataM3W.trial]; same.time = [dataM0.time dataM3W.time]; diff = dataM6; diff.trial = [dataM3Bb.trial dataM6.trial]; diff.time = [dataM3Bb.time dataM6.time]; switch timetype case 'simple' timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); case 'hassan' cfg.vartrllength = 0; %was changed to 0 from 2 cfg.covariance = 'yes'; cfg.covariancewindow = timewindow; cfg.keeptrials = 'yes'; timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); end save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') ============================ %% make sourcemodel switch sourcemodeltype case 'templatebased' template=load('standard_sourcemodel3d10mm.mat'); elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file cfg = []; cfg.headmodel = headmodel; cfg.mri=mri; cfg.grid.warpmni = 'yes'; cfg.grid.template = template.sourcemodel; cfg.grid.nonlinear = 'yes'; cfg.resolution = 2; % resolution of the template grid in mm cfg.moveinward = 1; % actually uses vol mesh cfg.grid.unit ='mm'; cfg.inwardshift = 0; % needs to be expressed to work with moveinward cfg.elec = elec; % cfg.headshape=('cortex_5124.surf.gii'); mysourcemodel = ft_prepare_sourcemodel(cfg); case 'individual' load('standard_sourcemodel3d5mm.mat'); cfg = []; cfg.grid.warpmni = 'yes'; cfg.resolution = 5; % resolution of the template grid in mm cfg.grid.nonlinear = 'yes'; % use non linear normalization cfg.mri = mri; % use subject's mri in mni coordinates cfg.grid.unit = 'mm'; mysourcemodel = ft_prepare_sourcemodel(cfg); case 'template' mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work end save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') ======================= %% Plot the single subject'e head model and grid positions figure hold on ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); ======================== %% Double check that source model is aligned to the segmented volume and to the electrodes *HERE IS WHERE I SEE THE ERROR* figure hold on plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); ======================================== %% make leadfield switch gridtype case 'individual' cfg = []; cfg.elec = elec; cfg.headmodel = headmodel; cfg.normalize = 'yes'; cfg.reducerank= 3; cfg.grid.unit = 'cm';% same unit as above, i.e. in cm [grid] = ft_prepare_leadfield(cfg); case 'templatebased' load('standard_sourcemodel3d10mm.mat') cfg = []; cfg.elec = elec; cfg.template = sourcemodel.cfg.grid; cfg.grid=mysourcemodel.cfg.grid; cfg.headmodel = headmodel; cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG cfg.channel = 'all'; cfg.normalize= 'yes'; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; [grid] = ft_prepare_leadfield(cfg); case 'template10' load('standard_sourcemodel3d10mm.mat') cfg.normalize='yes'; [grid]=sourcemodel.cfg.grid; end save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') =========================== %% Interpolate cfg = []; cfg.interpmethod = 'linear'; cfg.parameter = 'pow'; sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); % save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') ================================= %%beamforming cfg = []; cfg.method = 'slice'; % cfg.slicedim= 1; cfg.funcolormap = 'jet'; % cfg.method = 'ortho'; % cfg.funcolorlim = 'zeromax'; % cfg.funcolorlim = [0.01 0.2]; cfg.funparameter= 'pow'; test2=sourceinterp_diff; test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); test=sourceinterp_diff; test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; ft_sourceplot(cfg,test) ft_sourceplot(cfg,test2) ft_sourceplot(cfg,sourceinterp_same); ft_sourceplot(cfg,sourceinterp_diff); ft_sourceplot(cfg,sourceinterp_m0); ft_sourceplot(cfg,sourceinterp_m6); ft_sourceplot(cfg,sourceinterp_m3w); ft_sourceplot(cfg,sourceinterp_m3b); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figforfilegrid.jpg Type: image/jpeg Size: 37427 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figforemail.jpg Type: image/jpeg Size: 28140 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: combinedforemail.jpg Type: image/jpeg Size: 41474 bytes Desc: not available URL: From mi_mayer at gmx.de Wed Mar 30 13:44:08 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Wed, 30 Mar 2016 13:44:08 +0200 Subject: [FieldTrip] Shift triggers Message-ID: An HTML attachment was scrubbed... URL: From carsten.wolters at uni-muenster.de Wed Mar 30 12:14:11 2016 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 30 Mar 2016 12:14:11 +0200 Subject: [FieldTrip] PhD position available: EEG/MEG inverse problem in presurgical epilepy diagnosis Message-ID: <56FBA6F3.4010808@uni-muenster.de> Doctoral Student *Neuroscientist with focus on the EEG/MEG inverse problem in presurgical epilepsy diagnosis * The *medical faculty of the University of Münster*, Germany, invites applications for a Doctoral Student Ref.: 10937 for a TVL13, 65%, three year position to work on the combined Electro- (EEG) and Magneto-encephalography (MEG) inverse problem in presurgical epilepsy diagnosis using calibrated realistic finite element volume conductor models of the patients heads within a DFG-funded project. The successful applicant holds a Master’s degree (or equivalent) in a relevant academic area such as *applied mathematics, computer science, physics, biomedical or electrical engineering or similar disciplines.* Good programming expertise (C++, Matlab, Fortran or equivalent) and experience with the Linux operating system is expected, because large software toolboxes are used and further developed. The working language at the institute is English. Experience with the measurement and analysis of brain signals is advantageous, but not essential. The applicant’s merits are assessed on the basis of the quality of Master’s level studies and thesis, previous experience with inverse problems, numerical mathematics, software development, motivation and research interests. The location for this research will mainly be the workgroups “Methods in bioelectromagnetism” of Dr. Wolters at the Institute for Biomagnetism and Biosignalanalysis (IBB) and “Imaging” of Prof. Dr. Martin Burger at the Institute for Computational and Applied Mathematics, both at the University of Münster in Germany. Expected close collaborations and visits are with the Department of Neurosurgery at the University of Erlangen (Dr.med. Stefan Rampp) and with the epilepsy centers Münster-Osnabrück (Dr. Gabriel Möddel; PD Dr.med. Christoph Kellinghaus) and Bochum (Prof. Dr.med. Jörg Wellmer). The application should include a statement of research interests and reasons for applying to the project, a curriculum vitae (max. 4 pages) composed according to good scientific practice, a certificate of Master’s degree, copy of the master’s thesis and grades of Master’s level studies, the names and e-mail addresses of two referees and a proof of proficiency in English. The position will be open until filled. To apply for the position, please send the above documents as pdfs until 20.04.2016 to *PD Dr. rer.nat. Carsten Wolters*, Institute for Biomagnetism and Biosignalanalysis, University of Münster, Malmedyweg 15, 48149 Münster, Germany, or by Email to *carsten.wolters(at)­uni-muenster(dot)­de . For additional information please contact PD Dr. Carsten Wolters (Email: carsten.wolters(at)­uni-muenster(dot)­de *, Phone: +49 (0)251 83-56904). Applications of women are specifically invited. In the case of similar qualifications, competence, and specific achievements, women will be considered on preferential terms within the framework of the legal possibilities. Handicapped candidates with equivalent qualifications will be given preference. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From carsten.wolters at uni-muenster.de Wed Mar 30 12:16:03 2016 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 30 Mar 2016 12:16:03 +0200 Subject: [FieldTrip] PhD position available: EEG/MEG forward problem in presurgical epilepy diagnosis Message-ID: <56FBA763.8050207@uni-muenster.de> Doctoral Student *Neuroscientist with focus on the EEG/MEG forward problem in presurgical epilepsy diagnosis* The *medical faculty of the University of Münster*, Germany, invites applications for a Doctoral Student Ref.: 10939 for a TVL13, 65%, three year position to work on the combined Electro- (EEG) and Magneto-encephalography (MEG) forward problem in presurgical epilepsy diagnosis using calibrated realistic finite element volume conductor models of the patients heads within a DFG-funded project. The successful applicant holds a Master’s degree (or equivalent) in a relevant academic area such as *applied* *mathematics, computer science, physics, biomedical or electrical engineering or similar disciplines. *Good programming expertise (C++, Matlab, Fortran or equivalent) and experience with the Linux operating system is expected, because large software toolboxes (DUNE-PDELab, see http://www.dune-project.org/) are used and further developed. The working language at the institute is English. Experience with finite element method based simulation and the analysis of brain signals is advantageous, but not essential. The applicant’s merits are assessed on the basis of the quality of Master’s level studies and thesis, previous experience with the numerical solution of partial differential equations, numerical mathematics, inverse problems, software development, motivation and research interests. The location for this research will mainly be the workgroups “Methods in bioelectromagnetism” of PD Dr. Wolters at the Institute for Biomagnetism and Biosignalanalysis (IBB) and “Applications of partial differential equations” of Prof. Dr. Christian Engwer at the Institute for Computational and Applied Mathematics, both at the University of Münster in Germany. Expected close collaborations and visits are with the Department of Neurosurgery at the University of Erlangen (Dr.med. Stefan Rampp) and with the epilepsy centers Münster-Osnabrück (Dr. Gabriel Möddel; PD Dr.med. Christoph Kellinghaus) and Bochum (Prof. Dr.med. Jörg Wellmer). The application should include a statement of research interests and reasons for applying to the project, a curriculum vitae (max. 4 pages) composed according to good scientific practice, a certificate of Master’s degree, copy of the master’s thesis and grades of Master’s level studies, the names and e-mail addresses of two referees and a proof of proficiency in English. The position will be open until filled. To apply for the position, please send the above documents as pdfs until 20.04.2016 to*PD Dr.rer.nat. Carsten Wolters*, Institute for Biomagnetism and Biosignalanalysis, University of Münster, Malmedyweg 15, 48149 Münster, Germany, or by Email to *carsten.wolters(at)­uni-muenster(dot)­de *. For additional information please contact*PD Dr. Carsten Wolters (Email: carsten.wolters(at)­uni-muenster(dot)­de *, Phone: +49 (0)251 83-56904). Applications of women are specifically invited. In the case of similar qualifications, competence, and specific achievements, women will be considered on preferential terms within the framework of the legal possibilities. Handicapped candidates with equivalent qualifications will be given preference. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Mar 30 15:17:31 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 30 Mar 2016 13:17:31 +0000 Subject: [FieldTrip] Shift triggers In-Reply-To: References: Message-ID: <883F387F-B82E-4511-B31A-49B924EB02ED@donders.ru.nl> Hi Sophia, If you would like to stick to the default ft_trialfun_general, you could update the 3d column in your cfg_trl.trl matrix. This column contains the ‘offset’ for each trial, which specifies for the first sample in each trial the number of samples prior to what is defined as ‘time point zero’ for that trial. You should subtract or add round(0.015.*the-sampling-rate), depending on the intended direction of the shift. I leave it as exercise to you to determine whether to add or subtract. Best, Jan-Mathijs On 30 Mar 2016, at 13:44, Irene Sophia Mayer > wrote: Dear Fieldtrippers, I am defining my trials with the following code: cfg = []; cfg.dataset = infile; cfg.trialdef.eventtype = 'Stimulus'; cfg.trialdef.eventvalue = 'S 1'; cfg.trialdef.prestim = .1; cfg.trialdef.poststim = 2.2; cfg_trl = ft_definetrial(cfg); However, I have measured that my stimulus appeared 15ms late. Is there a way of shifting the triggers or the trials? Meaning, that trialdef does not take the actual time of the event but adds 15ms. Then this new value is considered for the prestimulus and poststimulus time as the new point zero. Cheers, Sophia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Mar 30 15:55:53 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 30 Mar 2016 15:55:53 +0200 Subject: [FieldTrip] please help! sourcemodel and grid don't match In-Reply-To: References: Message-ID: <94637D12-7261-4751-A3FE-A763E552D458@gmail.com> Hi Hassan, have you double-checked that all your input units are in the same in all elements (i.e. electrodes, volume, mri, grid all have the same .unit and .pos values in the same ballpark)? You can use ft_convert_units to fix possible differences. Good luck, Julian Am 30.03.2016 um 03:19 schrieb Hassan Aleem: > Hi all, > > When I plot the sourcemodel and the headmodel, the sourcemodel is many magnitudes larger than the headmodel. Not sure if it has anything to do with my code so attaching that below. Also attaching the jpgs. > > %% read the parameters > > %% Parameter 2.2 > > mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; > mritype='MNI'; > realign='realigned'; > volumereslicing='volumeresliced'; > brainthresh=0.5; > scalpthresh=0.10; > scalpsmooth='scalp_smooth'; > scalp_smooth.parameter=9; > scalpvertices=1000; > skullvertices=1000; > brainvertices=1000; > meshmethod='projectmesh'; > headmodel_method='dipoli'; > subjnum='915'; > time='pre'; > timetype='hassan'; > timewindow=[0 .1]; > gridtype='template10'; > beamformer='lcmv'; > sourcemodeltype= 'templatebased'; > identifier='Parameter2-2'; > =================================== > %%read in mri > > switch mritype > case 'MNI' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='MNI'; > case 'Analyze' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='Analyze'; > case 'SPM' > [mri] = ft_read_mri(mrifile); > mri.coordsys = 'SPM'; > end > save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') > cfg=[]; > ft_sourceplot(cfg,mri) > ============================== > > %% realigning > switch realign > case 'realigned' > cfg=[]; > cfg.method='fiducial'; > cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; > cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; > cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; > mri_realigned=ft_volumerealign(cfg,mri); > ft_sourceplot(cfg,mri_realigned) > save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') > case 'notrealigned' > %do nothing > end > > ========================= > %% volume reslicing > switch volumereslicing > case 'volumeresliced' > cfg = []; > cfg.resolution = 1; > mri_resliced = ft_volumereslice(cfg, mri); > save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') > case 'notresliced' > %do nothing > end > ft_sourceplot(cfg,mri_resliced) > ============================== > > %% segmentation parameters > switch scalpsmooth > case 'noscalpsmooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > case 'scalp_smooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.scalpsmooth = scalp_smooth.parameter; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > end > > seg.anatomy = mri.anatomy; > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > cfg.maskparameter=cfg.funparameter; > ft_sourceplot(cfg,seg) > > save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') > ================================= > %% prepare mesh > > cfg = []; > cfg.method= meshmethod; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [scalpvertices skullvertices brainvertices]; > bnd = ft_prepare_mesh(cfg, seg); > % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001; > bnd(2).pnt = bnd(2).pnt.*1; > bnd(3).pnt = bnd(3).pnt.*0.999; > > figure; > ft_plot_mesh(bnd(1))%scalp > figure; > ft_plot_mesh(bnd(2))%skull > figure; > ft_plot_mesh(bnd(3))%brain > > %% save mesh > save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') > ============================================= > > %% build headmodel > > switch headmodel_method > case 'dipoli' > cfg = []; > cfg.method = 'dipoli'; > case 'bemcp' > cfg = []; > cfg.method = 'bemcp'; > end > > headmodel = ft_prepare_headmodel(cfg, bnd); > headmodel = ft_convert_units(headmodel,'cm'); > > save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); > > ==================================== > %% adding electrodes to headmodel > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file > % visualize head surface (scalp) > figure; > ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > ================================= > %most likely they are not aligned, so for aligning electrodes > cfg = []; > cfg.method = 'interactive';%can try the 'fiducial' method but is very > %likely not to fix it > cfg.elec = elec; > % nas=mri_realigned.cfg.fiducial.nas; > % lpa=mri_realigned.cfg.fiducial.lpa; > % rpa=mri_realigned.cfg.fiducial.rpa; > cfg.headshape = headmodel.bnd(1);%scalp > elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes > > save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') > ================================== > %% load EEG data > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6w') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM0') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3W') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bw') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bb') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6b') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6') > ==================================== > %% timelock data > > cfg = []; > cfg.refef= 'yes'; %added at 2-5 > > > same = dataM0; > same.trial = [dataM0.trial dataM3W.trial]; > same.time = [dataM0.time dataM3W.time]; > > diff = dataM6; > diff.trial = [dataM3Bb.trial dataM6.trial]; > diff.time = [dataM3Bb.time dataM6.time]; > > switch timetype > case 'simple' > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > case 'hassan' > cfg.vartrllength = 0; %was changed to 0 from 2 > cfg.covariance = 'yes'; > cfg.covariancewindow = timewindow; > cfg.keeptrials = 'yes'; > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > > end > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') > > ============================ > %% make sourcemodel > > switch sourcemodeltype > case 'templatebased' > template=load('standard_sourcemodel3d10mm.mat'); > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file > cfg = []; > cfg.headmodel = headmodel; > cfg.mri=mri; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.resolution = 2; % resolution of the template grid in mm > cfg.moveinward = 1; % actually uses vol mesh > cfg.grid.unit ='mm'; > cfg.inwardshift = 0; % needs to be expressed to work with moveinward > cfg.elec = elec; > % cfg.headshape=('cortex_5124.surf.gii'); > mysourcemodel = ft_prepare_sourcemodel(cfg); > > case 'individual' > load('standard_sourcemodel3d5mm.mat'); > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 5; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > mysourcemodel = ft_prepare_sourcemodel(cfg); > case 'template' > mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work > end > > > > save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') > ======================= > %% Plot the single subject'e head model and grid positions > > figure > hold on > ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); > ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); > ======================== > %% Double check that source model is aligned to the segmented volume and to the electrodes > HERE IS WHERE I SEE THE ERROR > figure > hold on > plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); > ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); > ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); > ======================================== > %% make leadfield > > > switch gridtype > case 'individual' > cfg = []; > cfg.elec = elec; > cfg.headmodel = headmodel; > cfg.normalize = 'yes'; > cfg.reducerank= 3; > cfg.grid.unit = 'cm';% same unit as above, i.e. in cm > [grid] = ft_prepare_leadfield(cfg); > case 'templatebased' > load('standard_sourcemodel3d10mm.mat') > cfg = []; > cfg.elec = elec; > cfg.template = sourcemodel.cfg.grid; > cfg.grid=mysourcemodel.cfg.grid; > cfg.headmodel = headmodel; > cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG > cfg.channel = 'all'; > cfg.normalize= 'yes'; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > [grid] = ft_prepare_leadfield(cfg); > case 'template10' > load('standard_sourcemodel3d10mm.mat') > cfg.normalize='yes'; > [grid]=sourcemodel.cfg.grid; > end > > > save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') > =========================== > %% Interpolate > cfg = []; > cfg.interpmethod = 'linear'; > cfg.parameter = 'pow'; > sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); > sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); > sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); > sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); > sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); > sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); > > > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') > ================================= > > %%beamforming > > cfg = []; > cfg.method = 'slice'; > % cfg.slicedim= 1; > cfg.funcolormap = 'jet'; > % cfg.method = 'ortho'; > % cfg.funcolorlim = 'zeromax'; > % cfg.funcolorlim = [0.01 0.2]; > cfg.funparameter= 'pow'; > > > test2=sourceinterp_diff; > test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); > test=sourceinterp_diff; > test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; > ft_sourceplot(cfg,test) > ft_sourceplot(cfg,test2) > ft_sourceplot(cfg,sourceinterp_same); > ft_sourceplot(cfg,sourceinterp_diff); > ft_sourceplot(cfg,sourceinterp_m0); > ft_sourceplot(cfg,sourceinterp_m6); > ft_sourceplot(cfg,sourceinterp_m3w); > ft_sourceplot(cfg,sourceinterp_m3b); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From sreenivasan.r.nadar at gmail.com Wed Mar 30 16:39:26 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Wed, 30 Mar 2016 10:39:26 -0400 Subject: [FieldTrip] please help! sourcemodel and grid don't match In-Reply-To: References: Message-ID: Hi Hasan, The problem is probably related to dimensions (units: mm, cm) and same could be changed by using the command: headmodel = ft_convert_units(headmodel, 'cm'). Good luck! Vasan On Tue, Mar 29, 2016 at 9:19 PM, Hassan Aleem wrote: > Hi all, > > When I plot the sourcemodel and the headmodel, the sourcemodel is many > magnitudes larger than the headmodel. Not sure if it has anything to do > with my code so attaching that below. Also attaching the jpgs. > > %% read the parameters > > %% Parameter 2.2 > > mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; > mritype='MNI'; > realign='realigned'; > volumereslicing='volumeresliced'; > brainthresh=0.5; > scalpthresh=0.10; > scalpsmooth='scalp_smooth'; > scalp_smooth.parameter=9; > scalpvertices=1000; > skullvertices=1000; > brainvertices=1000; > meshmethod='projectmesh'; > headmodel_method='dipoli'; > subjnum='915'; > time='pre'; > timetype='hassan'; > timewindow=[0 .1]; > gridtype='template10'; > beamformer='lcmv'; > sourcemodeltype= 'templatebased'; > identifier='Parameter2-2'; > =================================== > %%read in mri > > switch mritype > case 'MNI' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='MNI'; > case 'Analyze' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='Analyze'; > case 'SPM' > [mri] = ft_read_mri(mrifile); > mri.coordsys = 'SPM'; > end > save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') > cfg=[]; > ft_sourceplot(cfg,mri) > ============================== > > %% realigning > switch realign > case 'realigned' > cfg=[]; > cfg.method='fiducial'; > cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; > cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; > cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; > mri_realigned=ft_volumerealign(cfg,mri); > ft_sourceplot(cfg,mri_realigned) > > save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') > case 'notrealigned' > %do nothing > end > > ========================= > %% volume reslicing > switch volumereslicing > case 'volumeresliced' > cfg = []; > cfg.resolution = 1; > mri_resliced = ft_volumereslice(cfg, mri); > > save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') > case 'notresliced' > %do nothing > end > ft_sourceplot(cfg,mri_resliced) > ============================== > > %% segmentation parameters > switch scalpsmooth > case 'noscalpsmooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > case 'scalp_smooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.scalpsmooth = scalp_smooth.parameter; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > end > > seg.anatomy = mri.anatomy; > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > cfg.maskparameter=cfg.funparameter; > ft_sourceplot(cfg,seg) > > save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') > ================================= > %% prepare mesh > > cfg = []; > cfg.method= meshmethod; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [scalpvertices skullvertices brainvertices]; > bnd = ft_prepare_mesh(cfg, seg); > % i enlarged / reduced the boundary mesh a little bit, because they were > causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001; > bnd(2).pnt = bnd(2).pnt.*1; > bnd(3).pnt = bnd(3).pnt.*0.999; > > figure; > ft_plot_mesh(bnd(1))%scalp > figure; > ft_plot_mesh(bnd(2))%skull > figure; > ft_plot_mesh(bnd(3))%brain > > %% save mesh > > save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') > ============================================= > > %% build headmodel > > switch headmodel_method > case 'dipoli' > cfg = []; > cfg.method = 'dipoli'; > case 'bemcp' > cfg = []; > cfg.method = 'bemcp'; > end > > headmodel = ft_prepare_headmodel(cfg, bnd); > headmodel = ft_convert_units(headmodel,'cm'); > > > save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); > > ==================================== > %% adding electrodes to headmodel > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode > file > % visualize head surface (scalp) > figure; > ft_plot_mesh(headmodel.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > ================================= > %most likely they are not aligned, so for aligning electrodes > cfg = []; > cfg.method = 'interactive';%can try the 'fiducial' method but is very > %likely not to fix it > cfg.elec = elec; > % nas=mri_realigned.cfg.fiducial.nas; > % lpa=mri_realigned.cfg.fiducial.lpa; > % rpa=mri_realigned.cfg.fiducial.rpa; > cfg.headshape = headmodel.bnd(1);%scalp > elec_aligned = ft_electroderealign(cfg);%use the gui to manually align > the electrodes > > save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') > ================================== > %% load EEG data > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6w') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM0') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3W') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3Bw') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3Bb') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6b') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6') > ==================================== > %% timelock data > > cfg = []; > cfg.refef= 'yes'; %added at 2-5 > > > same = dataM0; > same.trial = [dataM0.trial dataM3W.trial]; > same.time = [dataM0.time dataM3W.time]; > > diff = dataM6; > diff.trial = [dataM3Bb.trial dataM6.trial]; > diff.time = [dataM3Bb.time dataM6.time]; > > switch timetype > case 'simple' > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > case 'hassan' > cfg.vartrllength = 0; %was changed to 0 from 2 > cfg.covariance = 'yes'; > cfg.covariancewindow = timewindow; > cfg.keeptrials = 'yes'; > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > > end > > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') > > ============================ > %% make sourcemodel > > switch sourcemodeltype > case 'templatebased' > template=load('standard_sourcemodel3d10mm.mat'); > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load > electrode file > cfg = []; > cfg.headmodel = headmodel; > cfg.mri=mri; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.resolution = 2; % resolution of the template grid in mm > cfg.moveinward = 1; % actually uses vol mesh > cfg.grid.unit ='mm'; > cfg.inwardshift = 0; % needs to be expressed to work with > moveinward > cfg.elec = elec; > % cfg.headshape=('cortex_5124.surf.gii'); > mysourcemodel = ft_prepare_sourcemodel(cfg); > > case 'individual' > load('standard_sourcemodel3d5mm.mat'); > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 5; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > mysourcemodel = ft_prepare_sourcemodel(cfg); > case 'template' > mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work > end > > > > > save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') > ======================= > %% Plot the single subject'e head model and grid positions > > figure > hold on > ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); > ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); > ======================== > %% Double check that source model is aligned to the segmented volume and > to the electrodes > *HERE IS WHERE I SEE THE ERROR* > figure > hold on > > plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); > > ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); > ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); > ======================================== > %% make leadfield > > > switch gridtype > case 'individual' > cfg = []; > cfg.elec = elec; > cfg.headmodel = headmodel; > cfg.normalize = 'yes'; > cfg.reducerank= 3; > cfg.grid.unit = 'cm';% same unit as above, i.e. in cm > [grid] = ft_prepare_leadfield(cfg); > case 'templatebased' > load('standard_sourcemodel3d10mm.mat') > cfg = []; > cfg.elec = elec; > cfg.template = sourcemodel.cfg.grid; > cfg.grid=mysourcemodel.cfg.grid; > cfg.headmodel = headmodel; > cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG > cfg.channel = 'all'; > cfg.normalize= 'yes'; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > [grid] = ft_prepare_leadfield(cfg); > case 'template10' > load('standard_sourcemodel3d10mm.mat') > cfg.normalize='yes'; > [grid]=sourcemodel.cfg.grid; > end > > > save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') > =========================== > %% Interpolate > cfg = []; > cfg.interpmethod = 'linear'; > cfg.parameter = 'pow'; > sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); > sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); > sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); > sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); > sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); > sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); > > > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') > ================================= > > %%beamforming > > cfg = []; > cfg.method = 'slice'; > % cfg.slicedim= 1; > cfg.funcolormap = 'jet'; > % cfg.method = 'ortho'; > % cfg.funcolorlim = 'zeromax'; > % cfg.funcolorlim = [0.01 0.2]; > cfg.funparameter= 'pow'; > > > test2=sourceinterp_diff; > > test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); > test=sourceinterp_diff; > test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; > ft_sourceplot(cfg,test) > ft_sourceplot(cfg,test2) > ft_sourceplot(cfg,sourceinterp_same); > ft_sourceplot(cfg,sourceinterp_diff); > ft_sourceplot(cfg,sourceinterp_m0); > ft_sourceplot(cfg,sourceinterp_m6); > ft_sourceplot(cfg,sourceinterp_m3w); > ft_sourceplot(cfg,sourceinterp_m3b); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Thu Mar 31 13:11:31 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Thu, 31 Mar 2016 13:11:31 +0200 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> Message-ID: Dear FielTrip community, Sorry to bother you again... I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... This is my story : - It's a single-subject study - I want to compare two sets of trials observed in different conditions. - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the "unequal sample size problem". - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). Based on the paper, I could refer myself to the point "2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin". - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. - And I can perform the montecarlo simulation. My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? This is what I did : 1) Extract and preprocess the signal from my condition 1. 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → 3) coh1= ft_connectivityanalysis(cfg, freq1) I did the same thing for the other condition → coh2. And then for the statistics : cfg = []; cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) cfg.parameter='cohspctrm'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; stat=ft_freqstatistics(cfg, coh1, coh2); And it gives me the following error : Error using ft_checkconfig (line 153) The field cfg.design is required. Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? Any help will be appreciated ! Thanks a lot for your time, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Thu Mar 31 13:47:19 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Thu, 31 Mar 2016 11:47:19 +0000 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr>, Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> Hi Laetitia, If you only have one subject you do need individual trial data, otherwise you can't do statistics like this. You need multiple observations (either subjects or trials). Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of laetitia.lalla at inserm.fr [laetitia.lalla at inserm.fr] Sent: Thursday, March 31, 2016 1:11 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question about coherence statistics Dear FielTrip community, Sorry to bother you again... I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... This is my story : - It's a single-subject study - I want to compare two sets of trials observed in different conditions. - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the “unequal sample size problem”. - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). Based on the paper, I could refer myself to the point “2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin”. - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. - And I can perform the montecarlo simulation. My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? This is what I did : 1) Extract and preprocess the signal from my condition 1. 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → 3) coh1= ft_connectivityanalysis(cfg, freq1) I did the same thing for the other condition → coh2. And then for the statistics : cfg = []; cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) cfg.parameter='cohspctrm'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; stat=ft_freqstatistics(cfg, coh1, coh2); And it gives me the following error : Error using ft_checkconfig (line 153) The field cfg.design is required. Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? Any help will be appreciated ! Thanks a lot for your time, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Thu Mar 31 15:22:31 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Thu, 31 Mar 2016 15:22:31 +0200 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr>, <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, thank you very much for your fast answer ! I'm not sure I understand what you mean though... Maybe i did not express myself correctly. I do have individual trial data : I have 26 observations for condition 1 and 26 observations for condition 2. They appear : - In my structure "data" (output of ft_preprocessing) : data.trial is a cell {1 x nbtrials} (in my case : {1, 26}) - in my structure "freq" (output of ft_freqanalysis) : freq.powspctrm is a matrix of dimension : nbtrials X nbchannel X nbfreq (in my case 26x2x25) But I don't have this information anymore in the structure "coh" (output of ft_connectivityanalysis) : coh.cospctrm is a matrix of dimension nbchannelcmb x nbfreq (in my case 1x25) since the coherence is calculated by averaging over trials... You may mean I should give the "freq" structures as inputs to the fonction ft_freqstatistics ? I just tried that : I created a structure data_all by concatenated data1.trial and data2.trial (and every other appropriate attribute). I took the Time Frequency Representation with ft_freqanalysis (with keeptrials='yes') to obtain a structure TFR_all (following this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics This is actually how I did the statistics for the Power). But then, if I give this as an input to ft_freqstatistics, like this : cfg = []; cfg.statistic = 'diff'; cfg.parameter='cohspctrm'; cfg.design= [ones(1,nbtrial)) 2*ones(1, nbtrial))]; %same nb of trials for both condition cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; >> stat=ft_freqstatistics(cfg, FR_alltrials); I have the following error : Error using getdimord (line 15) field "cohspctrm" not present in data which makes a lot of sense, since I did not gave coherence as an input... I gave Frequency representations.. I was hoping that maybe the function would calculate the coherence itself for the statistics ? ^^ But it's clearly not the way to go. Could you be a bit more explicit about what you meant ? Thanks a lot. Best, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France On 31-03-2016 13:47, Snijders, T.M. (Tineke) wrote: > Hi Laetitia, > > If you only have one subject you do need individual trial data, otherwise you can't do statistics like this. > You need multiple observations (either subjects or trials). > > Best, > Tineke > > ------------------------- > > FROM: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of laetitia.lalla at inserm.fr [laetitia.lalla at inserm.fr] > SENT: Thursday, March 31, 2016 1:11 PM > TO: fieldtrip at science.ru.nl > SUBJECT: [FieldTrip] Question about coherence statistics > > Dear FielTrip community, > > Sorry to bother you again... > > I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) > > I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... > > This is my story : > > - It's a single-subject study > > - I want to compare two sets of trials observed in different conditions. > > - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the "unequal sample size problem". > > - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). > > Based on the paper, I could refer myself to the point "2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin". > > - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. > > - And I can perform the montecarlo simulation. > > My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? > > This is what I did : > > 1) Extract and preprocess the signal from my condition 1. > > 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → > > 3) coh1= ft_connectivityanalysis(cfg, freq1) > > I did the same thing for the other condition → coh2. > > And then for the statistics : > > cfg = []; > > cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) > > cfg.parameter='cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.numrandomization = 1000; > > cfg.ivar = 1; > > cfg.alpha=0.05; > > cfg.tail=0; > > cfg.correcttail='alpha'; > > stat=ft_freqstatistics(cfg, coh1, coh2); > > And it gives me the following error : > > Error using ft_checkconfig (line 153) > > The field cfg.design is required. > > Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... > > Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? > > Any help will be appreciated ! > > Thanks a lot for your time, > > Laetitia Lalla > > PhD student in Neurosciences > > INMED, Marseille, France > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From runna90 at 126.com Tue Mar 1 09:23:48 2016 From: runna90 at 126.com (CRN) Date: Tue, 1 Mar 2016 16:23:48 +0800 Subject: [FieldTrip] where is the trial information after doing ft_timelockgrandaverage using within method Message-ID: <971DC9DB-D127-4553-9524-F662A6CA90D3@126.com> Dear all, I am new to field trip and I encountered a lot problems when I analyzing the MEG data. Looking forward to your help! My data structure is like this, 3 subjects x 3 conditions x 2 blocks. Now I want to do time-locked permutation test between trialsI. Here is my procedure: preprocessing-define trials-timelockanalysis-timelockgrandaverage. The problem occurred in the forth step, the trial information was depreciated when I used the ft_timelockgrandaverage function. I got a warning: Warning: depreciating trial field: using the avg to compute the grand average. But it is required when I do permutation test. What should I do? Thank you for your time! Best wishes, Runnan runna90 at 126.com Institute of Biophysics, Chinese Academy of Science, Beijing, China -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Tue Mar 1 10:44:16 2016 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Tue, 1 Mar 2016 10:44:16 +0100 Subject: [FieldTrip] How to plot sourcedata at the cortical surface In-Reply-To: <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> References: <347287188.845797.1456776718141.JavaMail.yahoo.ref@mail.yahoo.com> <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> Message-ID: <005f01d1739e$ec0347c0$c409d740$@artinis.com> Hi Diljit, I hope you are doing fine. Have you seen this tutorial, which explains the processing of anatomical data? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate It’s a somewhat cumbersome work including some freesurfer action. With best regards, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of D I L J I T Sent: Monday, February 29, 2016 21:12 To: fieldtrip at science.ru.nl Subject: [FieldTrip] How to plot sourcedata at the cortical surface Hi All, We have done the MEG source analysis using fieltrip. We want to plot the the source data at the surface. We want to have the individual surface. Can anyone please guide us how to prepare them(i.e. surface_white_both.mat etc). Thanks alot in advance, Warm Regards DJ Diljit Singh Kajal ------------------------------------ Ph.D Research Scholar, International Max Planck Research School, Graduate Training Centre for Neuroscience, Institute for Medical Psychology & Behavioural Neurobiology, MEG Centre, Room number 202, Otfried-Müller-Str. 47, University of Tübingen, Tübingen-72076, Germany. +49-176-88262138(M), +49-7071-2981196(O) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Mar 1 11:02:08 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 1 Mar 2016 10:02:08 +0000 Subject: [FieldTrip] How to plot sourcedata at the cortical surface In-Reply-To: <005f01d1739e$ec0347c0$c409d740$@artinis.com> References: <347287188.845797.1456776718141.JavaMail.yahoo.ref@mail.yahoo.com> <347287188.845797.1456776718141.JavaMail.yahoo@mail.yahoo.com> <005f01d1739e$ec0347c0$c409d740$@artinis.com> Message-ID: An alternative to Jorn’s suggestion would be to register the source reconstructed data to MNI space, and use the template surface for visualisation. Best, Jan-Mathijs On 01 Mar 2016, at 10:44, Jörn M. Horschig > wrote: Hi Diljit, I hope you are doing fine. Have you seen this tutorial, which explains the processing of anatomical data? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate It’s a somewhat cumbersome work including some freesurfer action. With best regards, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of D I L J I T Sent: Monday, February 29, 2016 21:12 To: fieldtrip at science.ru.nl Subject: [FieldTrip] How to plot sourcedata at the cortical surface Hi All, We have done the MEG source analysis using fieltrip. We want to plot the the source data at the surface. We want to have the individual surface. Can anyone please guide us how to prepare them(i.e. surface_white_both.mat etc). Thanks alot in advance, Warm Regards DJ Diljit Singh Kajal ------------------------------------ Ph.D Research Scholar, International Max Planck Research School, Graduate Training Centre for Neuroscience, Institute for Medical Psychology & Behavioural Neurobiology, MEG Centre, Room number 202, Otfried-Müller-Str. 47, University of Tübingen, Tübingen-72076, Germany. +49-176-88262138(M), +49-7071-2981196(O) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Tue Mar 1 11:51:17 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Tue, 1 Mar 2016 10:51:17 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth Message-ID: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 From stephen.politzer-ahles at ling-phil.ox.ac.uk Tue Mar 1 12:14:50 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Tue, 1 Mar 2016 11:14:50 +0000 Subject: [FieldTrip] MEG sensors statistics Message-ID: Hello Elana, This depends a lot on what statistical test you did and how your data were acquired and processed. e.g., to take the simplest example: if you simply do t-tests at each sensor and don't correct for multiple comparisons, this certainly is 'false power' (it's extremely anti-conservative: it will get a lot of false positives). However, if you use cluster-based statistics, this is less of a concern, since sensors showing related activity likely get grouped together. The fieldtrip tutorial on cluster-based permutation testing has more information. Even with that, there still are potentially related issues, for instance, if you recorded with axial gradiometers then a single dipole might show up as two clusters of sensors, whereas if you recorded with planar gradiometers (or transformed the data to the planar gradient) then a single dipole should only show up as one cluster. What you are describing in your message is also possible (it's similar to calculating global field power, which people do do), but it throws away any spatial information from the signal. Which analysis is most appropriate for you really depends on the nature of the hypotheses you want to test. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 8 > Date: Mon, 29 Feb 2016 20:20:17 +0000 > From: "Harris, Elana" > To: FieldTrip discussion list > Cc: "Shahana, Nasrin \(Nasrin Shahana\)" > Subject: [FieldTrip] MEG sensors statistics > Message-ID: > < > B622DB18EE766C4BBAA34EA95310C34C5021AA68 at MCEXMB3.chmccorp.cchmc.org> > Content-Type: text/plain; charset="utf-8" > > Dear All, > > I have the minimum, maximum and mean alpha power for each MEG sensor > (found using MEGProcessor developed by Jing Xiang, MD, PhD) for 16 > subjects, 8 of whom have a psychiatric condition and 8 are healthy > comparison subjects. > > We find statistical significance when comparing the set all of the MLF or > MRO sensors, for instance, between the groups (healthy and pathological), > however, I am wondering if this is false statistical power as all of the > sensors likely represent once source generator and not truly, multiple, > separate, non-independent recordings. Would it be best to summarize each > subject?s data with one number to represent the maximum alpha power for the > group of MLF sensors and then compare the two groups of subjects? > > I welcome your advice. > > Thank you. > > Elana > > Elana Harris, MD, PhD > Assistant Professor > Division of Child & Adolescent Psychiatry > Cincinnati Children?s Hospital Medical Center > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160229/598ee99d/attachment-0001.html > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Tue Mar 1 15:52:12 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Tue, 1 Mar 2016 09:52:12 -0500 Subject: [FieldTrip] volume conduction model Message-ID: Fieldtripers, What is the best volume conduction model that compute all sources (entire grid) that are within the brain volume? I am doing resting state analysis and wish to extract source time series for all the grids within the brain volume. I am using singleshell volume conduction model and lcmv and eloreta source models. Unfortunately, for large number of grids i.e, the source.avg.filter are empty. Please let me know if there are ways to deal with this problem. Thank you in advance. -Vasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.pedrosa at ndcn.ox.ac.uk Tue Mar 1 16:21:36 2016 From: david.pedrosa at ndcn.ox.ac.uk (David Pedrosa) Date: Tue, 1 Mar 2016 15:21:36 +0000 Subject: [FieldTrip] Question on coherence stats at sensor level Message-ID: Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Mar 1 17:06:25 2016 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 1 Mar 2016 17:06:25 +0100 Subject: [FieldTrip] volume conduction model In-Reply-To: References: Message-ID: Dear Vasan, the choice of your volume conduction model depends on the data you want to analyze. Do you use MEG or EEG? If you state, a large number of grid points are empty, do you refer to the "inside" grid points, i.e. the elements of your grid falling into the the brain volume, or do you refer to all grid points? If the latter is the case, that is the correct behavior, as grid points outside your brain volume should not contain data. Hope this helps, Julian On Tue, Mar 1, 2016 at 3:52 PM, Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com> wrote: > Fieldtripers, > > What is the best volume conduction model that compute all sources (entire > grid) that are within the brain volume? I am doing resting state analysis > and wish to extract source time series for all the grids within the brain > volume. I am using singleshell volume conduction model and lcmv and eloreta > source models. Unfortunately, for large number of grids i.e, the > source.avg.filter are empty. Please let me know if there are ways to deal > with this problem. > > Thank you in advance. > > -Vasan > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Tue Mar 1 17:20:34 2016 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Tue, 1 Mar 2016 17:20:34 +0100 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: References: Message-ID: <012d01d173d6$48b804b0$da280e10$@artinis.com> Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.Nieuwland at ed.ac.uk Tue Mar 1 21:04:08 2016 From: M.Nieuwland at ed.ac.uk (NIEUWLAND Mante) Date: Tue, 1 Mar 2016 20:04:08 +0000 Subject: [FieldTrip] colored or grey output from ft_singleplotTFR 'mask' Message-ID: Dear Fieldtrip users, With the same singleplotTFR script (see below), which masks the differenceplot of two conditions using the statistical result, I seem to get the expected color output in one dataset (1c1d.pdf) but unexpectedly grey output in another dataset (3c3d.pdf) *irrespective of how I set the z-lim*. I've also tried changing. Does anyone have an idea how this can happen? Cheers, Mante chan = {'C3'}; % channel to plot cfg = []; cfg.interactive = 'yes'; cfg.layout = 'elec_30layout.lay'; cfg.zlim = [.9 1.1]; cfg.ylim = [30 90]; cfg.xlim = [-.5 1.5]; cfg.colorbar = 'yes'; cfg.colormap = jet; cfg.renderer = 'painters'; %, 'painters', 'zbuffer',' opengl' or 'none' (default = []) cfg.channel = chan; figure; [other subplots] figure; cfg.zlim = [-.2 0.2]; % singlechan effect subplot(2, 1, 1) ft_singleplotTFR(cfg,grandavg_hi_131_132); title({''},'fontsize',15); linehandle = line([0 0], [30 90],'Color','b'); % line at zero set(linehandle, 'Color', 'k'); set(gca,'fontsize', 15); cfg.zlim = [-.2 0.2]; grandavg_hi_131_132.mask = logical(zeros(size(grandavg_hi_131_132.powspctrm))); grandavg_hi_131_132.mask(:,3:27,121:251) = statisTFR_hi_131_132.mask; cfg.maskstyle = 'saturation'; % 'saturation'; % 'outline'; % opacity cfg.maskparameter = 'mask'; subplot(2,1,2) ft_singleplotTFR(cfg,grandavg_hi_131_132); title(' ','fontsize',15); linehandle = line([0 0], [30 90],'Color','b'); set(linehandle, 'Color', 'k'); set(gca,'fontsize', 15); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1c1d.pdf Type: application/pdf Size: 15821 bytes Desc: 1c1d.pdf URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3c3d.pdf Type: application/pdf Size: 17214 bytes Desc: 3c3d.pdf URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From david.pedrosa at ndcn.ox.ac.uk Wed Mar 2 12:39:17 2016 From: david.pedrosa at ndcn.ox.ac.uk (David Pedrosa) Date: Wed, 2 Mar 2016 11:39:17 +0000 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: <012d01d173d6$48b804b0$da280e10$@artinis.com> References: , <012d01d173d6$48b804b0$da280e10$@artinis.com> Message-ID: Hi Jorn, thanks for the fast help! It was as you suggested. Now, I have a different issue someone might be able to help me with. When I do the analyses as explained, fieldtrip tells me that cluster stats are not possible as there are no labels in the data. This of course makes sense as it is coherence data with a labelcmb instead of label structure. Is there a way to do the cluster correction in fieldtrip with coherence data anyway? Or would it make more sense to take the raw fourier data into ft_freqstatistics and do the stats as desired in a custom statfun function with the corrections as wanted, e.g. similar to indepsamplesZcoh but for between subjects analyses? Best David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Jörn M. Horschig [jorn at artinis.com] Gesendet: Dienstag, 1. März 2016 16:20 An: 'FieldTrip discussion list' Betreff: Re: [FieldTrip] Question on coherence stats at sensor level Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David ________________________________ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Wed Mar 2 13:13:55 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 2 Mar 2016 12:13:55 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Message-ID: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel > On 01.03.2016, at 11:51, Hähnke, Daniel wrote: > > Dear FieldTrip users, > > I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. > However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. > > I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. > > Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. > > Does anyone know how to objectively choose the bandwidth parameter? > > Best, > > Daniel > -- > Daniel Hähnke > PhD student > > Technische Universität München > Institute of Neuroscience > Translational NeuroCognition Laboratory > Biedersteiner Straße 29, Bau 601 > 80802 Munich > Germany > > Email: daniel.haehnke at tum.de > Phone: +49 89 4140 3356 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Wed Mar 2 14:05:43 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 2 Mar 2016 13:05:43 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> Message-ID: <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 daniel.haehnke at tum.de Wed Mar 2 15:08:24 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 2 Mar 2016 14:08:24 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> Message-ID: <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 fosco.bernasconi at gmail.com Wed Mar 2 15:29:53 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Wed, 2 Mar 2016 15:29:53 +0100 Subject: [FieldTrip] Beamformer source localization for EEG, template MRI & standard BEM Message-ID: Dear all, I'm trying to compute source localization (to eventually do some connectivity in the source space) on my EEG data, using template mri and standard bem. I have few errors: 1. When computing the leadfield: Warning: dipole lies on boundary of volume model > In forward/private/inf_medium_leadfield at 54 In forward/private/eeg_leadfieldb at 93 In ft_compute_leadfield at 442 In ft_prepare_leadfield at 222 2. I tried to discard this error, I cannot compute the source localization: Error using svd Input to SVD must not contain NaN or Inf. Error in beamformer_dics>pinv (line 643) [U,S,V] = svd(A,0); Error in beamformer_dics (line 336) filt = pinv(lf' * invCf * lf) * lf' * invCf; % Gross eqn. 3, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 657) dip(i) = beamformer_dics(grid, sens, headmodel, [], squeeze(Cf(i,:,:)), optarg{:}); According to previous posts, the second error might be due to labeling of the electrodes. But the labels are ok, and I can make everything work when using the mne (by adapting the script of course) instead of beamforming. Therefore, I think the problem is more related to some of the previous steps. Here my code: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2 cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft); % read electrodes elec = ft_read_sens('/home/sv/Matlabtoolboxes/fieldtrip-20160223/template/electrode/biosemi64_1.sfp'); elec = ft_convert_units(elec,'cm'); % Load mri: mri = ft_read_mri('/home/sv/Matlabtoolboxes/fieldtrip-20160223/external/spm8/templates/T1.nii'); mri = ft_convert_units(mri,elec.unit); % Load headmodel: load('/home/sv/Matlabtoolboxes/fieldtrip-20160223//template/headmodel/standard_bem.mat'); vol = ft_convert_units(vol,elec.unit); [vol, sens] = ft_prepare_vol_sens(vol,elec); % Load sourcemodel: load('standard_sourcemodel3d8mm.mat'); % Compute LeadField cfg = []; cfg.channel = 'eeg'; cfg.elec = sens; cfg.headmodel = vol; grid = ft_prepare_leadfield(cfg,freq); % Compute Source: cfg = []; cfg.method = 'dics'; cfg.grid = grid; cfg.vol = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); any help is appreciated thanks a lot! fosco -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Wed Mar 2 17:54:28 2016 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Wed, 02 Mar 2016 11:54:28 -0500 Subject: [FieldTrip] TMS-EEG tutorial error Message-ID: <56D6D474020000DC00018FF5@MPRC.UMARYLAND.EDU> Dear all, I am trying to run the scripts on TMS-EEG tutorial (http://www.fieldtriptoolbox.org/tutorial/tms-eeg). However, when reject ICA components, it gave me an error message. Specifically, when I ran this command in Matlab: data_tms_clean_segmented = ft_rejectcomponent(cfg, comp_tms); The error message is : Error using cat Dimensions of matrices being concatenated are not consistent. Error in ft_apply_montage (line 245) tmp = cat(1, data_unused.trial{:}); Error in ft_rejectcomponent (line 184) data = ft_apply_montage(data, montage, 'keepunused', keepunused, 'feedback', cfg.feedback); It went through when I added an input data for ft_rejectcomponent like this data_tms_clean_segmented = ft_rejectcomponent(cfg, comp_tms, data_tms_segmented); Although the results I got look similar to the figures on the webpage, please let me know if there are some fundamental issues of adding the data-input. Any suggestions will be appreciated!Xiaoming -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Thu Mar 3 15:00:58 2016 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Thu, 3 Mar 2016 15:00:58 +0100 Subject: [FieldTrip] Question on coherence stats at sensor level In-Reply-To: References: , <012d01d173d6$48b804b0$da280e10$@artinis.com> Message-ID: <012301d17555$1d578540$58068fc0$@artinis.com> Hi David, If I remember correctly you can call ft_checkdata with the key-value pair ‘cmbrepresentation’, ‘full’ if you want to switch back from data.labelcmb to data.label (or ‘sparse’ for the reverse way). Best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Wednesday, March 2, 2016 12:39 To: FieldTrip discussion list Subject: Re: [FieldTrip] Question on coherence stats at sensor level Hi Jorn, thanks for the fast help! It was as you suggested. Now, I have a different issue someone might be able to help me with. When I do the analyses as explained, fieldtrip tells me that cluster stats are not possible as there are no labels in the data. This of course makes sense as it is coherence data with a labelcmb instead of label structure. Is there a way to do the cluster correction in fieldtrip with coherence data anyway? Or would it make more sense to take the raw fourier data into ft_freqstatistics and do the stats as desired in a custom statfun function with the corrections as wanted, e.g. similar to indepsamplesZcoh but for between subjects analyses? Best David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ _____ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Jörn M. Horschig [jorn at artinis.com] Gesendet: Dienstag, 1. März 2016 16:20 An: 'FieldTrip discussion list' Betreff: Re: [FieldTrip] Question on coherence stats at sensor level Hi David, The problem is with specifying cfg.statistics = ‘diff’. the ft_xxxstats function work by ‘eval’-ing the content of cfg.statistics. Thus, it runs the built-in Matlab function ‘diff’, which is not defined for structs such as FT-data variables, but only for matrices (and cells?). I saw there is also a ft_statfun_diff, which is probably the one you were aiming to use. The problem is that internally, the private function ft_getuserfun is checking first for the existence of ‘diff’, before it even comes to considering ‘ft_statfun_diff’. Long story short, you can most likely solve your problem by specifying ‘ft_statfun_diff’ instead of ‘diff’, and the FT guys should think about what to do with ft_getuserfun. All the best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of David Pedrosa Sent: Tuesday, March 1, 2016 16:22 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question on coherence stats at sensor level Dear list, I running analyses on the sensor level with EMG-EEG coherence data and I ran into some problems. Basically my intention is to compare the corticomuscular coherence at rest versus during an activation task. For that, according to some older posts and literature, I computed the Z-transformed coherence (after using ft_connectivityanalyses, I manually transformed the cohspctrm data with respect to the dof) which I want to test with a permutation test. Now, when it comes to computing the stats, it gives me the error >> Function 'diff' is not supported for class 'struct'. << Would it be more reasonable using another function? Or does anyone have an idea where my problem could be or what I should do instead? Here's the used code I use: %% for loop normalizing coherence manually and creating 0-coherence data... coh_diff{1,1} = coh_diff_condition{1,1}.cohspctrm = (atanh(x1) - ... coh_diff_null{1,1}.cohspctrm(:) = 0; cfg = []; cfg.channel = {'EEG' 'xEDC'}; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'diff'; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = .025; cfg.numrandomization = 500; cfgl = []; cfgl.layout = 'brainamp.sfp'; cfg.layout = ft_prepare_layout(cfgl); cfg.computestat = 'yes'; cfg.correctm = 'cluster'; cfg.clusteralpha = .05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfgn = []; cfgn.method = 'distance'; cfgn.neighbourdist = 40; %in mm cfg.neighbours = ft_prepare_neighbours(cfgn,data_epoched_wo); design = zeros( 2,2*numel(coh_diff)); design(1,:) = [1:numel(coh_diff), 1:numel(coh_diff_null)]; design(2,1:numel(coh_diff)) = 1; design(2,numel(coh_diff)+1:numel(coh_diff)+numel(coh_diff_null)) = 2; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; [stat] = ft_freqstatistics(cfg, coh_diff{1,1}, coh_diff{1,2}, ..., coh_diff_null{1,12}; Thanks for your help. Best, David _____ Dr. David Pedrosa Clinical Research Fellow Medical Research Council Brain Network Dynamics Unit at the University of Oxford Nuffield Department of Clinical Neurosciences University of Oxford Level 6, West Wing John Radcliffe Hospital, OX3 9DU Tel: +44 (0)1865 572490 E-Mail: david.pedrosa at ndcn.ox.ac.uk http://www.mrcbndu.ox.ac.uk/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.schreiner at psychologie.uzh.ch Thu Mar 3 21:22:29 2016 From: thomas.schreiner at psychologie.uzh.ch (thomas.schreiner at psychologie.uzh.ch) Date: Thu, 3 Mar 2016 21:22:29 +0100 Subject: [FieldTrip] open PhD position in sleep/memory research Message-ID: Hi all, please find attached a link leading to the details of an open PhD position.  The successful candidate will work on the project „Oscillatory mechanisms underlying memory retention and reactivation during sleep” under supervision of Björn Rasch at the University of Fribourg, Switzerland.  Feel free to share!  Best, Thomas --- University of Zurich Dr. Thomas Schreiner Department of Psychology Biopsychology Binzmuehlestr. 14 / Box 5 CH - 8050 Zuerich Tel. +41 44 635 7467 www.psychologie.uzh.ch thomas.schreiner at psychologie.uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.schreiner at psychologie.uzh.ch Thu Mar 3 23:00:27 2016 From: thomas.schreiner at psychologie.uzh.ch (thomas.schreiner at psychologie.uzh.ch) Date: Thu, 3 Mar 2016 23:00:27 +0100 Subject: [FieldTrip] open PhD position sleep/memory Message-ID: Hi again, here now the link concerning the sleep / memory PhD position... http://www.unifr.ch/psycho/assets/files/CogPsy/Open_PhD_Position_SleepMemory.pdf Best, Thomas --- University of Zurich Dr. Thomas Schreiner Department of Psychology Biopsychology Binzmuehlestr. 14 / Box 5 CH - 8050 Zuerich Tel. +41 44 635 7467 www.psychologie.uzh.ch thomas.schreiner at psychologie.uzh.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 4 06:28:18 2016 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Thu, 3 Mar 2016 21:28:18 -0800 Subject: [FieldTrip] issue at interpolation after source analysis Message-ID: <56D91CF2.5080604@gmail.com> Hi everyone, I'm working with clinical MEG data for which part of the source pipeline has been conducted by someone else as part of a clinical protocol. I don't have full access to what has been done to the MRI that I'm getting, so I'm trying to put bits and pieces of code together to arrive at a source reconstruction. The rest of my pipeline is the pretty standard tutorial beamforming. I was hoping someone could help me figure out where my source analysis is going wrong by looking at this figure. On the left, the subject's headmodel seems to be fine (after warping to MNI). On the right, I'm plotting the source result without interpolating with any structural data. In the middle you see what happens when I interpolate the source with the "single_subj_T1.nii" structural image. It doesn't seem to be a matter of scaling (like mm to cm), but rather it being kinda upside down + something else? Does anyone know by looking at this whether the error emerges because of an unsuccessful interpolation or because something more fundamental is going wrong earlier on? Thanks so much, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: djijjfaf.png Type: image/png Size: 104874 bytes Desc: not available URL: From a.stolk8 at gmail.com Fri Mar 4 07:18:54 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Thu, 3 Mar 2016 22:18:54 -0800 Subject: [FieldTrip] issue at interpolation after source analysis In-Reply-To: <56D91CF2.5080604@gmail.com> References: <56D91CF2.5080604@gmail.com> Message-ID: Hey Vitoria, Hard to tell without seeing any code, but my hunch is that the plot on the left is subject space whereas the middle is subject spaced data plotted in MNI space. If the sourcemodel/grid on the left is truly MNI-aligned (but the regular spacing suggests otherwise) than it may be an instance of forgetting to copy over the dim and pos fields from the MNI template to the subject mri structure. You can check whether this is case by comparing the dim and pos fields of the template with those of the subject. They should be the same (after alignment). Hopefully that solves it. Otherwise you'd probably need to provide some code. Arjen 2016-03-03 21:28 GMT-08:00 Vitória Piai : > Hi everyone, > > I'm working with clinical MEG data for which part of the source pipeline > has been conducted by someone else as part of a clinical protocol. I don't > have full access to what has been done to the MRI that I'm getting, so I'm > trying to put bits and pieces of code together to arrive at a source > reconstruction. The rest of my pipeline is the pretty standard tutorial > beamforming. > > I was hoping someone could help me figure out where my source analysis is > going wrong by looking at this figure. On the left, the subject's headmodel > seems to be fine (after warping to MNI). On the right, I'm plotting the > source result without interpolating with any structural data. In the middle > you see what happens when I interpolate the source with the > "single_subj_T1.nii" structural image. > It doesn't seem to be a matter of scaling (like mm to cm), but rather it > being kinda upside down + something else? Does anyone know by looking at > this whether the error emerges because of an unsuccessful interpolation or > because something more fundamental is going wrong earlier on? > > Thanks so much, > Vitoria > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: djijjfaf.png Type: image/png Size: 104874 bytes Desc: not available URL: From andrea.brovelli at univ-amu.fr Fri Mar 4 09:21:18 2016 From: andrea.brovelli at univ-amu.fr (Andrea Brovelli) Date: Fri, 4 Mar 2016 09:21:18 +0100 Subject: [FieldTrip] Brain Connectivity Workshop 2016 Message-ID: <56D9457E.2000500@univ-amu.fr> Dear all, I thought it may interest some people from the list. Andrea -------------------------------------------------------------------------------------------------------------- ** *Brain Connectivity Workshop 2016, Marseille (France)* Registration is open now! (reduced rates until March 30^th ) When: 22nd to 24th June, 2016 Link to official website: http://bcw2016.org We are happy to announce the 15th edition of the *Brain Connectivity Workshop* (BCW) to take place in Marseille from the 22nd to the 24th of June 2016. The Brain Connectivity Workshop (BCW) is a well-established workshop series, which has been held annually in Europe, USA, Australia and Asia for the last 14 years. BCW is an official satellite of the annual meeting of OHBM, which is held in Geneva, Switzerland in 2016. BCW attracts every year a public of 100-200 participants working in cognitive, computational and clinical neurosciences. The discussions are centered on all themes around brain connectivity including structural and functional imaging, modeling, brain function and clinics. BCW is highly influential in the field due to the traditionally high quality of speakers and a long track record of innovation. For instance, both, the Connectome and The Virtual Brain have been born within the BCW community. The typical BCW format —a first educational day of lectures held by international authorities in their fields, followed by two days of shorter talks with ample time for discussion provides a unique forum for creativity, controversy and brainstorming. BCW 2016, introduced by a first day of tutorials by experts in their field, will feature focused sessions on themes such as perturbing the brain, mapping the brain, and brain dynamics in function (cognition) and dysfunction (epilepsy). *NB: Please note that European Cup of Football will be held in France during this period and hotels are going to be booked fast! * Confirmed educational lecturers (day 1) and workshop speakers (days 2-3) include: • Fabrice Bartolomei (Aix-Marseille University, Marseille, France) • Michael Breakspear (QIMR, Brisbane, Australia) • Vince Calhoun (University Of New Mexico, Albuquerque, NM) • Karl Friston (UCL, London, UK) • Jorge Gonzalez-Martinez (Cleveland Clinic, Cleveland, OH) • Marc Goodfellow (University of Exeter, Exeter, UK) • Charles Gray (Montana State University, Bozeman, MT) • Claudius Gros (Goethe University, Frankfurt am Main, Germany) • Sean Hill (EPFL, Lausanne, Switzerland) • Martin Hoffman-Apitius (Fraunhofer Institute SCAI, St Augustin, Germany) • Esther Krook-Magnuson (University of Minnesota, Minneapolis, MN) • Pierre Luppi (Lyon Neuroscience Research Center, Lyon, France) • Randy McIntosh (Baycrest Research Center, Toronto, ON) • Lionel Naccache (ICM, Paris, France) • Ivan Soltesz (UC Irvine, CA) • Olaf Sporns (Indiana University, Bloomington, IN) • William Stacey (University of Michigan, Ann Arbor, MI) • Gregor Thut (University of Glasgow, Glasgow, UK) • Stephan Van Gils (University of Twente, Ae Enschede, The Netherlands) • Michael Wibral (Goethe University, Frankfurt am Main, Germany) A special evening lecture will be delivered by Patrick Chauvel (Aix-Marseille University, Marseille, France). A detailed program is coming soon. Organizing committee Viktor Jirsa, Chair (INS, Aix-Marseille University, UMR 1106 INSERM) Demian Battaglia, Christian Bénar, Mireille Bonnard, Monique Esclapez (INS, Aix-Marseille University) Andrea Brovelli (INT, Aix-Marseille University), Maxime Guye (CRMBM, Aix-Marseille University, UMR 7339 CNRS & APHM) Ingo Bojak (University of Reading, UK). An event sponsored by: University Aix-Marseille, Brain Products, Bionics, Springer EPJ Nonlinear Biomedical Physics Journal, Codebox, Institute of System Neuroscience Inserm, Institute of Neuroscience Timone, Center for Magnetic Resonance in Biology and Medicine, Mediterranean Society of Neuroscience (IBRO member) -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Mar 4 17:09:01 2016 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Fri, 4 Mar 2016 08:09:01 -0800 Subject: [FieldTrip] issue at interpolation after source analysis In-Reply-To: References: <56D91CF2.5080604@gmail.com> Message-ID: <56D9B31D.8060003@gmail.com> Thanks, Arjen! I know for sure dim and pos fields are the same as in the template because I do copy them from the template grid. So I'll try going back to make sure the alignment is really happening. If I can't figure it out, I'll post some code with it. Cheers, Vitoria On 3/3/2016 10:18 PM, Arjen Stolk wrote: > Hey Vitoria, > > Hard to tell without seeing any code, but my hunch is that the plot on > the left is subject space whereas the middle is subject spaced data > plotted in MNI space. If the sourcemodel/grid on the left is truly > MNI-aligned (but the regular spacing suggests otherwise) than it may > be an instance of forgetting to copy over the dim and pos fields from > the MNI template to the subject mri structure. You can check whether > this is case by comparing the dim and pos fields of the template with > those of the subject. They should be the same (after alignment). > > Hopefully that solves it. Otherwise you'd probably need to provide > some code. > Arjen > > 2016-03-03 21:28 GMT-08:00 Vitória Piai >: > > Hi everyone, > > I'm working with clinical MEG data for which part of the source > pipeline has been conducted by someone else as part of a clinical > protocol. I don't have full access to what has been done to the > MRI that I'm getting, so I'm trying to put bits and pieces of code > together to arrive at a source reconstruction. The rest of my > pipeline is the pretty standard tutorial beamforming. > > I was hoping someone could help me figure out where my source > analysis is going wrong by looking at this figure. On the left, > the subject's headmodel seems to be fine (after warping to MNI). > On the right, I'm plotting the source result without interpolating > with any structural data. In the middle you see what happens when > I interpolate the source with the "single_subj_T1.nii" structural > image. > It doesn't seem to be a matter of scaling (like mm to cm), but > rather it being kinda upside down + something else? Does anyone > know by looking at this whether the error emerges because of an > unsuccessful interpolation or because something more fundamental > is going wrong earlier on? > > Thanks so much, > Vitoria > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 104874 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Mon Mar 7 10:02:03 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 7 Mar 2016 09:02:03 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> Message-ID: <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 bushra.riaz at gu.se Mon Mar 7 10:18:21 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Mon, 7 Mar 2016 09:18:21 +0000 Subject: [FieldTrip] EEG position information not read properly from fif file Message-ID: <1457342301486.91257@gu.se> Hello, I am reading fif files with only EEG data (no MEG data)in fieldtrip . When my sensor locations are more than 60 than the positions in the elec.elecpos are not written Digging a bit deeper into this showed me that in mne2grad.m file line number 420 ( fieldtrip-20160306?) is the cause of the problem kChan = 0; for n = chn_eeg kChan = kChan+1; if nEEG<=60 % this if condition is the reason position was not written properly elec.elecpos(kChan,1:3) = orig.chs(n).eeg_loc(1:3); else if kChan<=numel(dig_eeg) elec.elecpos(kChan,1:3) = orig.dig(dig_eeg(kChan)).r; else ft_warning('not all EEG channel positions have been digitized'); elec.elecpos(kChan,1:3) = nan; end end elec.label{kChan} = deblank(orig.ch_names{n}); end I haven't read the whole source code for mne2grad.m to understand why this condition is important and why the limit is of 60 channels. I am solving my problem by changing this condition, I hope this will not effect rest of my processing Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Mon Mar 7 10:51:34 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Mon, 7 Mar 2016 17:51:34 +0800 Subject: [FieldTrip] common filter with more than two conditions Message-ID: Dear community, I'm trying to do lcmv beamformer source analysis with a common filter for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I am interested in both the main effect of A (A1 vs. A2) as well as the simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). My question is how to build the common filter. I could combine all the four conditions to obtain a common filter for the contrast of A1 vs. A2. Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I have to build a different common filter (to combine the A1B1 and A2B1 conditions) for the contrast of A1B1 vs. A2B1? Thanks for your help in advance! Best, Lin -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Mon Mar 7 13:04:00 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Mon, 7 Mar 2016 12:04:00 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Jan-Mathijs, thanks for sharing your thoughts about problems with using non-equidistant frequency bins. Also thanks for pointing out the possible problems in Granger causality. I actually computed the GC using non-parametric factorization and equidistant frequency bins, since the code gives an error if you don’t. As I wrote, these values from equidistant frequency bins look pretty similar to those PSI values from non-equidistant frequency bins. Best, Daniel On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Mon Mar 7 17:09:18 2016 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Mon, 7 Mar 2016 17:09:18 +0100 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Daniel and Jan-Mathis, since I also have tried to play around with PSI, I have an additional issue regarding the frequency bandwidth configuration. I found that with using linear equidistant frequency bins, the low frequency oscillation has narrower bandwidth compared to high frequencies. So if I took 5 Hz frequency bandwidth and compute the PSI to check the low frequency (i.e alpha) coupling direction, low frequency coupling may not have sufficient neighboring frequencies. In some cases PSI could also mixed up both the positive and negative phase slope, then the summation result from n-frequency bins can be spuriously positive or negative. Regarding the mixing of slope information, possibly this is one of methodological disadvantage. But for fairer frequency slope summation, I also have the same thought whether the logarithmic frequency step might be more proper in computing PSI.. Please someone correct me if I am wrong in interpreting these, I am trying to figure out how FieldTrip's PSI works. Thanks! Best, Sandhy ----------- Prasandhya A. Yusuf PhD student *Medizinische Hochschule Hannover* VIANNA - Institute of AudioNeuroTechnology On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel wrote: > Hi Jan-Mathijs, > > thanks for sharing your thoughts about problems with using non-equidistant > frequency bins. > > Also thanks for pointing out the possible problems in Granger causality. I > actually computed the GC using non-parametric factorization and equidistant > frequency bins, since the code gives an error if you don’t. As I wrote, > these values from equidistant frequency bins look pretty similar to those > PSI values from non-equidistant frequency bins. > > Best, > > Daniel > > > On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Daniel, > > I am not an expert on PSI theory either, and here I would like to stay on > the safe side. Even if it may be possible to vary the number of integration > bins across frequencies, and include some normalisation step on top if it, > I think it is very tricky, and rather won’t support this. The normalisation > is probably quite arbitrary, because it could also involve some > extrapolation of the underlying coherence spectrum. Also, using non > equidistant frequency spacing increases the risk of the user having > specified frequency specific smoothing, which further complicates > integration of phase and coherence estimates across neighbouring frequency > bins. Long story short, I will build in an explicit check about > equidistance of frequency bins in ft_connectivityanalysis, to return an > explicit error if this is not the case. This update will be a general clean > up of the psi functionality, which also will include better error handling > if the user happens to forget the bandwidth argument in the cfg. This will > address bug 3084 on bugzilla.fieldtriptoolbox.org. > > While I am at it, you mentioned that your psi results look very much like > the Granger you have computed. I am not sure how you have computed the > Granger causality, but (if you have used non parametric factorisation of > the cod matrix to get your spectral transfer matrices) it may be relevant > to know that it is incorrect to compute it from freq data with > non-equidistant frequency bins. The non-parametric spectral factorisation > code assumes the data to be represented on equidistant frequency bins. > > Best, > Jan-Mathijs > > > > On 02 Mar 2016, at 15:08, Hähnke, Daniel wrote: > > Hi Jan-Mathijs, > > never underestimate the creativity of scientists ;) > > Why do you think I can’t expect meaningful results from using > logarithmically spaced frequency bins? At least when comparing my Granger > results with the PSI values, they look pretty similar. > I know that the phase slope is dependent on the step size between > frequencies, so I could miss or aberrantly pick up non-monotonicity in the > phase slope if I use non-equidistant bins. > But if I assume that the slope changes monotonically across frequencies > (which, if I’m not mistaken, is also assumed for equidistant frequency > bins), a normalization by the bandwidth should be possible. > > Please correct me if I’m wrong. I’m obviously no expert in PSI theory and > would be glad to learn more. > > Best, > > Daniel > > On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Daniel > I have never in my life considered that people would be so creative as to > expect meaningful results when inputting the function with logarithmically > spaced frequency bins. I should have known better, but I would be strongly > in favour of checking for equidistant frequency bins, and if not: throw an > error*. *I am opposed to using ‘bins’ as a unit, because FieldTrip should > work wherever possible with physical units, rather than with unit-less > units. > > Best, > Jan-Mathijs > > > On 02 Mar 2016, at 13:13, Hähnke, Daniel wrote: > > Hi all, > > since only a few people seem to be using the PSI, I went into the code to > see what it actually does. I would like to point out that there are some > issues with the current implementation if you’re using logarithmically > spaced frequency axes. > > The parameter cfg.bandwidth (in Hz) is used to calculate the number of > frequency bins that is used to calculate the PSI. This calculation, > however, is only done once using the frequency from the lowest frequency > bin. If the chosen bandwidth is not an integer multiple of a frequency bin > step, this computation leads to a changed bandwidth. > If your frequency axis is not evenly spaced this leads to various > bandwidths across the frequency axis, since the code only uses a fixed > number of frequency bins across which to compute the PSI. > > I think it would be useful to change the cfg.bandwidth input from Hz to > number of bins. Also, people should be aware of the fact that the PSI value > is correlated with the bandwidth. So, if you use a logarithmically spaced > frequency axis, you should normalize your PSI values by the bandwidth > corresponding to each frequency bin. > > Best, > > Daniel > > On 01.03.2016, at 11:51, Hähnke, Daniel wrote: > > Dear FieldTrip users, > > I currently want to double-check the results I got from a non-parametric > Granger-causality analysis with another measure of directed communication, > phase slope index. > However, after having read Nolte et al.’s paper from 2008 that introduced > the PSI, I still don’t understand how to best choose the parameter > cfg.bandwidth. > > I tried out different values and got something qualitatively very similar > to my Granger results. But this is rather fitting the parameter to the > Granger results and kind of undermines my purpose of double-checking. > > Furthermore, I am using a logarithmic (to base 2) frequency axis. > Consequently, my frequency bins are not evenly spaced. I have the feeling > that I would rather need different bandwidths for the individual frequency > bins. > > Does anyone know how to objectively choose the bandwidth parameter? > > Best, > > Daniel > -- > Daniel Hähnke > PhD student > > Technische Universität München > Institute of Neuroscience > Translational NeuroCognition Laboratory > Biedersteiner Straße 29, Bau 601 > 80802 Munich > Germany > > Email: daniel.haehnke at tum.de > Phone: +49 89 4140 3356 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Mar 7 17:19:14 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 7 Mar 2016 08:19:14 -0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hey Lin, Provided that there are no systematic confounds (e.g. head position) across conditions, you could construct a common filter based on data from all conditions. I would leave any statistical comparison to after source-reconstruction. Does that answer your question? Arjen 2016-03-07 1:51 GMT-08:00 Lin Wang : > Dear community, > > I'm trying to do lcmv beamformer source analysis with a common filter for > more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I > am interested in both the main effect of A (A1 vs. A2) as well as the > simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). > > My question is how to build the common filter. I could combine all the > four conditions to obtain a common filter for the contrast of A1 vs. A2. > Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I > have to build a different common filter (to combine the A1B1 and A2B1 > conditions) for the contrast of A1B1 vs. A2B1? > > Thanks for your help in advance! > > Best, > Lin > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at nbt-analytics.com Mon Mar 7 18:03:01 2016 From: poil.simonshlomo at nbt-analytics.com (Simon-Shlomo Poil) Date: Mon, 7 Mar 2016 18:03:01 +0100 Subject: [FieldTrip] NBT Analytics is looking for a lead programmer Message-ID: Dear all, NBT Analytics is looking for a lead programmer. This Amsterdam based startup focuses on offering comprehensive EEG analyses for clinical trials, with the aim of improving drug development for CNS disorders. Get in touch if interested! Please read more here: http://www.nbt-analytics.com/#career Best regards, -- Dr. Simon-Shlomo Poil Co-founder / Chief Technology Officer NBT Analytics BV Amsterdam Health and Technology Center Paasheuvelweg 25 1105BP Amsterdam The Netherlands Website: https://www.nbt-analytics.com -- NBT Analytics BV http://www.nbt-analytics.com IMPORTANT: This message and any attachments are intended for the individual or entity named above. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, you must not read, copy, use or disclose this communication to others; also please notify the sender by replying to this message, and then delete it from your system. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: logosmall.png Type: image/png Size: 2855 bytes Desc: not available URL: From fosco.bernasconi at gmail.com Mon Mar 7 18:10:19 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Mon, 7 Mar 2016 18:10:19 +0100 Subject: [FieldTrip] Use precomputed common filter problem Message-ID: Dear community, I'm computing the beamformer filters based on the entire eeg data (based on templates headmodel). But when I use the precomputed common filter to calculate the sources for each condition independently I have the following error: Subselecting/reordering the channels in the precomputed filters Bad cell reference operation. Error in ft_sourceanalysis (line 510) grid.filter{k} = grid.filter{k}(:, i2); Here my code: cfg = []; cfg.method = 'pcc'; cfg.channel = sens.label; cfg.grid = grid; cfg.vol = vol; cfg.grid.filter = source.avg.filter; source_C1 = ft_sourceanalysis(cfg,freq{isub,1}); -------------- next part -------------- An HTML attachment was scrubbed... URL: From vic.schroeder2 at gmail.com Mon Mar 7 21:47:07 2016 From: vic.schroeder2 at gmail.com (victoria schroeder) Date: Mon, 7 Mar 2016 20:47:07 +0000 Subject: [FieldTrip] ft_combineplanar after ft_channelrepair Message-ID: Hey Fieldtrip users, I am working with neuromag data 306 channels. I would like to interpolate channels using ft_channelrepair. Afterwards it would be good to combine the gradiometers to create planar gradients. However, unfortunately i get an error message when trying to use ft_combineplanar when i have used ft_channelrepair. Without using ft_channelrepair things work well. Can these two functions not be used on the same data? (See the code and the error message below) Thank you a lot Victoria %prepare neighbours cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'neuromag306all.lay'; neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig); % Interpolate and put into new data structure cfg = []; cfg.badchannel = { 'MEG1122', 'MEG1312','MEG1411'}; cfg.layout = 'neuromag306all.lay'; cfg.method = 'nearest'; cfg.neighbours = neighbours; Chan_clean = ft_channelrepair(cfg,data_orig); data=Chan_clean; %time frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'MEGGRAD'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [2:2:30]; cfg.toi = [-1.3:0.05:1]; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.keeptrials = 'yes'; cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128); freq = ft_freqanalysis(cfg, data); %time frequency baselined cfg=[]; cfg.baseline = [-0.5 0]; cfg.baselinetype = 'absolute'; Base = ft_freqbaseline(cfg, freq); %Combine planar Comb = ft_combineplanar([],Base); Error! Reference to non-existent field 'chanori'. Error in ft_combineplanar (line 293) newgrad.chanori = data.grad.chanori(sel,:); -------------- next part -------------- An HTML attachment was scrubbed... URL: From changa5 at mcmaster.ca Mon Mar 7 22:41:52 2016 From: changa5 at mcmaster.ca (Andrew Chang) Date: Mon, 7 Mar 2016 16:41:52 -0500 Subject: [FieldTrip] naive questions about resampling and ICA Message-ID: Dear all, I am very new to this toolbox, and still trying to figure out how to prepare my data for analyzing it in Fieldtrip. I am following the tutorial of this document ( http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts), and trying to adapt it to my own data. I got two problems, one is about resampling and another is about running ICA. Here is my script: cfg2 = []; cfg2.dataset = 'data\Andrew_EEG_continous1224\SS_CC_1.raw'; cfg2.trialdef.eventtype = 'trigger'; cfg2 = ft_definetrial(cfg2); cfg2.channel = 'EEG'; cfg2.continuous = 'yes'; data2 = ft_preprocessing(cfg2); The above part seems working, although I am not sure the information in the cfg2 or data2 was sufficient for subsequent analyses. Here is the printscreen of these 2 objects: [image: Inline image 1] Then run the resampling % downsample the data to speed up the next step cfg2 = []; cfg2.resamplefs = 300; cfg2.detrend = 'no'; data2 = ft_resampledata(cfg2, data2); I got the error message if the 'resamplefs' does not equal to 500, but 500 Hz was my original sampling rate: Matrix dimensions must agree. Error in ft_resampledata (line 226) data.trial{itr} = data.trial{itr} + bsl(:,ones(1,numel(data.time{itr}))); Skipping the resampling and run the ICA directly: % perform the independent component analysis (i.e., decompose the data) cfg2 = []; cfg2.method = 'runica'; % this is the default and uses the implementation from EEGLAB comp = ft_componentanalysis(cfg2,data2); Here is what MATLAB returns: the input is raw data with 257 channels and 203 trials the call to "ft_selectdata" took 0 seconds baseline correcting data no scaling applied, since factor is 0 concatenating data............... concatenated data matrix size 257x203 starting decomposition using runica runica(): data length (203) < data channels (257)! Output argument "sphere" (and maybe others) not assigned during call to "runica". Error in ft_componentanalysis (line 488) [weights, sphere] = runica(dat, optarg{:}); Some additional information: I am using MATLAB 2015b with Fieldtrip version 20160304 Any help is much appreciated! Thank you all Best, Andrew -- Andrew Chang Ph.D. Candidate Auditory Development Lab Department of Psychology, Neuroscience & Behaviour McMaster University http://changa5.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 144915 bytes Desc: not available URL: From murphyk5 at aston.ac.uk Mon Mar 7 22:56:10 2016 From: murphyk5 at aston.ac.uk (Murphy, Kelly (Research Student)) Date: Mon, 7 Mar 2016 21:56:10 +0000 Subject: [FieldTrip] ft_combineplanar after ft_channelrepair In-Reply-To: References: Message-ID: Hi Victoria, I don’t know if this will address your problem; but I think it might depend on the order of your pipeline because if you use PCA at any point before interpolating, you will be reducing the dimensionality of your data; and interpolation (and presumably combining gradiometers) relies on the data from neighbouring channels to be linearly related. In my pipeline, I’ve visually rejected trials and channels, then run ICA, then interpolated; I don’t know if that would address your issues? Hope you get it sorted Kelly From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of victoria schroeder Sent: 07 March 2016 20:47 To: FieldTrip discussion list Subject: [FieldTrip] ft_combineplanar after ft_channelrepair Hey Fieldtrip users, I am working with neuromag data 306 channels. I would like to interpolate channels using ft_channelrepair. Afterwards it would be good to combine the gradiometers to create planar gradients. However, unfortunately i get an error message when trying to use ft_combineplanar when i have used ft_channelrepair. Without using ft_channelrepair things work well. Can these two functions not be used on the same data? (See the code and the error message below) Thank you a lot Victoria %prepare neighbours cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'neuromag306all.lay'; neighbours = ft_prepare_neighbours(cfg_neighb, dat_orig); % Interpolate and put into new data structure cfg = []; cfg.badchannel = { 'MEG1122', 'MEG1312','MEG1411'}; cfg.layout = 'neuromag306all.lay'; cfg.method = 'nearest'; cfg.neighbours = neighbours; Chan_clean = ft_channelrepair(cfg,data_orig); data=Chan_clean; %time frequency analysis cfg = []; cfg.output = 'pow'; cfg.channel = 'MEGGRAD'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = [2:2:30]; cfg.toi = [-1.3:0.05:1]; cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; cfg.keeptrials = 'yes'; cfg.trials = find(data.trialinfo(:,1) == 64 | data.trialinfo(:,1) == 128); freq = ft_freqanalysis(cfg, data); %time frequency baselined cfg=[]; cfg.baseline = [-0.5 0]; cfg.baselinetype = 'absolute'; Base = ft_freqbaseline(cfg, freq); %Combine planar Comb = ft_combineplanar([],Base); Error! Reference to non-existent field 'chanori'. Error in ft_combineplanar (line 293) newgrad.chanori = data.grad.chanori(sel,:); -------------- next part -------------- An HTML attachment was scrubbed... URL: From changa5 at mcmaster.ca Mon Mar 7 23:28:04 2016 From: changa5 at mcmaster.ca (Andrew Chang) Date: Mon, 7 Mar 2016 17:28:04 -0500 Subject: [FieldTrip] "not enough input" probelm in ft_artifact_zvalue tutorial code Message-ID: Dear all, Sorry for asking another naive question. I am following the tutorial code of this: http://www.fieldtriptoolbox.org/tutorial/automatic_artifact_rejection I used the ArtifactMEG.ds data, which is used in tutorial, and used the exact same code. However, I am unable to run the ft_artifact_zvalue function. I am running this code on MATLAB2015b with fieldtrip version 20160304. I got the same problem even I changed the MATLAB version into 2013a. I am really confused since I am running the exact same code as tutorial, but I got many warnings and MATLAB returned error too. Here is the script: cfg = []; cfg.dataset = 'ArtifactMEG.ds'; cfg.headerformat = 'ctf_ds'; cfg.dataformat = 'ctf_ds'; cfg.trialdef.eventtype = 'trial'; cfg = ft_definetrial(cfg); trl = cfg.trl(1:50,:); %% jump cfg = []; cfg.trl = trl; cfg.datafile = 'ArtifactMEG.ds'; cfg.headerfile = 'ArtifactMEG.ds'; cfg.continuous = 'yes'; % channel selection, cutoff and padding cfg.artfctdef.zvalue.channel = 'MEG'; cfg.artfctdef.zvalue.cutoff = 20; cfg.artfctdef.zvalue.trlpadding = 0; cfg.artfctdef.zvalue.artpadding = 0; cfg.artfctdef.zvalue.fltpadding = 0; % algorithmic parameters cfg.artfctdef.zvalue.cumulative = 'yes'; cfg.artfctdef.zvalue.medianfilter = 'yes'; cfg.artfctdef.zvalue.medianfiltord = 9; cfg.artfctdef.zvalue.absdiff = 'yes'; % make the process interactive cfg.artfctdef.zvalue.interactive = 'yes'; [cfg, artifact_jump] = ft_artifact_zvalue(cfg); Here are what MATLAB return to me: Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial (line 138) evaluating trialfunction 'ft_trialfun_general' getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_trialfun_general (line 78) In ft_definetrial (line 177) reading the events from 'ArtifactMEG.ds\ArtifactMEG.res4' getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_read_event (line 511) In ft_trialfun_general (line 86) In ft_definetrial (line 177) found 76 events created 76 trials the call to "ft_definetrial" took 1 seconds ans = [] getRawCTFBalanceCoefs : Sensor Q11 appears in ds.res4.scrr, but not in ds.res4.chanNames Warning: cannot read balancing coefficients for G3BR > In ft_read_header (line 569) In ft_artifact_zvalue (line 195) searching for artifacts in 139 channels searching in trial 50 from 50 Not enough input arguments. Error in ft_artifact_zvalue (line 481) opt.data = data; Any comments are appreciated! Thank you all! Best, Andrew -- Andrew Chang Ph.D. Candidate Auditory Development Lab Department of Psychology, Neuroscience & Behaviour McMaster University http://changa5.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Tue Mar 8 01:16:27 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Tue, 8 Mar 2016 08:16:27 +0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hi Arjen, Yes, it answers my question. Thank! :-) Then a further question is: is it better to include as many trials as possible to have a good estimation of the covariance matrix (provided that the signals are good for all trials)? For example, there are two experimental conditions, with 20 trials per condition. There are also 40 filler trials with a similar structure as the experimental conditions. In this case, can I combine all the conditions to build the common filter and then only compare the two experimental conditions later? The cognitive processes might be different between the experimental conditions and the fillers, so I'm not sure whether combining them has any influence on the spatial filter. Best, Lin On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: > Hey Lin, > > Provided that there are no systematic confounds (e.g. head position) > across conditions, you could construct a common filter based on data from > all conditions. I would leave any statistical comparison to after > source-reconstruction. > > Does that answer your question? > Arjen > > 2016-03-07 1:51 GMT-08:00 Lin Wang : > >> Dear community, >> >> I'm trying to do lcmv beamformer source analysis with a common filter for >> more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and I >> am interested in both the main effect of A (A1 vs. A2) as well as the >> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >> >> My question is how to build the common filter. I could combine all the >> four conditions to obtain a common filter for the contrast of A1 vs. A2. >> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >> have to build a different common filter (to combine the A1B1 and A2B1 >> conditions) for the contrast of A1B1 vs. A2B1? >> >> Thanks for your help in advance! >> >> Best, >> Lin >> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Mar 8 01:28:11 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 7 Mar 2016 16:28:11 -0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hey Lin, Overall the more data (i.e. covariance matrices) the spatial filter is constructed from the better it'll be able to describe the spatiotemporal patterns present in the data (cf. ERPs, being smoother with more averaging). The latter indeed may be condition-specific, and since I do not know anything about your conditions, I'll refrain from having an opinion there. :) Arjen 2016-03-07 16:16 GMT-08:00 Lin Wang : > Hi Arjen, > > Yes, it answers my question. Thank! :-) > > Then a further question is: is it better to include as many trials as > possible to have a good estimation of the covariance matrix (provided that > the signals are good for all trials)? > > For example, there are two experimental conditions, with 20 trials per > condition. There are also 40 filler trials with a similar structure as the > experimental conditions. In this case, can I combine all the conditions to > build the common filter and then only compare the two experimental > conditions later? > > The cognitive processes might be different between the experimental > conditions and the fillers, so I'm not sure whether combining them has any > influence on the spatial filter. > > Best, > Lin > > On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: > >> Hey Lin, >> >> Provided that there are no systematic confounds (e.g. head position) >> across conditions, you could construct a common filter based on data from >> all conditions. I would leave any statistical comparison to after >> source-reconstruction. >> >> Does that answer your question? >> Arjen >> >> 2016-03-07 1:51 GMT-08:00 Lin Wang : >> >>> Dear community, >>> >>> I'm trying to do lcmv beamformer source analysis with a common filter >>> for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and >>> I am interested in both the main effect of A (A1 vs. A2) as well as the >>> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >>> >>> My question is how to build the common filter. I could combine all the >>> four conditions to obtain a common filter for the contrast of A1 vs. A2. >>> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >>> have to build a different common filter (to combine the A1B1 and A2B1 >>> conditions) for the contrast of A1B1 vs. A2B1? >>> >>> Thanks for your help in advance! >>> >>> Best, >>> Lin >>> >>> >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 wanglinsisi at gmail.com Tue Mar 8 07:16:15 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Tue, 8 Mar 2016 14:16:15 +0800 Subject: [FieldTrip] common filter with more than two conditions In-Reply-To: References: <0f4f6702252040928b0a61602ce7ea3c@EXPRD01.hosting.ru.nl> Message-ID: Hi Arjen, Thanks for your help. :-) Best, Lin On Tue, Mar 8, 2016 at 8:28 AM, Arjen Stolk wrote: > Hey Lin, > > Overall the more data (i.e. covariance matrices) the spatial filter is > constructed from the better it'll be able to describe the spatiotemporal > patterns present in the data (cf. ERPs, being smoother with more > averaging). The latter indeed may be condition-specific, and since I do not > know anything about your conditions, I'll refrain from having an opinion > there. :) > > Arjen > > 2016-03-07 16:16 GMT-08:00 Lin Wang : > >> Hi Arjen, >> >> Yes, it answers my question. Thank! :-) >> >> Then a further question is: is it better to include as many trials as >> possible to have a good estimation of the covariance matrix (provided that >> the signals are good for all trials)? >> >> For example, there are two experimental conditions, with 20 trials per >> condition. There are also 40 filler trials with a similar structure as the >> experimental conditions. In this case, can I combine all the conditions to >> build the common filter and then only compare the two experimental >> conditions later? >> >> The cognitive processes might be different between the experimental >> conditions and the fillers, so I'm not sure whether combining them has any >> influence on the spatial filter. >> >> Best, >> Lin >> >> On Tue, Mar 8, 2016 at 12:19 AM, Arjen Stolk wrote: >> >>> Hey Lin, >>> >>> Provided that there are no systematic confounds (e.g. head position) >>> across conditions, you could construct a common filter based on data from >>> all conditions. I would leave any statistical comparison to after >>> source-reconstruction. >>> >>> Does that answer your question? >>> Arjen >>> >>> 2016-03-07 1:51 GMT-08:00 Lin Wang : >>> >>>> Dear community, >>>> >>>> I'm trying to do lcmv beamformer source analysis with a common filter >>>> for more than two conditions. I have a 2A (A1, A2) * 2B (B1,B2) design, and >>>> I am interested in both the main effect of A (A1 vs. A2) as well as the >>>> simple effects (A1B1 vs. A2B1 and A1B2 vs. A2B2). >>>> >>>> My question is how to build the common filter. I could combine all the >>>> four conditions to obtain a common filter for the contrast of A1 vs. A2. >>>> Then can I also use this common filter to compare A1B1 vs. A2B1? Or do I >>>> have to build a different common filter (to combine the A1B1 and A2B1 >>>> conditions) for the contrast of A1B1 vs. A2B1? >>>> >>>> Thanks for your help in advance! >>>> >>>> Best, >>>> Lin >>>> >>>> >>>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 daniel.haehnke at tum.de Tue Mar 8 10:57:26 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Tue, 8 Mar 2016 09:57:26 +0000 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Sandhy, that’s interesting. Can you describe how you found out about the bandwidth being narrower for lower frequencies? When I read the code, I had the impression that the bandwidth parameter is used once to calculate one bandwidth parameter in frequency bins that is subsequently used for the whole spectrum. Best, Daniel On 07.03.2016, at 17:09, Prasandhya Astagiri Yusuf > wrote: Hi Daniel and Jan-Mathis, since I also have tried to play around with PSI, I have an additional issue regarding the frequency bandwidth configuration. I found that with using linear equidistant frequency bins, the low frequency oscillation has narrower bandwidth compared to high frequencies. So if I took 5 Hz frequency bandwidth and compute the PSI to check the low frequency (i.e alpha) coupling direction, low frequency coupling may not have sufficient neighboring frequencies. In some cases PSI could also mixed up both the positive and negative phase slope, then the summation result from n-frequency bins can be spuriously positive or negative. Regarding the mixing of slope information, possibly this is one of methodological disadvantage. But for fairer frequency slope summation, I also have the same thought whether the logarithmic frequency step might be more proper in computing PSI.. Please someone correct me if I am wrong in interpreting these, I am trying to figure out how FieldTrip's PSI works. Thanks! Best, Sandhy ----------- Prasandhya A. Yusuf PhD student Medizinische Hochschule Hannover VIANNA - Institute of AudioNeuroTechnology On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel > wrote: Hi Jan-Mathijs, thanks for sharing your thoughts about problems with using non-equidistant frequency bins. Also thanks for pointing out the possible problems in Granger causality. I actually computed the GC using non-parametric factorization and equidistant frequency bins, since the code gives an error if you don’t. As I wrote, these values from equidistant frequency bins look pretty similar to those PSI values from non-equidistant frequency bins. Best, Daniel On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel, I am not an expert on PSI theory either, and here I would like to stay on the safe side. Even if it may be possible to vary the number of integration bins across frequencies, and include some normalisation step on top if it, I think it is very tricky, and rather won’t support this. The normalisation is probably quite arbitrary, because it could also involve some extrapolation of the underlying coherence spectrum. Also, using non equidistant frequency spacing increases the risk of the user having specified frequency specific smoothing, which further complicates integration of phase and coherence estimates across neighbouring frequency bins. Long story short, I will build in an explicit check about equidistance of frequency bins in ft_connectivityanalysis, to return an explicit error if this is not the case. This update will be a general clean up of the psi functionality, which also will include better error handling if the user happens to forget the bandwidth argument in the cfg. This will address bug 3084 on bugzilla.fieldtriptoolbox.org. While I am at it, you mentioned that your psi results look very much like the Granger you have computed. I am not sure how you have computed the Granger causality, but (if you have used non parametric factorisation of the cod matrix to get your spectral transfer matrices) it may be relevant to know that it is incorrect to compute it from freq data with non-equidistant frequency bins. The non-parametric spectral factorisation code assumes the data to be represented on equidistant frequency bins. Best, Jan-Mathijs On 02 Mar 2016, at 15:08, Hähnke, Daniel > wrote: Hi Jan-Mathijs, never underestimate the creativity of scientists ;) Why do you think I can’t expect meaningful results from using logarithmically spaced frequency bins? At least when comparing my Granger results with the PSI values, they look pretty similar. I know that the phase slope is dependent on the step size between frequencies, so I could miss or aberrantly pick up non-monotonicity in the phase slope if I use non-equidistant bins. But if I assume that the slope changes monotonically across frequencies (which, if I’m not mistaken, is also assumed for equidistant frequency bins), a normalization by the bandwidth should be possible. Please correct me if I’m wrong. I’m obviously no expert in PSI theory and would be glad to learn more. Best, Daniel On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel I have never in my life considered that people would be so creative as to expect meaningful results when inputting the function with logarithmically spaced frequency bins. I should have known better, but I would be strongly in favour of checking for equidistant frequency bins, and if not: throw an error. I am opposed to using ‘bins’ as a unit, because FieldTrip should work wherever possible with physical units, rather than with unit-less units. Best, Jan-Mathijs On 02 Mar 2016, at 13:13, Hähnke, Daniel > wrote: Hi all, since only a few people seem to be using the PSI, I went into the code to see what it actually does. I would like to point out that there are some issues with the current implementation if you’re using logarithmically spaced frequency axes. The parameter cfg.bandwidth (in Hz) is used to calculate the number of frequency bins that is used to calculate the PSI. This calculation, however, is only done once using the frequency from the lowest frequency bin. If the chosen bandwidth is not an integer multiple of a frequency bin step, this computation leads to a changed bandwidth. If your frequency axis is not evenly spaced this leads to various bandwidths across the frequency axis, since the code only uses a fixed number of frequency bins across which to compute the PSI. I think it would be useful to change the cfg.bandwidth input from Hz to number of bins. Also, people should be aware of the fact that the PSI value is correlated with the bandwidth. So, if you use a logarithmically spaced frequency axis, you should normalize your PSI values by the bandwidth corresponding to each frequency bin. Best, Daniel On 01.03.2016, at 11:51, Hähnke, Daniel > wrote: Dear FieldTrip users, I currently want to double-check the results I got from a non-parametric Granger-causality analysis with another measure of directed communication, phase slope index. However, after having read Nolte et al.’s paper from 2008 that introduced the PSI, I still don’t understand how to best choose the parameter cfg.bandwidth. I tried out different values and got something qualitatively very similar to my Granger results. But this is rather fitting the parameter to the Granger results and kind of undermines my purpose of double-checking. Furthermore, I am using a logarithmic (to base 2) frequency axis. Consequently, my frequency bins are not evenly spaced. I have the feeling that I would rather need different bandwidths for the individual frequency bins. Does anyone know how to objectively choose the bandwidth parameter? Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eva.patai at psych.ox.ac.uk Tue Mar 8 18:05:21 2016 From: eva.patai at psych.ox.ac.uk (Zita Eva Patai) Date: Tue, 8 Mar 2016 17:05:21 +0000 Subject: [FieldTrip] ft_definetrial using data structure in workspace In-Reply-To: References: Message-ID: Dear FT-ers I would like to epoch my data, but as it is in a format not supported by Fieldtrip (.xdf), I used Eeglab to convert it, and then converted between Eeglab and FT with the eeg2fieldtrip function. Now i have a FT data structure. The data structure looks fine, but it seems that to use ft_definetrial, i need to specify a path to a file to be processed. Is there any way to change this so i can use something in the workspace? Many thanks On Tue, Mar 8, 2016 at 4:57 PM, Zita Eva Patai wrote: > Dear FT-ers > > I would like to epoch my data, but as it is in a format not supported by > Fieldtrip (.xdf), I used Eeglab to convert it, and then converted between > Eeglab and FT with the eeg2fieldtrip function. Now i have a FT data > structure. > > The data structure looks fine, but it seems that to use ft_definetrial, i > need to specify a path to a file to be processed. Is there any way to > change this so i can use something in the workspace? > > Many thanks > zita > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzuchenlung at gmail.com Wed Mar 9 04:34:59 2016 From: tzuchenlung at gmail.com (Jane Lung) Date: Wed, 9 Mar 2016 11:34:59 +0800 Subject: [FieldTrip] question about head model preparing Message-ID: Dear all, I am currently explore how to do the source reconstruction, my data come from Yokogawa160, and I use fieldtrip_20150708 after following the direction of the website: http://www.fieldtriptoolbox.org/getting_started/yokogawa I've met some problem preparing Head model: 1. after sourceplot three fiducial positions, these locations didn't stored automatically in a "marker-coregis.txt" file, as website mentioned. 2. so, I copy their locations from command window manually. for the next step, I also copy the marker's location from another marker location file (.hsp file), and define them in grad.fid.pnt(). Howerver, when I run the ft_sensorrealign, the error happened: Warning: use cfg.target instead of cfg.template > In ft_checkconfig (line 120) In ft_sensorrealign (line 135) using the fiducials instead of the sensor positions converting units from 'mm' to 'cm' Subscripted assignment between dissimilar structures. Error in ft_sensorrealign (line 228) tmp(i) = ft_convert_units(template(i), elec.unit); % ensure that the units are consistent with the electrodes I'll be really appreciated if I can get any comment ! Sincerely Tzu-Chen ---------------------------- Tzu-Chen Lung, M.S. Research Assistant, Institute of Cognitive Neuroscience, National Central University, Taiwan (R.O.C) -------------- next part -------------- An HTML attachment was scrubbed... URL: From prasandhya.a.yusuf at gmail.com Wed Mar 9 09:49:07 2016 From: prasandhya.a.yusuf at gmail.com (Prasandhya Astagiri Yusuf) Date: Wed, 9 Mar 2016 09:49:07 +0100 Subject: [FieldTrip] Phase Slope Index: How to choose bandwidth In-Reply-To: References: <571C7E1D-DADD-4606-8B31-173104B0AC7A@tum.de> <8BE89906-FBC3-4225-B296-57EB7ED4DF78@donders.ru.nl> <22EBF687-BB1B-4982-9329-052CE0A471A6@tum.de> <1D8014DF-FD14-4A71-9324-67B08A3010DE@donders.ru.nl> Message-ID: Hi Daniel, I mean it is known that the EEG bands have different frequency bandwidth, like: - Theta 4-7 Hz -> 4 Hz bandwidth - Alpha 8-15 Hz -> 8 Hz bandwidth - Beta 16-31 Hz -> 16 Hz bandwidth So in my opinion, I think it's not really fair to have (in example) 5 Hz bandwidth configuration in measuring PSI for Theta, even Delta, since it (probably) mixed other oscillation band together. In Field Trip's PSI, I found that the cross spectra S(f) are multiplied with the conjugate cross spectra of the neighboring-higher-frequency bin S*((f+1) to have phase lag difference between neighboring frequency bins (or yields frequency slope if divided by the frequency resolution). Then it sums together the results within 2 Hz above and 2 Hz below (for 5 Hz bandwidth example). Finally it takes the imaginary part from the result. If the phase lag difference between neighboring frequency bins (or the frequency slope) are consistent for all results within this 5 Hz bandwidth, then it yields high value. If they are inconsistent, they should not yield high value. But what if the result is quite high that we then interpret as a directionality, but it was only due to mixed up of positive and negative values..? I still cannot answer this one. Maybe someone could help. Best, Sandhy On Tue, Mar 8, 2016 at 10:57 AM, Hähnke, Daniel wrote: > Hi Sandhy, > > that’s interesting. Can you describe how you found out about the bandwidth > being narrower for lower frequencies? When I read the code, I had the > impression that the bandwidth parameter is used once to calculate one > bandwidth parameter in frequency bins that is subsequently used for the > whole spectrum. > > Best, > > Daniel > > > On 07.03.2016, at 17:09, Prasandhya Astagiri Yusuf < > prasandhya.a.yusuf at gmail.com> wrote: > > Hi Daniel and Jan-Mathis, > > since I also have tried to play around with PSI, I have an additional > issue regarding the frequency bandwidth configuration. > > I found that with using linear equidistant frequency bins, the low > frequency oscillation has narrower bandwidth compared to high frequencies. > So if I took 5 Hz frequency bandwidth and compute the PSI to check the low > frequency (i.e alpha) coupling direction, low frequency coupling may not > have sufficient neighboring frequencies. In some cases PSI could also mixed > up both the positive and negative phase slope, then the summation result > from n-frequency bins can be spuriously positive or negative. > > Regarding the mixing of slope information, possibly this is one of > methodological disadvantage. But for fairer frequency slope summation, I > also have the same thought whether the logarithmic frequency step might be > more proper in computing PSI.. > > Please someone correct me if I am wrong in interpreting these, I am trying > to figure out how FieldTrip's PSI works. > > Thanks! > > Best, > Sandhy > > ----------- > > Prasandhya A. Yusuf > > PhD student > > *Medizinische Hochschule Hannover* > VIANNA - Institute of AudioNeuroTechnology > > > > On Mon, Mar 7, 2016 at 1:04 PM, Hähnke, Daniel > wrote: > >> Hi Jan-Mathijs, >> >> thanks for sharing your thoughts about problems with using >> non-equidistant frequency bins. >> >> Also thanks for pointing out the possible problems in Granger causality. >> I actually computed the GC using non-parametric factorization and >> equidistant frequency bins, since the code gives an error if you don’t. As >> I wrote, these values from equidistant frequency bins look pretty similar >> to those PSI values from non-equidistant frequency bins. >> >> Best, >> >> Daniel >> >> >> On 07.03.2016, at 10:02, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >> Hi Daniel, >> >> I am not an expert on PSI theory either, and here I would like to stay on >> the safe side. Even if it may be possible to vary the number of integration >> bins across frequencies, and include some normalisation step on top if it, >> I think it is very tricky, and rather won’t support this. The normalisation >> is probably quite arbitrary, because it could also involve some >> extrapolation of the underlying coherence spectrum. Also, using non >> equidistant frequency spacing increases the risk of the user having >> specified frequency specific smoothing, which further complicates >> integration of phase and coherence estimates across neighbouring frequency >> bins. Long story short, I will build in an explicit check about >> equidistance of frequency bins in ft_connectivityanalysis, to return an >> explicit error if this is not the case. This update will be a general clean >> up of the psi functionality, which also will include better error handling >> if the user happens to forget the bandwidth argument in the cfg. This will >> address bug 3084 on bugzilla.fieldtriptoolbox.org. >> >> While I am at it, you mentioned that your psi results look very much like >> the Granger you have computed. I am not sure how you have computed the >> Granger causality, but (if you have used non parametric factorisation of >> the cod matrix to get your spectral transfer matrices) it may be relevant >> to know that it is incorrect to compute it from freq data with >> non-equidistant frequency bins. The non-parametric spectral factorisation >> code assumes the data to be represented on equidistant frequency bins. >> >> Best, >> Jan-Mathijs >> >> >> >> On 02 Mar 2016, at 15:08, Hähnke, Daniel wrote: >> >> Hi Jan-Mathijs, >> >> never underestimate the creativity of scientists ;) >> >> Why do you think I can’t expect meaningful results from using >> logarithmically spaced frequency bins? At least when comparing my Granger >> results with the PSI values, they look pretty similar. >> I know that the phase slope is dependent on the step size between >> frequencies, so I could miss or aberrantly pick up non-monotonicity in the >> phase slope if I use non-equidistant bins. >> But if I assume that the slope changes monotonically across frequencies >> (which, if I’m not mistaken, is also assumed for equidistant frequency >> bins), a normalization by the bandwidth should be possible. >> >> Please correct me if I’m wrong. I’m obviously no expert in PSI theory and >> would be glad to learn more. >> >> Best, >> >> Daniel >> >> On 02.03.2016, at 14:05, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >> Hi Daniel >> I have never in my life considered that people would be so creative as to >> expect meaningful results when inputting the function with logarithmically >> spaced frequency bins. I should have known better, but I would be strongly >> in favour of checking for equidistant frequency bins, and if not: throw an >> error*. *I am opposed to using ‘bins’ as a unit, because FieldTrip >> should work wherever possible with physical units, rather than with >> unit-less units. >> >> Best, >> Jan-Mathijs >> >> >> On 02 Mar 2016, at 13:13, Hähnke, Daniel wrote: >> >> Hi all, >> >> since only a few people seem to be using the PSI, I went into the code to >> see what it actually does. I would like to point out that there are some >> issues with the current implementation if you’re using logarithmically >> spaced frequency axes. >> >> The parameter cfg.bandwidth (in Hz) is used to calculate the number of >> frequency bins that is used to calculate the PSI. This calculation, >> however, is only done once using the frequency from the lowest frequency >> bin. If the chosen bandwidth is not an integer multiple of a frequency bin >> step, this computation leads to a changed bandwidth. >> If your frequency axis is not evenly spaced this leads to various >> bandwidths across the frequency axis, since the code only uses a fixed >> number of frequency bins across which to compute the PSI. >> >> I think it would be useful to change the cfg.bandwidth input from Hz to >> number of bins. Also, people should be aware of the fact that the PSI value >> is correlated with the bandwidth. So, if you use a logarithmically spaced >> frequency axis, you should normalize your PSI values by the bandwidth >> corresponding to each frequency bin. >> >> Best, >> >> Daniel >> >> On 01.03.2016, at 11:51, Hähnke, Daniel wrote: >> >> Dear FieldTrip users, >> >> I currently want to double-check the results I got from a non-parametric >> Granger-causality analysis with another measure of directed communication, >> phase slope index. >> However, after having read Nolte et al.’s paper from 2008 that introduced >> the PSI, I still don’t understand how to best choose the parameter >> cfg.bandwidth. >> >> I tried out different values and got something qualitatively very similar >> to my Granger results. But this is rather fitting the parameter to the >> Granger results and kind of undermines my purpose of double-checking. >> >> Furthermore, I am using a logarithmic (to base 2) frequency axis. >> Consequently, my frequency bins are not evenly spaced. I have the feeling >> that I would rather need different bandwidths for the individual frequency >> bins. >> >> Does anyone know how to objectively choose the bandwidth parameter? >> >> Best, >> >> Daniel >> -- >> Daniel Hähnke >> PhD student >> >> Technische Universität München >> Institute of Neuroscience >> Translational NeuroCognition Laboratory >> Biedersteiner Straße 29, Bau 601 >> 80802 Munich >> Germany >> >> Email: daniel.haehnke at tum.de >> Phone: +49 89 4140 3356 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Wed Mar 9 11:57:44 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Wed, 9 Mar 2016 13:57:44 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. Message-ID: Pipeline for sourceanalysis with individualize grip Dear field trippers, I have a question related to pipeline for sourceanalysis with individualize grid. Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. Best Regards, Olga. % 1. load template grid, e.g. load( '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' ); template_grid = sourcemodel; %2. Make the individual subjects' grid %a) Load individual subject mri, e.g. [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); %b) construct individual grid by projecting to template grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); % 3. Make source reconstruction, using individualized grid and* template? or individual headmodel* %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); template_vol = vol; cfg = []; cfg.grid = grid_ind{Subj_i}; *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* cfg.channel = {'MEG'}; cfg.grad = freq_cmb{Subj_i}.grad; sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with individual or template headmodel?* *cfg.vol = vol_K0012_cm; **% individual or template vol???* cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed Mar 9 12:43:58 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 9 Mar 2016 12:43:58 +0100 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Dear Olga, > Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? I would use the individual head model based on the MRI as it provides more information for your source analysis. This should provide more accurate results. > Actually I tried both ways for one subject and did not notice any difference in the results. It seems to that this is due to this line of code, but I’m not quite sure about that: > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_cm{Subj_i}; > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); I think with this configuration the source model that is prepared is only based on the cfg.grid.template, and completely ignores the MRI (which you are interested in). This might explain why you see no difference. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: > > Pipeline for sourceanalysis with individualize grip > > > Dear field trippers, > > I have a question related to pipeline for sourceanalysis with individualize grid. > Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. > Best Regards, > Olga. > > % 1. load template grid, e.g. > > load('/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat'); > template_grid = sourcemodel; > > <>%2. Make the individual subjects' grid > %a) Load individual subject mri, e.g. > > [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); > mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); > > %b) construct individual grid by projecting to template grid > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_cm{Subj_i}; > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > % 3. Make source reconstruction, using individualized grid and template? or individual headmodel > %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); > template_vol = vol; > > cfg = []; > cfg.grid = grid_ind{Subj_i}; > cfg.vol = vol_K0012_cm; % individual or template vol??? > cfg.channel = {'MEG'}; > cfg.grad = freq_cmb{Subj_i}.grad; > sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); > > cfg = []; > cfg.frequency = freq_cmb{Subj_i}.freq; > cfg.grad = freq_cmb{Subj_i}.grad; > cfg.method = 'dics'; > cfg.keeptrials = 'yes'; > cfg.grid = sourcemodel_lf{Subj_i}; % sourcemodel after leadfield with individual or template headmodel? > cfg.vol = vol_K0012_cm; % individual or template vol??? > cfg.keeptrials = 'yes'; > cfg.dics.lambda = '5%'; > cfg.dics.keepfilter = 'yes'; > cfg.dics.fixedori = 'yes'; > cfg.dics.realfilter = 'yes'; > source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.taesler at uke.uni-hamburg.de Wed Mar 9 13:12:34 2016 From: p.taesler at uke.uni-hamburg.de (Philipp Taesler) Date: Wed, 9 Mar 2016 13:12:34 +0100 Subject: [FieldTrip] ft_definetrial using data structure in workspace In-Reply-To: References: Message-ID: <56E01332.5050506@uke.uni-hamburg.de> Hi Zita, if you have the info about which samples belong to your trials (e.g. extracted from some kind of marker file) you should be able to do this by using ft_redefinetrial. Basically you need a trial definition of the form described in the help to ft_definetrial (a Nx3 vector with start-sample, end-sample and zero-point offset). Then you might try something like: cfg = []; cfg.trl = *your Nx3 trial vector*; segmented_data = ft_redefinetrial(cfg, imported_data); Hope this works out for you. All the best, Phil Am 08.03.2016 um 18:05 schrieb Zita Eva Patai: > Dear FT-ers > > I would like to epoch my data, but as it is in a format not supported by > Fieldtrip (.xdf), I used Eeglab to convert it, and then converted > between Eeglab and FT with the eeg2fieldtrip function. Now i have a FT > data structure. > > The data structure looks fine, but it seems that to use ft_definetrial, > i need to specify a path to a file to be processed. Is there any way to > change this so i can use something in the workspace? > > Many thanks > > > -- Philipp Taesler Department of Systems Neuroscience University Medical Center Hamburg-Eppendorf Martinistr. 52, W34, 20248 Hamburg, Germany Phone: +49-40-7410-59902 Fax: +49-40-7410-59955 Email: p.taesler at uke.uni-hamburg.de -- _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From olga.v.sysoeva at gmail.com Wed Mar 9 17:18:11 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Wed, 9 Mar 2016 19:18:11 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the answer, but I think that this code should "create the subject specific grid, using the template grid" as specified in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. " % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid .warpmni = 'yes'; cfg.grid .template = template_grid; cfg.grid .nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.grid .unit ='mm';grid = ft_prepare_sourcemodel(cfg); I believe it "align/project" the template grid with individual mri using non-linear transformation. Correct me if I'm wrong. I'll be more than happy to get more comments on this. Best Regards, Olga. On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle wrote: > Dear Olga, > > Should I use template or subject-specific headmodel with “projected to > template grid individualized grid”? > > > I would use the individual head model based on the MRI as it provides more > information for your source analysis. This should provide more accurate > results. > > Actually I tried both ways for one subject and did not notice any > difference in the results. > > > It seems to that this is due to this line of code, but I’m not quite sure > about that: > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.grid.template = template_grid; > > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > > cfg.mri = mri_cm{Subj_i}; > > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > > I think with this configuration the source model that is prepared is only > based on the cfg.grid.template, and completely ignores the MRI (which you > are interested in). This might explain why you see no difference. > > Bests, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: > > Pipeline for sourceanalysis with individualize grip > > > > Dear field trippers, > > > I have a question related to pipeline for sourceanalysis with > individualize grid. > > Should I use template or subject-specific headmodel with “projected to > template grid individualized grid”? Below is my pipeline with details of > what I mean. Actually I tried both ways for one subject and did not notice > any difference in the results. Does it mean that I do not need to constract > headmodel for each subject? That's indeed save a lot of time, but I'd like > to get your green light on this. > > Best Regards, > > Olga. > > > % 1. load template grid, e.g. > > > load( > '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' > ); > > template_grid = sourcemodel; > > > %2. Make the individual subjects' grid > > %a) Load individual subject mri, e.g. > > > [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); > > mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); > > > %b) construct individual grid by projecting to template grid > > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.grid.template = template_grid; > > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > > cfg.mri = mri_cm{Subj_i}; > > grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); > > > % 3. Make source reconstruction, using individualized grid and* template? > or individual headmodel* > > %a) load template volume > load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); > > template_vol = vol; > > > cfg = []; > > cfg.grid = grid_ind{Subj_i}; > > *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* > > cfg.channel = {'MEG'}; > > cfg.grad = freq_cmb{Subj_i}.grad; > > sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); > > > cfg = []; > > cfg.frequency = freq_cmb{Subj_i}.freq; > > cfg.grad = freq_cmb{Subj_i}.grad; > > cfg.method = 'dics'; > > cfg.keeptrials = 'yes'; > > *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with > individual or template headmodel?* > > *cfg.vol = vol_K0012_cm; **% individual or template vol???* > > cfg.keeptrials = 'yes'; > > cfg.dics.lambda = '5%'; > > cfg.dics.keepfilter = 'yes'; > > cfg.dics.fixedori = 'yes'; > > cfg.dics.realfilter = 'yes'; > > source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 ha438 at georgetown.edu Wed Mar 9 21:26:36 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 9 Mar 2016 15:26:36 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 Message-ID: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; *ft_sourceplot(cfg,seg)* I get the error: *Error using textscan* First input can not be empty. Expected a non-empty string or a valid file-id. *Error in issubfield (line 44)* t = textscan(f,'%s','delimiter','.'); *Error in ft_sourceplot (line 460)* hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan -------------- next part -------------- An HTML attachment was scrubbed... URL: From seymourr at aston.ac.uk Wed Mar 9 21:38:57 2016 From: seymourr at aston.ac.uk (Seymour, Robert (Research Student)) Date: Wed, 9 Mar 2016 20:38:57 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 Message-ID: Hi Hassan, Is there any reason you want to use the FSL template brain? If not, it might be worth trying SPM template like so: [mri] = ft_read_mri('~pathtofieldtrip/template/anatomy/single_subj_T1'); mri.coordsys ='SPM' Hope this works out for you, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Wed Mar 9 21:46:33 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 9 Mar 2016 15:46:33 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: Message-ID: Hi Robert, Thanks for your reply. I am looking to use both, but I have had the same issue with the SPM also. I feel that the problem is not datatype dependent. Best, Hassan On Mar 9, 2016 3:39 PM, "Seymour, Robert (Research Student)" < seymourr at aston.ac.uk> wrote: > Hi Hassan, > > > Is there any reason you want to use the FSL template brain? If not, it might > be worth trying SPM template like so: > > > [mri] = ft_read_mri('~pathtofieldtrip/template/anatomy/single_subj_T1'); > > mri.coordsys ='SPM' > > > Hope this works out for you, > > Rob > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Wed Mar 9 21:49:48 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 9 Mar 2016 13:49:48 -0700 Subject: [FieldTrip] Moving window peak-to-peak artifact correction Message-ID: Hi fieldtrippers, ERPlab has a method of artifact detection which, within an epoch, will take a moving window of a defined size, measure peak-to-peak amplitude difference, and reject the trial based on a defined threshold. http://erpinfo.org/erplab/erplab-documentation/manual_4/Artifact_Detection.html I would like to implement a similar method in fieldtrip, but the closest I can find is ft_artifact_threshold. As I understand it, the range or min-max is the peak-to-peak amplitude difference, but as best as I can tell there is no way to do this over a moving window, only across the whole trial. Is there a way to implement this in fieldtrip? On a related note, why is it that (nearly) all of the fieldtrip artifact rejection methods require the .trl matrix, even with epoched data? Is there a specific reason why artifacts can't just be rejected by trial, besides the fact that allowing for rejection by .trl matrices allows for partial trial rejection? That would be a reasonable explanation, but there have been times where, for various reasons, having to reject by the .trl matrix has created complications (usually due to lack of foresight on my part, but nonetheless frustrating). Thanks, Max -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Thu Mar 10 01:40:56 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Thu, 10 Mar 2016 01:40:56 +0100 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space Message-ID: Dear FieldTrip users, I have a few questions regarding source localisation and statistics: 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. Thank you! Best regards, Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Mar 10 08:55:54 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Mar 2016 07:55:54 +0000 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Hi Olga, The ‘template grid’ refers to a so-called source model, i.e. the set of positions that you use to model your sources. The headmodel refers to the volume conduction model of the head. The inverse warping is intended to facilitate group comparisons after the source reconstruction. For the source reconstruction you can use these ‘inverse warped template grids’, but it is advisable to always use a volume conduction model based on the participant’s anatomy, as Simon already suggested in his reply. Best wishes, Jan-Mathijs On 09 Mar 2016, at 17:18, Olga Sysoeva > wrote: Dear Simon, Thank you very much for the answer, but I think that this code should "create the subject specific grid, using the template grid" as specified in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. " % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.grid.unit ='mm'; grid = ft_prepare_sourcemodel(cfg); I believe it "align/project" the template grid with individual mri using non-linear transformation. Correct me if I'm wrong. I'll be more than happy to get more comments on this. Best Regards, Olga. On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle > wrote: Dear Olga, Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? I would use the individual head model based on the MRI as it provides more information for your source analysis. This should provide more accurate results. Actually I tried both ways for one subject and did not notice any difference in the results. It seems to that this is due to this line of code, but I’m not quite sure about that: cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); I think with this configuration the source model that is prepared is only based on the cfg.grid.template, and completely ignores the MRI (which you are interested in). This might explain why you see no difference. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 On 09 Mar 2016, at 11:57, Olga Sysoeva > wrote: Pipeline for sourceanalysis with individualize grip Dear field trippers, I have a question related to pipeline for sourceanalysis with individualize grid. Should I use template or subject-specific headmodel with “projected to template grid individualized grid”? Below is my pipeline with details of what I mean. Actually I tried both ways for one subject and did not notice any difference in the results. Does it mean that I do not need to constract headmodel for each subject? That's indeed save a lot of time, but I'd like to get your green light on this. Best Regards, Olga. % 1. load template grid, e.g. load('/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat'); template_grid = sourcemodel; %2. Make the individual subjects' grid %a) Load individual subject mri, e.g. [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); %b) construct individual grid by projecting to template grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_cm{Subj_i}; grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); % 3. Make source reconstruction, using individualized grid and template? or individual headmodel %a) load template volume load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); template_vol = vol; cfg = []; cfg.grid = grid_ind{Subj_i}; cfg.vol = vol_K0012_cm; % individual or template vol??? cfg.channel = {'MEG'}; cfg.grad = freq_cmb{Subj_i}.grad; sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; cfg.grid = sourcemodel_lf{Subj_i}; % sourcemodel after leadfield with individual or template headmodel? cfg.vol = vol_K0012_cm; % individual or template vol??? cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 10 09:00:09 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 10 Mar 2016 08:00:09 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: Message-ID: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Hassan, Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use? Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with. Best, Jan-Mathijs On 09 Mar 2016, at 21:26, Hassan Aleem > wrote: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; ft_sourceplot(cfg,seg) I get the error: Error using textscan First input can not be empty. Expected a non-empty string or a valid file-id. Error in issubfield (line 44) t = textscan(f,'%s','delimiter','.'); Error in ft_sourceplot (line 460) hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga.v.sysoeva at gmail.com Thu Mar 10 12:44:53 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Thu, 10 Mar 2016 14:44:53 +0300 Subject: [FieldTrip] Pipeline for sourceanalysis with individualize grid. In-Reply-To: References: Message-ID: Thank you Jan-Mathijs for clarification. Therefore, I think it is better for me to change my pipeline to more conventional. Like this? 1.read individual mri (I do have it in .fif format adjusted in Graph to sensor position) [mri{subj_i}] = ft_read_mri(filename{subj_i}); 2. perform the segmentation cfg = []; cfg.output = 'brain'; segmentedmri{subj_i} = ft_volumesegment(cfg, mri{subj_i}); 3. create a headmodel cfg = []; cfg.method='singleshell'; vol{subj_i} = ft_prepare_headmodel(cfg, segmentedmri{subj_i}); 4. create a leadfield (do I need to do it twice – sourcemodel first and than leadfield?). Which resolution is better to use? 1 cm – to coarse? cfg = []; cfg.grad = freqPost{Subj_i} .grad; cfg.vol = vol{Subj_i} ; cfg.reducerank = 2; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; [grid{Subj_i} ] = ft_prepare_leadfield(cfg); 5. do source reconstraction cfg = []; cfg.frequency = freq_cmb{Subj_i}.freq; cfg.grad = freq_cmb{Subj_i}.grad; cfg.method = 'dics'; cfg.keeptrials = 'yes'; *cfg.grid = **grid{Subj_i};* *cfg.vol = vol**{Subj_i};* cfg.keeptrials = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.fixedori = 'yes'; cfg.dics.realfilter = 'yes'; *source {Subj_i} = ft_sourceanalysis(cfg, freq_cmb{Subj_i});* How does it look for experienced sourcemodeller? Best Regards, Olga. On Thu, Mar 10, 2016 at 10:55 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Olga, > > The ‘template grid’ refers to a so-called source model, i.e. the set of > positions that you use to model your sources. > The headmodel refers to the volume conduction model of the head. > > The inverse warping is intended to facilitate group comparisons after the > source reconstruction. > > For the source reconstruction you can use these ‘inverse warped template > grids’, but it is advisable to always use a volume conduction model based > on the participant’s anatomy, as Simon already suggested in his reply. > > Best wishes, > Jan-Mathijs > > > > On 09 Mar 2016, at 17:18, Olga Sysoeva wrote: > > Dear Simon, > > Thank you very much for the answer, but I think that this code should > "create the subject specific grid, using the template grid" as specified > in tutorial here http://www.fieldtriptoolbox.org/tutorial/sourcemodel. > " > > % create the subject specific grid, using the template grid that has just been created > cfg = []; > cfg.grid .warpmni = 'yes'; > cfg.grid .template = template_grid; > cfg.grid .nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri; > cfg.grid .unit ='mm';grid = ft_prepare_sourcemodel(cfg); > > I believe it "align/project" the template grid with individual mri using > non-linear transformation. > > Correct me if I'm wrong. > I'll be more than happy to get more comments on this. > > Best Regards, > Olga. > > On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle > wrote: > >> Dear Olga, >> >> Should I use template or subject-specific headmodel with “projected to >> template grid individualized grid”? >> >> >> I would use the individual head model based on the MRI as it provides >> more information for your source analysis. This should provide more >> accurate results. >> >> Actually I tried both ways for one subject and did not notice any >> difference in the results. >> >> >> It seems to that this is due to this line of code, but I’m not quite sure >> about that: >> >> cfg = []; >> >> cfg.grid.warpmni = 'yes'; >> >> cfg.grid.template = template_grid; >> >> cfg.grid.nonlinear = 'yes'; % use non-linear normalization >> >> cfg.mri = mri_cm{Subj_i}; >> >> grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); >> >> >> I think with this configuration the source model that is prepared is only >> based on the cfg.grid.template, and completely ignores the MRI (which you >> are interested in). This might explain why you see no difference. >> >> Bests, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 09 Mar 2016, at 11:57, Olga Sysoeva wrote: >> >> Pipeline for sourceanalysis with individualize grip >> >> >> >> Dear field trippers, >> >> >> I have a question related to pipeline for sourceanalysis with >> individualize grid. >> >> Should I use template or subject-specific headmodel with “projected to >> template grid individualized grid”? Below is my pipeline with details of >> what I mean. Actually I tried both ways for one subject and did not notice >> any difference in the results. Does it mean that I do not need to constract >> headmodel for each subject? That's indeed save a lot of time, but I'd like >> to get your green light on this. >> >> Best Regards, >> >> Olga. >> >> >> % 1. load template grid, e.g. >> >> >> load( >> '/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat' >> ); >> >> template_grid = sourcemodel; >> >> >> %2. Make the individual subjects' grid >> >> %a) Load individual subject mri, e.g. >> >> >> [mri{Subj_i}] = ft_read_mri(path_MRI{Subj_i}); >> >> mri_cm{Subj_i} = ft_convert_units(mri{Subj_i}, 'cm'); >> >> >> %b) construct individual grid by projecting to template grid >> >> >> cfg = []; >> >> cfg.grid.warpmni = 'yes'; >> >> cfg.grid.template = template_grid; >> >> cfg.grid.nonlinear = 'yes'; % use non-linear normalization >> >> cfg.mri = mri_cm{Subj_i}; >> >> grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg); >> >> >> % 3. Make source reconstruction, using individualized grid and* >> template? or individual headmodel* >> >> %a) load template volume >> load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat'); >> >> template_vol = vol; >> >> >> cfg = []; >> >> cfg.grid = grid_ind{Subj_i}; >> >> *cfg.vol = vol_K0012_cm; **% **individual* *or template **vol???* >> >> cfg.channel = {'MEG'}; >> >> cfg.grad = freq_cmb{Subj_i}.grad; >> >> sourcemodel_lf_K0012 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i}); >> >> >> cfg = []; >> >> cfg.frequency = freq_cmb{Subj_i}.freq; >> >> cfg.grad = freq_cmb{Subj_i}.grad; >> >> cfg.method = 'dics'; >> >> cfg.keeptrials = 'yes'; >> >> *cfg.grid = sourcemodel_lf{Subj_i}; % **sourcemodel after leadfield with >> individual or template headmodel?* >> >> *cfg.vol = vol_K0012_cm; **% individual or template vol???* >> >> cfg.keeptrials = 'yes'; >> >> cfg.dics.lambda = '5%'; >> >> cfg.dics.keepfilter = 'yes'; >> >> cfg.dics.fixedori = 'yes'; >> >> cfg.dics.realfilter = 'yes'; >> >> source_K0012 = ft_sourceanalysis(cfg, freq_cmb{Subj_i}); >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 laxmi.shaw22 at gmail.com Thu Mar 10 14:41:59 2016 From: laxmi.shaw22 at gmail.com (Laxmi Shaw) Date: Thu, 10 Mar 2016 19:11:59 +0530 Subject: [FieldTrip] Issue in topographs Message-ID: Dear Fieldtrip users, Can anybody is having complete manual book of fieldtrip toolbox. Actually i am facing problem in simple topographic plot. I am using fieldtrip-20051231 and my data set is in .xls files.Can anybody help in this regard. Thanks in advance Regards -- Laxmi Shaw Research Scholar(PhD) IIT Kharagpur India Ph no-08388837821 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Fri Mar 11 01:02:54 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Thu, 10 Mar 2016 19:02:54 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Hi J.M, I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux operating system. However the problem appears also on my windows 10 OS. I am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot does not work with the same complaint as with trying to plot the source interpolation, I assume that's what you mean by checking them. Let me post the script to give you more information. ( the headmodel part of the script was modified from robert bauer) *%reading mri* [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' ----------------------------------- *%segmentation* cfg = []; cfg.brainthreshold = 0.5; cfg.scalpthreshold = 0.15; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); ---------------------------------- %plotting segmentation cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; ft_sourceplot(cfg,seg) *this does not work, same error.* ------------------------------------------ *%building mesh* cfg = []; cfg.method= 'projectmesh'; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [1000 1000 1000]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001 bnd(2).pnt = bnd(2).pnt.*1 bnd(3).pnt = bnd(3).pnt.*0.999 ft_plot_mesh(bnd(1))%scalp ft_plot_mesh(bnd(2))%skull ft_plot_mesh(bnd(3))%brain ---------------------------------------------------------- *%preparing headmodel* cfg = []; cfg.method = 'dipoli'; headmodel = ft_prepare_headmodel(cfg, bnd); -------------------------------------------------------- *%adding electrodes to headmodel* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') % aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp st_elec_aligned = ft_electroderealign(cfg); ----------------------------------------------- *%using the standard template sourcemodel from fieldtrip.* load('standard_sourcemodel3d5mm.mat') ------------------------------------- *%% timelock data* cfg = []; m0 = ft_timelockanalysis(cfg, dataM0); -------------------------------------- *%% perform source analysis* cfg = []; cfg.method = 'lcmv'; cfg.lcmv.lambda='5%'; cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD source_m0=ft_sourceanalysis(cfg,m0); ------------------------------ *%% source interpolation* cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; cfg.grid=sourcemodel.cfg.grid; sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); ---------------------------------------------- *%plotting* cfg = []; cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg, sourceinterp_m0); This is where it gives me the error. Please let me know if you need more information. I also had a question about making a 'source' it seems that the fieldtrip tutorial does not use a 'sourcemodel' but instead use a dipolefitting source, is this comparable. Thank you for the help in advance. Best, Hassan On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hassan, > Can you please provide a bit more information with respect to what version > of fieldtrip, matlab and operating system you use? > Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? > We need more information to work with. > Best, > Jan-Mathijs > > > > On 09 Mar 2016, at 21:26, Hassan Aleem wrote: > > Hi everyone, > > I have a question that is possibly very easy to solve but is evading me. I > am unable to get ft_sourceplot to work. For example when I run the code: > > [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); > mri.coordsys ='MNI' > > cfg = []; > cfg.output = {'brain' 'scalp' 'skull'}; > seg = ft_volumesegment(cfg, mri); > seg.anatomy = mri.anatomy; > > cfg = []; > cfg.funparameter = 'brain'; > *ft_sourceplot(cfg,seg)* > > I get the error: > > *Error using textscan* > First input can not be empty. Expected a non-empty string or a valid > file-id. > > * Error in issubfield (line 44)* > t = textscan(f,'%s','delimiter','.'); > > * Error in ft_sourceplot (line 460)* > hasmsk = issubfield(functional, cfg.maskparameter); > > This is happening regardless of what stage I use ft_sourceplot. > > Thanks for your consideration! > > Hassan > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 Fri Mar 11 07:36:17 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 11 Mar 2016 06:36:17 +0000 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: I cannot reproduce your problem. It seems that you are using an incorrect/outdated copy of issubfield. The line number you report in your error message does not line up with the current version. Please ensure that your matlab path is set correctly, in particular try to avoid copies of SPM or eeglab taking precedence. These may have old versions of FT code that can cause all kinds of erratic behaviour. Best wishes, Jan-Mathijs On 11 Mar 2016, at 01:02, Hassan Aleem > wrote: Hi J.M, I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux operating system. However the problem appears also on my windows 10 OS. I am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot does not work with the same complaint as with trying to plot the source interpolation, I assume that's what you mean by checking them. Let me post the script to give you more information. ( the headmodel part of the script was modified from robert bauer) %reading mri [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' ----------------------------------- %segmentation cfg = []; cfg.brainthreshold = 0.5; cfg.scalpthreshold = 0.15; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); ---------------------------------- %plotting segmentation cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; ft_sourceplot(cfg,seg) this does not work, same error. ------------------------------------------ %building mesh cfg = []; cfg.method= 'projectmesh'; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [1000 1000 1000]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001 bnd(2).pnt = bnd(2).pnt.*1 bnd(3).pnt = bnd(3).pnt.*0.999 ft_plot_mesh(bnd(1))%scalp ft_plot_mesh(bnd(2))%skull ft_plot_mesh(bnd(3))%brain ---------------------------------------------------------- %preparing headmodel cfg = []; cfg.method = 'dipoli'; headmodel = ft_prepare_headmodel(cfg, bnd); -------------------------------------------------------- %adding electrodes to headmodel elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') % aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp st_elec_aligned = ft_electroderealign(cfg); ----------------------------------------------- %using the standard template sourcemodel from fieldtrip. load('standard_sourcemodel3d5mm.mat') ------------------------------------- %% timelock data cfg = []; m0 = ft_timelockanalysis(cfg, dataM0); -------------------------------------- %% perform source analysis cfg = []; cfg.method = 'lcmv'; cfg.lcmv.lambda='5%'; cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD source_m0=ft_sourceanalysis(cfg,m0); ------------------------------ %% source interpolation cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; cfg.grid=sourcemodel.cfg.grid; sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); ---------------------------------------------- %plotting cfg = []; cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg, sourceinterp_m0); This is where it gives me the error. Please let me know if you need more information. I also had a question about making a 'source' it seems that the fieldtrip tutorial does not use a 'sourcemodel' but instead use a dipolefitting source, is this comparable. Thank you for the help in advance. Best, Hassan On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hassan, Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use? Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with. Best, Jan-Mathijs On 09 Mar 2016, at 21:26, Hassan Aleem > wrote: Hi everyone, I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code: [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); mri.coordsys ='MNI' cfg = []; cfg.output = {'brain' 'scalp' 'skull'}; seg = ft_volumesegment(cfg, mri); seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'brain'; ft_sourceplot(cfg,seg) I get the error: Error using textscan First input can not be empty. Expected a non-empty string or a valid file-id. Error in issubfield (line 44) t = textscan(f,'%s','delimiter','.'); Error in ft_sourceplot (line 460) hasmsk = issubfield(functional, cfg.maskparameter); This is happening regardless of what stage I use ft_sourceplot. Thanks for your consideration! Hassan _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 ha438 at georgetown.edu Fri Mar 11 07:46:18 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Fri, 11 Mar 2016 01:46:18 -0500 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Thanks for your response J.M. That makes sense. I will remove all eeglab/spm/fieldtrip and reinstall,making sure to keep fieldtrip separate. On Mar 11, 2016 1:40 AM, "Schoffelen, J.M. (Jan Mathijs)" < jan.schoffelen at donders.ru.nl> wrote: > I cannot reproduce your problem. It seems that you are using an > incorrect/outdated copy of issubfield. The line number you report in your > error message does not line up with the current version. Please ensure that > your matlab path is set correctly, in particular try to avoid copies of SPM > or eeglab taking precedence. These may have old versions of FT code that > can cause all kinds of erratic behaviour. > > Best wishes, > Jan-Mathijs > > > > > > > > On 11 Mar 2016, at 01:02, Hassan Aleem wrote: > > Hi J.M, > > I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux > operating system. However the problem appears also on my windows 10 OS. I > am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot > does not work with the same complaint as with trying to plot the source > interpolation, I assume that's what you mean by checking them. Let me post > the script to give you more information. ( the headmodel part of the script > was modified from robert bauer) > > *%reading mri* > [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); > mri.coordsys ='MNI' > ----------------------------------- > *%segmentation* > > cfg = []; > cfg.brainthreshold = 0.5; > cfg.scalpthreshold = 0.15; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'scalp' 'skull'}; > seg = ft_volumesegment(cfg, mri); > ---------------------------------- > %plotting segmentation > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > ft_sourceplot(cfg,seg) *this does not work, same error.* > ------------------------------------------ > *%building mesh* > cfg = []; > cfg.method= 'projectmesh'; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [1000 1000 1000]; > bnd = ft_prepare_mesh(cfg, seg); > > % i enlarged / reduced the boundary mesh a little bit, because they were > causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001 > bnd(2).pnt = bnd(2).pnt.*1 > bnd(3).pnt = bnd(3).pnt.*0.999 > > ft_plot_mesh(bnd(1))%scalp > ft_plot_mesh(bnd(2))%skull > ft_plot_mesh(bnd(3))%brain > > ---------------------------------------------------------- > *%preparing headmodel* > cfg = []; > cfg.method = 'dipoli'; > headmodel = ft_prepare_headmodel(cfg, bnd); > -------------------------------------------------------- > > * %adding electrodes to headmodel* > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode > file > > % visualize head surface (scalp) > > figure; > ft_plot_mesh(headmodel.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > > % aligning electrodes > cfg = []; > cfg.method = 'interactive'; > cfg.elec = elec; > cfg.headshape = headmodel.bnd(1);%scalp > st_elec_aligned = ft_electroderealign(cfg); > ----------------------------------------------- > *%using the standard template sourcemodel from fieldtrip.* > > load('standard_sourcemodel3d5mm.mat') > ------------------------------------- > *%% timelock data* > cfg = []; > m0 = ft_timelockanalysis(cfg, dataM0); > -------------------------------------- > > *%% perform source analysis * > cfg = []; > cfg.method = 'lcmv'; > cfg.lcmv.lambda='5%'; > cfg.grid = sourcemodel.cfg.grid;---this is the standard template from > fieldtrip > cfg.headmodel = headmodel; > cfg.lcmv.keepfilter = 'yes'; > cfg.lcmv.projectnoise='yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > source_m0=ft_sourceanalysis(cfg,m0); > ------------------------------ > *%% source interpolation* > > cfg = []; > cfg.interpmethod = 'nearest'; > cfg.parameter = 'pow'; > cfg.grid=sourcemodel.cfg.grid; > sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); > ---------------------------------------------- > *%plotting* > > cfg = []; > cfg.method = 'ortho'; > cfg.funcolorlim = 'maxabs'; > cfg.funparameter= 'pow'; > ft_sourceplot(cfg, sourceinterp_m0); > > This is where it gives me the error. Please let me know if you need more > information. I also had a question about making a 'source' it seems that > the fieldtrip tutorial does not use a 'sourcemodel' but instead use a > dipolefitting source, is this comparable. Thank you for the help in advance. > > Best, > > Hassan > > On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hassan, >> Can you please provide a bit more information with respect to what >> version of fieldtrip, matlab and operating system you use? >> Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? >> We need more information to work with. >> Best, >> Jan-Mathijs >> >> >> >> On 09 Mar 2016, at 21:26, Hassan Aleem wrote: >> >> Hi everyone, >> >> I have a question that is possibly very easy to solve but is evading me. >> I am unable to get ft_sourceplot to work. For example when I run the code: >> >> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >> mri.coordsys ='MNI' >> >> cfg = []; >> cfg.output = {'brain' 'scalp' 'skull'}; >> seg = ft_volumesegment(cfg, mri); >> seg.anatomy = mri.anatomy; >> >> cfg = []; >> cfg.funparameter = 'brain'; >> *ft_sourceplot(cfg,seg)* >> >> I get the error: >> >> *Error using textscan* >> First input can not be empty. Expected a non-empty string or a valid >> file-id. >> >> * Error in issubfield (line 44)* >> t = textscan(f,'%s','delimiter','.'); >> >> * Error in ft_sourceplot (line 460)* >> hasmsk = issubfield(functional, cfg.maskparameter); >> >> This is happening regardless of what stage I use ft_sourceplot. >> >> Thanks for your consideration! >> >> Hassan >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 bushra.riaz at gu.se Fri Mar 11 12:00:21 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Fri, 11 Mar 2016 11:00:21 +0000 Subject: [FieldTrip] error in reading epoched fif files Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> Hello, I am getting an error in reading epoched fiff files created with the latest stable version of mne Is there a quick fix to this problem? Thank you Kind regards Bushra Riaz? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Fri Mar 11 12:10:25 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Fri, 11 Mar 2016 11:10:25 +0000 Subject: [FieldTrip] Issue in topographs Message-ID: Hello Laxmi, The tutorials within the Fieldtrip wiki online, as well as the reference documentation and FAQs on the wiki, are the manual. You can find tutorials there for how to get your data into Fieldtrip, and examples for how to plot. There are also some video tutorials. If you have more specific questions then people here on the e-mail list might be able to help. But you would need to provide more details, such as, what is the format of your data in .xls files (is it averages, grand averages, epochs, continuous data, etc...?). If you search the archives of this mailing list I think you can find some previous messages about how to "hack" data from unsupported file formats into the proper MATLAB structure to be compatible with the fieldtrip functions. Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > > Message: 2 > Date: Thu, 10 Mar 2016 19:11:59 +0530 > From: Laxmi Shaw > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Issue in topographs > Message-ID: > < > CABWJU2Sk5qG_4G63EbYXkySo9wcOFfZxdqmsQ6i9mRMLQBSJkg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fieldtrip users, > Can anybody is having complete manual book of fieldtrip toolbox. Actually i > am facing problem in simple topographic plot. I am using > fieldtrip-20051231 and my data set is in .xls files.Can anybody help in > this regard. > > > > Thanks in advance > > > Regards > > -- > Laxmi Shaw > Research Scholar(PhD) > IIT Kharagpur > India > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Fri Mar 11 22:59:58 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Fri, 11 Mar 2016 21:59:58 +0000 Subject: [FieldTrip] DICS between two frequencies? Message-ID: Hi FieldTrip list, When doing source analysis using DICS the help document refers to cfg.foi as a single value, but the workshop notes (http://www.fieldtriptoolbox.org/workshop/meg-uk-2015/fieldtrip-beamformer-demo) use two values. So possibly silly question, but does ft_source analysis function normally using two values? Also, does it require wavelet transform data or would using fft data over a large frequency range then inputting the required bands be OK to do? Thanks, Peter From runna90 at 126.com Sat Mar 12 01:02:40 2016 From: runna90 at 126.com (runna90 at 126.com) Date: Sat, 12 Mar 2016 08:02:40 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: Message-ID: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Dear Harold, I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here . Source model: Co-registration of the source space to the sensor-based head coordinate system, I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? Best regards, Runnan > 在 2016年3月10日,08:40,Harold Cavendish 写道: > > Dear FieldTrip users, > > I have a few questions regarding source localisation and statistics: > > 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). > > What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? > > 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? > > I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. > > Thank you! > > Best regards, > Harold > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sat Mar 12 12:12:27 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sat, 12 Mar 2016 11:12:27 +0000 Subject: [FieldTrip] error in reading epoched fif files Message-ID: Hello Bushra, You will be more likely to get helpful advice if you can provide more details about your problem. See http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 1 > Date: Fri, 11 Mar 2016 11:00:21 +0000 > From: Bushra Riaz Syeda > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] error in reading epoched fif files > Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b at EXCH03-P.GU.GU.SE> > Content-Type: text/plain; charset="iso-8859-1" > > Hello, > > I am getting an error in reading epoched fiff files created with the > latest stable version of mne > Is there a quick fix to this problem? > > Thank you > Kind regards > Bushra Riaz? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Sat Mar 12 15:06:38 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Sat, 12 Mar 2016 15:06:38 +0100 Subject: [FieldTrip] Head model for EEG source localization - Possible bug in BEMCP? Message-ID: Dear all, I am working on EEG source localization of a very simple fist clenching task (right hand, 10 seconds of contraction alternated to 10 seconds of relaxation to be used as contrast condition) using DICS beamformer (frequency 10 Hz). I have the individial MRI and EEG electrode positions of my participants, so I wrote a script to create the individual forward model following the tutorials on the fieldtrip webpage and some useful discussions on the mailing list. Below I report the full code used for the forward model and the code used for the source analysis. Attached, you find the results of the source localization and ​some ​ figures of different steps in the computation of the forward model. According to my task, I expect to identify a desynchronization on the left motor cortex, but what I am getting are very weird results(see attachment ​s)​ . I tryed to use the standard MRI in template\headmodel\standard_mri, and I get similar results. After a full day of self-debugging, I managed to get the result I expect (attached) using the method "concentricspheres" instead of "bemcp" in the computation of the head model, both with the MRI of my participants and with the standard MRI. I assume there must be something wrong with "bemcp", also becasue when I use the standard bem headmodel (template\headmodel\standard_bem) created with the method "dipoli", everything looks fine again. Did anybody experienced a similar issue before? Is there anything wrong I am doing in the pipeline? Thanks a lot in advace for your support! Best, Debora Fieldtrip version: 20150828 Matlab version: R2015a (64 bit) OS: Windows 8 (64 bit) %%%% --------------------- Code for Forward Model ---------------- %%% %% Read MRI data (DICOM) mri = ft_read_mri(experiment.mri); % experiment.mri contains the path to individual MRIs %% Convert anatomical MRI to MNI coordinate system (= RAS) cfg = []; cfg.method = 'interactive'; cfg.coordsys = 'spm'; % MNI coordinate system (=RAS) cfg.viewmode = 'ortho'; mri_spm = ft_volumerealign(cfg,mri); %% Re-slice the MRI volume so that all the 3 dimensions have the same number of voxels cfg = []; cfg.resolution = 1; % 1 mm thick slices cfg.dim = [256 256 256]; mri_spm = ft_volumereslice(cfg,mri_spm); %% Visualize MRI data to check that everything is ok cfg = []; cfg.method = 'ortho'; ft_sourceplot(cfg,mri_spm) %% Segment the anatomical data cfg = []; cfg.output = {'brain' 'skull' 'scalp'}; cfg.brainsmooth = 2; cfg.brainthreshold = 0.25; cfg.scalpthreshold = 0.025; mri_seg = ft_volumesegment(cfg, mri_spm); %% Check segmentation brain cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'brain'; ft_sourceplot(cfg,mri_seg) %% Check segmentation skull cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'skull'; ft_sourceplot(cfg,mri_seg) %% Check segmentation scalp cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'scalp'; ft_sourceplot(cfg,mri_seg) %% Prepare mesh: creates surfaces at the boarders of the different tissue-types cfg = []; cfg.method = 'projectmesh'; cfg.tissue = {'brain' 'skull' 'scalp'}; cfg.numvertices = [6000 4000 2000]; bnd = ft_prepare_mesh(cfg, mri_seg); %% Visualize surfaces figure ft_plot_mesh(bnd(1),'facecolor','none') % brain figure ft_plot_mesh(bnd(2),'facecolor','none') % skull figure ft_plot_mesh(bnd(3),'facecolor','none') % scalp %% Visualize full mesh figure ft_plot_mesh(bnd(3), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(bnd(1),'edgecolor','none','facecolor',[0.4 0.6 0.4]); %% Prepare head model (volume conduction model) cfg = []; cfg.method = 'bemcp'; headmodel = ft_prepare_headmodel(cfg,bnd); %% % --------------------- Align the EEG electrodes!!!-------------------%%% %% (1) Read electrode position from Localizer file elec = ft_read_sens(experiment.electrodes); % experiment.electrodes contains the path to the individual electrode positions %% (2) Check if alignment is necessary figure %plot scalp ft_plot_mesh(headmodel.bnd(3),'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]) hold on % plot electrodes ft_plot_sens(elec,'style','sk') %% (3) If the electrodes are not aligned to the head surface, interactively align them cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(3); % scalp elec_aligned = ft_electroderealign(cfg); %% Load hdr and order elec_aligned accordign to original order of signal acquisition %%% This is necessary because the eeg elctrod eposition shave been acquired %%% in a different order with respect to theorder of the signal recording load([experiment.path '\Data'],'hdr') % hdr contains some information about the original order of the channels and so on... [~, original_order] = ismember(hdr.elec.label,elec_aligned.label); elec_aligned.chanpos = elec_aligned.chanpos(original_order,:); elec_aligned.elecpos = elec_aligned.elecpos(original_order,:); elec_aligned.label = elec_aligned.label(original_order); %% Check if the alignment is ok figure %plot scalp ft_plot_mesh(headmodel.bnd(3),'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]) hold on % plot electrodes ft_plot_sens(elec_aligned,'style','sk') %% -------------------------------- Source model -------------------------%% %% Make the individual subject's grid cfg = []; cfg.grid.warpmni = 'yes'; cfg.resolution = 6; % resolution of the template grid in mm cfg.grid.nonlinear = 'yes'; % use non linear normalization cfg.mri = mri_spm; % use subject's mri in mni coordinates cfg.grid.unit = 'mm'; sourcemodel = ft_prepare_sourcemodel(cfg); %% Plot the single subject'e head model and grid positions figure hold on ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); ft_plot_mesh(sourcemodel.pos(sourcemodel.inside,:)); %% Double check that source model is aligned to the segmented volume and to the electrodes figure hold on plot3(sourcemodel.pos(sourcemodel.inside,1),sourcemodel.pos(sourcemodel.inside,2),sourcemodel.pos(sourcemodel.inside,3),'.'); ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); %% ---------------------- FORWARD SOLUTION ------------------------ %% %% Prepare leadfield cfg = []; cfg.elec = elec_aligned; cfg.grid = sourcemodel; cfg.headmodel = headmodel; leadfield = ft_prepare_leadfield(cfg); %% Test sourc elocalization load([experiment.path '\DATA'], 'preexperiment_freqsource') % preexperiment_freqsource contains the output of ft_freqanalysis cfg = []; cfg.elec = elec_aligned; cfg.method = 'dics'; cfg.frequency = 10; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.dics.keepfilter = 'yes'; cfg.dics.lambda = '10%'; src = ft_sourceanalysis(cfg, preexperiment_freqsource); filter = src.avg.filter; markers = [224 192]; % markers are some number in the trialinfo, 224 is related to fist clenching, 192 to relaxation for mm = 1:length(markers) cfg = []; cfg.trials = find(preexperiment_freqsource.trialinfo == markers(mm)); data = ft_selectdata(cfg,preexperiment_freqsource); %%% DICS cfg = []; cfg.elec = elec_aligned; cfg.method = 'dics'; cfg.frequency = 10; cfg.grid = leadfield; cfg.headmodel = headmodel; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '10%'; cfg.grid.filter = filter; Source{mm} = ft_sourceanalysis(cfg, data); end %% Interpolate results to anatomy source = Source{1}; source1 = Source{1}; %clenching source2 = Source{2}; % release source.avg.cont = (source2.avg.pow./source1.avg.pow)-1; cfg = []; cfg.parameter = 'cont'; source = ft_sourceinterpolate(cfg, source, mri_spm); %% Plot surface cfg = []; cfg.method = 'surface'; cfg.funparameter = 'cont'; cfg.funcolormap = 'jet'; ft_sourceplot(cfg, source) -------------------------------------------------------------------- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_CONCENTRICSPHERES_Results_Source.PNG Type: image/png Size: 126346 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0_IndividualMRI_spm.PNG Type: image/png Size: 80674 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1_Segmentaiton_BrainSkullScalp.PNG Type: image/png Size: 41612 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2a_Output ft_plot_mesh_BrainSkullScalp.PNG Type: image/png Size: 66519 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2b_Output ft_plot_mesh_allSurfaces.PNG Type: image/png Size: 40960 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3_BEMCP_SourceModel.PNG Type: image/png Size: 19959 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3_CONCENTRICSPHERES_SourceModel.PNG Type: image/png Size: 19714 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_BEMCP_Alignment_HeadModel_SourceModel_Electrodes.PNG Type: image/png Size: 58428 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_CONCENTRICSPHERES_Alignment_HeadModel_SourceModel_Electrodes.PNG Type: image/png Size: 67775 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 5_BEMCP_Results_Source.PNG Type: image/png Size: 143105 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Sat Mar 12 15:42:59 2016 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sat, 12 Mar 2016 14:42:59 +0000 Subject: [FieldTrip] BEMCP Message-ID: Deb: I have had problems with BEMCP. 1—one of the practical / technical problems is that if the compartments overlap, or even come close, then the procedure would not work—the ft_sourceanlaysis crashed. 2—There are a couple of studies comparing BEMCP and dipoli, among other methods. The BEMCP method does not fare well, the dipoli fares better, E. g., among three or four studies I have seen. Gramfort, A., et al. (2010). "OpenMEEG: opensource software for quasistatic bioelectromagnetics." Biomed Eng Online 9: 45. Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput Intell Neurosci 2011: 923703. 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, and the Simbio FEM model, by correlating results from each model (e.g., correlations of all the dipole CDR estimates; or correlations across anatomical ROIs). The BEMCP and concentric spheres work similarly, and the dipoli and Simbio-FEM work similarly. This was with infants using participant-computed realistic models for the compartments and the FEM. I am not claiming from this and superiority of the dipoli (or FEM) models over the BEMCP, but I suggest looking at the research literature formally comparing these methods before going much further with BEMCP. John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Sat Mar 12 16:30:12 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Sat, 12 Mar 2016 16:30:12 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear John, thanks a lot for your promt reply and your suggestion. I guess that I was sticking to the BEM head model just because I read the tutorial for EEG BEM head model first, but going quickly through the studies you have mentioned and considering the tests you have performed, I may also consider to switch to the FEM head model or to simply use the concentric spheres (which appeared to work similar to BEMCP in your comparisons). I am relatively new to source localization and had no crash/errors in my pipeline, and this combination makes always difficult to find possible pitfalls. As soon as I have them ready, I will post the results obtained with the FEM head model as well, maybe they will be useful for some other users :) Thanks again for your support! All the best, Debora On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN wrote: > Deb: > > I have had problems with BEMCP. > > 1—one of the practical / technical problems is that if the compartments > overlap, or even come close, then the procedure would not work—the > ft_sourceanlaysis crashed. > > 2—There are a couple of studies comparing BEMCP and dipoli, among other > methods. The BEMCP method does not fare well, the dipoli fares better, > > E. g., among three or four studies I have seen. > Gramfort, A., et al. (2010). "OpenMEEG: opensource software for > quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. > > Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput > Intell Neurosci *2011*: 923703. > > 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, > and the Simbio FEM model, by correlating results from each model (e.g., > correlations of all the dipole CDR estimates; or correlations across > anatomical ROIs). The BEMCP and concentric spheres work similarly, and the > dipoli and Simbio-FEM work similarly. This was with infants using > participant-computed realistic models for the compartments and the FEM. > > I am not claiming from this and superiority of the dipoli (or FEM) models > over the BEMCP, but I suggest looking at the research literature formally > comparing these methods before going much further with BEMCP. > > John > > *********************************************** > John E. Richards Carolina Distinguished Professor > Department of Psychology > University of South Carolina > Columbia, SC 29208 > Dept Phone: 803 777 2079 > Fax: 803 777 9558 > Email: richards-john at sc.edu > HTTP: jerlab.psych.sc.edu > *********************************************** > > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Sat Mar 12 17:14:40 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sat, 12 Mar 2016 16:14:40 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Debora, The critical thing with BEMCP is that your sources are not too close to the inner skull boundary. When they are closer than the safe distance the solution you get is completely wrong. When they are not too close, the solution is OK and comparable at least to concentric spheres. The safe distance is is more or less the average edge length in your skull mesh. In SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option cfg.moveinward that corrects the mesh to ensure that it is not too close. It would be interesting if you use this option and report whether this resolves your problem. This issue should occur in any BEM but depending on the implementation the critical distance might be shorter. Best, Vladimir On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri wrote: > Dear John, > thanks a lot for your promt reply and your suggestion. I guess that I was > sticking to the BEM head model just because I read the tutorial for EEG BEM > head model first, but going quickly through the studies you have mentioned > and considering the tests you have performed, I may also consider to switch > to the FEM head model or to simply use the concentric spheres (which > appeared to work similar to BEMCP in your comparisons). I am relatively new > to source localization and had no crash/errors in my pipeline, and this > combination makes always difficult to find possible pitfalls. > > As soon as I have them ready, I will post the results obtained with the > FEM head model as well, maybe they will be useful for some other users :) > > Thanks again for your support! > All the best, > Debora > > On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN > wrote: > >> Deb: >> >> I have had problems with BEMCP. >> >> 1—one of the practical / technical problems is that if the compartments >> overlap, or even come close, then the procedure would not work—the >> ft_sourceanlaysis crashed. >> >> 2—There are a couple of studies comparing BEMCP and dipoli, among other >> methods. The BEMCP method does not fare well, the dipoli fares better, >> >> E. g., among three or four studies I have seen. >> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >> >> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >> Intell Neurosci *2011*: 923703. >> >> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >> and the Simbio FEM model, by correlating results from each model (e.g., >> correlations of all the dipole CDR estimates; or correlations across >> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >> dipoli and Simbio-FEM work similarly. This was with infants using >> participant-computed realistic models for the compartments and the FEM. >> >> I am not claiming from this and superiority of the dipoli (or FEM) models >> over the BEMCP, but I suggest looking at the research literature formally >> comparing these methods before going much further with BEMCP. >> >> John >> >> *********************************************** >> John E. Richards Carolina Distinguished Professor >> Department of Psychology >> University of South Carolina >> Columbia, SC 29208 >> Dept Phone: 803 777 2079 >> Fax: 803 777 9558 >> Email: richards-john at sc.edu >> HTTP: jerlab.psych.sc.edu >> *********************************************** >> >> > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Sun Mar 13 13:20:16 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Sun, 13 Mar 2016 13:20:16 +0100 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Runnan, I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. *Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue.* Best regards, Harold On 12 March 2016 at 01:02, wrote: > Dear Harold, > I am very sorry that I am not writing to reply your question but to > request you something about minimum norm estimate because I am a rather new > fieldtripper. I noticed that you have got results applying MNE, thus I > think you must be more experienced! I followed the tutorial at > http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did > source reconstruction with MEG data acquired from ctf 275 system. But I > got stuck in here > . Source model: Co-registration of the source space to the sensor-based > head coordinate system, > I could not find the file named ‘orig-nomask.mgz’ under the mir folder. > Would you tell me in which step should this file be created? And how to > create this file? > > Best regards, > > Runnan > > > > > > > 在 2016年3月10日,08:40,Harold Cavendish 写道: > > > Dear FieldTrip users, > > > I have a few questions regarding source localisation and statistics: > > > 1. Suppose I'm doing source reconstruction of ERP using minimum-norm > estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() > and getting rather meaningful results which I visualise via ft_plot_mesh(). > > > What is the validity of this result? I understand there are many > individual dipoles spread over the cortical sheet and we're estimating best > fit to the data given the conductance model while minimising overall power, > but what does this actually tell us? If I find an area with higher power, > what conclusions can I draw? > > > 2. Can I compute a correlation between the result in the source space and > a behavioural variable? Perhaps even specify a region of interest? If yes, > is this approach considered to be valid? > > > I want to see if e.g. the power of the reconstructed activity in the > source space averaged over a time window correlates with my behavioural > variable. > > > Thank you! > > > Best regards, > > Harold > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > 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 alexandre.gramfort at telecom-paristech.fr Sun Mar 13 18:16:47 2016 From: alexandre.gramfort at telecom-paristech.fr (Alexandre Gramfort) Date: Sun, 13 Mar 2016 18:16:47 +0100 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: References: Message-ID: hi, Basically the MNE code has been updated and the fieldtrip code has not been updated to be able to read the new epochs files MNE produces. Bushra you should share a file and code snippet to replicate the problem. HTH Alex On Sat, Mar 12, 2016 at 12:12 PM, Stephen Politzer-Ahles wrote: > Hello Bushra, > > You will be more likely to get helpful advice if you can provide more > details about your problem. See > http://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab > Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > > >> >> Message: 1 >> Date: Fri, 11 Mar 2016 11:00:21 +0000 >> From: Bushra Riaz Syeda >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] error in reading epoched fif files >> Message-ID: <7a4b34b1746f48f6b3b1f0d2fcf1731b at EXCH03-P.GU.GU.SE> >> Content-Type: text/plain; charset="iso-8859-1" >> >> >> Hello, >> >> I am getting an error in reading epoched fiff files created with the >> latest stable version of mne >> Is there a quick fix to this problem? >> >> Thank you >> Kind regards >> Bushra Riaz? >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > The information in this e-mail is intended only for the person to whom it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > From ha438 at georgetown.edu Sun Mar 13 20:42:06 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Sun, 13 Mar 2016 15:42:06 -0400 Subject: [FieldTrip] quick fix? ft_sourceplot error line 460 In-Reply-To: References: <7A558CEA-E07F-438E-8F63-040B9EFE6D21@donders.ru.nl> Message-ID: Just to put this out there for reference. I was able to solve the problem by replacing the 'issubfield' function with its Matlab equivalent 'isfield'. On Fri, Mar 11, 2016 at 1:46 AM, Hassan Aleem wrote: > Thanks for your response J.M. That makes sense. I will remove all > eeglab/spm/fieldtrip and reinstall,making sure to keep fieldtrip separate. > On Mar 11, 2016 1:40 AM, "Schoffelen, J.M. (Jan Mathijs)" < > jan.schoffelen at donders.ru.nl> wrote: > >> I cannot reproduce your problem. It seems that you are using an >> incorrect/outdated copy of issubfield. The line number you report in your >> error message does not line up with the current version. Please ensure that >> your matlab path is set correctly, in particular try to avoid copies of SPM >> or eeglab taking precedence. These may have old versions of FT code that >> can cause all kinds of erratic behaviour. >> >> Best wishes, >> Jan-Mathijs >> >> >> >> >> >> >> >> On 11 Mar 2016, at 01:02, Hassan Aleem wrote: >> >> Hi J.M, >> >> I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux >> operating system. However the problem appears also on my windows 10 OS. I >> am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot >> does not work with the same complaint as with trying to plot the source >> interpolation, I assume that's what you mean by checking them. Let me post >> the script to give you more information. ( the headmodel part of the script >> was modified from robert bauer) >> >> *%reading mri* >> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >> mri.coordsys ='MNI' >> ----------------------------------- >> *%segmentation* >> >> cfg = []; >> cfg.brainthreshold = 0.5; >> cfg.scalpthreshold = 0.15; >> cfg.downsample = 1; %no downsampling >> cfg.output = {'brain' 'scalp' 'skull'}; >> seg = ft_volumesegment(cfg, mri); >> ---------------------------------- >> %plotting segmentation >> cfg = []; >> cfg.funparameter = 'trishells'; >> cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; >> ft_sourceplot(cfg,seg) *this does not work, same error.* >> ------------------------------------------ >> *%building mesh* >> cfg = []; >> cfg.method= 'projectmesh'; >> cfg.tissue = {'scalp', 'skull', 'brain'}; >> cfg.numvertices = [1000 1000 1000]; >> bnd = ft_prepare_mesh(cfg, seg); >> >> % i enlarged / reduced the boundary mesh a little bit, because they were >> causing errors, probably due to overlapping >> bnd(1).pnt = bnd(1).pnt.*1.001 >> bnd(2).pnt = bnd(2).pnt.*1 >> bnd(3).pnt = bnd(3).pnt.*0.999 >> >> ft_plot_mesh(bnd(1))%scalp >> ft_plot_mesh(bnd(2))%skull >> ft_plot_mesh(bnd(3))%brain >> >> ---------------------------------------------------------- >> *%preparing headmodel* >> cfg = []; >> cfg.method = 'dipoli'; >> headmodel = ft_prepare_headmodel(cfg, bnd); >> -------------------------------------------------------- >> >> * %adding electrodes to headmodel* >> elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load >> electrode file >> >> % visualize head surface (scalp) >> >> figure; >> ft_plot_mesh(headmodel.bnd(1), >> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); >> hold on; >> % plot electrodes >> ft_plot_sens(elec,'style', 'sk') >> >> % aligning electrodes >> cfg = []; >> cfg.method = 'interactive'; >> cfg.elec = elec; >> cfg.headshape = headmodel.bnd(1);%scalp >> st_elec_aligned = ft_electroderealign(cfg); >> ----------------------------------------------- >> *%using the standard template sourcemodel from fieldtrip.* >> >> load('standard_sourcemodel3d5mm.mat') >> ------------------------------------- >> *%% timelock data* >> cfg = []; >> m0 = ft_timelockanalysis(cfg, dataM0); >> -------------------------------------- >> >> *%% perform source analysis * >> cfg = []; >> cfg.method = 'lcmv'; >> cfg.lcmv.lambda='5%'; >> cfg.grid = sourcemodel.cfg.grid;---this is the standard template from >> fieldtrip >> cfg.headmodel = headmodel; >> cfg.lcmv.keepfilter = 'yes'; >> cfg.lcmv.projectnoise='yes'; >> cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD >> source_m0=ft_sourceanalysis(cfg,m0); >> ------------------------------ >> *%% source interpolation* >> >> cfg = []; >> cfg.interpmethod = 'nearest'; >> cfg.parameter = 'pow'; >> cfg.grid=sourcemodel.cfg.grid; >> sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg); >> ---------------------------------------------- >> *%plotting* >> >> cfg = []; >> cfg.method = 'ortho'; >> cfg.funcolorlim = 'maxabs'; >> cfg.funparameter= 'pow'; >> ft_sourceplot(cfg, sourceinterp_m0); >> >> This is where it gives me the error. Please let me know if you need more >> information. I also had a question about making a 'source' it seems that >> the fieldtrip tutorial does not use a 'sourcemodel' but instead use a >> dipolefitting source, is this comparable. Thank you for the help in advance. >> >> Best, >> >> Hassan >> >> On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) < >> jan.schoffelen at donders.ru.nl> wrote: >> >>> Hassan, >>> Can you please provide a bit more information with respect to what >>> version of fieldtrip, matlab and operating system you use? >>> Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? >>> We need more information to work with. >>> Best, >>> Jan-Mathijs >>> >>> >>> >>> On 09 Mar 2016, at 21:26, Hassan Aleem wrote: >>> >>> Hi everyone, >>> >>> I have a question that is possibly very easy to solve but is evading me. >>> I am unable to get ft_sourceplot to work. For example when I run the code: >>> >>> [mri] = ft_read_mri('MNI152_T1_0.5mm.nii'); >>> mri.coordsys ='MNI' >>> >>> cfg = []; >>> cfg.output = {'brain' 'scalp' 'skull'}; >>> seg = ft_volumesegment(cfg, mri); >>> seg.anatomy = mri.anatomy; >>> >>> cfg = []; >>> cfg.funparameter = 'brain'; >>> *ft_sourceplot(cfg,seg)* >>> >>> I get the error: >>> >>> *Error using textscan* >>> First input can not be empty. Expected a non-empty string or a valid >>> file-id. >>> >>> * Error in issubfield (line 44)* >>> t = textscan(f,'%s','delimiter','.'); >>> >>> * Error in ft_sourceplot (line 460)* >>> hasmsk = issubfield(functional, cfg.maskparameter); >>> >>> This is happening regardless of what stage I use ft_sourceplot. >>> >>> Thanks for your consideration! >>> >>> Hassan >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 pgoodin at swin.edu.au Mon Mar 14 05:59:43 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 14 Mar 2016 04:59:43 +0000 Subject: [FieldTrip] Striations in stats? Message-ID: Hi Fieldtrip list (and apologies for two posts in 4 days), I've run source analysis using DICS and the method outlined on the extended beamformer tutorial (http://www.fieldtriptoolbox.org/tutorial/beamformingextended) and am happy with the outcome, except after running permutation stats there's striations the the output (see attached). Any ideas on where this is coming from and how it could possibly be fixed (if at all) would be really appreciated. Just in case I've attached the code used to run the source analysis and stats. Thanks, Peter Source analysis on individuals (using common filter): %Source analysis of conditions and baselines cfg=[]; cfg.grad=grad; cfg.frequency=foi; %foi is taken from a peak at ~18Hz with 9Hz smoothing cfg.method='dics'; cfg.grid=leadfield; cfg.grid.filter=common; %Common filter computed from adding 4 conditions together. cfg.headmodel=hdm; cfg.dics.lambda=reg; %reg is 0 (due to having ~500 trials per condition). cfg.dics.keepfilter='no'; cfg.dics.fixedori='yes'; cfg.dics.realfilter='yes'; source_bsl=ft_sourceanalysis(cfg, bl_freqs); source_cond=ft_sourceanalysis(cfg, av_freqs); source_diff=source_cond; source_diff.avg.pow = (source_cond.avg.pow ./ source_bsl.avg.pow) -1; %Replace subject source grid locations with MNI positions. source_diff.pos = template.sourcemodel.pos; source_diff.dim = template.sourcemodel.dim; source_cond.pos = template.sourcemodel.pos; source_cond.dim = template.sourcemodel.dim; source_bsl.pos = template.sourcemodel.pos; source_bsl.dim = template.sourcemodel.dim; cfg.parameter='pow'; cfg.interpmethod='spline'; source_diff=ft_sourceinterpolate(cfg, source_diff, mnimri); source_cond=ft_sourceinterpolate(cfg, source_cond, mnimri); source_bsl=ft_sourceinterpolate(cfg, source_bsl, mnimri); *****Average source (source_diff) calculated using ft_sourcegrandaverage***** Stats (13 subs, repeated measures t-test): subj=size(cond,2); design=zeros(2,2*subj); for i=1:subj design(1,i)=i; end for i=1:subj design(1,subj+i)=i; end design(2,1:subj)=1; design(2,subj+1:2*subj)=2; cfg=[]; cfg.parameter='pow'; cfg.method='montecarlo'; cfg.statistic='ft_statfun_depsamplesT'; cfg.correctm='cluster'; cfg.numrandomization=rand; %rand = 2000 cfg.clustertail=0; cfg.alpha=0.025; cfg.design=design; cfg.uvar=1; cfg.ivar=2; %stat=ft_sourcestatistics(cfg, cond_ga{:},bsl_ga{:}); stat=ft_sourcestatistics(cfg, cond{:},bsl{:}); Plotting (average source masked by stats <.05): cfg=[]; cfg.method='slice'; cfg.funparameter='pow'; cfg.anaparameter='anatomy'; cfg.maskparameter='mask'; source_diff.mask=stat.prob <.05; ft_sourceplot(cfg, source_diff); _______________________ Dr Peter Goodin, Brain and Psychological Sciences Research Centre (BPsyC) Swinburne University, Hawthorn, Vic, 3122 -------------- next part -------------- A non-text attachment was scrubbed... Name: beta.jpg Type: image/jpeg Size: 251484 bytes Desc: beta.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: beta_sig.jpg Type: image/jpeg Size: 282748 bytes Desc: beta_sig.jpg URL: From bushra.riaz at gu.se Mon Mar 14 07:30:47 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Mon, 14 Mar 2016 06:30:47 +0000 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> References: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE> Message-ID: <1457937054408.48754@gu.se> My bad. I should have explained the problem I am using this code to read epoched fif files created with latest version of mne-python as was explained in fieldtrip tutorial (http://www.fieldtriptoolbox.org/development/integrate_with_mne) The sample epoched file can be downloaded from this link https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0? cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); and I am getting the following error Error using fiff_read_epochs (line 46) Could not find epochs data Error in fiff_read_epochs (line 46) error(me,'Could not find epochs data'); Error in ft_read_header (line 1601) epochs = fiff_read_epochs(filename); Error in ft_preprocessing (line 397) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Mar 14 09:40:36 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 14 Mar 2016 08:40:36 +0000 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Hi Runnan, Sorry for the confusion. The part of the documentation you are working with is currently being improved, but not finalized yet. In particular, the part you refer to ‘Source model: co-registration of the source space to the sensor-based coordinate system’ needs a heavy update. I would assume that you have done the tutorial up until there. In particular, if you have done the preprocessing of the anatomical MRI, where you have created 2 transformation matrices (using the same anatomical volume), you’re almost there. So please forget about the orig.mgz, either nomask or not, and please be a bit patient until we (i.e. I) find time to update the documentation. This is how you get the appropriate coregistration: (Note: I assume that all the objects are defined in ‘mm’, otherwise it won’t work. To get all things in ‘mm’, use ft_convert_units). Preliminaries: -we know how to get from an arbitrary voxel-space to the sensor-based coordinate system: transform_vox2ctf -we know how to get to the ‘mni’ coordinate system from the same arbitrary voxel-space: transform_vox2spm -we know that the sourcespace is expressed in the ‘mni’ coordinate system (check the units, is it mm?) Based on the first two points above, we can easily construct a transformation matrix that goes from ‘mni’ to ‘ctf’: T = transform_vox2ctf/transform_vox2spm We can now use T to transform the sourcespace: sourcespace = ft_transform_geometry(T, sourcespace); I am pretty sure that this will do the trick. Best, Jan-Mathijs On 13 Mar 2016, at 13:20, Harold Cavendish > wrote: Dear Runnan, I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. Best regards, Harold On 12 March 2016 at 01:02, > wrote: Dear Harold, I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here . Source model: Co-registration of the source space to the sensor-based head coordinate system, I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? Best regards, Runnan 在 2016年3月10日,08:40,Harold Cavendish > 写道: Dear FieldTrip users, I have a few questions regarding source localisation and statistics: 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. Thank you! Best regards, Harold _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 deb.desideri at gmail.com Mon Mar 14 11:46:36 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Mon, 14 Mar 2016 11:46:36 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir, thanks for your explanation. I tryed to use the option cfg.moveinward in ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this did not solve the issue. As you can see from the attachment the cortex is now partially uncovered. I am not sure I am using this option properly, maybe there is a combination of values for cfg.moveinward and cfg.inwardshift that works fine. I tryed several, but none of them gave me the source localization that I expect. I don't know whether the fact that some dipoles fall outside the brain matters. For the attached figures I had no dipoles outside the brain, whilst for some of the others attempts I had. I actually found this post on the mailinglist where both you and John already pointed out this issue using BEM: http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html Also I don't know whether this link (still under construction/discussion) may be of interest in this contex: http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed Furthermore, this other page (also under construction), uses the option cfg.inwardshift for the template grid to be used in the creation of the individual subject's grid, but without an explanation of why the option is/should be used: http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) provided by Fiedltrip, I don't know whether craeting my own template_grid using the cfg.inwardshift option would actually fix the problem. I would like to perform some further attempts, as soon as I have some time to go through the function and understand how this options actually interplay. Meanwhile, I am still working on producing the results using the FEM head model. It is much more time-consuming than the BEM, and maybe that's one of the reasons to choose BEM models. As soon as they are ready I will post them as well :) Anyway, thanks so much for your help. It was actually quite useful and instructive! All the best wishes, Debora On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak wrote: > Dear Debora, > > The critical thing with BEMCP is that your sources are not too close to > the inner skull boundary. When they are closer than the safe distance the > solution you get is completely wrong. When they are not too close, the > solution is OK and comparable at least to concentric spheres. The safe > distance is is more or less the average edge length in your skull mesh. In > SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option > cfg.moveinward that corrects the mesh to ensure that it is not too close. > It would be interesting if you use this option and report whether this > resolves your problem. > > This issue should occur in any BEM but depending on the implementation the > critical distance might be shorter. > > Best, > > Vladimir > > On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri > wrote: > >> Dear John, >> thanks a lot for your promt reply and your suggestion. I guess that I was >> sticking to the BEM head model just because I read the tutorial for EEG BEM >> head model first, but going quickly through the studies you have mentioned >> and considering the tests you have performed, I may also consider to switch >> to the FEM head model or to simply use the concentric spheres (which >> appeared to work similar to BEMCP in your comparisons). I am relatively new >> to source localization and had no crash/errors in my pipeline, and this >> combination makes always difficult to find possible pitfalls. >> >> As soon as I have them ready, I will post the results obtained with the >> FEM head model as well, maybe they will be useful for some other users :) >> >> Thanks again for your support! >> All the best, >> Debora >> >> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN >> wrote: >> >>> Deb: >>> >>> I have had problems with BEMCP. >>> >>> 1—one of the practical / technical problems is that if the compartments >>> overlap, or even come close, then the procedure would not work—the >>> ft_sourceanlaysis crashed. >>> >>> 2—There are a couple of studies comparing BEMCP and dipoli, among other >>> methods. The BEMCP method does not fare well, the dipoli fares better, >>> >>> E. g., among three or four studies I have seen. >>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>> >>> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >>> Intell Neurosci *2011*: 923703. >>> >>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >>> and the Simbio FEM model, by correlating results from each model (e.g., >>> correlations of all the dipole CDR estimates; or correlations across >>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>> dipoli and Simbio-FEM work similarly. This was with infants using >>> participant-computed realistic models for the compartments and the FEM. >>> >>> I am not claiming from this and superiority of the dipoli (or FEM) >>> models over the BEMCP, but I suggest looking at the research literature >>> formally comparing these methods before going much further with BEMCP. >>> >>> John >>> >>> *********************************************** >>> John E. Richards Carolina Distinguished Professor >>> Department of Psychology >>> University of South Carolina >>> Columbia, SC 29208 >>> Dept Phone: 803 777 2079 >>> Fax: 803 777 9558 >>> Email: richards-john at sc.edu >>> HTTP: jerlab.psych.sc.edu >>> *********************************************** >>> >>> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ResultSource_moveinward6mm.PNG Type: image/png Size: 144542 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SourceModel_moveinward6mm.PNG Type: image/png Size: 12143 bytes Desc: not available URL: From litvak.vladimir at gmail.com Mon Mar 14 12:11:36 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Mon, 14 Mar 2016 11:11:36 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Debora, cfg.moveinward option is useful when your source space is a mesh as it actually deforms the mesh to push it inwards. When your source space is a grid you should use cfg.inwardshift to just exclude the points that are closer than 6 mm to the boundary. It might be a useful exercise for you to compute the lead fields with concentric spheres and with a BEM for the same grid and then look at correlations between these lead fields. You should see that the correlations should be high at depth but might be low for some points close to the surface. Once you hit the right value of inwardshift the low correlations should disappear. Best, Vladimir On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri wrote: > Dear Vladimir, > thanks for your explanation. I tryed to use the option cfg.moveinward in > ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this > did not solve the issue. As you can see from the attachment the cortex is > now partially uncovered. I am not sure I am using this option properly, > maybe there is a combination of values for cfg.moveinward and > cfg.inwardshift that works fine. I tryed several, but none of them gave me > the source localization that I expect. > I don't know whether the fact that some dipoles fall outside the brain > matters. For the attached figures I had no dipoles outside the brain, > whilst for some of the others attempts I had. > > I actually found this post on the mailinglist where both you and John > already pointed out this issue using BEM: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html > > Also I don't know whether this link (still under construction/discussion) > may be of interest in this contex: > > > http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed > > Furthermore, this other page (also under construction), uses the option > cfg.inwardshift for the template grid to be used in the creation of the > individual subject's grid, but without an explanation of why the option > is/should be used: > > > http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space > > In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) > provided by Fiedltrip, I don't know whether craeting my own template_grid > using the cfg.inwardshift option would actually fix the problem. I would > like to perform some further attempts, as soon as I have some time to go > through the function and understand how this options actually interplay. > > Meanwhile, I am still working on producing the results using the FEM head > model. It is much more time-consuming than the BEM, and maybe that's one of > the reasons to choose BEM models. As soon as they are ready I will post > them as well :) > > Anyway, thanks so much for your help. It was actually quite useful and > instructive! > > All the best wishes, > Debora > > > > On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < > litvak.vladimir at gmail.com> wrote: > >> Dear Debora, >> >> The critical thing with BEMCP is that your sources are not too close to >> the inner skull boundary. When they are closer than the safe distance the >> solution you get is completely wrong. When they are not too close, the >> solution is OK and comparable at least to concentric spheres. The safe >> distance is is more or less the average edge length in your skull mesh. In >> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >> cfg.moveinward that corrects the mesh to ensure that it is not too close. >> It would be interesting if you use this option and report whether this >> resolves your problem. >> >> This issue should occur in any BEM but depending on the implementation >> the critical distance might be shorter. >> >> Best, >> >> Vladimir >> >> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri >> wrote: >> >>> Dear John, >>> thanks a lot for your promt reply and your suggestion. I guess that I >>> was sticking to the BEM head model just because I read the tutorial for EEG >>> BEM head model first, but going quickly through the studies you have >>> mentioned and considering the tests you have performed, I may also consider >>> to switch to the FEM head model or to simply use the concentric spheres >>> (which appeared to work similar to BEMCP in your comparisons). I am >>> relatively new to source localization and had no crash/errors in my >>> pipeline, and this combination makes always difficult to find possible >>> pitfalls. >>> >>> As soon as I have them ready, I will post the results obtained with the >>> FEM head model as well, maybe they will be useful for some other users :) >>> >>> Thanks again for your support! >>> All the best, >>> Debora >>> >>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN >> > wrote: >>> >>>> Deb: >>>> >>>> I have had problems with BEMCP. >>>> >>>> 1—one of the practical / technical problems is that if the >>>> compartments overlap, or even come close, then the procedure would not >>>> work—the ft_sourceanlaysis crashed. >>>> >>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>> better, >>>> >>>> E. g., among three or four studies I have seen. >>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>> >>>> Gramfort, A., et al. (2011). "Forward field computation with OpenMEEG." Comput >>>> Intell Neurosci *2011*: 923703. >>>> >>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, dipoli, >>>> and the Simbio FEM model, by correlating results from each model (e.g., >>>> correlations of all the dipole CDR estimates; or correlations across >>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>> participant-computed realistic models for the compartments and the FEM. >>>> >>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>> models over the BEMCP, but I suggest looking at the research literature >>>> formally comparing these methods before going much further with BEMCP. >>>> >>>> John >>>> >>>> *********************************************** >>>> John E. Richards Carolina Distinguished Professor >>>> Department of Psychology >>>> University of South Carolina >>>> Columbia, SC 29208 >>>> Dept Phone: 803 777 2079 >>>> Fax: 803 777 9558 >>>> Email: richards-john at sc.edu >>>> HTTP: jerlab.psych.sc.edu >>>> *********************************************** >>>> >>>> >>> >>> >>> -- >>> >>> Debora Desideri, PhD Student >>> BNP Lab - Neurology Department >>> University Hospital Tübingen >>> Eberhard Karls University Tübingen >>> Hoppe-Seyler Str. 3 >>> D-72076 Tübingen >>> Tel: +49 7071/29 80478 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Mon Mar 14 16:12:12 2016 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Mon, 14 Mar 2016 15:12:12 +0000 Subject: [FieldTrip] Subsample spike structure Message-ID: <04263829-3D34-463B-AA84-61862B33445C@tum.de> Dear all, is it possible to subsample spikes from a spike structure according to trials-of-interest? I have an existing spike structure containing spikes at all trials, but I want to analyze only spikes specific to a subset of trials. Best, Daniel -- Daniel Hähnke PhD student Technische Universität München Institute of Neuroscience Translational NeuroCognition Laboratory Biedersteiner Straße 29, Bau 601 80802 Munich Germany Email: daniel.haehnke at tum.de Phone: +49 89 4140 3356 From recasensmarc at gmail.com Mon Mar 14 23:09:36 2016 From: recasensmarc at gmail.com (Marc Recasens) Date: Mon, 14 Mar 2016 22:09:36 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> Message-ID: Dear Jan-Mathijs, Sara and FT community, I'd like to bring up this old thread which I think might be of interest us all. I don't know if there's been any new development on the MNE approach (?) since this thread was started one year ago. Anyway, in order to get template-registered surfaces that allow for inter-subject comparison/averaging, I tried using Jan-Mathijs suggestion to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR . - I managed to get the .coord and .topo files using CARET - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico -6") registered to the template (fsaverage I assume) using the following files. Actually I'm not 100% sure these are the correct files I should read (the output seems to make sense though): ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for rh/lh.orig ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for rh/lh.white (JM did not say anything about rh/lh.white but mne_setup_source_space required it) - I got the resulting template-registered sourcespace properly co-registered in the correct coordinate system (individual sensor space) - and successfully applied MNE on the template-registered sourcespace. Sources make sense are meshes are exchangeable across subjects (which I think makes sense since they're all registered to a template). HOWEVER, I'm stuck in what I think should be a rather straight forward step, which is the creation of a template sourcemodel/grid (from the fsaverage or Colins brain) that I can use in the same way as the MNI-aligned template grid is used; that is a Talairach aligned surface with 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the lines below, but without success (because of MNI instead of TAL aligned?): template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); bnd.pnt = template_sourcemodel.pnt; bnd.tri = template_sourcemodel.tri; Any ideas about how to get such a template mesh will be highly appreciated! Best wishes Marc On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Sara, > > What you need are some of the .coord files, and the .topo files. > > Specifically, the midthickness_orig and the sphere files should be > converted into a format that the mne-software can work with. > The only way I managed this, was to convert the gifti files back into > freesurfer’s format: > > tmp = ft_read_headshape({‘something-something.topo.gii’ > ‘somethingelse-.L.midthickness_orig.coord.gii’}); > ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); > > and likewise for the right hemisphere, as well as for the spheres. > > Then, you can proceed with using mne_setup_source_space to create the 8196 > mesh. The final tricky thing eventually is to get the stuff properly > co-registered in the correct coordinate system again, but this should > proceed in the same way as when you would have used non-surface registered > meshes. > > The creation of the volume conduction model is a separate step (and does > not require the cortical meshes). > > Best, > Jan-Mathijs > > > On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe wrote: > > > Dear Jan Mathijs, > > > > Thank you very much for your quick and detailed answer! > > > > As suggested, I post-processed the surface of one of my subjects based > on the recipe on the link. > > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, > .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), > > but at this point I am not sure about how to proceed. So I have now > several questions: > > > > - Do you know which are the files containing the registered data for the > creation of the meshes? > > How should I create them given the current format? most are .gii files. > > - Once creating the meshes, should I follow with the creation of the > volume conduction model > > and analysis of the functional data as described in the tutorial? > http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > > > > Apologize for all these specific questions but it is being a little bit > confusing to me. > > So if anyone has experienced the same and/or have any suggestion, any > comment would be very welcomed. > > > > Thanks a lot in advance, > > > > Best, > > > > Sara > > > > > > > > > > > > > > > > ----- Original Message ----- > > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: "FieldTrip discussion list" > > Sent: Wednesday, September 30, 2015 9:33:03 AM > > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage > with MNE > > > > Hi Sara, > > > > I think that in this case there is no absolutely ‘correct’ approach, > although some approaches may make more sense than others. > > At this point in time it is indeed not well documented how to proceed > from individual subject results source-reconstructed onto an individual > cortically constrained mesh to a group analysis. > > In the past, we have been working with a procedure where the surface > data were interpolated onto a 3D-grid so that we could use volumetric > normalization techniques in order to get the subjects into a common space > to allow for group statistics. So, here the order of the steps would be to > call ft_sourceinterpolate, followed by ft_volumenormalise, or to > interpolate the functional data directly onto a MNI-warped grid ( > http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > ). > > In the code you pasted in your e-mail message, there is also reference > to ft_volumerealign, but I am not sure I understand why this is a required > step at this point in the pipeline. > > > > All the above being said, nowadays I would advocate a slightly different > approach, which bypasses the volumetric interpolation, where per subject I > would use cortical meshes that is surface-registered to a template mesh, > which as a consequence allows for direct comparison of source locations > across subjects. The way to achieve this would be to post-process the > surfaces that come out of the freesurfer pipeline according to the recipe > described on > http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. > After this registration step, the low-resolution (i.e. in this case the > 8196-vertex) meshes can be created. > > > > Best wishes, > > Jan-Mathijs > > > > > > > > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > > > Max Planck Institute for Psycholinguistics > > Donders Centre for Cognitive Neuroimaging > > > > E-mail: j.schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.fieldtriptoolbox.org > > http://www.hettaligebrein.nl > > > > > > > > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe > wrote: > > > >> Dear all, > >> > >> I am working on the source analysis of ERF data from ElektaNeuromag > system, with individual T1s, using minimum-norm estimate as described in > the following tutorial: > >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > >> I am exactly following the suggested steps, and so got the source > estimation for each of my subjects (bellow the output for one subject), > which i can nicely plot with the ft_plot_mesh function: > >> > >> sourceest = > >> > >> time: [1x1401 double] > >> inside: [8196x1 logical] > >> pos: [8196x3 double] > >> method: 'average' > >> avg: [1x1 struct] > >> cfg: [1x1 struct] > >> > >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, > >> I am trying to normalise (ft_volumenormalise) and interpolate > (ft_sourceinterpolate) the functional and anatomical data. > >> > >> However, I am struggling in this two last steps. > >> Since I did not find a clear pipeline/tutorial about the exact approach > (am I missing something?) > >> and after trying several options (bellow I copy the code I am using), > it is not clear to me: > >> > >> - which is the exact input data for each of these last two functions, > and > >> - in which order they should be called. > >> > >> Now, I would highly appreciate if anyone could give me any cue about > which the correct approach is. > >> > >> Thank you in advance, > >> > >> All the best, > >> > >> Sara > >> > >> > >> > >> %%%%%%%%%%%% > >> > >> % Inverse solution > >> cfg = []; > >> cfg.method = 'mne'; > >> cfg.grid = leadfield; > >> cfg.vol = vol; > >> cfg.mne.prewhiten = 'yes'; > >> cfg.mne.lambda = 3; > >> cfg.mne.scalesourcecov = 'yes'; > >> cfg.senstype = 'MEG'; > >> > >> sourceest = ft_sourceanalysis(cfg,erf); > >> > >> % read T1 volume - coords in scanner space > >> mri = ft_read_mri('s01.nii'); > >> mri.coordsys = 'neuromag'; > >> > >> % read headshape - Neuromag coords > >> hsf = 's01.fif'; > >> [headshape] = ft_read_headshape(hsf); > >> > >> % align T1 with head posiiton in MEG > >> cfg = []; > >> cfg.method = 'headshape'; > >> cfg.parameter = 'anatomy'; > >> cfg.headshape.headshape = headshape; > >> cfg.headshape.interactive = 'no'; > >> > >> mri_real = ft_volumerealign(cfg,mri); > >> > >> % normalize the realinged individual MRI to SPM template > >> cfg = []; > >> cfg.spmversion = 'spm8'; > >> % cfg.template='T1.nii'; % when enabling this field, an incoming error > message indicates that the template is not in the spm coordinate system. > >> % However, is the one used by default in this > function (as mentioned in the reference) so it is confusing to me > >> > >> norm_mri = ft_volumenormalise(cfg,mri_real); > >> > >> % interpolate Source with MEG-aligned T1 > >> cfg = []; > >> cfg.parameter = 'all'; > >> cfg.downsample = 2; > >> > >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); > >> > >> %%%%%%%%%%%%%% > >> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> 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 > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From runna90 at 126.com Tue Mar 15 09:45:16 2016 From: runna90 at 126.com (CRN) Date: Tue, 15 Mar 2016 16:45:16 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Jan-Mathijs, Thank you very much for your reply! I have been halted in this problem for a few days… And I am really looking forward urgently to get the source localization result. So I am sorry to bother you again! But there is still something wrong with followed steps in this page. 1. The built of volume conduction model. I noticed that it is required to create the volume model with same coordinate system as MEG sensor positions were defined. The ‘or-nomask.mgz’ file was asked to provide again to be used as anatomical data. I chose to replace this file with ‘orig.mgz’ first, but I got bad outcome as displayed below: the code I applied was copied from the web: mri_nom = ft_read_mri('orig.mgz'); cfg = []; cfg.coordsys = 'spm'; cfg.output = {'brain'}; seg = ft_volumesegment(cfg, mri_nom); seg = ft_convert_units(seg,'cm'); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg,seg); vol.bnd = ft_transform_geometry(T, vol.bnd); save vol vol; So should I use the mri data with ctf coordinate system to build the model and then transform it to spm system with the ’T’ metric? 2. When I did Forward solution, I could not find sourcespace.pnt, parameters I got in the sourcespace as below: what is the definition of ‘.pnt’? Why it was lost in my sourcespace data? Thank you for your help! Best Runnan > On Mar 14, 2016, at 16:40, Schoffelen, J.M. (Jan Mathijs) wrote: > > Hi Runnan, > > Sorry for the confusion. The part of the documentation you are working with is currently being improved, but not finalized yet. > In particular, the part you refer to ‘Source model: co-registration of the source space to the sensor-based coordinate system’ needs a heavy update. I would assume that you have done the tutorial up until there. In particular, if you have done the preprocessing of the anatomical MRI, where you have created 2 transformation matrices (using the same anatomical volume), you’re almost there. So please forget about the orig.mgz, either nomask or not, and please be a bit patient until we (i.e. I) find time to update the documentation. > > This is how you get the appropriate coregistration: > > (Note: I assume that all the objects are defined in ‘mm’, otherwise it won’t work. To get all things in ‘mm’, use ft_convert_units). > > Preliminaries: > -we know how to get from an arbitrary voxel-space to the sensor-based coordinate system: transform_vox2ctf > -we know how to get to the ‘mni’ coordinate system from the same arbitrary voxel-space: transform_vox2spm > -we know that the sourcespace is expressed in the ‘mni’ coordinate system (check the units, is it mm?) > > Based on the first two points above, we can easily construct a transformation matrix that goes from ‘mni’ to ‘ctf’: > > T = transform_vox2ctf/transform_vox2spm > > We can now use T to transform the sourcespace: > > sourcespace = ft_transform_geometry(T, sourcespace); > > I am pretty sure that this will do the trick. > > Best, > Jan-Mathijs > > > > >> On 13 Mar 2016, at 13:20, Harold Cavendish > wrote: >> >> Dear Runnan, >> >> I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). >> >> However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. >> >> As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. >> >> Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. >> >> Best regards, >> Harold >> >> >> On 12 March 2016 at 01:02, > wrote: >> Dear Harold, >> I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here >> . Source model: Co-registration of the source space to the sensor-based head coordinate system,  <> >> I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? >> >> Best regards, >> >> Runnan >> >> >> >> >> >> >>> 在 2016年3月10日,08:40,Harold Cavendish > 写道: >>> >>> Dear FieldTrip users, >>> >>> I have a few questions regarding source localisation and statistics: >>> >>> 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). >>> >>> What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? >>> >>> 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? >>> >>> I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. >>> >>> Thank you! >>> >>> Best regards, >>> Harold >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2016-03-14 at 18.05.20.png Type: image/png Size: 82608 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2016-03-15 at 16.40.16.png Type: image/png Size: 18951 bytes Desc: not available URL: From runna90 at 126.com Tue Mar 15 09:49:56 2016 From: runna90 at 126.com (CRN) Date: Tue, 15 Mar 2016 16:49:56 +0800 Subject: [FieldTrip] What does minimum-norm estimate tell me + correlation in the source space In-Reply-To: References: <5A1F7278-BFA4-4E53-B3B2-356BD142F3E0@126.com> Message-ID: Dear Harold, Thank you for your reply! It is very kind of you that trying to help me even though you did not do analysis following the page I mentioned. Hope the reply from Jan-Mathijs could help both of us! Best, Runnan > On Mar 13, 2016, at 20:20, Harold Cavendish wrote: > > Dear Runnan, > > I'd be happy to help, but sadly, I have no experience with FreeSurfer and skipped that portion of the tutorial entirely (instead, I used files from fieldtrip/template). > > However, using just common sense, I believe there's an error in the tutorial because orig-nomask.mgz is mentioned for the first time where you need to load it but it isn't present in any of the outputs or in the Subject01 directory. I believe it's just a renamed copy of orig.mgz which is created as explained in the tutorial. > > As far as I understand, you take an anatomical MRI image (e.g. Subject01.mri), use FT to do some preprocessing and get Subject01.mgz (a FreeSurfer-compatible format), then do some segmentation and get Subject01masked.mgz, then do some conversion in FreeSurfer and transform those two into orig.mgz and brainmask.mgz respectively, and to make it even more convoluted, some filled.mgz pops up as well. To be honest, I don't follow… I have zero experience with FreeSurfer as well as MRI/fMRI analysis. > > Briefly, try using orig.mgz instead of orig-nomask.mgz whenever you need to use ft_read_mri('orig-nomask.mgz'). If it doesn't do the job, hopefully someone else will come to the rescue. > > Best regards, > Harold > > > On 12 March 2016 at 01:02, > wrote: > Dear Harold, > I am very sorry that I am not writing to reply your question but to request you something about minimum norm estimate because I am a rather new fieldtripper. I noticed that you have got results applying MNE, thus I think you must be more experienced! I followed the tutorial at http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate and did source reconstruction with MEG data acquired from ctf 275 system. But I got stuck in here > . Source model: Co-registration of the source space to the sensor-based head coordinate system,  <> > I could not find the file named ‘orig-nomask.mgz’ under the mir folder. Would you tell me in which step should this file be created? And how to create this file? > > Best regards, > > Runnan > > > > > > >> 在 2016年3月10日,08:40,Harold Cavendish > 写道: >> >> Dear FieldTrip users, >> >> I have a few questions regarding source localisation and statistics: >> >> 1. Suppose I'm doing source reconstruction of ERP using minimum-norm estimate; one condition, multiple subjects. I'm using ft_sourceanalysis() and getting rather meaningful results which I visualise via ft_plot_mesh(). >> >> What is the validity of this result? I understand there are many individual dipoles spread over the cortical sheet and we're estimating best fit to the data given the conductance model while minimising overall power, but what does this actually tell us? If I find an area with higher power, what conclusions can I draw? >> >> 2. Can I compute a correlation between the result in the source space and a behavioural variable? Perhaps even specify a region of interest? If yes, is this approach considered to be valid? >> >> I want to see if e.g. the power of the reconstructed activity in the source space averaged over a time window correlates with my behavioural variable. >> >> Thank you! >> >> Best regards, >> Harold >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 Tue Mar 15 16:16:29 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 15 Mar 2016 15:16:29 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> Message-ID: <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> Marc, I would not recommend to try and create a low-resolution mesh for Colin’s brain. In some sense, Colin’s brain is not more special than any of your single subject brains. In other words, you could pick any of your single subjects, and use that for visualization. If you would like to visualize your results on a ‘average’ brain, I’d recommend the Conte69 brain, that has been developed at Washington University (the Caret people). As a side note, Caret development is discontinued by the WashU group. They have moved to connectome workbench, which has most of the functionality supported by Caret. Specfically, there’s now also a freesurfer_to_fs_LR script that uses wb_command (the command line utility of connectome workbench). Note 2: the *.coord.* and *.topo.* files are old style Caret. Nowadays, the topologies are represented in a single file *.surf.* (rather than the positions in the coord and the triangles in the topo). BEst, JM On 14 Mar 2016, at 23:09, Marc Recasens > wrote: Dear Jan-Mathijs, Sara and FT community, I'd like to bring up this old thread which I think might be of interest us all. I don't know if there's been any new development on the MNE approach (?) since this thread was started one year ago. Anyway, in order to get template-registered surfaces that allow for inter-subject comparison/averaging, I tried using Jan-Mathijs suggestion to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. - I managed to get the .coord and .topo files using CARET - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico -6") registered to the template (fsaverage I assume) using the following files. Actually I'm not 100% sure these are the correct files I should read (the output seems to make sense though): ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for rh/lh.orig ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for rh/lh.white (JM did not say anything about rh/lh.white but mne_setup_source_space required it) - I got the resulting template-registered sourcespace properly co-registered in the correct coordinate system (individual sensor space) - and successfully applied MNE on the template-registered sourcespace. Sources make sense are meshes are exchangeable across subjects (which I think makes sense since they're all registered to a template). HOWEVER, I'm stuck in what I think should be a rather straight forward step, which is the creation of a template sourcemodel/grid (from the fsaverage or Colins brain) that I can use in the same way as the MNI-aligned template grid is used; that is a Talairach aligned surface with 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the lines below, but without success (because of MNI instead of TAL aligned?): template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); bnd.pnt = template_sourcemodel.pnt; bnd.tri = template_sourcemodel.tri; Any ideas about how to get such a template mesh will be highly appreciated! Best wishes Marc On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Sara, What you need are some of the .coord files, and the .topo files. Specifically, the midthickness_orig and the sphere files should be converted into a format that the mne-software can work with. The only way I managed this, was to convert the gifti files back into freesurfer’s format: tmp = ft_read_headshape({‘something-something.topo.gii’ ‘somethingelse-.L.midthickness_orig.coord.gii’}); ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); and likewise for the right hemisphere, as well as for the spheres. Then, you can proceed with using mne_setup_source_space to create the 8196 mesh. The final tricky thing eventually is to get the stuff properly co-registered in the correct coordinate system again, but this should proceed in the same way as when you would have used non-surface registered meshes. The creation of the volume conduction model is a separate step (and does not require the cortical meshes). Best, Jan-Mathijs On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe > wrote: > Dear Jan Mathijs, > > Thank you very much for your quick and detailed answer! > > As suggested, I post-processed the surface of one of my subjects based on the recipe on the link. > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), > but at this point I am not sure about how to proceed. So I have now several questions: > > - Do you know which are the files containing the registered data for the creation of the meshes? > How should I create them given the current format? most are .gii files. > - Once creating the meshes, should I follow with the creation of the volume conduction model > and analysis of the functional data as described in the tutorial? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate > > Apologize for all these specific questions but it is being a little bit confusing to me. > So if anyone has experienced the same and/or have any suggestion, any comment would be very welcomed. > > Thanks a lot in advance, > > Best, > > Sara > > > > > > > > ----- Original Message ----- > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: "FieldTrip discussion list" > > Sent: Wednesday, September 30, 2015 9:33:03 AM > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE > > Hi Sara, > > I think that in this case there is no absolutely ‘correct’ approach, although some approaches may make more sense than others. > At this point in time it is indeed not well documented how to proceed from individual subject results source-reconstructed onto an individual cortically constrained mesh to a group analysis. > In the past, we have been working with a procedure where the surface data were interpolated onto a 3D-grid so that we could use volumetric normalization techniques in order to get the subjects into a common space to allow for group statistics. So, here the order of the steps would be to call ft_sourceinterpolate, followed by ft_volumenormalise, or to interpolate the functional data directly onto a MNI-warped grid (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space). > In the code you pasted in your e-mail message, there is also reference to ft_volumerealign, but I am not sure I understand why this is a required step at this point in the pipeline. > > All the above being said, nowadays I would advocate a slightly different approach, which bypasses the volumetric interpolation, where per subject I would use cortical meshes that is surface-registered to a template mesh, which as a consequence allows for direct comparison of source locations across subjects. The way to achieve this would be to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. After this registration step, the low-resolution (i.e. in this case the 8196-vertex) meshes can be created. > > Best wishes, > Jan-Mathijs > > > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > Max Planck Institute for Psycholinguistics > Donders Centre for Cognitive Neuroimaging > > E-mail: j.schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.fieldtriptoolbox.org > http://www.hettaligebrein.nl > > > > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe > wrote: > >> Dear all, >> >> I am working on the source analysis of ERF data from ElektaNeuromag system, with individual T1s, using minimum-norm estimate as described in the following tutorial: >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> I am exactly following the suggested steps, and so got the source estimation for each of my subjects (bellow the output for one subject), which i can nicely plot with the ft_plot_mesh function: >> >> sourceest = >> >> time: [1x1401 double] >> inside: [8196x1 logical] >> pos: [8196x3 double] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, >> I am trying to normalise (ft_volumenormalise) and interpolate (ft_sourceinterpolate) the functional and anatomical data. >> >> However, I am struggling in this two last steps. >> Since I did not find a clear pipeline/tutorial about the exact approach (am I missing something?) >> and after trying several options (bellow I copy the code I am using), it is not clear to me: >> >> - which is the exact input data for each of these last two functions, and >> - in which order they should be called. >> >> Now, I would highly appreciate if anyone could give me any cue about which the correct approach is. >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> >> >> %%%%%%%%%%%% >> >> % Inverse solution >> cfg = []; >> cfg.method = 'mne'; >> cfg.grid = leadfield; >> cfg.vol = vol; >> cfg.mne.prewhiten = 'yes'; >> cfg.mne.lambda = 3; >> cfg.mne.scalesourcecov = 'yes'; >> cfg.senstype = 'MEG'; >> >> sourceest = ft_sourceanalysis(cfg,erf); >> >> % read T1 volume - coords in scanner space >> mri = ft_read_mri('s01.nii'); >> mri.coordsys = 'neuromag'; >> >> % read headshape - Neuromag coords >> hsf = 's01.fif'; >> [headshape] = ft_read_headshape(hsf); >> >> % align T1 with head posiiton in MEG >> cfg = []; >> cfg.method = 'headshape'; >> cfg.parameter = 'anatomy'; >> cfg.headshape.headshape = headshape; >> cfg.headshape.interactive = 'no'; >> >> mri_real = ft_volumerealign(cfg,mri); >> >> % normalize the realinged individual MRI to SPM template >> cfg = []; >> cfg.spmversion = 'spm8'; >> % cfg.template='T1.nii'; % when enabling this field, an incoming error message indicates that the template is not in the spm coordinate system. >> % However, is the one used by default in this function (as mentioned in the reference) so it is confusing to me >> >> norm_mri = ft_volumenormalise(cfg,mri_real); >> >> % interpolate Source with MEG-aligned T1 >> cfg = []; >> cfg.parameter = 'all'; >> cfg.downsample = 2; >> >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); >> >> %%%%%%%%%%%%%% >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 -- Marc Recasens Tel.: +34 639 24 15 98 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Tue Mar 15 19:18:34 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Tue, 15 Mar 2016 19:18:34 +0100 Subject: [FieldTrip] Events in databrowser Message-ID: An HTML attachment was scrubbed... URL: From recasensmarc at gmail.com Wed Mar 16 01:48:16 2016 From: recasensmarc at gmail.com (Marc Recasens) Date: Wed, 16 Mar 2016 00:48:16 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> <4FC00A43-8428-44DB-9D87-D82E0696D803@donders.ru.nl> Message-ID: Dear JM Thanks for you answer! didn't know anything about Connectome Workbench, but this FieldTrip-Connectome link sounds VERY cool! I'll have a look at the wb_command and see if I can read the Conte69 *surf from there. Best wishes Marc On Tue, Mar 15, 2016 at 3:16 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Marc, > > I would not recommend to try and create a low-resolution mesh for Colin’s > brain. In some sense, Colin’s brain is not more special than any of your > single subject brains. In other words, you could pick any of your single > subjects, and use that for visualization. > If you would like to visualize your results on a ‘average’ brain, I’d > recommend the Conte69 brain, that has been developed at Washington > University (the Caret people). > > As a side note, Caret development is discontinued by the WashU group. They > have moved to connectome workbench, which has most of the functionality > supported by Caret. Specfically, there’s now also a freesurfer_to_fs_LR > script that uses wb_command (the command line utility of connectome > workbench). Note 2: the *.coord.* and *.topo.* files are old style Caret. > Nowadays, the topologies are represented in a single file *.surf.* (rather > than the positions in the coord and the triangles in the topo). > > BEst, > JM > > > > > On 14 Mar 2016, at 23:09, Marc Recasens wrote: > > Dear Jan-Mathijs, Sara and FT community, > > I'd like to bring up this old thread which I think might be of interest us > all. I don't know if there's been any new development on the MNE approach > (?) since this thread was started one year ago. Anyway, in order to get > template-registered surfaces that allow for inter-subject > comparison/averaging, I tried using Jan-Mathijs suggestion to post-process > the surfaces that come out of the freesurfer pipeline according to the > recipe described on > http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR > . > > - I managed to get the .coord and .topo files using CARET > - I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico > -6") registered to the template (fsaverage I assume) using the following > files. Actually I'm not 100% sure these are the correct files I should read > (the output seems to make sense though): > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']}); % for > rh/lh.orig > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']}); % for rh/lh.sphere > ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] > [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']}); % for > rh/lh.white (JM did not say anything about rh/lh.white but > mne_setup_source_space required it) > > - I got the resulting template-registered sourcespace properly > co-registered in the correct coordinate system (individual sensor space) > - and successfully applied MNE on the template-registered sourcespace. > Sources make sense are meshes are exchangeable across subjects (which I > think makes sense since they're all registered to a template). > > HOWEVER, I'm stuck in what I think should be a rather straight forward > step, which is the creation of a template sourcemodel/grid (from the > fsaverage or Colins brain) that I can use in the same way as the > MNI-aligned template grid is used; that is a Talairach aligned surface with > 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the > lines below, but without success (because of MNI instead of TAL aligned?): > > template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii'); > template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm'); > bnd.pnt = template_sourcemodel.pnt; > bnd.tri = template_sourcemodel.tri; > > Any ideas about how to get such a template mesh will be highly appreciated! > > Best wishes > Marc > > > On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > >> Hi Sara, >> >> What you need are some of the .coord files, and the .topo files. >> >> Specifically, the midthickness_orig and the sphere files should be >> converted into a format that the mne-software can work with. >> The only way I managed this, was to convert the gifti files back into >> freesurfer’s format: >> >> tmp = ft_read_headshape({‘something-something.topo.gii’ >> ‘somethingelse-.L.midthickness_orig.coord.gii’}); >> ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’); >> >> and likewise for the right hemisphere, as well as for the spheres. >> >> Then, you can proceed with using mne_setup_source_space to create the >> 8196 mesh. The final tricky thing eventually is to get the stuff properly >> co-registered in the correct coordinate system again, but this should >> proceed in the same way as when you would have used non-surface registered >> meshes. >> >> The creation of the volume conduction model is a separate step (and does >> not require the cortical meshes). >> >> Best, >> Jan-Mathijs >> >> >> On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe wrote: >> >> > Dear Jan Mathijs, >> > >> > Thank you very much for your quick and detailed answer! >> > >> > As suggested, I post-processed the surface of one of my subjects based >> on the recipe on the link. >> > The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, >> .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii), >> > but at this point I am not sure about how to proceed. So I have now >> several questions: >> > >> > - Do you know which are the files containing the registered data for >> the creation of the meshes? >> > How should I create them given the current format? most are .gii files. >> > - Once creating the meshes, should I follow with the creation of the >> volume conduction model >> > and analysis of the functional data as described in the tutorial? >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> > >> > Apologize for all these specific questions but it is being a little bit >> confusing to me. >> > So if anyone has experienced the same and/or have any suggestion, any >> comment would be very welcomed. >> > >> > Thanks a lot in advance, >> > >> > Best, >> > >> > Sara >> > >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > From: "Schoffelen, J.M. (Jan Mathijs)" >> > To: "FieldTrip discussion list" >> > Sent: Wednesday, September 30, 2015 9:33:03 AM >> > Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage >> with MNE >> > >> > Hi Sara, >> > >> > I think that in this case there is no absolutely ‘correct’ approach, >> although some approaches may make more sense than others. >> > At this point in time it is indeed not well documented how to proceed >> from individual subject results source-reconstructed onto an individual >> cortically constrained mesh to a group analysis. >> > In the past, we have been working with a procedure where the surface >> data were interpolated onto a 3D-grid so that we could use volumetric >> normalization techniques in order to get the subjects into a common space >> to allow for group statistics. So, here the order of the steps would be to >> call ft_sourceinterpolate, followed by ft_volumenormalise, or to >> interpolate the functional data directly onto a MNI-warped grid ( >> http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> ). >> > In the code you pasted in your e-mail message, there is also reference >> to ft_volumerealign, but I am not sure I understand why this is a required >> step at this point in the pipeline. >> > >> > All the above being said, nowadays I would advocate a slightly >> different approach, which bypasses the volumetric interpolation, where per >> subject I would use cortical meshes that is surface-registered to a >> template mesh, which as a consequence allows for direct comparison of >> source locations across subjects. The way to achieve this would be to >> post-process the surfaces that come out of the freesurfer pipeline >> according to the recipe described on >> http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. >> After this registration step, the low-resolution (i.e. in this case the >> 8196-vertex) meshes can be created. >> > >> > Best wishes, >> > Jan-Mathijs >> > >> > >> > >> > >> > Jan-Mathijs Schoffelen, MD PhD, Senior researcher >> > >> > Max Planck Institute for Psycholinguistics >> > Donders Centre for Cognitive Neuroimaging >> > >> > E-mail: j.schoffelen at donders.ru.nl >> > Telephone: +31-24-3614793 >> > >> > http://www.fieldtriptoolbox.org >> > http://www.hettaligebrein.nl >> > >> > >> > >> > On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe >> wrote: >> > >> >> Dear all, >> >> >> >> I am working on the source analysis of ERF data from ElektaNeuromag >> system, with individual T1s, using minimum-norm estimate as described in >> the following tutorial: >> >> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate >> >> I am exactly following the suggested steps, and so got the source >> estimation for each of my subjects (bellow the output for one subject), >> which i can nicely plot with the ft_plot_mesh function: >> >> >> >> sourceest = >> >> >> >> time: [1x1401 double] >> >> inside: [8196x1 logical] >> >> pos: [8196x3 double] >> >> method: 'average' >> >> avg: [1x1 struct] >> >> cfg: [1x1 struct] >> >> >> >> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, >> >> I am trying to normalise (ft_volumenormalise) and interpolate >> (ft_sourceinterpolate) the functional and anatomical data. >> >> >> >> However, I am struggling in this two last steps. >> >> Since I did not find a clear pipeline/tutorial about the exact >> approach (am I missing something?) >> >> and after trying several options (bellow I copy the code I am using), >> it is not clear to me: >> >> >> >> - which is the exact input data for each of these last two functions, >> and >> >> - in which order they should be called. >> >> >> >> Now, I would highly appreciate if anyone could give me any cue about >> which the correct approach is. >> >> >> >> Thank you in advance, >> >> >> >> All the best, >> >> >> >> Sara >> >> >> >> >> >> >> >> %%%%%%%%%%%% >> >> >> >> % Inverse solution >> >> cfg = []; >> >> cfg.method = 'mne'; >> >> cfg.grid = leadfield; >> >> cfg.vol = vol; >> >> cfg.mne.prewhiten = 'yes'; >> >> cfg.mne.lambda = 3; >> >> cfg.mne.scalesourcecov = 'yes'; >> >> cfg.senstype = 'MEG'; >> >> >> >> sourceest = ft_sourceanalysis(cfg,erf); >> >> >> >> % read T1 volume - coords in scanner space >> >> mri = ft_read_mri('s01.nii'); >> >> mri.coordsys = 'neuromag'; >> >> >> >> % read headshape - Neuromag coords >> >> hsf = 's01.fif'; >> >> [headshape] = ft_read_headshape(hsf); >> >> >> >> % align T1 with head posiiton in MEG >> >> cfg = []; >> >> cfg.method = 'headshape'; >> >> cfg.parameter = 'anatomy'; >> >> cfg.headshape.headshape = headshape; >> >> cfg.headshape.interactive = 'no'; >> >> >> >> mri_real = ft_volumerealign(cfg,mri); >> >> >> >> % normalize the realinged individual MRI to SPM template >> >> cfg = []; >> >> cfg.spmversion = 'spm8'; >> >> % cfg.template='T1.nii'; % when enabling this field, an incoming error >> message indicates that the template is not in the spm coordinate system. >> >> % However, is the one used by default in this >> function (as mentioned in the reference) so it is confusing to me >> >> >> >> norm_mri = ft_volumenormalise(cfg,mri_real); >> >> >> >> % interpolate Source with MEG-aligned T1 >> >> cfg = []; >> >> cfg.parameter = 'all'; >> >> cfg.downsample = 2; >> >> >> >> source_int = ft_sourceinterpolate(cfg, sourceest,norm_mri); >> >> >> >> %%%%%%%%%%%%%% >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> 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 >> > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzuchenlung at gmail.com Wed Mar 16 09:52:17 2016 From: tzuchenlung at gmail.com (Jane Lung) Date: Wed, 16 Mar 2016 16:52:17 +0800 Subject: [FieldTrip] Why does dissimilar structures happen? Message-ID: Dear FieldTrip users, I have a question about preparing head model, I got an error after executing: "grad_aligned = ft_sensorrealign(cfg, grad);" the error message as follow: Subscripted assignment between dissimilar structures. Error in ft_sensorrealign (line 235) tmp(i) = ft_convert_units(template(i), elec.unit); % ensure that the units are consistent with the electrodes since my data come from Yokogawa160 I just followed the tutorial: Getting started with Yokogawa data Can anyone give me a suggestion? what might be wrong? because I'm a beginner of fieldtrip user, so please excuse me for my naive question... Sincerely Jane -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Wed Mar 16 14:44:13 2016 From: alik.widge at gmail.com (Alik Widge) Date: Wed, 16 Mar 2016 09:44:13 -0400 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: My approach has been to define my events temporarily as "artifacts" in the cfg. Mark a few artifacts manually in the data browser, then inspect the cfg you get as output, you'll see the necessary structure. Just make sure to take them back out before you call rejectartifact! On Mar 16, 2016 1:08 AM, "Irene Sophia Mayer" wrote: > Dear fieldtrippers, > > I would like to look at my data while it is still in its continuous form > with databrowser. However, it does not display my events. > > Is there a way to display data in databrowser with the events visible? > > Cheers, > Irene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Wed Mar 16 18:36:30 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Wed, 16 Mar 2016 18:36:30 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf Message-ID: Dear all, I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion? Thank you very much in advance. Bests, Federica -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Wed Mar 16 19:00:02 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Wed, 16 Mar 2016 19:00:02 +0100 Subject: [FieldTrip] Events in databrowser Message-ID: An HTML attachment was scrubbed... URL: From gina.joue at univr.it Wed Mar 16 19:07:42 2016 From: gina.joue at univr.it (gj) Date: Wed, 16 Mar 2016 19:07:42 +0100 Subject: [FieldTrip] import own format (long trials) Message-ID: <56E9A0EE.3060006@univr.it> Hi, I am trying to import EEG data preprocessed and averaged in BrainVision Analyzer. I have a 2-second segment of data per condition per subject which corresponds to the averaged signal across all trials of each condition for the subject. Is the following approach correct? Import the 4 conditions as 4 long trials (2 sec or 2000 samples with sampling freq of 1000 Hz) => data.trial is a 1x4 cell array and each cell array contains an nchan x 2000 matrix I am trying to fill in the other fields of the data structure to mimic FieldTrip's raw data but I think I am having problems with data.sampleinfo which, if I understand correctly, needs to be specified for long trials. According to the wiki, this should be an array containing [startsample endsample] to specify the position of each trial, with info for each trial on every row. However, it doesn't seem right to have data.sampleinfo = repmat([1 2000],4,1) Thanks in advance for any help! Gina From Max.Cantor at Colorado.EDU Wed Mar 16 19:40:35 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 16 Mar 2016 12:40:35 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: I currently use a neuroscan64 system, with the quickcap64 layout. Just looking at the layout, it seems like FP1 could be interpolated from FPZ and AF3, but I'd have to test (or look at my neighbours structure) to see if this would be the case. Anyway, depending on your setup, it may be the case that FP1 does not have any designated neighbours to interpolate from. You may need to try a different method than average or nearest. On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer wrote: > Dear fieldtrippers, > > I have excluded noisy channels from my data using > > data = ft_rejectvisual(cfg, data); > data = ft_rejectartifact(cfg, data); > > and now want to interpolate them. To do so, I am first defining the > neighbours using a zebris file: > > cfg = []; > cfg.method = 'template'; > cfg.layout = 'EEG1010.lay'; > cfg.feedback = 'yes'; > cfg.elec = ft_read_sens('Maque.sfp'); > neighbours = ft_prepare_neighbours(cfg,data_con); > > With data_con being the data that still has all the channels in it. This > gives me the variable neighbours that does indeed contain the 6 neighbours > for my missing channel. However, when I try to use > > cfg.method = 'average'; > cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; > cfg.neighbours = neighbours; > data = ft_channelrepair(cfg,data); > > I get the following message for each and every trial: trying to > reconstruct missing channel Fp1 - cannot reconstruct channel - no > neighbours in the original data or in the sensor position. > > Does anyone have an idea why this is not working properly? > > Cheers, > Irene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From maity_winky at yahoo.es Wed Mar 16 19:55:00 2016 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Wed, 16 Mar 2016 18:55:00 +0000 (UTC) Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: Message-ID: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best,Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion?Thank you very much in advance.Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Wed Mar 16 20:31:09 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Wed, 16 Mar 2016 13:31:09 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: Coincidentally, I just had to remove FP1 from one of my datasets, failed to check my neighbours structure ahead of time despite this conversation, and can confirm that FP1 could not be interpolated for me as well. On Wed, Mar 16, 2016 at 12:40 PM, Max Cantor wrote: > I currently use a neuroscan64 system, with the quickcap64 layout. Just > looking at the layout, it seems like FP1 could be interpolated from FPZ and > AF3, but I'd have to test (or look at my neighbours structure) to see if > this would be the case. Anyway, depending on your setup, it may be the case > that FP1 does not have any designated neighbours to interpolate from. You > may need to try a different method than average or nearest. > > On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer > wrote: > >> Dear fieldtrippers, >> >> I have excluded noisy channels from my data using >> >> data = ft_rejectvisual(cfg, data); >> data = ft_rejectartifact(cfg, data); >> >> and now want to interpolate them. To do so, I am first defining the >> neighbours using a zebris file: >> >> cfg = []; >> cfg.method = 'template'; >> cfg.layout = 'EEG1010.lay'; >> cfg.feedback = 'yes'; >> cfg.elec = ft_read_sens('Maque.sfp'); >> neighbours = ft_prepare_neighbours(cfg,data_con); >> >> With data_con being the data that still has all the channels in it. This >> gives me the variable neighbours that does indeed contain the 6 neighbours >> for my missing channel. However, when I try to use >> >> cfg.method = 'average'; >> cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; >> cfg.neighbours = neighbours; >> data = ft_channelrepair(cfg,data); >> >> I get the following message for each and every trial: trying to >> reconstruct missing channel Fp1 - cannot reconstruct channel - no >> neighbours in the original data or in the sensor position. >> >> Does anyone have an idea why this is not working properly? >> >> Cheers, >> Irene >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Max Cantor > Graduate Student > Cognitive Neuroscience of Language Lab > University of Colorado Boulder > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Thu Mar 17 03:47:22 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Wed, 16 Mar 2016 22:47:22 -0400 Subject: [FieldTrip] please help, approaching deadline. ft_sourceanalysis line 813 Message-ID: Hi all, I have a pipeline created where at the ft_prepare_leadfield step, the grid.label and cfg.channel fields both exist, But when I run the ft_sourceanalysis, they result as empty matrices--throwing an error. they are both cells {128x1}, but at ft_sourceanalysis result in [ ] here is my code for reference. Sorry for the long post, I am very close to a deadline and would be very grateful for your help. Please scroll below to see section where the error is thrown. *%% parameters list* (just for reference) mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; mritype='MNI'; realign='realigned'; volumereslicing='volumeresliced'; brainthresh=0.5; scalpthresh=0.10; scalpsmooth='scalp_smooth'; scalp_smooth.parameter=9; scalpvertices=1000; skullvertices=1000; brainvertices=1000; meshmethod='projectmesh'; headmodel_method='bemcp'; subjnum='915'; time='pre'; timetype='simple'; gridtype='template10'; beamformer='lcmv'; identifier='Parameter2'; *%% make headmodel* switch mritype case 'MNI' [mri] = ft_read_mri(mrifile); mri.coordsys ='MNI'; case 'Analyze' [mri] = ft_read_mri(mrifile); mri.coordsys ='Analyze'; end *%% realigning* switch realign case 'realigned' cfg=[]; cfg.method='fiducial'; cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; mri_realigned=ft_volumerealign(cfg,mri); save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') case 'notrealigned' %do nothing end *%% volume reslicing* switch volumereslicing case 'volumeresliced' cfg = []; cfg.resolution = 1; mri_resliced = ft_volumereslice(cfg, mri); save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') case 'notresliced' %do nothing end *%% segmentation parameters* switch scalpsmooth case 'noscalpsmooth' cfg = []; cfg.brainthreshold = braintresh; cfg.scalpthreshold = scalpthresh; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); case 'scalp_smooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.scalpsmooth = scalp_smooth.parameter; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); end *%%prepare mesh * cfg = []; cfg.method= meshmethod; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [scalpvertices skullvertices brainvertices]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001; bnd(2).pnt = bnd(2).pnt.*1; bnd(3).pnt = bnd(3).pnt.*0.999; *%% prepare headmodel* switch headmodel_method case 'dipoli' cfg = []; cfg.method = 'dipoli'; case 'bemcp' cfg = []; cfg.method = 'bemcp'; end headmodel = ft_prepare_headmodel(cfg, bnd); headmodel = ft_convert_units(headmodel,'cm'); *%% adding electrodes to headmodel* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') %most likely they are not aligned, so for aligning electrodes cfg = []; cfg.method = 'interactive'; cfg.elec = elec; cfg.headshape = headmodel.bnd(1);%scalp elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes nas=mri_realigned.cfg.fiducial.nas; lpa=mri_realigned.cfg.fiducial.lpa; rpa=mri_realigned.cfg.fiducial.rpa; *%% load EEG data* i can send these to any ambitiously nice person wanting to try out the script exactly *%% timelock data* elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); cfg = []; same = dataM0; same.trial = [dataM0.trial dataM3W.trial]; same.time = [dataM0.time dataM3W.time]; diff = dataM6; diff.trial = [dataM3Bb.trial dataM6.trial]; diff.time = [dataM3Bb.time dataM6.time]; switch timetype case 'simple' timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); case 'hassan' cfg.vartrllength = 2; cfg.covariance = 'yes'; cfg.covariancewindow = [0 .2]; cfg.keeptrials = 'yes'; timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); *%% make sourcemodel* cfg = []; cfg.headmodel = headmodel; cfg.mri=mri; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel.cfg.grid; cfg.grid.nonlinear = 'yes'; cfg.resolution = 10; % resolution of the template grid in mm cfg.moveinward = 1; cfg.grid.unit ='mm'; cfg.inwardshift = 0; cfg.elec = elec; % cfg.headshape=('cortex_5124.surf.gii'); mysourcemodel = ft_prepare_sourcemodel(cfg); *%% make leadfield* switch gridtype case 'individual' cfg = []; cfg.elec = elec; cfg.headmodel = headmodel; cfg.grid =mysourcemodel; % cfg.grid.resolution = 2; %gives me Error using ft_prepare_sourcemodel (line 163) %You cannot specify cfg.grid.resolution and an explicit cfg.grid.xgrid simultaneously cfg.reducerank= 3; cfg.channel = elec.chanpos; cfg.grid.unit = 'cm';% same unit as above, i.e. in cm [grid] = ft_prepare_leadfield(cfg); case 'templatebased' load('standard_sourcemodel3d10mm.mat') cfg = []; cfg.elec = elec; cfg.template = sourcemodel.cfg.grid; cfg.grid=grid; cfg.headmodel = headmodel; cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG cfg.channel = 'all'; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; [grid] = ft_prepare_leadfield(cfg); case 'template10' load('standard_sourcemodel3d10mm.mat') [grid]=sourcemodel.cfg.grid; end *%% run beamformer*-* this step is what gives the error, * switch beamformer case 'lcmv' cfg = []; cfg.method = 'lcmv'; cfg.elec=elec; cfg.lcmv.lambda='5%'; cfg.grid = grid; cfg.headmodel = headmodel; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.projectnoise='yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD >>>>>the error is>>> *Subscript indices must either be real positive integers or logicals.Error in beamformer_lcmv (line 168) noise = noise(end);Error in ft_sourceanalysis (line 841)dip(i) = beamformer_lcmv(grid, sens, headmodel, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:});* *I suspect its because in ft_sourceanalysis (line813) [i1, i2] = match_str(cfg.channel, grid.label)* *the result is i1=[] and i2=[]. eventhough when I look up cfg.channel and grid.label in my variables they exist. after running ft_sourceanalysis the cfg.channel field disappeaers. * *%%interpolate* cfg = []; cfg.interpmethod = 'nearest'; cfg.parameter = 'pow'; sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri_resliced); sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri_resliced); sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri_resliced); sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri_resliced); sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri_resliced); sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri_resliced); *%%Plot* cfg = []; cfg.method = 'surface'; cfg.funcolormap = 'jet'; % cfg.method = 'ortho'; cfg.funcolorlim = 'maxabs'; cfg.funparameter= 'pow'; ft_sourceplot(cfg,sourceinterp_diff); ft_sourceplot(cfg,sourceinterp_m0); ft_sourceplot(cfg,sourceinterp_m6); ft_sourceplot(cfg,sourceinterp_m3w); ft_sourceplot(cfg,sourceinterp_m3b); ft_sourceplot(cfg,sourceinterp_same); -------------- next part -------------- An HTML attachment was scrubbed... URL: From gunnar.norrman at biling.su.se Thu Mar 17 08:36:22 2016 From: gunnar.norrman at biling.su.se (Gunnar Norrman) Date: Thu, 17 Mar 2016 07:36:22 +0000 Subject: [FieldTrip] Epoching EEG data after downsampling Message-ID: <1458200183218.67807@biling.su.se> Hello, I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > In ft_redefinetrial (line 222) Subscripted assignment dimension mismatch. Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? Thank you! Best regards, Gunnar Norrman --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se -------------- next part -------------- An HTML attachment was scrubbed... URL: From mi_mayer at gmx.de Thu Mar 17 09:40:56 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Thu, 17 Mar 2016 09:40:56 +0100 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 15:08:05 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 15:08:05 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir and John, attached you can find the results of the source localizaiton with the FEM head model. Moreover, I also report the correlation of the lead fields for the FEM and concentric spheres models and BEM and concentric spheres model (the latter one using an inwardshift of 6 mm). Unfortunately, I could not produce the correlation trend we expected (I tryed several values of inwardshifts, ranging form 1mm to 10 mm and the plot is of course not identical to the one I posted, but it is qualitatively similar). There must still be something I don't fully get probably, since the correlation between the concentric spheres lead fields and the BEM lead fields is always so low, even close to the center of the head, regardless of the inwardshift value. All considered, I would rather go for a FEM model at least for the moment being. Thanks a lot for your support! Best, Debora On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak wrote: > Dear Debora, > > cfg.moveinward option is useful when your source space is a mesh as it > actually deforms the mesh to push it inwards. When your source space is a > grid you should use cfg.inwardshift to just exclude the points that are > closer than 6 mm to the boundary. It might be a useful exercise for you to > compute the lead fields with concentric spheres and with a BEM for the same > grid and then look at correlations between these lead fields. You should > see that the correlations should be high at depth but might be low for some > points close to the surface. Once you hit the right value of inwardshift > the low correlations should disappear. > > Best, > > Vladimir > > On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri > wrote: > >> Dear Vladimir, >> thanks for your explanation. I tryed to use the option cfg.moveinward in >> ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this >> did not solve the issue. As you can see from the attachment the cortex is >> now partially uncovered. I am not sure I am using this option properly, >> maybe there is a combination of values for cfg.moveinward and >> cfg.inwardshift that works fine. I tryed several, but none of them gave me >> the source localization that I expect. >> I don't know whether the fact that some dipoles fall outside the brain >> matters. For the attached figures I had no dipoles outside the brain, >> whilst for some of the others attempts I had. >> >> I actually found this post on the mailinglist where both you and John >> already pointed out this issue using BEM: >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >> >> Also I don't know whether this link (still under construction/discussion) >> may be of interest in this contex: >> >> >> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >> >> Furthermore, this other page (also under construction), uses the option >> cfg.inwardshift for the template grid to be used in the creation of the >> individual subject's grid, but without an explanation of why the option >> is/should be used: >> >> >> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >> >> In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) >> provided by Fiedltrip, I don't know whether craeting my own template_grid >> using the cfg.inwardshift option would actually fix the problem. I would >> like to perform some further attempts, as soon as I have some time to go >> through the function and understand how this options actually interplay. >> >> Meanwhile, I am still working on producing the results using the FEM head >> model. It is much more time-consuming than the BEM, and maybe that's one of >> the reasons to choose BEM models. As soon as they are ready I will post >> them as well :) >> >> Anyway, thanks so much for your help. It was actually quite useful and >> instructive! >> >> All the best wishes, >> Debora >> >> >> >> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >> litvak.vladimir at gmail.com> wrote: >> >>> Dear Debora, >>> >>> The critical thing with BEMCP is that your sources are not too close to >>> the inner skull boundary. When they are closer than the safe distance the >>> solution you get is completely wrong. When they are not too close, the >>> solution is OK and comparable at least to concentric spheres. The safe >>> distance is is more or less the average edge length in your skull mesh. In >>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>> It would be interesting if you use this option and report whether this >>> resolves your problem. >>> >>> This issue should occur in any BEM but depending on the implementation >>> the critical distance might be shorter. >>> >>> Best, >>> >>> Vladimir >>> >>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri >> > wrote: >>> >>>> Dear John, >>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>> BEM head model first, but going quickly through the studies you have >>>> mentioned and considering the tests you have performed, I may also consider >>>> to switch to the FEM head model or to simply use the concentric spheres >>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>> relatively new to source localization and had no crash/errors in my >>>> pipeline, and this combination makes always difficult to find possible >>>> pitfalls. >>>> >>>> As soon as I have them ready, I will post the results obtained with the >>>> FEM head model as well, maybe they will be useful for some other users :) >>>> >>>> Thanks again for your support! >>>> All the best, >>>> Debora >>>> >>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>> RICHARDS at mailbox.sc.edu> wrote: >>>> >>>>> Deb: >>>>> >>>>> I have had problems with BEMCP. >>>>> >>>>> 1—one of the practical / technical problems is that if the >>>>> compartments overlap, or even come close, then the procedure would not >>>>> work—the ft_sourceanlaysis crashed. >>>>> >>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>> better, >>>>> >>>>> E. g., among three or four studies I have seen. >>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>> >>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>> >>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>> participant-computed realistic models for the compartments and the FEM. >>>>> >>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>> models over the BEMCP, but I suggest looking at the research literature >>>>> formally comparing these methods before going much further with BEMCP. >>>>> >>>>> John >>>>> >>>>> *********************************************** >>>>> John E. Richards Carolina Distinguished Professor >>>>> Department of Psychology >>>>> University of South Carolina >>>>> Columbia, SC 29208 >>>>> Dept Phone: 803 777 2079 >>>>> Fax: 803 777 9558 >>>>> Email: richards-john at sc.edu >>>>> HTTP: jerlab.psych.sc.edu >>>>> *********************************************** >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> Debora Desideri, PhD Student >>>> BNP Lab - Neurology Department >>>> University Hospital Tübingen >>>> Eberhard Karls University Tübingen >>>> Hoppe-Seyler Str. 3 >>>> D-72076 Tübingen >>>> Tel: +49 7071/29 80478 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_FEM_CONCENTRICSPHERES.png Type: image/png Size: 80143 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FEM_SourceResults.png Type: image/png Size: 117351 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_BEM_CONCENTRICSPHERES_inwardshift6mm.png Type: image/png Size: 124166 bytes Desc: not available URL: From litvak.vladimir at gmail.com Thu Mar 17 15:21:26 2016 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Thu, 17 Mar 2016 14:21:26 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: What about correlations between local spheres and the FEM? If it's only the BEM that's broken I'd expect that you should get decent values for those. Your plots don't look so good. I did something similar a couple of years ago and got much better results. Perhaps it'd be a good idea to re-check the BEM again. Vladimir On Thu, Mar 17, 2016 at 2:08 PM, Debora Desideri wrote: > Dear Vladimir and John, > attached you can find the results of the source localizaiton with the FEM > head model. Moreover, I also report the correlation of the lead fields for > the FEM and concentric spheres models and BEM and concentric spheres model > (the latter one using an inwardshift of 6 mm). Unfortunately, I could not > produce the correlation trend we expected (I tryed several values of > inwardshifts, ranging form 1mm to 10 mm and the plot is of course not > identical to the one I posted, but it is qualitatively similar). > There must still be something I don't fully get probably, since the > correlation between the concentric spheres lead fields and the BEM lead > fields is always so low, even close to the center of the head, regardless > of the inwardshift value. > > All considered, I would rather go for a FEM model at least for the moment > being. > Thanks a lot for your support! > > Best, > Debora > > > > > On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak < > litvak.vladimir at gmail.com> wrote: > >> Dear Debora, >> >> cfg.moveinward option is useful when your source space is a mesh as it >> actually deforms the mesh to push it inwards. When your source space is a >> grid you should use cfg.inwardshift to just exclude the points that are >> closer than 6 mm to the boundary. It might be a useful exercise for you to >> compute the lead fields with concentric spheres and with a BEM for the same >> grid and then look at correlations between these lead fields. You should >> see that the correlations should be high at depth but might be low for some >> points close to the surface. Once you hit the right value of inwardshift >> the low correlations should disappear. >> >> Best, >> >> Vladimir >> >> On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri > > wrote: >> >>> Dear Vladimir, >>> thanks for your explanation. I tryed to use the option cfg.moveinward in >>> ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but this >>> did not solve the issue. As you can see from the attachment the cortex is >>> now partially uncovered. I am not sure I am using this option properly, >>> maybe there is a combination of values for cfg.moveinward and >>> cfg.inwardshift that works fine. I tryed several, but none of them gave me >>> the source localization that I expect. >>> I don't know whether the fact that some dipoles fall outside the brain >>> matters. For the attached figures I had no dipoles outside the brain, >>> whilst for some of the others attempts I had. >>> >>> I actually found this post on the mailinglist where both you and John >>> already pointed out this issue using BEM: >>> >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >>> >>> Also I don't know whether this link (still under >>> construction/discussion) may be of interest in this contex: >>> >>> >>> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >>> >>> Furthermore, this other page (also under construction), uses the option >>> cfg.inwardshift for the template grid to be used in the creation of the >>> individual subject's grid, but without an explanation of why the option >>> is/should be used: >>> >>> >>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >>> >>> In ft_prepare_sourcemodel I am using the standard grid (6 mm resolution) >>> provided by Fiedltrip, I don't know whether craeting my own template_grid >>> using the cfg.inwardshift option would actually fix the problem. I would >>> like to perform some further attempts, as soon as I have some time to go >>> through the function and understand how this options actually interplay. >>> >>> Meanwhile, I am still working on producing the results using the FEM >>> head model. It is much more time-consuming than the BEM, and maybe that's >>> one of the reasons to choose BEM models. As soon as they are ready I will >>> post them as well :) >>> >>> Anyway, thanks so much for your help. It was actually quite useful and >>> instructive! >>> >>> All the best wishes, >>> Debora >>> >>> >>> >>> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >>> litvak.vladimir at gmail.com> wrote: >>> >>>> Dear Debora, >>>> >>>> The critical thing with BEMCP is that your sources are not too close to >>>> the inner skull boundary. When they are closer than the safe distance the >>>> solution you get is completely wrong. When they are not too close, the >>>> solution is OK and comparable at least to concentric spheres. The safe >>>> distance is is more or less the average edge length in your skull mesh. In >>>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>>> It would be interesting if you use this option and report whether this >>>> resolves your problem. >>>> >>>> This issue should occur in any BEM but depending on the implementation >>>> the critical distance might be shorter. >>>> >>>> Best, >>>> >>>> Vladimir >>>> >>>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri < >>>> deb.desideri at gmail.com> wrote: >>>> >>>>> Dear John, >>>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>>> BEM head model first, but going quickly through the studies you have >>>>> mentioned and considering the tests you have performed, I may also consider >>>>> to switch to the FEM head model or to simply use the concentric spheres >>>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>>> relatively new to source localization and had no crash/errors in my >>>>> pipeline, and this combination makes always difficult to find possible >>>>> pitfalls. >>>>> >>>>> As soon as I have them ready, I will post the results obtained with >>>>> the FEM head model as well, maybe they will be useful for some other users >>>>> :) >>>>> >>>>> Thanks again for your support! >>>>> All the best, >>>>> Debora >>>>> >>>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>>> RICHARDS at mailbox.sc.edu> wrote: >>>>> >>>>>> Deb: >>>>>> >>>>>> I have had problems with BEMCP. >>>>>> >>>>>> 1—one of the practical / technical problems is that if the >>>>>> compartments overlap, or even come close, then the procedure would not >>>>>> work—the ft_sourceanlaysis crashed. >>>>>> >>>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>>> better, >>>>>> >>>>>> E. g., among three or four studies I have seen. >>>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>>> >>>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>>> >>>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>>> participant-computed realistic models for the compartments and the FEM. >>>>>> >>>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>>> models over the BEMCP, but I suggest looking at the research literature >>>>>> formally comparing these methods before going much further with BEMCP. >>>>>> >>>>>> John >>>>>> >>>>>> *********************************************** >>>>>> John E. Richards Carolina Distinguished Professor >>>>>> Department of Psychology >>>>>> University of South Carolina >>>>>> Columbia, SC 29208 >>>>>> Dept Phone: 803 777 2079 >>>>>> Fax: 803 777 9558 >>>>>> Email: richards-john at sc.edu >>>>>> HTTP: jerlab.psych.sc.edu >>>>>> *********************************************** >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Debora Desideri, PhD Student >>>>> BNP Lab - Neurology Department >>>>> University Hospital Tübingen >>>>> Eberhard Karls University Tübingen >>>>> Hoppe-Seyler Str. 3 >>>>> D-72076 Tübingen >>>>> Tel: +49 7071/29 80478 >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> >>> -- >>> >>> Debora Desideri, PhD Student >>> BNP Lab - Neurology Department >>> University Hospital Tübingen >>> Eberhard Karls University Tübingen >>> Hoppe-Seyler Str. 3 >>> D-72076 Tübingen >>> Tel: +49 7071/29 80478 >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > > Debora Desideri, PhD Student > BNP Lab - Neurology Department > University Hospital Tübingen > Eberhard Karls University Tübingen > Hoppe-Seyler Str. 3 > D-72076 Tübingen > Tel: +49 7071/29 80478 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 15:46:46 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 15:46:46 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: Dear Vladimir, The correlation between concentric spheres and FEM (attached) it is not so bad I think. There are quite "low" (ca. 0.4-0.5) correlaiton values closer to the surface, but it is close enough to our expectations. I used concentric spheres because I am working with EEG data, isn't the local spheres method only for MEG? I am also surprised that the correlaiton between BEM and concentric spheres lead fields is so bad. It almost looks random... Best, Debora On Thu, Mar 17, 2016 at 3:21 PM, Vladimir Litvak wrote: > What about correlations between local spheres and the FEM? If it's only > the BEM that's broken I'd expect that you should get decent values for > those. Your plots don't look so good. I did something similar a couple of > years ago and got much better results. Perhaps it'd be a good idea to > re-check the BEM again. > > Vladimir > > On Thu, Mar 17, 2016 at 2:08 PM, Debora Desideri > wrote: > >> Dear Vladimir and John, >> attached you can find the results of the source localizaiton with the FEM >> head model. Moreover, I also report the correlation of the lead fields for >> the FEM and concentric spheres models and BEM and concentric spheres model >> (the latter one using an inwardshift of 6 mm). Unfortunately, I could not >> produce the correlation trend we expected (I tryed several values of >> inwardshifts, ranging form 1mm to 10 mm and the plot is of course not >> identical to the one I posted, but it is qualitatively similar). >> There must still be something I don't fully get probably, since the >> correlation between the concentric spheres lead fields and the BEM lead >> fields is always so low, even close to the center of the head, regardless >> of the inwardshift value. >> >> All considered, I would rather go for a FEM model at least for the moment >> being. >> Thanks a lot for your support! >> >> Best, >> Debora >> >> >> >> >> On Mon, Mar 14, 2016 at 12:11 PM, Vladimir Litvak < >> litvak.vladimir at gmail.com> wrote: >> >>> Dear Debora, >>> >>> cfg.moveinward option is useful when your source space is a mesh as it >>> actually deforms the mesh to push it inwards. When your source space is a >>> grid you should use cfg.inwardshift to just exclude the points that are >>> closer than 6 mm to the boundary. It might be a useful exercise for you to >>> compute the lead fields with concentric spheres and with a BEM for the same >>> grid and then look at correlations between these lead fields. You should >>> see that the correlations should be high at depth but might be low for some >>> points close to the surface. Once you hit the right value of inwardshift >>> the low correlations should disappear. >>> >>> Best, >>> >>> Vladimir >>> >>> On Mon, Mar 14, 2016 at 10:46 AM, Debora Desideri < >>> deb.desideri at gmail.com> wrote: >>> >>>> Dear Vladimir, >>>> thanks for your explanation. I tryed to use the option cfg.moveinward >>>> in ft_prepare_sourcemodel ( I set it to 6 mm,, with inwardshift = 0), but >>>> this did not solve the issue. As you can see from the attachment the cortex >>>> is now partially uncovered. I am not sure I am using this option properly, >>>> maybe there is a combination of values for cfg.moveinward and >>>> cfg.inwardshift that works fine. I tryed several, but none of them gave me >>>> the source localization that I expect. >>>> I don't know whether the fact that some dipoles fall outside the brain >>>> matters. For the attached figures I had no dipoles outside the brain, >>>> whilst for some of the others attempts I had. >>>> >>>> I actually found this post on the mailinglist where both you and John >>>> already pointed out this issue using BEM: >>>> >>>> >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-November/009783.html >>>> >>>> Also I don't know whether this link (still under >>>> construction/discussion) may be of interest in this contex: >>>> >>>> >>>> http://www.fieldtriptoolbox.org/faq/is_it_good_or_bad_to_have_dipole_locations_outside_of_the_brain_for_which_the_source_reconstruction_is_computed >>>> >>>> Furthermore, this other page (also under construction), uses the option >>>> cfg.inwardshift for the template grid to be used in the creation of the >>>> individual subject's grid, but without an explanation of why the option >>>> is/should be used: >>>> >>>> >>>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-specific_grids_that_are_equivalent_across_subjects_in_normalized_space >>>> >>>> In ft_prepare_sourcemodel I am using the standard grid (6 mm >>>> resolution) provided by Fiedltrip, I don't know whether craeting my own >>>> template_grid using the cfg.inwardshift option would actually fix the >>>> problem. I would like to perform some further attempts, as soon as I have >>>> some time to go through the function and understand how this options >>>> actually interplay. >>>> >>>> Meanwhile, I am still working on producing the results using the FEM >>>> head model. It is much more time-consuming than the BEM, and maybe that's >>>> one of the reasons to choose BEM models. As soon as they are ready I will >>>> post them as well :) >>>> >>>> Anyway, thanks so much for your help. It was actually quite useful and >>>> instructive! >>>> >>>> All the best wishes, >>>> Debora >>>> >>>> >>>> >>>> On Sat, Mar 12, 2016 at 5:14 PM, Vladimir Litvak < >>>> litvak.vladimir at gmail.com> wrote: >>>> >>>>> Dear Debora, >>>>> >>>>> The critical thing with BEMCP is that your sources are not too close >>>>> to the inner skull boundary. When they are closer than the safe distance >>>>> the solution you get is completely wrong. When they are not too close, the >>>>> solution is OK and comparable at least to concentric spheres. The safe >>>>> distance is is more or less the average edge length in your skull mesh. In >>>>> SPM meshes this is 6 mm. In ft_prepare_sourcemodel there is an option >>>>> cfg.moveinward that corrects the mesh to ensure that it is not too close. >>>>> It would be interesting if you use this option and report whether this >>>>> resolves your problem. >>>>> >>>>> This issue should occur in any BEM but depending on the implementation >>>>> the critical distance might be shorter. >>>>> >>>>> Best, >>>>> >>>>> Vladimir >>>>> >>>>> On Sat, Mar 12, 2016 at 3:30 PM, Debora Desideri < >>>>> deb.desideri at gmail.com> wrote: >>>>> >>>>>> Dear John, >>>>>> thanks a lot for your promt reply and your suggestion. I guess that I >>>>>> was sticking to the BEM head model just because I read the tutorial for EEG >>>>>> BEM head model first, but going quickly through the studies you have >>>>>> mentioned and considering the tests you have performed, I may also consider >>>>>> to switch to the FEM head model or to simply use the concentric spheres >>>>>> (which appeared to work similar to BEMCP in your comparisons). I am >>>>>> relatively new to source localization and had no crash/errors in my >>>>>> pipeline, and this combination makes always difficult to find possible >>>>>> pitfalls. >>>>>> >>>>>> As soon as I have them ready, I will post the results obtained with >>>>>> the FEM head model as well, maybe they will be useful for some other users >>>>>> :) >>>>>> >>>>>> Thanks again for your support! >>>>>> All the best, >>>>>> Debora >>>>>> >>>>>> On Sat, Mar 12, 2016 at 3:42 PM, RICHARDS, JOHN < >>>>>> RICHARDS at mailbox.sc.edu> wrote: >>>>>> >>>>>>> Deb: >>>>>>> >>>>>>> I have had problems with BEMCP. >>>>>>> >>>>>>> 1—one of the practical / technical problems is that if the >>>>>>> compartments overlap, or even come close, then the procedure would not >>>>>>> work—the ft_sourceanlaysis crashed. >>>>>>> >>>>>>> 2—There are a couple of studies comparing BEMCP and dipoli, among >>>>>>> other methods. The BEMCP method does not fare well, the dipoli fares >>>>>>> better, >>>>>>> >>>>>>> E. g., among three or four studies I have seen. >>>>>>> Gramfort, A., et al. (2010). "OpenMEEG: opensource software for >>>>>>> quasistatic bioelectromagnetics." Biomed Eng Online *9*: 45. >>>>>>> >>>>>>> Gramfort, A., et al. (2011). "Forward field computation with >>>>>>> OpenMEEG." Comput Intell Neurosci *2011*: 923703. >>>>>>> >>>>>>> 3—I have directly compared BEMCP, a 4-shell concentric spheres, >>>>>>> dipoli, and the Simbio FEM model, by correlating results from each model >>>>>>> (e.g., correlations of all the dipole CDR estimates; or correlations across >>>>>>> anatomical ROIs). The BEMCP and concentric spheres work similarly, and the >>>>>>> dipoli and Simbio-FEM work similarly. This was with infants using >>>>>>> participant-computed realistic models for the compartments and the FEM. >>>>>>> >>>>>>> I am not claiming from this and superiority of the dipoli (or FEM) >>>>>>> models over the BEMCP, but I suggest looking at the research literature >>>>>>> formally comparing these methods before going much further with BEMCP. >>>>>>> >>>>>>> John >>>>>>> >>>>>>> *********************************************** >>>>>>> John E. Richards Carolina Distinguished Professor >>>>>>> Department of Psychology >>>>>>> University of South Carolina >>>>>>> Columbia, SC 29208 >>>>>>> Dept Phone: 803 777 2079 >>>>>>> Fax: 803 777 9558 >>>>>>> Email: richards-john at sc.edu >>>>>>> HTTP: jerlab.psych.sc.edu >>>>>>> *********************************************** >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> Debora Desideri, PhD Student >>>>>> BNP Lab - Neurology Department >>>>>> University Hospital Tübingen >>>>>> Eberhard Karls University Tübingen >>>>>> Hoppe-Seyler Str. 3 >>>>>> D-72076 Tübingen >>>>>> Tel: +49 7071/29 80478 >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> Debora Desideri, PhD Student >>>> BNP Lab - Neurology Department >>>> University Hospital Tübingen >>>> Eberhard Karls University Tübingen >>>> Hoppe-Seyler Str. 3 >>>> D-72076 Tübingen >>>> Tel: +49 7071/29 80478 >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> >> -- >> >> Debora Desideri, PhD Student >> BNP Lab - Neurology Department >> University Hospital Tübingen >> Eberhard Karls University Tübingen >> Hoppe-Seyler Str. 3 >> D-72076 Tübingen >> Tel: +49 7071/29 80478 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LeadfieldCorrelaiton_FEM_CONCENTRICSPHERES.png Type: image/png Size: 80143 bytes Desc: not available URL: From RICHARDS at mailbox.sc.edu Thu Mar 17 15:57:47 2016 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Thu, 17 Mar 2016 14:57:47 +0000 Subject: [FieldTrip] BEMCP In-Reply-To: References: Message-ID: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> "The correlation between concentric spheres and FEM (attached) it is not so bad” . I am not sure what you are correlating. Is this over the time of a beamformer model, or over participants with a single-time model? In either case, I think the correlations for the FEM-Concentric spheres are bad, many are less < 0.8, and a number are in the range from .9 to .95. This result confirms the difference in the FEM and concentric-sphere models. These are exacerbated even further when you use a subject-specific realistic FEM model and a concentric spheres model. The results between the BEMCP and concentric spheres suggests that the BEMCP model is not working. Most of the correlations should be positive. I have not used correlations as you have, but have done ROIs in an individual, and correlated the values of the ROIs over the head for one subject, or multiple subjects. I find higher correlations for the BEMCP and Concentric sphere models, than between either of these and a FEM model. However, in my case I am not using the standard model from FT, but using subject-specific BEMCP, concentric spheres, and FEM models. If the FEM model is working for you, why not use it? John *********************************************** John E. Richards Carolina Distinguished Professor Department of Psychology University of South Carolina Columbia, SC 29208 Dept Phone: 803 777 2079 Fax: 803 777 9558 Email: richards-john at sc.edu HTTP: jerlab.psych.sc.edu *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From deb.desideri at gmail.com Thu Mar 17 16:13:35 2016 From: deb.desideri at gmail.com (Debora Desideri) Date: Thu, 17 Mar 2016 16:13:35 +0100 Subject: [FieldTrip] BEMCP In-Reply-To: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> References: <50F254C3-3371-44EC-9078-D87EFFFCFA07@mailbox.sc.edu> Message-ID: Dear John, what I am correlating are the lead field produced using subject-specific realistic FEM head model or BEM head model and concentric spheres head model. As Vladimir suggested, this should help me to find the proper inward shift to apply in order to achieve good results with the BEM model. Unfortunately, the BEM model still seems not to work properly. Anyway, given the results of the latest attempts, I will definitely use the FEM model for my analysis, even if it is takes much longer to create the head model and lead fields. Thanks again! Best, Debora On Thu, Mar 17, 2016 at 3:57 PM, RICHARDS, JOHN wrote: > "The correlation between concentric spheres and FEM (attached) it is not > so bad” . I am not sure what you are correlating. Is this over the time of > a beamformer model, or over participants with a single-time model? In > either case, I think the correlations for the FEM-Concentric spheres are > bad, many are less < 0.8, and a number are in the range from .9 to .95. > > This result confirms the difference in the FEM and concentric-sphere > models. These are exacerbated even further when you use a > subject-specific realistic FEM model and a concentric spheres model. > > The results between the BEMCP and concentric spheres suggests that the > BEMCP model is not working. Most of the correlations should be positive. > I have not used correlations as you have, but have done ROIs in an > individual, and correlated the values of the ROIs over the head for one > subject, or multiple subjects. I find higher correlations for the BEMCP > and Concentric sphere models, than between either of these and a FEM > model. However, in my case I am not using the standard model from FT, but > using subject-specific BEMCP, concentric spheres, and FEM models. > > If the FEM model is working for you, why not use it? > > John > > *********************************************** > John E. Richards Carolina Distinguished Professor > Department of Psychology > University of South Carolina > Columbia, SC 29208 > Dept Phone: 803 777 2079 > Fax: 803 777 9558 > Email: richards-john at sc.edu > HTTP: jerlab.psych.sc.edu > *********************************************** > > > -- Debora Desideri, PhD Student BNP Lab - Neurology Department University Hospital Tübingen Eberhard Karls University Tübingen Hoppe-Seyler Str. 3 D-72076 Tübingen Tel: +49 7071/29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Thu Mar 17 15:55:37 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Thu, 17 Mar 2016 15:55:37 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards, Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > Hi Federica, > > If you have access to BESA, you could import txt files and export them as > edf. > > Best, > Maite > > > El Miércoles 16 de marzo de 2016 18:57, Federica Mauro < > federica.ma at gmail.com> escribió: > > > Dear all, > I'm trying to convert txt files of web recordings in the edf format, but I > didn't find a any useful solution until now. > Do you have any suggestion? > Thank you very much in advance. > Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 joseluisblues at gmail.com Thu Mar 17 20:03:41 2016 From: joseluisblues at gmail.com (Jose) Date: Thu, 17 Mar 2016 20:03:41 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel Message-ID: dear list, There might be an error in the beamformer tutorial ( http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead field and the sources, *cfg.vol* rather than *cfg.headmodel *has to be defined to determine the headmodel. Thanks for corroborating this. -- José -------------- next part -------------- An HTML attachment was scrubbed... URL: From Max.Cantor at Colorado.EDU Thu Mar 17 21:20:12 2016 From: Max.Cantor at Colorado.EDU (Max Cantor) Date: Thu, 17 Mar 2016 14:20:12 -0600 Subject: [FieldTrip] Events in databrowser In-Reply-To: References: Message-ID: Ya, in the past I used an equidistant cap so it was never an issue to interpolate so long as multiple neighboring channels did not all need to be interpolated. Otherwise I don't see a way around it besides using a different method such as spline. On Thursday, March 17, 2016, Irene Sophia Mayer wrote: > My problem now is that I have the neighbours structure, including the > neighbours for 'Fp1', in the form of just a list stating the neighbours. > Still, it says that there are no neighbours. I will try to use a different > method than 'average' or 'nearest' but I'm not completely happy with > that... > > *Gesendet:* Mittwoch, 16. März 2016 um 20:31 Uhr > *Von:* "Max Cantor" > *An:* "FieldTrip discussion list" > > *Betreff:* Re: [FieldTrip] Events in databrowser > Coincidentally, I just had to remove FP1 from one of my datasets, failed > to check my neighbours structure ahead of time despite this conversation, > and can confirm that FP1 could not be interpolated for me as well. > > On Wed, Mar 16, 2016 at 12:40 PM, Max Cantor > wrote: >> >> I currently use a neuroscan64 system, with the quickcap64 layout. Just >> looking at the layout, it seems like FP1 could be interpolated from FPZ and >> AF3, but I'd have to test (or look at my neighbours structure) to see if >> this would be the case. Anyway, depending on your setup, it may be the case >> that FP1 does not have any designated neighbours to interpolate from. You >> may need to try a different method than average or nearest. >> >> On Wed, Mar 16, 2016 at 12:00 PM, Irene Sophia Mayer >> wrote: >> >>> Dear fieldtrippers, >>> >>> I have excluded noisy channels from my data using >>> >>> data = ft_rejectvisual(cfg, data); >>> data = ft_rejectartifact(cfg, data); >>> >>> and now want to interpolate them. To do so, I am first defining the >>> neighbours using a zebris file: >>> >>> cfg = []; >>> cfg.method = 'template'; >>> cfg.layout = 'EEG1010.lay'; >>> cfg.feedback = 'yes'; >>> cfg.elec = ft_read_sens('Maque.sfp'); >>> neighbours = ft_prepare_neighbours(cfg,data_con); >>> >>> With data_con being the data that still has all the channels in it. This >>> gives me the variable neighbours that does indeed contain the 6 neighbours >>> for my missing channel. However, when I try to use >>> >>> cfg.method = 'average'; >>> cfg.missingchannel = {'Fp1', 'Fp2', 'AF7', 'AF8'}; >>> cfg.neighbours = neighbours; >>> data = ft_channelrepair(cfg,data); >>> >>> I get the following message for each and every trial: trying to >>> reconstruct missing channel Fp1 - cannot reconstruct channel - no >>> neighbours in the original data or in the sensor position. >>> >>> Does anyone have an idea why this is not working properly? >>> >>> Cheers, >>> Irene >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Max Cantor >> Graduate Student >> Cognitive Neuroscience of Language Lab >> University of Colorado Boulder >> > > > -- > Max Cantor > Graduate Student > Cognitive Neuroscience of Language Lab > University of Colorado Boulder > _______________________________________________ fieldtrip mailing list > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Max Cantor Graduate Student Cognitive Neuroscience of Language Lab University of Colorado Boulder -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 18 08:36:18 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:36:18 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel In-Reply-To: References: Message-ID: Hi José The option cfg.vol (for “volume conduction model”) has been replaced by cfg.headmodel for quite some time (probably more than a year ago). The code is backward compatible, so cfg.vol will also still work, but the documentation reflects the current standard. I suggest you update your copy of FieldTrip to a more recent version. best regards, Robert On 17 Mar 2016, at 20:03, Jose wrote: > dear list, > > There might be an error in the beamformer tutorial (http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead field and the sources, cfg.vol rather than cfg.headmodel has to be defined to determine the headmodel. Thanks for corroborating this. > > -- > José > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Fri Mar 18 08:38:29 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:38:29 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> Hi Frederica, Please look at the FAQ How can I convert one dataformat into an other? best regards, Robert On 17 Mar 2016, at 15:55, Federica Mauro wrote: > Hi Maité, > > thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. > > Best regards, > Federica > > 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > Hi Federica, > > If you have access to BESA, you could import txt files and export them as edf. > > Best, > Maite > > > El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: > > > Dear all, > I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. > Do you have any suggestion? > Thank you very much in advance. > Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 r.oostenveld at donders.ru.nl Fri Mar 18 08:50:11 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 18 Mar 2016 08:50:11 +0100 Subject: [FieldTrip] Epoching EEG data after downsampling In-Reply-To: <1458200183218.67807@biling.su.se> References: <1458200183218.67807@biling.su.se> Message-ID: Hi Gunnar, This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. cfg = [] cfg = … data_old = ft_preprocessing(cfg) data_old.label{end+1} = ‘sample’; for i=1:size(data_old.sampleinfo,1) % this works for one or more trials data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); end cfg = [] cfg = … data_new = ft_resampledata(cfg, data_old); The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. best regards, Robert On 17 Mar 2016, at 08:36, Gunnar Norrman wrote: > Hello, > > I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > > > In ft_redefinetrial (line 222) > Subscripted assignment dimension mismatch. > > Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. > > Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? > > Thank you! > > Best regards, > Gunnar Norrman > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Fri Mar 18 08:57:35 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Fri, 18 Mar 2016 07:57:35 +0000 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> Message-ID: <87DBECC2-4595-4D21-AA68-2C6E01A80108@cfin.au.dk> Dear Federica, To write EDF format, have you tried looking info the “swrite” function from the Biosig toolbox? http://biosig.sourceforge.net You should be able to import your text files directly into Matlab. If they are raw files with no header, simply “load -ascii filename.txt” should work. If there’s a header, you can try Matlab’s built-in tools like “uiimport” or “textread”. Cheers, Sarang On 17 Mar 2016, at 15:55, Federica Mauro > wrote: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards, Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García >: Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best, Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro > escribió: Dear all, I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion? Thank you very much in advance. Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 sarang at cfin.au.dk Fri Mar 18 11:53:08 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Fri, 18 Mar 2016 10:53:08 +0000 Subject: [FieldTrip] Postdoc/PhD positions for cortical/retinal oscillation project (Aarhus University, Denmark) In-Reply-To: <9747D2C1-584B-4665-8AEF-D4E62D8F7A74@CFIN.AU.DK> References: <9747D2C1-584B-4665-8AEF-D4E62D8F7A74@CFIN.AU.DK> Message-ID: <25362234-33E5-479A-BE81-73E09411E04E@cfin.au.dk> The Neuroelectromagnetic Oscillations (NEMO) Lab, directed by Sarang Dalal and recently relocated to Aarhus University (Denmark), is recruiting postdocs and PhD students for a large ERC-funded project. The ERC project will examine in detail how neural oscillations communicate information between the retina and cerebral cortex in humans, during presentation of various types of visual stimuli as well as during rest. This will involve several recording techniques, primarily magnetoencephalography (MEG) and electroretinography (ERG), with some components involving scalp EEG, intracranial EEG in epilepsy patients, and transcranial magnetic stimulation (TMS). Our group is part of the Center of Functionally Integrative Neuroscience at Aarhus University, which hosts lab facilities for these techniques, as well as MRI and PET. The working language of the research group and center is English. Qualified applicants will have a background in neuroimaging, systems/cognitive neuroscience, neural signal processing, retinal electrophysiology, or related fields. Start dates can be between summer 2016 and spring 2018, with an initial appointment of 2-3 years (postdoc) or 3 years (PhD student). Applications will be accepted until all positions are filled. For more details, please get in touch with Sarang: sarang at cfin.au.dk . Please feel free to forward to anybody who might be interested! From gunnar.norrman at biling.su.se Fri Mar 18 15:17:51 2016 From: gunnar.norrman at biling.su.se (Gunnar Norrman) Date: Fri, 18 Mar 2016 14:17:51 +0000 Subject: [FieldTrip] Epoching EEG data after downsampling In-Reply-To: References: <1458200183218.67807@biling.su.se>, Message-ID: <1458310671610.29705@biling.su.se> Thank you, Robert, this looks like a nice solution, I will try it out! Best, Gunnar --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Robert Oostenveld Sent: Friday, March 18, 2016 08:50 To: FieldTrip discussion list Subject: Re: [FieldTrip] Epoching EEG data after downsampling Hi Gunnar, This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. cfg = [] cfg = ... data_old = ft_preprocessing(cfg) data_old.label{end+1} = 'sample'; for i=1:size(data_old.sampleinfo,1) % this works for one or more trials data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); end cfg = [] cfg = ... data_new = ft_resampledata(cfg, data_old); The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. best regards, Robert On 17 Mar 2016, at 08:36, Gunnar Norrman > wrote: Hello, I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > In ft_redefinetrial (line 222) Subscripted assignment dimension mismatch. Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? Thank you! Best regards, Gunnar Norrman --- Gunnar Norrman Centre for Research on Bilingualism, Stockholm University +46 (0)8 16 3643 | gunnar.norrman at biling.su.se _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From paolo.belardinelli at gmail.com Fri Mar 18 15:35:54 2016 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 18 Mar 2016 15:35:54 +0100 Subject: [FieldTrip] Problem with Template Model for Source Reconstruction In-Reply-To: <56C58A7A.9000207@uni-konstanz.de> References: <56C58A7A.9000207@uni-konstanz.de> Message-ID: Dear Britta, I was deeply involved in the processing and I forgot to update this post. Thank you: it worked out! Eliminating the bias from MRI images (using light/very light regularization) leads to more accurate grids and correct results. Best, Paolo On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < britta.westner at uni-konstanz.de> wrote: > Dear Paolo, > > I experienced similar problems and found that correcting the field bias in > the participant's MRI (e.g. doing a "bias correction" with SPM) can help. > My explanation would be that the field bias either leads to small > inaccuracies in the segmentation and volume which then "get visible" when > warping the grid based on the non-segmented MRI, or that the warping > algorithm itself is affected by this bias. Maybe you can give that a try! > > Hope this helps, > Britta > > > > > Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: > > Dear Fieldtrippers, > we are encountering a problem with a template model for source > reconstruction. In particular, we are warping (non linearly) a template > grid to the individual subject's MRI. > Doing that, it appears that the very top of the brain is not fully covered > by dipole locations. > We found that this issue has been already reported: > > http://www.fieldtriptoolbox.org/template/sourcemodel > > Apparently, since March 7th 2013, this issue has been fixed. > However we are using August 28th 2015 Fieldtrip version and we are still > dealing with the same issue. > Any suggestions? > Here are our code lines: > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 6; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri_spm; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > sourcemodel = ft_prepare_sourcemodel(cfg); > > Thank you in advance. > > Paolo > > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Britta Westner, M.Sc. > Neuroelectromagnetic Oscillations Laboratory > > Fachbereich Psychologie > Universität Konstanz > Postfach 905 > 78457 Konstanz > > Telefon: +49-(0)7531-88-5703 > Fax: +49-(0)7531-88-5709 > www.psychologie.uni-konstanz.de/nemo-lab > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- -- Paolo Belardinelli, PhD Neurology Department University Hospital Tuebingen Eberhard Karls University Tuebingen Hoppe-Seyler Str. 3 D-72076 Tuebingen Tel: +49 7071 / 29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Fri Mar 18 16:12:01 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Fri, 18 Mar 2016 16:12:01 +0100 Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> References: <2134508129.2232424.1458154500059.JavaMail.yahoo@mail.yahoo.com> <429B6232-178E-4F15-BDC7-0DA215287672@donders.ru.nl> Message-ID: Dear Sarang and Robert, thank you for youe suggestions. I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. Namely, when I try to construct the header with hdr = ft_fetch_header(data) it says: Error using ft_checkdata (line 464) This function requires raw data as input. Error in ft_fetch_header (line 32) data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes'); Thank you again for any suggestion. Cheers, Federica 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > Hi Frederica, > > Please look at the FAQ How can I convert one dataformat into an other? > > > best regards, > Robert > > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > Hi Maité, > > thank you for the suggestion. I don't have the access to BESA now, so I > wished I could work it out with Matlab and related toolboxes. > > Best regards, > Federica > > 2016-03-16 19:55 GMT+01:00 Maité Crespo García : > >> Hi Federica, >> >> If you have access to BESA, you could import txt files and export them as >> edf. >> >> Best, >> Maite >> >> >> El Miércoles 16 de marzo de 2016 18:57, Federica Mauro < >> federica.ma at gmail.com> escribió: >> >> >> Dear all, >> I'm trying to convert txt files of web recordings in the edf format, but >> I didn't find a any useful solution until now. >> Do you have any suggestion? >> Thank you very much in advance. >> Bests, >> Federica >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 olga.v.sysoeva at gmail.com Fri Mar 18 16:29:10 2016 From: olga.v.sysoeva at gmail.com (Olga Sysoeva) Date: Fri, 18 Mar 2016 18:29:10 +0300 Subject: [FieldTrip] source grand average problem Message-ID: Dear FieldTrippers, I face the problem with source grand average. I use data after volumenormalization, but sourcegrandaverage function report that input files are vary in inside field? Why it might be the case? Best Regards, Olga Sysoeva. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maity_winky at yahoo.es Fri Mar 18 16:48:33 2016 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Fri, 18 Mar 2016 15:48:33 +0000 (UTC) Subject: [FieldTrip] EEG txt files conversion to .Edf In-Reply-To: References: Message-ID: <484823217.1695076.1458316113761.JavaMail.yahoo@mail.yahoo.com> Hi Federica, when you open the .txt file in notepad, does it have any additional information apart from numeric values? If yes, then you should try another Matlab function for importing the data. If not, then you should find out relevant information, such as sampling rate, time, the labels of the channels, the number of trials, etc. Then, you could build your own data structure inside Matlab and save this file as edf with Fieldtrip. El Viernes 18 de marzo de 2016 16:33, Federica Mauro escribió: Dear Sarang and Robert, thank you for youe suggestions. I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. Namely, when I try to construct the header with hdr = ft_fetch_header(data) it says: Error using ft_checkdata (line 464) This function requires raw data as input. Error in ft_fetch_header (line 32) data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes'); Thank you again for any suggestion. Cheers, Federica 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : Hi Frederica, Please look at the FAQ How can I convert one dataformat into an other? best regards,Robert On 17 Mar 2016, at 15:55, Federica Mauro wrote: Hi Maité, thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. Best regards,Federica 2016-03-16 19:55 GMT+01:00 Maité Crespo García : Hi Federica, If you have access to BESA, you could import txt files and export them as edf. Best,Maite El Miércoles 16 de marzo de 2016 18:57, Federica Mauro escribió: Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. Do you have any suggestion?Thank you very much in advance.Bests, Federica _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From fosco.bernasconi at gmail.com Fri Mar 18 16:49:33 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Fri, 18 Mar 2016 16:49:33 +0100 Subject: [FieldTrip] Error in ft_sourceinterpolate Message-ID: Dear all, I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate: * Reference to non-existent field 'avg'.Error in getsubfield (line 45) s = s.(t{k});Error in ft_sourceinterpolate (line 209) if ~iscell(getsubfield(functional, cfg.parameter{i}))* If I check my source structure I do have the avg field. source = freq: 10 cumtapcnt: [157x1 double] dim: [18 21 18] inside: [6804x1 logical] pos: [6804x3 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] Any suggestion? Thank you for your help! Best, fosco here the rest of my code: load('standard_bem.mat'); load('standard_sourcemodel3d10mm.mat'); templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; template_mri = ft_read_mri(templatefile); template_mri = ft_convert_units(template_mri,'mm'); template_mri.coordsys = 'spm'; cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = template_mri; sourcemodel = ft_prepare_sourcemodel(cfg,freq); sourcemodel = ft_convert_units(sourcemodel,'mm'); cfg = []; cfg.elec = sens; cfg.channel = sens.label; cfg.headmodel = vol; cfg.grid = sourcemodel; cfg.grid.unit = 'mm';% same unit as above, i.e. in cm lf = ft_prepare_leadfield(cfg,freq); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft{1,1}); % compute source reconstruction cfg = []; cfg.frequency = freq.freq; cfg.method = 'pcc'; cfg.grid = lf; cfg.headmodel = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); % and provide mni template source_proj.dim = sourcemodel.dim; source_proj.pos = sourcemodel.pos; cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.nai'; source_int = ft_sourceinterpolate(cfg,source,template_mri); -------------- next part -------------- An HTML attachment was scrubbed... URL: From gina.joue at univr.it Fri Mar 18 19:08:42 2016 From: gina.joue at univr.it (gj) Date: Fri, 18 Mar 2016 19:08:42 +0100 Subject: [FieldTrip] import own format (long trials) In-Reply-To: <56E9A0EE.3060006@univr.it> References: <56E9A0EE.3060006@univr.it> Message-ID: <56EC442A.50605@univr.it> In case anyone else is having the same problem, my mistake was how I set "data.time". According to the FT Wiki, "data.time" should be a "cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1*Nsamples vector" but it should be in seconds and I had specified it in number of samples instead, which triggered the error Error using ft_specest_mtmfft (line 96) "the padding that you specified is shorter than the data On 16/03/16 19:07, gj wrote: > Hi, > > I am trying to import EEG data preprocessed and averaged in BrainVision > Analyzer. I have a 2-second segment of data per condition per subject > which corresponds to the averaged signal across all trials of each > condition for the subject. > > Is the following approach correct? > > Import the 4 conditions as 4 long trials (2 sec or 2000 samples with > sampling freq of 1000 Hz) > => data.trial is a 1x4 cell array > and each cell array contains an nchan x 2000 matrix > > I am trying to fill in the other fields of the data structure to mimic > FieldTrip's raw data but I think I am having problems with > data.sampleinfo > which, if I understand correctly, needs to be specified for long trials. > > According to the wiki, this should be an array containing [startsample > endsample] to specify the position of each trial, with info for each > trial on every row. However, it doesn't seem right to have > data.sampleinfo = repmat([1 2000],4,1) > > Thanks in advance for any help! > Gina From hibafouani123 at hotmail.com Sun Mar 20 13:29:43 2016 From: hibafouani123 at hotmail.com (hiba fouani) Date: Sun, 20 Mar 2016 12:29:43 +0000 Subject: [FieldTrip] Mechanical localization In-Reply-To: References: Message-ID: Dear Fieldtripper, Is there a tool for localized the mechanical activity in another word does there is a mechanical forward problem and mechanical inverse problem? thank you Hiba > From: fieldtrip-request at science.ru.nl > Subject: fieldtrip Digest, Vol 64, Issue 25 > To: fieldtrip at science.ru.nl > Date: Sat, 19 Mar 2016 12:00:02 +0100 > > 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. Re: Epoching EEG data after downsampling (Gunnar Norrman) > 2. Re: Problem with Template Model for Source Reconstruction > (Paolo Belardinelli) > 3. Re: EEG txt files conversion to .Edf (Federica Mauro) > 4. source grand average problem (Olga Sysoeva) > 5. Re: EEG txt files conversion to .Edf (Mait? Crespo Garc?a) > 6. Error in ft_sourceinterpolate (fosco bernasconi) > 7. Re: import own format (long trials) (gj) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 18 Mar 2016 14:17:51 +0000 > From: Gunnar Norrman > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Epoching EEG data after downsampling > Message-ID: <1458310671610.29705 at biling.su.se> > Content-Type: text/plain; charset="iso-8859-1" > > Thank you, Robert, this looks like a nice solution, I will try it out! > > > Best, > > Gunnar > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > ________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of Robert Oostenveld > Sent: Friday, March 18, 2016 08:50 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Epoching EEG data after downsampling > > Hi Gunnar, > > This is a known challenge, especially for large datasets. Your considerations for the filtering during preprocessing are well taken. Since different resampling methods can be used with either integer or fractional resamling ratio's, it is not completely straightforward for to specify how the old and new samples map to each other. > > However, a trick is to add a channel to your original data that contains the sample indices of the original dataset. E.g. > > cfg = [] > cfg = ... > data_old = ft_preprocessing(cfg) > > data_old.label{end+1} = 'sample'; > for i=1:size(data_old.sampleinfo,1) > % this works for one or more trials > data_old.trial{i}(end+1,:) = data_old.sampleinfo(i,1):data_old.sampleinfo(i,2); > end > > cfg = [] > cfg = ... > data_new = ft_resampledata(cfg, data_old); > > The effect is that the linearly increasing sample channel also gets downsampled. In data_new you can subsequently look up the mapping between the new (index) and the old (value) samples. > > best regards, > Robert > > > > > On 17 Mar 2016, at 08:36, Gunnar Norrman > wrote: > > Hello, > > I have a set of BioSemi EEG data that I want to import, downsample and high pass filter as continuous data before epoching. However, when I load the original triggers from the .bsd file they are still in the original sample frequency, and when I want to apply the trials (extracted using ft_definetrial) using ft_redefinetrial, I get the following error: > > > In ft_redefinetrial (line 222) > Subscripted assignment dimension mismatch. > > Now, the obvious solution would be to downsample the data after epoching, of course, but then highpass filtering (in the original sample rate) takes a very long time to complete. I also want to save the continuous, filtered and downsampled data before epoching for plotting. > > Any suggestions? Is there any way to change the sample rate of the trial definitions, or to load the continuous data including trial information prior to downsampling? > > Thank you! > > Best regards, > Gunnar Norrman > > --- > Gunnar Norrman > Centre for Research on Bilingualism, Stockholm University > +46 (0)8 16 3643 | gunnar.norrman at biling.su.se > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Fri, 18 Mar 2016 15:35:54 +0100 > From: Paolo Belardinelli > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Template Model for Source > Reconstruction > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Britta, > I was deeply involved in the processing and I forgot to update this post. > Thank you: it worked out! > Eliminating the bias from MRI images (using light/very light > regularization) leads to more accurate grids and correct results. > > Best, > > Paolo > > > > On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < > britta.westner at uni-konstanz.de> wrote: > > > Dear Paolo, > > > > I experienced similar problems and found that correcting the field bias in > > the participant's MRI (e.g. doing a "bias correction" with SPM) can help. > > My explanation would be that the field bias either leads to small > > inaccuracies in the segmentation and volume which then "get visible" when > > warping the grid based on the non-segmented MRI, or that the warping > > algorithm itself is affected by this bias. Maybe you can give that a try! > > > > Hope this helps, > > Britta > > > > > > > > > > Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: > > > > Dear Fieldtrippers, > > we are encountering a problem with a template model for source > > reconstruction. In particular, we are warping (non linearly) a template > > grid to the individual subject's MRI. > > Doing that, it appears that the very top of the brain is not fully covered > > by dipole locations. > > We found that this issue has been already reported: > > > > http://www.fieldtriptoolbox.org/template/sourcemodel > > > > Apparently, since March 7th 2013, this issue has been fixed. > > However we are using August 28th 2015 Fieldtrip version and we are still > > dealing with the same issue. > > Any suggestions? > > Here are our code lines: > > > > cfg = []; > > cfg.grid.warpmni = 'yes'; > > cfg.resolution = 6; % resolution of the template grid in mm > > cfg.grid.nonlinear = 'yes'; % use non linear normalization > > cfg.mri = mri_spm; % use subject's mri in mni coordinates > > cfg.grid.unit = 'mm'; > > sourcemodel = ft_prepare_sourcemodel(cfg); > > > > Thank you in advance. > > > > Paolo > > > > > > > > > > -- > > -- > > Paolo Belardinelli, PhD > > Neurology Department > > University Hospital Tuebingen > > Eberhard Karls University Tuebingen > > Hoppe-Seyler Str. 3 > > D-72076 Tuebingen > > Tel: +49 7071 / 29 80478 > > > > > > > > _______________________________________________ > > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Britta Westner, M.Sc. > > Neuroelectromagnetic Oscillations Laboratory > > > > Fachbereich Psychologie > > Universit?t Konstanz > > Postfach 905 > > 78457 Konstanz > > > > Telefon: +49-(0)7531-88-5703 > > Fax: +49-(0)7531-88-5709 > > www.psychologie.uni-konstanz.de/nemo-lab > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Fri, 18 Mar 2016 16:12:01 +0100 > From: Federica Mauro > To: FieldTrip discussion list > Subject: Re: [FieldTrip] EEG txt files conversion to .Edf > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Sarang and Robert, > > thank you for youe suggestions. > > I've been working on them, but it seems that my main problem is I don't > have an header for my data. And at the moment I don't have any clue on how > to get it. > > Basically, when I success in load the data matrix on Matlab, it has the > dimensions of <5192001x5 double>, and this doesn't fit with any format > recognized by Fieldtrip. > Namely, when I try to construct the header with > > hdr = ft_fetch_header(data) > > it says: Error using ft_checkdata (line 464) > This function requires raw data as input. > > Error in ft_fetch_header (line 32) > data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', > 'yes'); > > Thank you again for any suggestion. > > Cheers, > > Federica > > > 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > > > Hi Frederica, > > > > Please look at the FAQ How can I convert one dataformat into an other? > > > > > > best regards, > > Robert > > > > > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > > > Hi Mait?, > > > > thank you for the suggestion. I don't have the access to BESA now, so I > > wished I could work it out with Matlab and related toolboxes. > > > > Best regards, > > Federica > > > > 2016-03-16 19:55 GMT+01:00 Mait? Crespo Garc?a : > > > >> Hi Federica, > >> > >> If you have access to BESA, you could import txt files and export them as > >> edf. > >> > >> Best, > >> Maite > >> > >> > >> El Mi?rcoles 16 de marzo de 2016 18:57, Federica Mauro < > >> federica.ma at gmail.com> escribi?: > >> > >> > >> Dear all, > >> I'm trying to convert txt files of web recordings in the edf format, but > >> I didn't find a any useful solution until now. > >> Do you have any suggestion? > >> Thank you very much in advance. > >> Bests, > >> Federica > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> 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: > > ------------------------------ > > Message: 4 > Date: Fri, 18 Mar 2016 18:29:10 +0300 > From: Olga Sysoeva > To: FieldTrip discussion list > Subject: [FieldTrip] source grand average problem > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear FieldTrippers, > > I face the problem with source grand average. I use data after > volumenormalization, but sourcegrandaverage function report that input > files are vary in inside field? Why it might be the case? > > Best Regards, > Olga Sysoeva. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 5 > Date: Fri, 18 Mar 2016 15:48:33 +0000 (UTC) > From: Mait? Crespo Garc?a > To: FieldTrip discussion list > Subject: Re: [FieldTrip] EEG txt files conversion to .Edf > Message-ID: > <484823217.1695076.1458316113761.JavaMail.yahoo at mail.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Hi Federica, > when you open the .txt file in notepad, does it have any additional information apart from numeric values? If yes, then you should try another Matlab function for importing the data. If not, then you should find out relevant information, such as sampling rate, time, the labels of the channels, the number of trials, etc. Then, you could build your own data structure inside Matlab and save this file as edf with Fieldtrip. > > > El Viernes 18 de marzo de 2016 16:33, Federica Mauro escribi?: > > > Dear Sarang and Robert, > > thank you for youe suggestions. > > I've been working on them, but it seems that my main problem is I don't have an header for my data. And at the moment I don't have any clue on how to get it. > > Basically, when I success in load the data matrix on Matlab, it has the dimensions of <5192001x5 double>, and this doesn't fit with any format recognized by Fieldtrip. > Namely, when I try to construct the header with > hdr = ft_fetch_header(data) > > it says: Error using ft_checkdata (line 464) > This function requires raw data as input. > > Error in ft_fetch_header (line 32) > data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', > 'yes'); > > Thank you again for any suggestion. > > Cheers, > Federica > > 2016-03-18 8:38 GMT+01:00 Robert Oostenveld : > > Hi Frederica, > Please look at the FAQ?How can I convert one dataformat into an other? > best regards,Robert > > On 17 Mar 2016, at 15:55, Federica Mauro wrote: > > Hi Mait?, > thank you for the suggestion. I don't have the access to BESA now, so I wished I could work it out with Matlab and related toolboxes. > Best regards,Federica > 2016-03-16 19:55 GMT+01:00 Mait? Crespo Garc?a : > > Hi Federica, > If you have access to BESA, you could import txt files and export them as edf. > Best,Maite > > > El Mi?rcoles 16 de marzo de 2016 18:57, Federica Mauro escribi?: > > > Dear all,I'm trying to convert txt files of web recordings in the edf format, but I didn't find a any useful solution until now. > Do you have any suggestion?Thank you very much in advance.Bests, > Federica > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 6 > Date: Fri, 18 Mar 2016 16:49:33 +0100 > From: fosco bernasconi > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Error in ft_sourceinterpolate > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear all, > > I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I > have an error when calling ft_sourceinterpolate: > > > > > > * Reference to non-existent field 'avg'.Error in getsubfield (line 45) s = > s.(t{k});Error in ft_sourceinterpolate (line 209) if > ~iscell(getsubfield(functional, cfg.parameter{i}))* > > > If I check my source structure I do have the avg field. > > source = > freq: 10 > cumtapcnt: [157x1 double] > dim: [18 21 18] > inside: [6804x1 logical] > pos: [6804x3 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > > Any suggestion? > > Thank you for your help! > Best, > fosco > > > here the rest of my code: > > > load('standard_bem.mat'); > load('standard_sourcemodel3d10mm.mat'); > > templatefile = > '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; > template_mri = ft_read_mri(templatefile); > template_mri = ft_convert_units(template_mri,'mm'); > template_mri.coordsys = 'spm'; > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = template_mri; > sourcemodel = ft_prepare_sourcemodel(cfg,freq); > sourcemodel = ft_convert_units(sourcemodel,'mm'); > > cfg = []; > cfg.elec = sens; > cfg.channel = sens.label; > cfg.headmodel = vol; > cfg.grid = sourcemodel; > cfg.grid.unit = 'mm';% same unit as above, i.e. in cm > lf = ft_prepare_leadfield(cfg,freq); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 10; > freq = ft_freqanalysis(cfg,dataft{1,1}); > > % compute source reconstruction > cfg = []; > cfg.frequency = freq.freq; > cfg.method = 'pcc'; > cfg.grid = lf; > cfg.headmodel = vol; > cfg.keeptrials = 'yes'; > cfg.pcc.lambda = '5%'; > cfg.pcc.projectnoise = 'yes'; > source = ft_sourceanalysis(cfg,freq); > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > % and provide mni template > source_proj.dim = sourcemodel.dim; > source_proj.pos = sourcemodel.pos; > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.nai'; > source_int = ft_sourceinterpolate(cfg,source,template_mri); > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 7 > Date: Fri, 18 Mar 2016 19:08:42 +0100 > From: gj > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] import own format (long trials) > Message-ID: <56EC442A.50605 at univr.it> > Content-Type: text/plain; charset=utf-8; format=flowed > > In case anyone else is having the same problem, my mistake was how I set > "data.time". > > According to the FT Wiki, "data.time" should be a "cell-array containing > a time axis for each trial (1 X Ntrial), each time axis is a 1*Nsamples > vector" > > but it should be in seconds and I had specified it in number of samples > instead, which triggered the error > > Error using ft_specest_mtmfft (line 96) > "the padding that you specified is shorter than the data > > > On 16/03/16 19:07, gj wrote: > > Hi, > > > > I am trying to import EEG data preprocessed and averaged in BrainVision > > Analyzer. I have a 2-second segment of data per condition per subject > > which corresponds to the averaged signal across all trials of each > > condition for the subject. > > > > Is the following approach correct? > > > > Import the 4 conditions as 4 long trials (2 sec or 2000 samples with > > sampling freq of 1000 Hz) > > => data.trial is a 1x4 cell array > > and each cell array contains an nchan x 2000 matrix > > > > I am trying to fill in the other fields of the data structure to mimic > > FieldTrip's raw data but I think I am having problems with > > data.sampleinfo > > which, if I understand correctly, needs to be specified for long trials. > > > > According to the wiki, this should be an array containing [startsample > > endsample] to specify the position of each trial, with info for each > > trial on every row. However, it doesn't seem right to have > > data.sampleinfo = repmat([1 2000],4,1) > > > > Thanks in advance for any help! > > Gina > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 64, Issue 25 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Sun Mar 20 16:19:50 2016 From: jens.klinzing at uni-tuebingen.de (=?UTF-8?B?IkplbnMgS2xpbnppbmcsIFVuaXZlcnNpdMOkdCBUw7xiaW5nZW4i?=) Date: Sun, 20 Mar 2016 16:19:50 +0100 Subject: [FieldTrip] Elements have wrong orientation or are degenerated In-Reply-To: References: Message-ID: <56EEBF96.7000805@uni-tuebingen.de> Hi Andreas, I got the same error but it was resolved by applying ft_volumereslice to the mri before segmentation. This is also what they do in the FEM tutorial: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_fem ...however I didn't do it at first because the segmentation looked fine even without it. Another difference between your and my code is that you directly call ft_headmodel_simbio while I call the higher-level function ft_prepare_headmodel but I didn't check whether that makes a difference. I also don't know if the solution applies to your particular case (restriction to a subvolume with two tissue types). All the best, Jens Horn, Andreas wrote: > Hello everybody, > > I am new to fieldtrip and want to use it (and simbio) to forward model the current spread of a known dipole. I consider only a small cubic fraction of brain tissue which I so far have divided in gray and white matter. I pass that cubic volume into ft_prepare_mesh and get a hexahedral mesh without error. ft_plot_mesh also shows the correct mesh. However, once I pass the mesh into ft_headmodel_simbio, I get the error > > ‘Elements have wrong orientation or are degenerated’ > > Does anyone have an idea of why this could happen and how I could potentially fix the issue? > > Thanks a lot, > > Andreas > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From paolo.belardinelli at gmail.com Sun Mar 20 19:25:36 2016 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Sun, 20 Mar 2016 19:25:36 +0100 Subject: [FieldTrip] Problem with Template Model for Source Reconstruction In-Reply-To: References: <56C58A7A.9000207@uni-konstanz.de> Message-ID: Dear Britta, I have been working with the bias correction of my subject's MRI these days, and while working extremely well for some of them, some others appear to be even worse after correction. I don't have much experience with MRI images, so maybe the combination of parameters that I am setting may be not optimal. At the moment, I am playing around with the Bias correction parameter (from extremely light to no correction) and the FWHM bias (from 30mm to 150mm). In the original images I can see some non-uniformity in terms of contrast and usually they look quite smooth/low frequency to me. After correction I can observe an improvement in the MRI images themselves, but no improvement or even worsening in terms of not covered surface in the source localization. Do you have any suggestion how to find some quantificable parameters to help me out in this procedure? How can I quickly check whether the quality of the image is enough to guarantee that the cortex is fully covered, without going through the whole forward model production? Sometimes, even though the grid is well positioned, I still have the aforementioned problem. Best wishes, Paolo On Fri, Mar 18, 2016 at 3:35 PM, Paolo Belardinelli < paolo.belardinelli at gmail.com> wrote: > Dear Britta, > I was deeply involved in the processing and I forgot to update this post. > Thank you: it worked out! > Eliminating the bias from MRI images (using light/very light > regularization) leads to more accurate grids and correct results. > > Best, > > Paolo > > > > On Thu, Feb 18, 2016 at 10:10 AM, Britta Westner < > britta.westner at uni-konstanz.de> wrote: > >> Dear Paolo, >> >> I experienced similar problems and found that correcting the field bias >> in the participant's MRI (e.g. doing a "bias correction" with SPM) can >> help. My explanation would be that the field bias either leads to small >> inaccuracies in the segmentation and volume which then "get visible" when >> warping the grid based on the non-segmented MRI, or that the warping >> algorithm itself is affected by this bias. Maybe you can give that a try! >> >> Hope this helps, >> Britta >> >> >> >> >> Am 17.02.2016 um 20:20 schrieb Paolo Belardinelli: >> >> Dear Fieldtrippers, >> we are encountering a problem with a template model for source >> reconstruction. In particular, we are warping (non linearly) a template >> grid to the individual subject's MRI. >> Doing that, it appears that the very top of the brain is not fully >> covered by dipole locations. >> We found that this issue has been already reported: >> >> http://www.fieldtriptoolbox.org/template/sourcemodel >> >> Apparently, since March 7th 2013, this issue has been fixed. >> However we are using August 28th 2015 Fieldtrip version and we are still >> dealing with the same issue. >> Any suggestions? >> Here are our code lines: >> >> cfg = []; >> cfg.grid.warpmni = 'yes'; >> cfg.resolution = 6; % resolution of the template grid in mm >> cfg.grid.nonlinear = 'yes'; % use non linear normalization >> cfg.mri = mri_spm; % use subject's mri in mni coordinates >> cfg.grid.unit = 'mm'; >> sourcemodel = ft_prepare_sourcemodel(cfg); >> >> Thank you in advance. >> >> Paolo >> >> >> >> >> -- >> -- >> Paolo Belardinelli, PhD >> Neurology Department >> University Hospital Tuebingen >> Eberhard Karls University Tuebingen >> Hoppe-Seyler Str. 3 >> D-72076 Tuebingen >> Tel: +49 7071 / 29 80478 >> >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -- >> Britta Westner, M.Sc. >> Neuroelectromagnetic Oscillations Laboratory >> >> Fachbereich Psychologie >> Universität Konstanz >> Postfach 905 >> 78457 Konstanz >> >> Telefon: +49-(0)7531-88-5703 >> Fax: +49-(0)7531-88-5709 >> www.psychologie.uni-konstanz.de/nemo-lab >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > -- > Paolo Belardinelli, PhD > Neurology Department > University Hospital Tuebingen > Eberhard Karls University Tuebingen > Hoppe-Seyler Str. 3 > D-72076 Tuebingen > Tel: +49 7071 / 29 80478 > > -- -- Paolo Belardinelli, PhD Neurology Department University Hospital Tuebingen Eberhard Karls University Tuebingen Hoppe-Seyler Str. 3 D-72076 Tuebingen Tel: +49 7071 / 29 80478 -------------- next part -------------- An HTML attachment was scrubbed... URL: From harold.cav89 at gmail.com Mon Mar 21 12:57:53 2016 From: harold.cav89 at gmail.com (Harold Cavendish) Date: Mon, 21 Mar 2016 12:57:53 +0100 Subject: [FieldTrip] Correlation with a behavioural variable in the source space? Message-ID: Dear FieldTrip users, can I do a correlation test with a behavioural variable in the source space using ft_statfun_correlationT? I want to do the same as in sensor space but use voxels instead of electrodes. How can I define a region of interest to limit the number of tests? My current approach is to compute the inverse solution using cfg = []; cfg.method = 'mne'; cfg.grid = leadfield; cfg.headmodel = vol; cfg.mne.prewhiten = 'yes'; cfg.mne.lambda = 3; cfg.mne.scalesourcecov = 'yes'; cfg.rawtrial = 'yes'; cfg.keeptrial = 'yes'; source = ft_sourceanalysis(cfg, timelock); and then simply call cfg = []; cfg.statistic = 'ft_statfun_correlationT'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.design = [1.457 1.214 2.477 5.441 …]; cfg.ivar = 1; cfg.alpha = 0.05; cfg.tail = 0; cfg.correcttail = 'alpha'; stat = ft_sourcestatistics(cfg, source); but Matlab just remains busy and nothing happens. Thank you. Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Mon Mar 21 17:08:51 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 12:08:51 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space Message-ID: Hi All, Is there any standard procedure (in Fieldtrip) for extracting virtual (source) time series from ROIs in Talariach or MNI space? Thank you -Vasan -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Mar 21 17:35:52 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 09:35:52 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hey Vasan, This page ("Extract the virtual channel time-series" section) provides an example: http://www.fieldtriptoolbox.org/tutorial/connectivity Arjen 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi All, > > Is there any standard procedure (in Fieldtrip) for extracting virtual > (source) time series from ROIs in Talariach or MNI space? > > Thank you > > -Vasan > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Mon Mar 21 17:40:37 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 12:40:37 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hi Arjen, The example scripts are for on the individual "subject space". I want to do the source analysis and also extracting time series for any ROIs in MNI space. -Vasan On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: > Hey Vasan, > > This page ("Extract the virtual channel time-series" section) provides an > example: > http://www.fieldtriptoolbox.org/tutorial/connectivity > > Arjen > > 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi All, >> >> Is there any standard procedure (in Fieldtrip) for extracting virtual >> (source) time series from ROIs in Talariach or MNI space? >> >> Thank you >> >> -Vasan >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 a.stolk8 at gmail.com Mon Mar 21 17:51:55 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 09:51:55 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hey Vasan, One way to do that is by 'normalizing' the subject's grid such that its points relate to specific points in MNI space. The procedure is described here: http://www.fieldtriptoolbox.org/tutorial/sourcemodel Using ft_volumelookup you can subsequently find the subject's grid points (now in MNI space) belonging to ROIs. Hope that helps, Arjen 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi Arjen, > > The example scripts are for on the individual "subject space". I want to > do the source analysis and also extracting time series for any ROIs in MNI > space. > > -Vasan > > On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: > >> Hey Vasan, >> >> This page ("Extract the virtual channel time-series" section) provides an >> example: >> http://www.fieldtriptoolbox.org/tutorial/connectivity >> >> Arjen >> >> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >> sreenivasan.r.nadar at gmail.com>: >> >>> Hi All, >>> >>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>> (source) time series from ROIs in Talariach or MNI space? >>> >>> Thank you >>> >>> -Vasan >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 sreenivasan.r.nadar at gmail.com Mon Mar 21 18:17:39 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Mon, 21 Mar 2016 13:17:39 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: Message-ID: Hi Arjen, Thank you. I tried the method give in that link with ft_volumelookup for ROIs in MNI space and make a new leadfield for the ROIs and use the following commands for visualization: figure; hold on; ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); However, this method doesn't work properly as the grid sometime do not fall in the expected anatomical location. -Vasan On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: > Hey Vasan, > > One way to do that is by 'normalizing' the subject's grid such that its > points relate to specific points in MNI space. The procedure is described > here: > http://www.fieldtriptoolbox.org/tutorial/sourcemodel > > Using ft_volumelookup you can subsequently find the subject's grid points > (now in MNI space) belonging to ROIs. > > Hope that helps, > Arjen > > 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi Arjen, >> >> The example scripts are for on the individual "subject space". I want to >> do the source analysis and also extracting time series for any ROIs in MNI >> space. >> >> -Vasan >> >> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk wrote: >> >>> Hey Vasan, >>> >>> This page ("Extract the virtual channel time-series" section) provides >>> an example: >>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>> >>> Arjen >>> >>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>> sreenivasan.r.nadar at gmail.com>: >>> >>>> Hi All, >>>> >>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>> (source) time series from ROIs in Talariach or MNI space? >>>> >>>> Thank you >>>> >>>> -Vasan >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 a.stolk8 at gmail.com Mon Mar 21 18:37:00 2016 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 21 Mar 2016 10:37:00 -0700 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> References: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> Message-ID: Hi Vasan, Hard to tell based on this information, but did you copy over the template's dim and pos fields after normalization and/or check for (mis-)matches in geometric units (cm vs. mm) between grids and ROIs? Arjen 2016-03-21 10:17 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < sreenivasan.r.nadar at gmail.com>: > Hi Arjen, > > Thank you. I tried the method give in that link with ft_volumelookup for > ROIs in MNI space and make a new leadfield for the ROIs and use the > following commands for visualization: > > figure; hold on; > ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); > ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); > > However, this method doesn't work properly as the grid sometime do not > fall in the expected anatomical location. > > -Vasan > > On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: > >> Hey Vasan, >> >> One way to do that is by 'normalizing' the subject's grid such that its >> points relate to specific points in MNI space. The procedure is described >> here: >> http://www.fieldtriptoolbox.org/tutorial/sourcemodel >> >> Using ft_volumelookup you can subsequently find the subject's grid points >> (now in MNI space) belonging to ROIs. >> >> Hope that helps, >> Arjen >> >> 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >> sreenivasan.r.nadar at gmail.com>: >> >>> Hi Arjen, >>> >>> The example scripts are for on the individual "subject space". I want to >>> do the source analysis and also extracting time series for any ROIs in MNI >>> space. >>> >>> -Vasan >>> >>> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk >>> wrote: >>> >>>> Hey Vasan, >>>> >>>> This page ("Extract the virtual channel time-series" section) provides >>>> an example: >>>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>>> >>>> Arjen >>>> >>>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>>> sreenivasan.r.nadar at gmail.com>: >>>> >>>>> Hi All, >>>>> >>>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>>> (source) time series from ROIs in Talariach or MNI space? >>>>> >>>>> Thank you >>>>> >>>>> -Vasan >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> 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 joseluisblues at gmail.com Tue Mar 22 11:19:38 2016 From: joseluisblues at gmail.com (Jose) Date: Tue, 22 Mar 2016 11:19:38 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel Message-ID: Thanks Robert, It runs better. Still I would like to check some errors I got... When I run "ft_prepare_leadfield" I get: Warning: the selected value 18 should be within the range of the array from 17.8808 to 17.8808 When I run "ft_sourceinterpolate" I get: Warning: could not reshape freq to the expected dimensions Is this something I should worry about?, Or there is something I need to pay attention when I define my FOI?, best, Jose Luis ------------------------------ > > Message: 5 > Date: Fri, 18 Mar 2016 08:36:18 +0100 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] beamforming tutorial - cfg.headmodel > Message-ID: > Content-Type: text/plain; charset="windows-1252" > > Hi Jos? > > The option cfg.vol (for ?volume conduction model?) has been replaced by > cfg.headmodel for quite some time (probably more than a year ago). The code > is backward compatible, so cfg.vol will also still work, but the > documentation reflects the current standard. I suggest you update your copy > of FieldTrip to a more recent version. > > best regards, > Robert > > On 17 Mar 2016, at 20:03, Jose wrote: > > > dear list, > > > > There might be an error in the beamformer tutorial ( > http://www.fieldtriptoolbox.org/tutorial/beamformer). To compute the lead > field and the sources, cfg.vol rather than cfg.headmodel has to be defined > to determine the headmodel. Thanks for corroborating this. > > > > -- > > Jos? > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160318/0074e3e9/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Tue Mar 22 15:48:40 2016 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 22 Mar 2016 15:48:40 +0100 Subject: [FieldTrip] beamforming tutorial - cfg.headmodel In-Reply-To: References: Message-ID: <26A274A1-34A4-4520-89AB-200521B53BFA@donders.ru.nl> Hi Jose Luis yes, you should worry about that. I don’t know whether it leads to errors, but it suggests that you are specifying things in the cfg that cannot be achieved with the data. You want to analyze 18 Hz, whereas the nearest frequency appears to be 17.8808 Hz, which is more than 2Hz off. Please check the frequency axis of your input data. You can always open (in the MATLAB editor) the code that issues the warning, and you can look at the code to try to understand it better. Robert On 22 Mar 2016, at 11:19, Jose wrote: > Thanks Robert, > It runs better. Still I would like to check some errors I got... > > When I run "ft_prepare_leadfield" I get: > Warning: the selected value 18 should be within the range of the array from 17.8808 to 17.8808 > > When I run "ft_sourceinterpolate" I get: > Warning: could not reshape freq to the expected dimensions > > Is this something I should worry about?, Or there is something I need to pay attention when I define my FOI?, > > best, > Jose Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From sreenivasan.r.nadar at gmail.com Tue Mar 22 16:32:01 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Tue, 22 Mar 2016 11:32:01 -0400 Subject: [FieldTrip] extracting virtual time series in MNI space In-Reply-To: References: <71e0832291c44633bee32033eb1b96f1@EXPRD03.hosting.ru.nl> Message-ID: Hi Arjen, Thank you. It worked well after I changed the template grid resolution. Vasan On Mon, Mar 21, 2016 at 1:37 PM, Arjen Stolk wrote: > Hi Vasan, > > Hard to tell based on this information, but did you copy over the > template's dim and pos fields after normalization and/or check for > (mis-)matches in geometric units (cm vs. mm) between grids and ROIs? > > Arjen > > 2016-03-21 10:17 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < > sreenivasan.r.nadar at gmail.com>: > >> Hi Arjen, >> >> Thank you. I tried the method give in that link with ft_volumelookup for >> ROIs in MNI space and make a new leadfield for the ROIs and use the >> following commands for visualization: >> >> figure; hold on; >> ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); >> ft_plot_mesh(lf_new.pos(lf_new.inside,:), 'facecolor','r'); >> >> However, this method doesn't work properly as the grid sometime do not >> fall in the expected anatomical location. >> >> -Vasan >> >> On Mon, Mar 21, 2016 at 12:51 PM, Arjen Stolk wrote: >> >>> Hey Vasan, >>> >>> One way to do that is by 'normalizing' the subject's grid such that its >>> points relate to specific points in MNI space. The procedure is described >>> here: >>> http://www.fieldtriptoolbox.org/tutorial/sourcemodel >>> >>> Using ft_volumelookup you can subsequently find the subject's grid >>> points (now in MNI space) belonging to ROIs. >>> >>> Hope that helps, >>> Arjen >>> >>> 2016-03-21 9:40 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>> sreenivasan.r.nadar at gmail.com>: >>> >>>> Hi Arjen, >>>> >>>> The example scripts are for on the individual "subject space". I want >>>> to do the source analysis and also extracting time series for any ROIs in >>>> MNI space. >>>> >>>> -Vasan >>>> >>>> On Mon, Mar 21, 2016 at 12:35 PM, Arjen Stolk >>>> wrote: >>>> >>>>> Hey Vasan, >>>>> >>>>> This page ("Extract the virtual channel time-series" section) provides >>>>> an example: >>>>> http://www.fieldtriptoolbox.org/tutorial/connectivity >>>>> >>>>> Arjen >>>>> >>>>> 2016-03-21 9:08 GMT-07:00 Sreenivasan R. Nadar, Ph.D. < >>>>> sreenivasan.r.nadar at gmail.com>: >>>>> >>>>>> Hi All, >>>>>> >>>>>> Is there any standard procedure (in Fieldtrip) for extracting virtual >>>>>> (source) time series from ROIs in Talariach or MNI space? >>>>>> >>>>>> Thank you >>>>>> >>>>>> -Vasan >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Tue Mar 22 20:09:06 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Tue, 22 Mar 2016 19:09:06 +0000 (UTC) Subject: [FieldTrip] Dipole Moment Question from forward simulated data example References: <1602509026.3378850.1458673747178.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> I am working on simulated data example provided in the fieldtrip toolbox webpage. When I find the dipole moment after dipole fitting is [-1 0 0], where as original dipole mom was [1 0 0]. I was not sure if I am calculated dipole moment correctly. Any help would be appreciated.Thank you. Srinivas % http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % create a set of electrodes, randomly placed on the sphereelec = [];elec.pnt = randn(128,3);dum = sqrt(sum(elec.pnt.^2,2));elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit spherefor i=1:128 elec.label{i} = sprintf('%03d', i);end vol = [];vol.r = [0.88 0.92 1.00]; % radii of spheresvol.cond = [1 1/80 1]; % conductivityvol.o = [0 0 0]; % center of sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % create a dipole simulation with one dipole and a 10Hz sine wavecfg = [];cfg.vol = vol; % see abovecfg.elec = elec; % see abovecfg.dip.pos = [0 0.5 0.3];cfg.dip.mom = [1 0 0]'; % note, it should be transposedcfg.dip.frequency = 10;cfg.ntrials = 1;cfg.triallength = 1; % secondscfg.fsample = 250; % Hzraw1 = ft_dipolesimulation(cfg);avg1 = ft_timelockanalysis([], raw1);plot(avg1.time, avg1.avg); % plot the timecourse % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % do a dipole fit of the first simulated datasetcfg = [];cfg.vol = vol; % see abovecfg.elec = elec; % see abovecfg.dip.pos = [0 0 0]; % initial search positioncfg.gridsearch = 'no';dip1 = ft_dipolefitting(cfg, avg1); [u,s,v] = svd(dip1.dip.mom); if s(1,1) > s(2,2) dipole_orientation = u(:,1); end -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Wed Mar 23 10:35:10 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Wed, 23 Mar 2016 10:35:10 +0100 Subject: [FieldTrip] Dipole Moment Question from forward simulated data example In-Reply-To: <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> References: <1602509026.3378850.1458673747178.JavaMail.yahoo.ref@mail.yahoo.com> <1602509026.3378850.1458673747178.JavaMail.yahoo@mail.yahoo.com> Message-ID: Dear Srinivas Kota, So what you did here is simulate a dipole which changes its moment over time (refer to help ft_dipolesimulation) So the resulting dipole position it computed is something like [5.2523e-08 0.5000 0.3000]. However if you look at dip1.dip.mom you see it as [3x250 double] matrix. The first entry is the [1 0 0] which you were looking for and all the the other describe the moment at a different timepoint. If you have a quick look at plot(dip1.dip.mom(1,:)) you see the oscillation of the dipole. Bests, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 22 Mar 2016, at 20:09, Srinivas Kota wrote: > > I am working on simulated data example provided in the fieldtrip toolbox webpage. When I find the dipole moment after dipole fitting is [-1 0 0], where as original dipole mom was [1 0 0]. I was not sure if I am calculated dipole moment correctly. Any help would be appreciated. > Thank you. > Srinivas > > % http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % create a set of electrodes, randomly placed on the sphere > elec = []; > elec.pnt = randn(128,3); > dum = sqrt(sum(elec.pnt.^2,2)); > elec.pnt = elec.pnt ./ [dum dum dum]; % scale them to a unit sphere > for i=1:128 > elec.label{i} = sprintf('%03d', i); > end > > vol = []; > vol.r = [0.88 0.92 1.00]; % radii of spheres > vol.cond = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; % center of sphere > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % create a dipole simulation with one dipole and a 10Hz sine wave > cfg = []; > cfg.vol = vol; % see above > cfg.elec = elec; % see above > cfg.dip.pos = [0 0.5 0.3]; > cfg.dip.mom = [1 0 0]'; % note, it should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 1; > cfg.triallength = 1; % seconds > cfg.fsample = 250; % Hz > raw1 = ft_dipolesimulation(cfg); > avg1 = ft_timelockanalysis([], raw1); > plot(avg1.time, avg1.avg); % plot the timecourse > % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % do a dipole fit of the first simulated dataset > cfg = []; > cfg.vol = vol; % see above > cfg.elec = elec; % see above > cfg.dip.pos = [0 0 0]; % initial search position > cfg.gridsearch = 'no'; > dip1 = ft_dipolefitting(cfg, avg1); > [u,s,v] = svd(dip1.dip.mom); > if s(1,1) > s(2,2) > dipole_orientation = u(:,1); > end > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jens.klinzing at uni-tuebingen.de Wed Mar 23 23:52:47 2016 From: jens.klinzing at uni-tuebingen.de (=?ISO-8859-1?Q?=22Jens_Klinzing=2C_Universit=E4t_T=FCbingen=22?=) Date: Wed, 23 Mar 2016 23:52:47 +0100 Subject: [FieldTrip] ft_volumereslice shifts the brain Message-ID: <56F31E3F.1050200@uni-tuebingen.de> Hi everyone, I have a problem with ft_volumereslice, applied to Nifti MRIs (haven't tested it on other formats). The function shifts the image to bring the brain in the center, as announced in the documentation. However, this is done a) in a way that the nose of my MRI is cut off (s. below), which is suboptimal since I register EEG electrodes and fiducials in relation to the MRI and the cut is done close to the nasion, b) in contrast to the documentation it shifts the brain whether or not a coordinate system (.coordsys) is given. I guess this happens during ft_sourceinterpolate which is called inside ft_volumereslice (line 180). The shift that could be done in ft_volumereslice (line 103ff) is not performed if there is no .coordsys, but the shift in the returned MRI is still there. Before and After (without an mri.coordsys): Sure I can just increase the dimensions of the MRI, then I get the nose back, but I was wondering if anyone can explain this behavior of ft_volumereslice and whether it is a genuine bug or not. Thanks and greetings, Jens -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 187055 bytes Desc: not available URL: From mick.lehmann at uzh.ch Thu Mar 24 10:48:57 2016 From: mick.lehmann at uzh.ch (Mick Lehmann) Date: Thu, 24 Mar 2016 10:48:57 +0100 Subject: [FieldTrip] Time Frequency Analysis of <1 Hz Message-ID: <686D5E56-B948-4C9C-9EAB-B56D8EF5F5D6@uzh.ch> Dear FT community, I'm currently analyzing sleep EEG data and therefore I'm also interested in frequency ranges around 0.5/1 Hz. However, when I plot the data, it starts only from 1.25Hz and the cluster-based permutation can't be conducted when I include frequency ranges below 1.5 Hz. Any ideas on this issue based on the information provided blow? Best regards, Mick The raw data was read using the following script: VP = dir('*.dat'); cfg = []; cfg.dataset = (VP.name); % dataset cfg.trialdef.eventtype = 'Comment'; cfg.trialdef.prestim = 3; cfg.trialdef.poststim = 5; cfg.trialdef.eventvalue = {'HitHitReakt_LL' 'GainReakt_LL'}; cfg = ft_definetrial(cfg); cfg.demean = 'yes'; cfg.baselinewindow = [-1 -.1]; HH_SlowOsc = ft_preprocessing(cfg); HH_SlowOsc = renamechannels(HH_SlowOsc); save HH_SlowOsc HH_SlowOsc Afterwards, TF analysis was conducted using this script: load HH_SlowOsc cfg = []; cfg.channel = 'all'; cfg.method = 'wavelet'; cfg.with = 2; HERE, I'VE TRIED 2 AND 7 CYCLES. BOTH DIDN'T WORK cfg.output = 'pow'; cfg.foi = 0.5:0.5:25; % Analysis from 2 to 30 Hz in 0.5 Hz steps cfg.toi = -3:0.05:5; % time window "slides" from -1 to 2 sec in steps of 0.05 sec (50 ms) % cfg.keeptrials = 'yes'; % für Single Trial Analysen TF_HH_SlowOsc = ft_freqanalysis(cfg, HH_SlowOsc); save TF_HH_SlowOsc TF_HH_SlowOsc; -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.pflug at musterkind.eu Thu Mar 24 12:12:27 2016 From: anja.pflug at musterkind.eu (Anja Pflug) Date: Thu, 24 Mar 2016 12:12:27 +0100 (CET) Subject: [FieldTrip] 1. Time Frequency Analysis of <1 Hz (Mick Lehmann) In-Reply-To: References: Message-ID: <1026761282.13417.70730d6f-540f-4503-a1c1-cd834547f92e.open-xchange@email.1und1.de> An HTML attachment was scrubbed... URL: From gina.joue at univr.it Thu Mar 24 12:30:48 2016 From: gina.joue at univr.it (gj) Date: Thu, 24 Mar 2016 12:30:48 +0100 Subject: [FieldTrip] Error with interpn when calling ft_sourceinterpolate Message-ID: <56F3CFE8.5050706@univr.it> Hi FieldTrip community, I am using FieldTrip ver.20160309 and am getting the error: Error using interpn (line 152) Wrong number of input arguments. Error in ft_sourceinterpolate>my_interpn (line 673) av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html Here is my code leading to the error when calling ft_sourceinterpolate: %-- snippet--% % sensor level Fourier spectra cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 13; freqsens = ft_freqanalysis(cfg, data); % source reconstruction cfg = []; cfg.frequency = freqsens.freq; cfg.elec = elec; cfg.method = 'eloreta'; cfg.grid = lf; cfg.vol = vol; cfg.keeptrials = 'yes'; cfg.rawtrial = 'yes'; source = ft_sourceanalysis(cfg, freqsens); % project to direction explaining most source variance cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); source_proj.dim = template_grid.sourcemodel.dim; source_proj.pos = template_grid.sourcemodel.pos; %%....... interpolate onto the MNI template brain cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.pow'; cfg.interpmethod = 'nearest'; source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); %-- end snippet--% Any help greatly appreciated! Gina From eva.patai at psych.ox.ac.uk Thu Mar 24 13:15:00 2016 From: eva.patai at psych.ox.ac.uk (Zita Eva Patai) Date: Thu, 24 Mar 2016 12:15:00 +0000 Subject: [FieldTrip] ft_freqstatistics error when averaged over channels Message-ID: Dear FT-ers I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. Is there an easy way to fix this? I am using the FT inside SPM12. Thanks very much, zita -------------- next part -------------- An HTML attachment was scrubbed... URL: From bushra.riaz at gu.se Thu Mar 24 13:38:07 2016 From: bushra.riaz at gu.se (Bushra Riaz Syeda) Date: Thu, 24 Mar 2016 12:38:07 +0000 Subject: [FieldTrip] error in reading epoched fif files In-Reply-To: <1457937054408.48754@gu.se> References: <7a4b34b1746f48f6b3b1f0d2fcf1731b@EXCH03-P.GU.GU.SE>, <1457937054408.48754@gu.se> Message-ID: <1458823086980.47671@gu.se> Hello, I found the problem with reading epoched fif files This code snippet cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); was giving the following error Error using fiff_read_epochs (line 46) Could not find epochs data This error was caused by this line of code (line 43 in fiff_read_epochs) ep = fiff_dir_tree_find(meas, FIFF.FIFFB_EPOCHS); because the returned structure ep was empty The value of this constant FIFF.FIFFB_EPOCHS is 122 , and in meas there was no block with such id therefore ep was empty The epoched data was in the block with the id 373 By changing line 43 in fiff_read_epochs by this ep = fiff_dir_tree_find(meas, 373); I am able to load the epoched data Kind regards Bushra Riaz ? ________________________________ From: Bushra Riaz Syeda Sent: Monday, March 14, 2016 7:30 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] error in reading epoched fif files My bad. I should have explained the problem I am using this code to read epoched fif files created with latest version of mne-python as was explained in fieldtrip tutorial (http://www.fieldtriptoolbox.org/development/integrate_with_mne) The sample epoched file can be downloaded from this link https://www.dropbox.com/s/3wy7clqu8o4a6wp/test-epo.fif?dl=0? cfg = []; cfg.dataset = Epochfilename; epoch1= ft_preprocessing(cfg); and I am getting the following error Error using fiff_read_epochs (line 46) Could not find epochs data Error in fiff_read_epochs (line 46) error(me,'Could not find epochs data'); Error in ft_read_header (line 1601) epochs = fiff_read_epochs(filename); Error in ft_preprocessing (line 397) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Kind regards Bushra Riaz -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Fri Mar 25 01:32:43 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Fri, 25 Mar 2016 00:32:43 +0000 (UTC) Subject: [FieldTrip] Simulated EEG with Cz as a reference References: <929834747.4959069.1458865963362.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <929834747.4959069.1458865963362.JavaMail.yahoo@mail.yahoo.com> I would like to simulate EEG with Cz as a reference. In the example http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit If I understand correctly, the function 'ft_dipolesimulation'  yields reference free simulated EEG. If I need Cz referenced EEG, would it be simulated EEG - Cz? BestSrini -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Fri Mar 25 09:58:27 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 08:58:27 +0000 Subject: [FieldTrip] Error in ft_sourceinterpolate References: Message-ID: Hi Fosco, What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = ‘avg.nai’;? Best, Jan-Mathijs On 18 Mar 2016, at 16:49, fosco bernasconi > wrote: Dear all, I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate: Reference to non-existent field 'avg'. Error in getsubfield (line 45) s = s.(t{k}); Error in ft_sourceinterpolate (line 209) if ~iscell(getsubfield(functional, cfg.parameter{i})) If I check my source structure I do have the avg field. source = freq: 10 cumtapcnt: [157x1 double] dim: [18 21 18] inside: [6804x1 logical] pos: [6804x3 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] Any suggestion? Thank you for your help! Best, fosco here the rest of my code: load('standard_bem.mat'); load('standard_sourcemodel3d10mm.mat'); templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; template_mri = ft_read_mri(templatefile); template_mri = ft_convert_units(template_mri,'mm'); template_mri.coordsys = 'spm'; cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = sourcemodel; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = template_mri; sourcemodel = ft_prepare_sourcemodel(cfg,freq); sourcemodel = ft_convert_units(sourcemodel,'mm'); cfg = []; cfg.elec = sens; cfg.channel = sens.label; cfg.headmodel = vol; cfg.grid = sourcemodel; cfg.grid.unit = 'mm';% same unit as above, i.e. in cm lf = ft_prepare_leadfield(cfg,freq); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'fourier'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 2; cfg.foi = 10; freq = ft_freqanalysis(cfg,dataft{1,1}); % compute source reconstruction cfg = []; cfg.frequency = freq.freq; cfg.method = 'pcc'; cfg.grid = lf; cfg.headmodel = vol; cfg.keeptrials = 'yes'; cfg.pcc.lambda = '5%'; cfg.pcc.projectnoise = 'yes'; source = ft_sourceanalysis(cfg,freq); cfg = []; cfg.projectmom = 'yes'; source_proj = ft_sourcedescriptives(cfg,source); % and provide mni template source_proj.dim = sourcemodel.dim; source_proj.pos = sourcemodel.pos; cfg = []; cfg.voxelcoord = 'no'; cfg.parameter = 'avg.nai'; source_int = ft_sourceinterpolate(cfg,source,template_mri); _______________________________________________ fieldtrip 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 Fri Mar 25 10:16:12 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 09:16:12 +0000 Subject: [FieldTrip] Error with interpn when calling ft_sourceinterpolate In-Reply-To: <56F3CFE8.5050706@univr.it> References: <56F3CFE8.5050706@univr.it> Message-ID: Hi Gina, What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151…., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) Best, Jan-Mathijs > On 24 Mar 2016, at 12:30, gj wrote: > > Hi FieldTrip community, > > I am using FieldTrip ver.20160309 and am getting the error: > > Error using interpn (line 152) > Wrong number of input arguments. > > Error in ft_sourceinterpolate>my_interpn (line 673) > av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > > while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: > > http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > > Here is my code leading to the error when calling ft_sourceinterpolate: > > %-- snippet--% > % sensor level Fourier spectra > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 13; > freqsens = ft_freqanalysis(cfg, data); > > % source reconstruction > cfg = []; > cfg.frequency = freqsens.freq; > cfg.elec = elec; > cfg.method = 'eloreta'; > cfg.grid = lf; > cfg.vol = vol; > cfg.keeptrials = 'yes'; > cfg.rawtrial = 'yes'; > source = ft_sourceanalysis(cfg, freqsens); > > % project to direction explaining most source variance > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > source_proj.dim = template_grid.sourcemodel.dim; > source_proj.pos = template_grid.sourcemodel.pos; > > %%....... interpolate onto the MNI template brain > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.pow'; > cfg.interpmethod = 'nearest'; > source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > > %-- end snippet--% > > > Any help greatly appreciated! > Gina > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jan.schoffelen at donders.ru.nl Fri Mar 25 10:18:30 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 09:18:30 +0000 Subject: [FieldTrip] ft_volumereslice shifts the brain References: <8C87A3FE-177D-4864-B2F4-686E2D9D8FBF@donders.ru.nl> Message-ID: Hi Jens, If not instructed otherwise, ft_volumereslice attempts to realign the ‘box-with-anatomical-data’ in such a way that the origin of the coordinate system (as specified in the .transform of the input image) is in the centre of the volume. In your image it seems that the origin is in the posterior commissure, which does not leave sufficient space toward the nose to fit the whole head. Had your origin been in the anterior commissure instead, 128 1mm voxels towards the front would probably have been sufficient to include the nose. You can specify a bounding box in the cfg to get the origin off-center. Otherwise (and I suspect that this was your intention from the start) you should first realign your input image to a proper AC-origin based coordinate system, and put the origin where it should be according to convention. This can of course be achieved with ft_volumerealign. With respect to the documentation, could you give a suggestion for a revised chunk of text which is more clear in your view? Best, Jan-Mathijs On 23 Mar 2016, at 23:52, Jens Klinzing, Universität Tübingen wrote: > > Hi everyone, > I have a problem with ft_volumereslice, applied to Nifti MRIs (haven't tested it on other formats). The function shifts the image to bring the brain in the center, as announced in the documentation. > > However, this is done > a) in a way that the nose of my MRI is cut off (s. below), which is suboptimal since I register EEG electrodes and fiducials in relation to the MRI and the cut is done close to the nasion, > b) in contrast to the documentation it shifts the brain whether or not a coordinate system (.coordsys) is given. I guess this happens during ft_sourceinterpolate which is called inside ft_volumereslice (line 180). The shift that could be done in ft_volumereslice (line 103ff) is not performed if there is no .coordsys, but the shift in the returned MRI is still there. > > Before and After (without an mri.coordsys): > > > Sure I can just increase the dimensions of the MRI, then I get the nose back, but I was wondering if anyone can explain this behavior of ft_volumereslice and whether it is a genuine bug or not. > > Thanks and greetings, > Jens > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gina.joue at univr.it Fri Mar 25 13:29:21 2016 From: gina.joue at univr.it (gj) Date: Fri, 25 Mar 2016 13:29:21 +0100 Subject: [FieldTrip] Error with interpn when calling, ft_sourceinterpolate Message-ID: <56F52F21.1010900@univr.it> Hi Jan-Mathijs, Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? Thanks! Gina > > Message: 7 > Date: Fri, 25 Mar 2016 09:16:12 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling > ft_sourceinterpolate > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Gina, > > What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) > > Best, > Jan-Mathijs > > > >> On 24 Mar 2016, at 12:30, gj wrote: >> >> Hi FieldTrip community, >> >> I am using FieldTrip ver.20160309 and am getting the error: >> >> Error using interpn (line 152) >> Wrong number of input arguments. >> >> Error in ft_sourceinterpolate>my_interpn (line 673) >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >> >> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: >> >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html >> >> Here is my code leading to the error when calling ft_sourceinterpolate: >> >> %-- snippet--% >> % sensor level Fourier spectra >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.output = 'fourier'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 2; >> cfg.foi = 13; >> freqsens = ft_freqanalysis(cfg, data); >> >> % source reconstruction >> cfg = []; >> cfg.frequency = freqsens.freq; >> cfg.elec = elec; >> cfg.method = 'eloreta'; >> cfg.grid = lf; >> cfg.vol = vol; >> cfg.keeptrials = 'yes'; >> cfg.rawtrial = 'yes'; >> source = ft_sourceanalysis(cfg, freqsens); >> >> % project to direction explaining most source variance >> cfg = []; >> cfg.projectmom = 'yes'; >> source_proj = ft_sourcedescriptives(cfg,source); >> >> source_proj.dim = template_grid.sourcemodel.dim; >> source_proj.pos = template_grid.sourcemodel.pos; >> >> %%....... interpolate onto the MNI template brain >> cfg = []; >> cfg.voxelcoord = 'no'; >> cfg.parameter = 'avg.pow'; >> cfg.interpmethod = 'nearest'; >> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); >> >> %-- end snippet--% >> >> >> Any help greatly appreciated! >> Gina >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From jan.schoffelen at donders.ru.nl Fri Mar 25 14:38:57 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 25 Mar 2016 13:38:57 +0000 Subject: [FieldTrip] Error with interpn when calling, ft_sourceinterpolate References: Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6@donders.ru.nl> Hi Gina, What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? Specifically, what’s size(source_proj.pos,1) and source_proj.dim? Best, Jan-Mathijs > On 25 Mar 2016, at 13:29, gj wrote: > > Hi Jan-Mathijs, > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? > > Thanks! > Gina > > >> >> Message: 7 >> Date: Fri, 25 Mar 2016 09:16:12 +0000 >> From: "Schoffelen, J.M. (Jan Mathijs)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Error with interpn when calling >> ft_sourceinterpolate >> Message-ID: >> Content-Type: text/plain; charset="utf-8" >> >> Hi Gina, >> >> What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) >> >> Best, >> Jan-Mathijs >> >> >> >>> On 24 Mar 2016, at 12:30, gj wrote: >>> >>> Hi FieldTrip community, >>> >>> I am using FieldTrip ver.20160309 and am getting the error: >>> >>> Error using interpn (line 152) >>> Wrong number of input arguments. >>> >>> Error in ft_sourceinterpolate>my_interpn (line 673) >>> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); >>> >>> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: >>> >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html >>> >>> Here is my code leading to the error when calling ft_sourceinterpolate: >>> >>> %-- snippet--% >>> % sensor level Fourier spectra >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'fourier'; >>> cfg.keeptrials = 'yes'; >>> cfg.tapsmofrq = 2; >>> cfg.foi = 13; >>> freqsens = ft_freqanalysis(cfg, data); >>> >>> % source reconstruction >>> cfg = []; >>> cfg.frequency = freqsens.freq; >>> cfg.elec = elec; >>> cfg.method = 'eloreta'; >>> cfg.grid = lf; >>> cfg.vol = vol; >>> cfg.keeptrials = 'yes'; >>> cfg.rawtrial = 'yes'; >>> source = ft_sourceanalysis(cfg, freqsens); >>> >>> % project to direction explaining most source variance >>> cfg = []; >>> cfg.projectmom = 'yes'; >>> source_proj = ft_sourcedescriptives(cfg,source); >>> >>> source_proj.dim = template_grid.sourcemodel.dim; >>> source_proj.pos = template_grid.sourcemodel.pos; >>> >>> %%....... interpolate onto the MNI template brain >>> cfg = []; >>> cfg.voxelcoord = 'no'; >>> cfg.parameter = 'avg.pow'; >>> cfg.interpmethod = 'nearest'; >>> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); >>> >>> %-- end snippet--% >>> >>> >>> Any help greatly appreciated! >>> Gina >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From hibafouani123 at hotmail.com Sat Mar 26 12:21:58 2016 From: hibafouani123 at hotmail.com (hiba fouani) Date: Sat, 26 Mar 2016 11:21:58 +0000 Subject: [FieldTrip] .dat file In-Reply-To: References: Message-ID: Dear Fieldtripper, How to convert from .dat file to .mat? Thank you Hiba > From: fieldtrip-request at science.ru.nl > Subject: fieldtrip Digest, Vol 64, Issue 32 > To: fieldtrip at science.ru.nl > Date: Sat, 26 Mar 2016 12:00:01 +0100 > > 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. Re: Error with interpn when calling, ft_sourceinterpolate (gj) > 2. Re: Error with interpn when calling, ft_sourceinterpolate > (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Mar 2016 13:29:21 +0100 > From: gj > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <56F52F21.1010900 at univr.it> > Content-Type: text/plain; charset=utf-8; format=flowed > > Hi Jan-Mathijs, > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in > Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must > have made some error in the steps leading up to source interpolation -- > are there perhaps data checks I can do to narrow down what it could be? > > Thanks! > Gina > > > > > > Message: 7 > > Date: Fri, 25 Mar 2016 09:16:12 +0000 > > From: "Schoffelen, J.M. (Jan Mathijs)" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Error with interpn when calling > > ft_sourceinterpolate > > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > > > Hi Gina, > > > > What version of MATLAB and operating system are you using? I cannot > get your error reproduced, and from the message it seems a low-level > MATLAB thing, because it complains about the number of input arguments > to a function that is provided by MATLAB. (by the way, the error message > that you got refers to line 152 in interpn, the same error check is done > in my version of interpn at line 151?., which suggests a different > version of the m-file. I was using matlab2014b on a windows machine) > > > > Best, > > Jan-Mathijs > > > > > > > >> On 24 Mar 2016, at 12:30, gj wrote: > >> > >> Hi FieldTrip community, > >> > >> I am using FieldTrip ver.20160309 and am getting the error: > >> > >> Error using interpn (line 152) > >> Wrong number of input arguments. > >> > >> Error in ft_sourceinterpolate>my_interpn (line 673) > >> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > >> > >> while trying to interpolate onto a template brain after having done > source reconstruction. This question had been posted before several > years ago but don't know how to "fix" the problem: > >> > >> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > >> > >> Here is my code leading to the error when calling ft_sourceinterpolate: > >> > >> %-- snippet--% > >> % sensor level Fourier spectra > >> cfg = []; > >> cfg.method = 'mtmfft'; > >> cfg.output = 'fourier'; > >> cfg.keeptrials = 'yes'; > >> cfg.tapsmofrq = 2; > >> cfg.foi = 13; > >> freqsens = ft_freqanalysis(cfg, data); > >> > >> % source reconstruction > >> cfg = []; > >> cfg.frequency = freqsens.freq; > >> cfg.elec = elec; > >> cfg.method = 'eloreta'; > >> cfg.grid = lf; > >> cfg.vol = vol; > >> cfg.keeptrials = 'yes'; > >> cfg.rawtrial = 'yes'; > >> source = ft_sourceanalysis(cfg, freqsens); > >> > >> % project to direction explaining most source variance > >> cfg = []; > >> cfg.projectmom = 'yes'; > >> source_proj = ft_sourcedescriptives(cfg,source); > >> > >> source_proj.dim = template_grid.sourcemodel.dim; > >> source_proj.pos = template_grid.sourcemodel.pos; > >> > >> %%....... interpolate onto the MNI template brain > >> cfg = []; > >> cfg.voxelcoord = 'no'; > >> cfg.parameter = 'avg.pow'; > >> cfg.interpmethod = 'nearest'; > >> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > >> > >> %-- end snippet--% > >> > >> > >> Any help greatly appreciated! > >> Gina > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------------ > > Message: 2 > Date: Fri, 25 Mar 2016 13:38:57 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > > Hi Gina, > > What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? > Specifically, what?s size(source_proj.pos,1) and source_proj.dim? > > Best, > Jan-Mathijs > > > On 25 Mar 2016, at 13:29, gj wrote: > > > > Hi Jan-Mathijs, > > > > Thanks for the prompt reply! Sorry I forgot to say...I tried it in Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must have made some error in the steps leading up to source interpolation -- are there perhaps data checks I can do to narrow down what it could be? > > > > Thanks! > > Gina > > > > > >> > >> Message: 7 > >> Date: Fri, 25 Mar 2016 09:16:12 +0000 > >> From: "Schoffelen, J.M. (Jan Mathijs)" > >> To: FieldTrip discussion list > >> Subject: Re: [FieldTrip] Error with interpn when calling > >> ft_sourceinterpolate > >> Message-ID: > >> Content-Type: text/plain; charset="utf-8" > >> > >> Hi Gina, > >> > >> What version of MATLAB and operating system are you using? I cannot get your error reproduced, and from the message it seems a low-level MATLAB thing, because it complains about the number of input arguments to a function that is provided by MATLAB. (by the way, the error message that you got refers to line 152 in interpn, the same error check is done in my version of interpn at line 151?., which suggests a different version of the m-file. I was using matlab2014b on a windows machine) > >> > >> Best, > >> Jan-Mathijs > >> > >> > >> > >>> On 24 Mar 2016, at 12:30, gj wrote: > >>> > >>> Hi FieldTrip community, > >>> > >>> I am using FieldTrip ver.20160309 and am getting the error: > >>> > >>> Error using interpn (line 152) > >>> Wrong number of input arguments. > >>> > >>> Error in ft_sourceinterpolate>my_interpn (line 673) > >>> av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); > >>> > >>> while trying to interpolate onto a template brain after having done source reconstruction. This question had been posted before several years ago but don't know how to "fix" the problem: > >>> > >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html > >>> > >>> Here is my code leading to the error when calling ft_sourceinterpolate: > >>> > >>> %-- snippet--% > >>> % sensor level Fourier spectra > >>> cfg = []; > >>> cfg.method = 'mtmfft'; > >>> cfg.output = 'fourier'; > >>> cfg.keeptrials = 'yes'; > >>> cfg.tapsmofrq = 2; > >>> cfg.foi = 13; > >>> freqsens = ft_freqanalysis(cfg, data); > >>> > >>> % source reconstruction > >>> cfg = []; > >>> cfg.frequency = freqsens.freq; > >>> cfg.elec = elec; > >>> cfg.method = 'eloreta'; > >>> cfg.grid = lf; > >>> cfg.vol = vol; > >>> cfg.keeptrials = 'yes'; > >>> cfg.rawtrial = 'yes'; > >>> source = ft_sourceanalysis(cfg, freqsens); > >>> > >>> % project to direction explaining most source variance > >>> cfg = []; > >>> cfg.projectmom = 'yes'; > >>> source_proj = ft_sourcedescriptives(cfg,source); > >>> > >>> source_proj.dim = template_grid.sourcemodel.dim; > >>> source_proj.pos = template_grid.sourcemodel.pos; > >>> > >>> %%....... interpolate onto the MNI template brain > >>> cfg = []; > >>> cfg.voxelcoord = 'no'; > >>> cfg.parameter = 'avg.pow'; > >>> cfg.interpmethod = 'nearest'; > >>> source_int = ft_sourceinterpolate(cfg, source_proj, template_mri); > >>> > >>> %-- end snippet--% > >>> > >>> > >>> Any help greatly appreciated! > >>> Gina > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> 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 > > End of fieldtrip Digest, Vol 64, Issue 32 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Mar 27 12:17:21 2016 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 27 Mar 2016 11:17:21 +0100 Subject: [FieldTrip] .dat file Message-ID: Hello Hiba, .dat files can be imported into MATLAB using the 'import data' GUI; you can also use that GUI to generate code for importing, and then you can modify the code to suit your needs. There are also plenty of other low-level functions for reading .dat files, e.g., http://uk.mathworks.com/matlabcentral/answers/79885-reading-dat-files-into-matlab, http://web.cecs.pdx.edu/~gerry/MATLAB/plotting/loadingPlotData.html, etc., you can find many more examples like this online. Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 1 > Date: Sat, 26 Mar 2016 11:21:58 +0000 > From: hiba fouani > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] .dat file > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > Dear Fieldtripper, > > How to convert from .dat file to .mat? > > Thank you > Hiba > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svkotak at yahoo.com Mon Mar 28 15:41:46 2016 From: svkotak at yahoo.com (Srinivas Kota) Date: Mon, 28 Mar 2016 13:41:46 +0000 (UTC) Subject: [FieldTrip] Dipole Simuation and Fitting References: <1410856922.1013069.1459172506243.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1410856922.1013069.1459172506243.JavaMail.yahoo@mail.yahoo.com>   In ‘ft_dipolesimulation.m’, what is the coordinate systemwhen considering dipole position in the example?  http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit I would like to see the dipole position and momentum in theMRI template for the dipole I simulate. I came across this link http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefittingI understand that the accuracy of source localization isdepends on the selection of Left and Right Pre Auricular points.  The ‘interactive’ method in ‘ft_volumerealign’could result mislocalization of LPA and RPA. Is there any demo or video of choosingpre auricular points in an anatomical MRI?  What would be the best way if I have to do spatially alignan anatomical MRI with head coordinates for each individual subject, given theoptions ‘interactive’, ‘fiducial’,’headshape’,’SPM’ and ‘FSL’?  I work with newborn EEG, are there any standard MRItemplates for newborns? Thank youSrini -------------- next part -------------- An HTML attachment was scrubbed... URL: From fosco.bernasconi at gmail.com Mon Mar 28 16:37:57 2016 From: fosco.bernasconi at gmail.com (fosco bernasconi) Date: Mon, 28 Mar 2016 16:37:57 +0200 Subject: [FieldTrip] Error in ft_sourceinterpolate In-Reply-To: References: Message-ID: Hi Jan-Mathijs, this is exactly what I end up using. Alternatively, I also created source.nai = avg.nai, which is working as well. I do have another short question, when using the ft_source2full I have some matab errors (which I guess it may be due to the changes in the source structure occurred in 2015, could it be?), I decided to skip ft_source2sparse and therefore ft_source2full (because I have the computational power to do so), this should not affect my connectivity results, right? Thanks a lot! fosco 2016-03-25 9:58 GMT+01:00 Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl>: > Hi Fosco, > > What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = > ‘avg.nai’;? > Best, > Jan-Mathijs > > On 18 Mar 2016, at 16:49, fosco bernasconi > wrote: > > Dear all, > > I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I > have an error when calling ft_sourceinterpolate: > > > > > > * Reference to non-existent field 'avg'. Error in getsubfield (line 45) > s = s.(t{k}); Error in ft_sourceinterpolate (line 209) if > ~iscell(getsubfield(functional, cfg.parameter{i}))* > > > If I check my source structure I do have the avg field. > > source = > freq: 10 > cumtapcnt: [157x1 double] > dim: [18 21 18] > inside: [6804x1 logical] > pos: [6804x3 double] > method: 'average' > avg: [1x1 struct] > cfg: [1x1 struct] > > > Any suggestion? > > Thank you for your help! > Best, > fosco > > > here the rest of my code: > > > load('standard_bem.mat'); > load('standard_sourcemodel3d10mm.mat'); > > templatefile = > '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii'; > template_mri = ft_read_mri(templatefile); > template_mri = ft_convert_units(template_mri,'mm'); > template_mri.coordsys = 'spm'; > > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = sourcemodel; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = template_mri; > sourcemodel = ft_prepare_sourcemodel(cfg,freq); > sourcemodel = ft_convert_units(sourcemodel,'mm'); > > cfg = []; > cfg.elec = sens; > cfg.channel = sens.label; > cfg.headmodel = vol; > cfg.grid = sourcemodel; > cfg.grid.unit = 'mm';% same unit as above, i.e. in cm > lf = ft_prepare_leadfield(cfg,freq); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'fourier'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 2; > cfg.foi = 10; > freq = ft_freqanalysis(cfg,dataft{1,1}); > > % compute source reconstruction > cfg = []; > cfg.frequency = freq.freq; > cfg.method = 'pcc'; > cfg.grid = lf; > cfg.headmodel = vol; > cfg.keeptrials = 'yes'; > cfg.pcc.lambda = '5%'; > cfg.pcc.projectnoise = 'yes'; > source = ft_sourceanalysis(cfg,freq); > > cfg = []; > cfg.projectmom = 'yes'; > source_proj = ft_sourcedescriptives(cfg,source); > > % and provide mni template > source_proj.dim = sourcemodel.dim; > source_proj.pos = sourcemodel.pos; > > cfg = []; > cfg.voxelcoord = 'no'; > cfg.parameter = 'avg.nai'; > source_int = ft_sourceinterpolate(cfg,source,template_mri); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 gina.joue at univr.it Tue Mar 29 09:16:29 2016 From: gina.joue at univr.it (gj) Date: Tue, 29 Mar 2016 09:16:29 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 64, Issue 32 In-Reply-To: References: Message-ID: <56FA2BCD.7010201@univr.it> Hi Jan-Mathijs, Before replacing them with the values from the template grid, source_proj.dim is 1-row matrix = [15,18,13] and source_proj.pos a 3510x3 matrix of doubles After, it's source_proj.dim is a 1-row matrix = [32,39,34] and source_proj.pos is a 42432x3 matrix of doubles Thanks! Gina > ------------------------------ > > Message: 2 > Date: Fri, 25 Mar 2016 13:38:57 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Error with interpn when calling, > ft_sourceinterpolate > Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> > Content-Type: text/plain; charset="utf-8" > > > Hi Gina, > > What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? > Specifically, what?s size(source_proj.pos,1) and source_proj.dim? > > Best, > Jan-Mathijs > From jan.schoffelen at donders.ru.nl Tue Mar 29 09:50:05 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 29 Mar 2016 07:50:05 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 64, Issue 32 In-Reply-To: <56FA2BCD.7010201@univr.it> References: <56FA2BCD.7010201@univr.it> Message-ID: Hi Gina, That’s what I was afraid of. By replacing the .pos and .dim you made the data structure inconsistent. The number of source positions should be kept constant, i.e. you need to use a ‘template grid’ that is defined at the same approximate spatial resolution as your individual grids. The reason for this is that the numeric data (e.g. in source.avg.pow) should have the same number of elements as the size(source.pos,1). Best, Jan-Mathijs > On 29 Mar 2016, at 09:16, gj wrote: > > Hi Jan-Mathijs, > > Before replacing them with the values from the template grid, > source_proj.dim is 1-row matrix = [15,18,13] > and > source_proj.pos a 3510x3 matrix of doubles > > > After, it's > source_proj.dim is a 1-row matrix = [32,39,34] > and > source_proj.pos is a 42432x3 matrix of doubles > > Thanks! > Gina > >> ------------------------------ >> >> Message: 2 >> Date: Fri, 25 Mar 2016 13:38:57 +0000 >> From: "Schoffelen, J.M. (Jan Mathijs)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] Error with interpn when calling, >> ft_sourceinterpolate >> Message-ID: <40EEF91F-360C-46B7-9E24-2163FEA99CF6 at donders.ru.nl> >> Content-Type: text/plain; charset="utf-8" >> >> >> Hi Gina, >> >> What is the content of the source_proj.pos and source_proj.dim fields before you replace them with the values from the template grid? >> Specifically, what?s size(source_proj.pos,1) and source_proj.dim? >> >> Best, >> Jan-Mathijs >> > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From laetitia.lalla at inserm.fr Tue Mar 29 10:50:46 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Tue, 29 Mar 2016 10:50:46 +0200 Subject: [FieldTrip] Pb with ft_freqstatistics when averaged over channels : NaNs In-Reply-To: References: Message-ID: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> Dear FieldTrip community, I have a similar problem that may be of help here. It's my first message on this mailing list so, first of all, thank you very much for this free toolbox and the help you're providing. I'm a PhD student in Marseille (France) and I'm doing LFP recordings with tetrodes or silicon probes in freely moving rats. (I apologize in advance for this very detailed - and long - email). I'm trying to compare the power in a certain frequency range between 2 conditions (Trial and Baseline). I can see a clear rising during the trial and I want to run the statistics now. Like Zita, I'd like to run a cluster permutation test on data with frequency and time information, and my signal is averaged over channels. I followed this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics. [1]Based on this, this is what I did : 1) I cut epochs of 6s (trials), filter [0.1 250Hz] and average over channels to have an averaged signal per probe (32 channels = 4 shanks = 1 probe). 2) I do the same for the baseline. 3) I create a structure data_all which gather all the epochs, with the appropriate design matrix (0 if baseline, 1 if trial). 4) I do a Time Frequency Transform averaged over time with ft_freqanalysis, 'mtmfft', with keeptrials='yes'. It give me, for each trial, a profile Power=f(Freq) averaged during the time of the epoch. The difference in my frequency range is very clear when I plot the profiles. 5) I use ft_freqstatistics like this : cfg = []; cfg.channel = 'Str'; cfg.design = data_all.designmatrix; cfg.method = 'montecarlo'; cfg.numrandomization = 500; cfg.statistic = 'indepsamplesT'; cfg.ivar = 1; cfg.correctm = 'cluster'; cfg.neighbours = []; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; [stat]=ft_freqstatistics(cfg, FR_alltrials) And this is not working because I have only NaNs... stat = stat: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] prob: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] cirange: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] mask: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] ref: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] dimord: 'chan_freq' freq: [1x25 double] label: {'Str'} cfg: [1x1 struct] Would you have an idea to resolve my problem ? Maybe I forgot to precise a parameter somewhere ? Thank you for your help! Best regards, Laetitia On 24-03-2016 13:15, Zita Eva Patai wrote: > Dear FT-ers > > I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. > > I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. > > If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. > > Is there an easy way to fix this? > > I am using the FT inside SPM12. > > Thanks very much, > zita > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Links: ------ [1] http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Tue Mar 29 12:08:10 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Tue, 29 Mar 2016 12:08:10 +0200 Subject: [FieldTrip] Pb with ft_freqstatistics when averaged over channels : NaNs In-Reply-To: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> Message-ID: <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> Hello again, I actually solved my problem... It was pretty silly... I needed to put 1 and 2 in my design matrix instead of 0 and 1... It's in the code here : in ft_statfun_indepsamplesT.m row 77 % perform some checks on the design sel1 = find(design(cfg.ivar,:)==1); sel2 = find(design(cfg.ivar,:)==2); Sorry about that... But maybe it can help other people ? Have a nice day, Laetitia On 29-03-2016 10:50, laetitia.lalla at inserm.fr wrote: > Dear FieldTrip community, > > I have a similar problem that may be of help here. > > It's my first message on this mailing list so, first of all, thank you very much for this free toolbox and the help you're providing. I'm a PhD student in Marseille (France) and I'm doing LFP recordings with tetrodes or silicon probes in freely moving rats. (I apologize in advance for this very detailed - and long - email). > > I'm trying to compare the power in a certain frequency range between 2 conditions (Trial and Baseline). I can see a clear rising during the trial and I want to run the statistics now. > > Like Zita, I'd like to run a cluster permutation test on data with frequency and time information, and my signal is averaged over channels. > > I followed this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics. [1]Based on this, this is what I did : > > 1) I cut epochs of 6s (trials), filter [0.1 250Hz] and average over channels to have an averaged signal per probe (32 channels = 4 shanks = 1 probe). > > 2) I do the same for the baseline. > > 3) I create a structure data_all which gather all the epochs, with the appropriate design matrix (0 if baseline, 1 if trial). > > 4) I do a Time Frequency Transform averaged over time with ft_freqanalysis, 'mtmfft', with keeptrials='yes'. It give me, for each trial, a profile Power=f(Freq) averaged during the time of the epoch. The difference in my frequency range is very clear when I plot the profiles. > > 5) I use ft_freqstatistics like this : > > cfg = []; > > cfg.channel = 'Str'; > > cfg.design = data_all.designmatrix; > > cfg.method = 'montecarlo'; > > cfg.numrandomization = 500; > > cfg.statistic = 'indepsamplesT'; > > cfg.ivar = 1; > > cfg.correctm = 'cluster'; > > cfg.neighbours = []; > > cfg.alpha=0.05; > > cfg.tail=0; > > cfg.correcttail='alpha'; > > [stat]=ft_freqstatistics(cfg, FR_alltrials) > > And this is not working because I have only NaNs... > > stat = > > stat: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] > > prob: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] > > cirange: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] > > mask: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] > > ref: [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN] > > dimord: 'chan_freq' > > freq: [1x25 double] > > label: {'Str'} > > cfg: [1x1 struct] > > Would you have an idea to resolve my problem ? Maybe I forgot to precise a parameter somewhere ? > > Thank you for your help! > > Best regards, > > Laetitia > > On 24-03-2016 13:15, Zita Eva Patai wrote: > >> Dear FT-ers >> >> I would like to run a cluster permutation test on data where i have frequency and time information, but have averaged over channels. >> >> I am setting my cfg for ft_freqstatistics as usual, but asking for all times and channels (no averaging). I am also not setting the cfg.neighbours option, because there aren't any. In this case it won't run and asks for that setting. If I then set cfg.neighbour = []; then it complains it cannot find the .powspctrm of my data. >> >> If I do not ask for cluster correction, it runs through fine and I get a stat structure out of it, but this is uncorrected. >> >> Is there an easy way to fix this? >> >> I am using the FT inside SPM12. >> >> Thanks very much, >> zita >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Links: ------ [1] http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics -------------- next part -------------- An HTML attachment was scrubbed... URL: From ha438 at georgetown.edu Wed Mar 30 03:19:01 2016 From: ha438 at georgetown.edu (Hassan Aleem) Date: Tue, 29 Mar 2016 21:19:01 -0400 Subject: [FieldTrip] please help! sourcemodel and grid don't match Message-ID: Hi all, When I plot the sourcemodel and the headmodel, the sourcemodel is many magnitudes larger than the headmodel. Not sure if it has anything to do with my code so attaching that below. Also attaching the jpgs. %% read the parameters %% Parameter 2.2 mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; mritype='MNI'; realign='realigned'; volumereslicing='volumeresliced'; brainthresh=0.5; scalpthresh=0.10; scalpsmooth='scalp_smooth'; scalp_smooth.parameter=9; scalpvertices=1000; skullvertices=1000; brainvertices=1000; meshmethod='projectmesh'; headmodel_method='dipoli'; subjnum='915'; time='pre'; timetype='hassan'; timewindow=[0 .1]; gridtype='template10'; beamformer='lcmv'; sourcemodeltype= 'templatebased'; identifier='Parameter2-2'; =================================== %%read in mri switch mritype case 'MNI' [mri] = ft_read_mri(mrifile); mri.coordsys ='MNI'; case 'Analyze' [mri] = ft_read_mri(mrifile); mri.coordsys ='Analyze'; case 'SPM' [mri] = ft_read_mri(mrifile); mri.coordsys = 'SPM'; end save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') cfg=[]; ft_sourceplot(cfg,mri) ============================== %% realigning switch realign case 'realigned' cfg=[]; cfg.method='fiducial'; cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; mri_realigned=ft_volumerealign(cfg,mri); ft_sourceplot(cfg,mri_realigned) save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') case 'notrealigned' %do nothing end ========================= %% volume reslicing switch volumereslicing case 'volumeresliced' cfg = []; cfg.resolution = 1; mri_resliced = ft_volumereslice(cfg, mri); save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') case 'notresliced' %do nothing end ft_sourceplot(cfg,mri_resliced) ============================== %% segmentation parameters switch scalpsmooth case 'noscalpsmooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); case 'scalp_smooth' cfg = []; cfg.brainthreshold = brainthresh; cfg.scalpthreshold = scalpthresh; cfg.scalpsmooth = scalp_smooth.parameter; cfg.downsample = 1; %no downsampling cfg.output = {'brain' 'skull' 'scalp'}; seg = ft_volumesegment(cfg, mri); end seg.anatomy = mri.anatomy; cfg = []; cfg.funparameter = 'trishells'; cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; cfg.maskparameter=cfg.funparameter; ft_sourceplot(cfg,seg) save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') ================================= %% prepare mesh cfg = []; cfg.method= meshmethod; cfg.tissue = {'scalp', 'skull', 'brain'}; cfg.numvertices = [scalpvertices skullvertices brainvertices]; bnd = ft_prepare_mesh(cfg, seg); % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping bnd(1).pnt = bnd(1).pnt.*1.001; bnd(2).pnt = bnd(2).pnt.*1; bnd(3).pnt = bnd(3).pnt.*0.999; figure; ft_plot_mesh(bnd(1))%scalp figure; ft_plot_mesh(bnd(2))%skull figure; ft_plot_mesh(bnd(3))%brain %% save mesh save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') ============================================= %% build headmodel switch headmodel_method case 'dipoli' cfg = []; cfg.method = 'dipoli'; case 'bemcp' cfg = []; cfg.method = 'bemcp'; end headmodel = ft_prepare_headmodel(cfg, bnd); headmodel = ft_convert_units(headmodel,'cm'); save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); ==================================== %% adding electrodes to headmodel elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file % visualize head surface (scalp) figure; ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); hold on; % plot electrodes ft_plot_sens(elec,'style', 'sk') ================================= %most likely they are not aligned, so for aligning electrodes cfg = []; cfg.method = 'interactive';%can try the 'fiducial' method but is very %likely not to fix it cfg.elec = elec; % nas=mri_realigned.cfg.fiducial.nas; % lpa=mri_realigned.cfg.fiducial.lpa; % rpa=mri_realigned.cfg.fiducial.rpa; cfg.headshape = headmodel.bnd(1);%scalp elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') ================================== %% load EEG data load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6w') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM0') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3W') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bw') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bb') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6b') load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6') ==================================== %% timelock data cfg = []; cfg.refef= 'yes'; %added at 2-5 same = dataM0; same.trial = [dataM0.trial dataM3W.trial]; same.time = [dataM0.time dataM3W.time]; diff = dataM6; diff.trial = [dataM3Bb.trial dataM6.trial]; diff.time = [dataM3Bb.time dataM6.time]; switch timetype case 'simple' timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); case 'hassan' cfg.vartrllength = 0; %was changed to 0 from 2 cfg.covariance = 'yes'; cfg.covariancewindow = timewindow; cfg.keeptrials = 'yes'; timelock_m0 = ft_timelockanalysis(cfg, dataM0); timelock_m6 = ft_timelockanalysis(cfg, dataM6); timelock_m3w = ft_timelockanalysis(cfg, dataM3W); timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); timelock_diff = ft_timelockanalysis(cfg, diff); timelock_same = ft_timelockanalysis(cfg, same); end save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') ============================ %% make sourcemodel switch sourcemodeltype case 'templatebased' template=load('standard_sourcemodel3d10mm.mat'); elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file cfg = []; cfg.headmodel = headmodel; cfg.mri=mri; cfg.grid.warpmni = 'yes'; cfg.grid.template = template.sourcemodel; cfg.grid.nonlinear = 'yes'; cfg.resolution = 2; % resolution of the template grid in mm cfg.moveinward = 1; % actually uses vol mesh cfg.grid.unit ='mm'; cfg.inwardshift = 0; % needs to be expressed to work with moveinward cfg.elec = elec; % cfg.headshape=('cortex_5124.surf.gii'); mysourcemodel = ft_prepare_sourcemodel(cfg); case 'individual' load('standard_sourcemodel3d5mm.mat'); cfg = []; cfg.grid.warpmni = 'yes'; cfg.resolution = 5; % resolution of the template grid in mm cfg.grid.nonlinear = 'yes'; % use non linear normalization cfg.mri = mri; % use subject's mri in mni coordinates cfg.grid.unit = 'mm'; mysourcemodel = ft_prepare_sourcemodel(cfg); case 'template' mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work end save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') ======================= %% Plot the single subject'e head model and grid positions figure hold on ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); ======================== %% Double check that source model is aligned to the segmented volume and to the electrodes *HERE IS WHERE I SEE THE ERROR* figure hold on plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); ======================================== %% make leadfield switch gridtype case 'individual' cfg = []; cfg.elec = elec; cfg.headmodel = headmodel; cfg.normalize = 'yes'; cfg.reducerank= 3; cfg.grid.unit = 'cm';% same unit as above, i.e. in cm [grid] = ft_prepare_leadfield(cfg); case 'templatebased' load('standard_sourcemodel3d10mm.mat') cfg = []; cfg.elec = elec; cfg.template = sourcemodel.cfg.grid; cfg.grid=mysourcemodel.cfg.grid; cfg.headmodel = headmodel; cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG cfg.channel = 'all'; cfg.normalize= 'yes'; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; [grid] = ft_prepare_leadfield(cfg); case 'template10' load('standard_sourcemodel3d10mm.mat') cfg.normalize='yes'; [grid]=sourcemodel.cfg.grid; end save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') =========================== %% Interpolate cfg = []; cfg.interpmethod = 'linear'; cfg.parameter = 'pow'; sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); % save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') % save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') ================================= %%beamforming cfg = []; cfg.method = 'slice'; % cfg.slicedim= 1; cfg.funcolormap = 'jet'; % cfg.method = 'ortho'; % cfg.funcolorlim = 'zeromax'; % cfg.funcolorlim = [0.01 0.2]; cfg.funparameter= 'pow'; test2=sourceinterp_diff; test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); test=sourceinterp_diff; test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; ft_sourceplot(cfg,test) ft_sourceplot(cfg,test2) ft_sourceplot(cfg,sourceinterp_same); ft_sourceplot(cfg,sourceinterp_diff); ft_sourceplot(cfg,sourceinterp_m0); ft_sourceplot(cfg,sourceinterp_m6); ft_sourceplot(cfg,sourceinterp_m3w); ft_sourceplot(cfg,sourceinterp_m3b); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figforfilegrid.jpg Type: image/jpeg Size: 37427 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figforemail.jpg Type: image/jpeg Size: 28140 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: combinedforemail.jpg Type: image/jpeg Size: 41474 bytes Desc: not available URL: From mi_mayer at gmx.de Wed Mar 30 13:44:08 2016 From: mi_mayer at gmx.de (Irene Sophia Mayer) Date: Wed, 30 Mar 2016 13:44:08 +0200 Subject: [FieldTrip] Shift triggers Message-ID: An HTML attachment was scrubbed... URL: From carsten.wolters at uni-muenster.de Wed Mar 30 12:14:11 2016 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 30 Mar 2016 12:14:11 +0200 Subject: [FieldTrip] PhD position available: EEG/MEG inverse problem in presurgical epilepy diagnosis Message-ID: <56FBA6F3.4010808@uni-muenster.de> Doctoral Student *Neuroscientist with focus on the EEG/MEG inverse problem in presurgical epilepsy diagnosis * The *medical faculty of the University of Münster*, Germany, invites applications for a Doctoral Student Ref.: 10937 for a TVL13, 65%, three year position to work on the combined Electro- (EEG) and Magneto-encephalography (MEG) inverse problem in presurgical epilepsy diagnosis using calibrated realistic finite element volume conductor models of the patients heads within a DFG-funded project. The successful applicant holds a Master’s degree (or equivalent) in a relevant academic area such as *applied mathematics, computer science, physics, biomedical or electrical engineering or similar disciplines.* Good programming expertise (C++, Matlab, Fortran or equivalent) and experience with the Linux operating system is expected, because large software toolboxes are used and further developed. The working language at the institute is English. Experience with the measurement and analysis of brain signals is advantageous, but not essential. The applicant’s merits are assessed on the basis of the quality of Master’s level studies and thesis, previous experience with inverse problems, numerical mathematics, software development, motivation and research interests. The location for this research will mainly be the workgroups “Methods in bioelectromagnetism” of Dr. Wolters at the Institute for Biomagnetism and Biosignalanalysis (IBB) and “Imaging” of Prof. Dr. Martin Burger at the Institute for Computational and Applied Mathematics, both at the University of Münster in Germany. Expected close collaborations and visits are with the Department of Neurosurgery at the University of Erlangen (Dr.med. Stefan Rampp) and with the epilepsy centers Münster-Osnabrück (Dr. Gabriel Möddel; PD Dr.med. Christoph Kellinghaus) and Bochum (Prof. Dr.med. Jörg Wellmer). The application should include a statement of research interests and reasons for applying to the project, a curriculum vitae (max. 4 pages) composed according to good scientific practice, a certificate of Master’s degree, copy of the master’s thesis and grades of Master’s level studies, the names and e-mail addresses of two referees and a proof of proficiency in English. The position will be open until filled. To apply for the position, please send the above documents as pdfs until 20.04.2016 to *PD Dr. rer.nat. Carsten Wolters*, Institute for Biomagnetism and Biosignalanalysis, University of Münster, Malmedyweg 15, 48149 Münster, Germany, or by Email to *carsten.wolters(at)­uni-muenster(dot)­de . For additional information please contact PD Dr. Carsten Wolters (Email: carsten.wolters(at)­uni-muenster(dot)­de *, Phone: +49 (0)251 83-56904). Applications of women are specifically invited. In the case of similar qualifications, competence, and specific achievements, women will be considered on preferential terms within the framework of the legal possibilities. Handicapped candidates with equivalent qualifications will be given preference. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From carsten.wolters at uni-muenster.de Wed Mar 30 12:16:03 2016 From: carsten.wolters at uni-muenster.de (Carsten Wolters) Date: Wed, 30 Mar 2016 12:16:03 +0200 Subject: [FieldTrip] PhD position available: EEG/MEG forward problem in presurgical epilepy diagnosis Message-ID: <56FBA763.8050207@uni-muenster.de> Doctoral Student *Neuroscientist with focus on the EEG/MEG forward problem in presurgical epilepsy diagnosis* The *medical faculty of the University of Münster*, Germany, invites applications for a Doctoral Student Ref.: 10939 for a TVL13, 65%, three year position to work on the combined Electro- (EEG) and Magneto-encephalography (MEG) forward problem in presurgical epilepsy diagnosis using calibrated realistic finite element volume conductor models of the patients heads within a DFG-funded project. The successful applicant holds a Master’s degree (or equivalent) in a relevant academic area such as *applied* *mathematics, computer science, physics, biomedical or electrical engineering or similar disciplines. *Good programming expertise (C++, Matlab, Fortran or equivalent) and experience with the Linux operating system is expected, because large software toolboxes (DUNE-PDELab, see http://www.dune-project.org/) are used and further developed. The working language at the institute is English. Experience with finite element method based simulation and the analysis of brain signals is advantageous, but not essential. The applicant’s merits are assessed on the basis of the quality of Master’s level studies and thesis, previous experience with the numerical solution of partial differential equations, numerical mathematics, inverse problems, software development, motivation and research interests. The location for this research will mainly be the workgroups “Methods in bioelectromagnetism” of PD Dr. Wolters at the Institute for Biomagnetism and Biosignalanalysis (IBB) and “Applications of partial differential equations” of Prof. Dr. Christian Engwer at the Institute for Computational and Applied Mathematics, both at the University of Münster in Germany. Expected close collaborations and visits are with the Department of Neurosurgery at the University of Erlangen (Dr.med. Stefan Rampp) and with the epilepsy centers Münster-Osnabrück (Dr. Gabriel Möddel; PD Dr.med. Christoph Kellinghaus) and Bochum (Prof. Dr.med. Jörg Wellmer). The application should include a statement of research interests and reasons for applying to the project, a curriculum vitae (max. 4 pages) composed according to good scientific practice, a certificate of Master’s degree, copy of the master’s thesis and grades of Master’s level studies, the names and e-mail addresses of two referees and a proof of proficiency in English. The position will be open until filled. To apply for the position, please send the above documents as pdfs until 20.04.2016 to*PD Dr.rer.nat. Carsten Wolters*, Institute for Biomagnetism and Biosignalanalysis, University of Münster, Malmedyweg 15, 48149 Münster, Germany, or by Email to *carsten.wolters(at)­uni-muenster(dot)­de *. For additional information please contact*PD Dr. Carsten Wolters (Email: carsten.wolters(at)­uni-muenster(dot)­de *, Phone: +49 (0)251 83-56904). Applications of women are specifically invited. In the case of similar qualifications, competence, and specific achievements, women will be considered on preferential terms within the framework of the legal possibilities. Handicapped candidates with equivalent qualifications will be given preference. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: carsten_wolters.vcf Type: text/x-vcard Size: 402 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Mar 30 15:17:31 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 30 Mar 2016 13:17:31 +0000 Subject: [FieldTrip] Shift triggers In-Reply-To: References: Message-ID: <883F387F-B82E-4511-B31A-49B924EB02ED@donders.ru.nl> Hi Sophia, If you would like to stick to the default ft_trialfun_general, you could update the 3d column in your cfg_trl.trl matrix. This column contains the ‘offset’ for each trial, which specifies for the first sample in each trial the number of samples prior to what is defined as ‘time point zero’ for that trial. You should subtract or add round(0.015.*the-sampling-rate), depending on the intended direction of the shift. I leave it as exercise to you to determine whether to add or subtract. Best, Jan-Mathijs On 30 Mar 2016, at 13:44, Irene Sophia Mayer > wrote: Dear Fieldtrippers, I am defining my trials with the following code: cfg = []; cfg.dataset = infile; cfg.trialdef.eventtype = 'Stimulus'; cfg.trialdef.eventvalue = 'S 1'; cfg.trialdef.prestim = .1; cfg.trialdef.poststim = 2.2; cfg_trl = ft_definetrial(cfg); However, I have measured that my stimulus appeared 15ms late. Is there a way of shifting the triggers or the trials? Meaning, that trialdef does not take the actual time of the event but adds 15ms. Then this new value is considered for the prestimulus and poststimulus time as the new point zero. Cheers, Sophia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Mar 30 15:55:53 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 30 Mar 2016 15:55:53 +0200 Subject: [FieldTrip] please help! sourcemodel and grid don't match In-Reply-To: References: Message-ID: <94637D12-7261-4751-A3FE-A763E552D458@gmail.com> Hi Hassan, have you double-checked that all your input units are in the same in all elements (i.e. electrodes, volume, mri, grid all have the same .unit and .pos values in the same ballpark)? You can use ft_convert_units to fix possible differences. Good luck, Julian Am 30.03.2016 um 03:19 schrieb Hassan Aleem: > Hi all, > > When I plot the sourcemodel and the headmodel, the sourcemodel is many magnitudes larger than the headmodel. Not sure if it has anything to do with my code so attaching that below. Also attaching the jpgs. > > %% read the parameters > > %% Parameter 2.2 > > mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; > mritype='MNI'; > realign='realigned'; > volumereslicing='volumeresliced'; > brainthresh=0.5; > scalpthresh=0.10; > scalpsmooth='scalp_smooth'; > scalp_smooth.parameter=9; > scalpvertices=1000; > skullvertices=1000; > brainvertices=1000; > meshmethod='projectmesh'; > headmodel_method='dipoli'; > subjnum='915'; > time='pre'; > timetype='hassan'; > timewindow=[0 .1]; > gridtype='template10'; > beamformer='lcmv'; > sourcemodeltype= 'templatebased'; > identifier='Parameter2-2'; > =================================== > %%read in mri > > switch mritype > case 'MNI' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='MNI'; > case 'Analyze' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='Analyze'; > case 'SPM' > [mri] = ft_read_mri(mrifile); > mri.coordsys = 'SPM'; > end > save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') > cfg=[]; > ft_sourceplot(cfg,mri) > ============================== > > %% realigning > switch realign > case 'realigned' > cfg=[]; > cfg.method='fiducial'; > cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; > cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; > cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; > mri_realigned=ft_volumerealign(cfg,mri); > ft_sourceplot(cfg,mri_realigned) > save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') > case 'notrealigned' > %do nothing > end > > ========================= > %% volume reslicing > switch volumereslicing > case 'volumeresliced' > cfg = []; > cfg.resolution = 1; > mri_resliced = ft_volumereslice(cfg, mri); > save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') > case 'notresliced' > %do nothing > end > ft_sourceplot(cfg,mri_resliced) > ============================== > > %% segmentation parameters > switch scalpsmooth > case 'noscalpsmooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > case 'scalp_smooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.scalpsmooth = scalp_smooth.parameter; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > end > > seg.anatomy = mri.anatomy; > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > cfg.maskparameter=cfg.funparameter; > ft_sourceplot(cfg,seg) > > save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') > ================================= > %% prepare mesh > > cfg = []; > cfg.method= meshmethod; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [scalpvertices skullvertices brainvertices]; > bnd = ft_prepare_mesh(cfg, seg); > % i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001; > bnd(2).pnt = bnd(2).pnt.*1; > bnd(3).pnt = bnd(3).pnt.*0.999; > > figure; > ft_plot_mesh(bnd(1))%scalp > figure; > ft_plot_mesh(bnd(2))%skull > figure; > ft_plot_mesh(bnd(3))%brain > > %% save mesh > save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') > ============================================= > > %% build headmodel > > switch headmodel_method > case 'dipoli' > cfg = []; > cfg.method = 'dipoli'; > case 'bemcp' > cfg = []; > cfg.method = 'bemcp'; > end > > headmodel = ft_prepare_headmodel(cfg, bnd); > headmodel = ft_convert_units(headmodel,'cm'); > > save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); > > ==================================== > %% adding electrodes to headmodel > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file > % visualize head surface (scalp) > figure; > ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > ================================= > %most likely they are not aligned, so for aligning electrodes > cfg = []; > cfg.method = 'interactive';%can try the 'fiducial' method but is very > %likely not to fix it > cfg.elec = elec; > % nas=mri_realigned.cfg.fiducial.nas; > % lpa=mri_realigned.cfg.fiducial.lpa; > % rpa=mri_realigned.cfg.fiducial.rpa; > cfg.headshape = headmodel.bnd(1);%scalp > elec_aligned = ft_electroderealign(cfg);%use the gui to manually align the electrodes > > save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') > ================================== > %% load EEG data > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6w') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM0') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3W') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bw') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM3Bb') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6b') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), 'dataM6') > ==================================== > %% timelock data > > cfg = []; > cfg.refef= 'yes'; %added at 2-5 > > > same = dataM0; > same.trial = [dataM0.trial dataM3W.trial]; > same.time = [dataM0.time dataM3W.time]; > > diff = dataM6; > diff.trial = [dataM3Bb.trial dataM6.trial]; > diff.time = [dataM3Bb.time dataM6.time]; > > switch timetype > case 'simple' > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > case 'hassan' > cfg.vartrllength = 0; %was changed to 0 from 2 > cfg.covariance = 'yes'; > cfg.covariancewindow = timewindow; > cfg.keeptrials = 'yes'; > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > > end > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') > > ============================ > %% make sourcemodel > > switch sourcemodeltype > case 'templatebased' > template=load('standard_sourcemodel3d10mm.mat'); > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file > cfg = []; > cfg.headmodel = headmodel; > cfg.mri=mri; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.resolution = 2; % resolution of the template grid in mm > cfg.moveinward = 1; % actually uses vol mesh > cfg.grid.unit ='mm'; > cfg.inwardshift = 0; % needs to be expressed to work with moveinward > cfg.elec = elec; > % cfg.headshape=('cortex_5124.surf.gii'); > mysourcemodel = ft_prepare_sourcemodel(cfg); > > case 'individual' > load('standard_sourcemodel3d5mm.mat'); > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 5; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > mysourcemodel = ft_prepare_sourcemodel(cfg); > case 'template' > mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work > end > > > > save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') > ======================= > %% Plot the single subject'e head model and grid positions > > figure > hold on > ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); > ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); > ======================== > %% Double check that source model is aligned to the segmented volume and to the electrodes > HERE IS WHERE I SEE THE ERROR > figure > hold on > plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); > ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); > ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); > ======================================== > %% make leadfield > > > switch gridtype > case 'individual' > cfg = []; > cfg.elec = elec; > cfg.headmodel = headmodel; > cfg.normalize = 'yes'; > cfg.reducerank= 3; > cfg.grid.unit = 'cm';% same unit as above, i.e. in cm > [grid] = ft_prepare_leadfield(cfg); > case 'templatebased' > load('standard_sourcemodel3d10mm.mat') > cfg = []; > cfg.elec = elec; > cfg.template = sourcemodel.cfg.grid; > cfg.grid=mysourcemodel.cfg.grid; > cfg.headmodel = headmodel; > cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG > cfg.channel = 'all'; > cfg.normalize= 'yes'; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > [grid] = ft_prepare_leadfield(cfg); > case 'template10' > load('standard_sourcemodel3d10mm.mat') > cfg.normalize='yes'; > [grid]=sourcemodel.cfg.grid; > end > > > save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') > =========================== > %% Interpolate > cfg = []; > cfg.interpmethod = 'linear'; > cfg.parameter = 'pow'; > sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); > sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); > sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); > sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); > sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); > sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); > > > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') > % save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') > ================================= > > %%beamforming > > cfg = []; > cfg.method = 'slice'; > % cfg.slicedim= 1; > cfg.funcolormap = 'jet'; > % cfg.method = 'ortho'; > % cfg.funcolorlim = 'zeromax'; > % cfg.funcolorlim = [0.01 0.2]; > cfg.funparameter= 'pow'; > > > test2=sourceinterp_diff; > test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); > test=sourceinterp_diff; > test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; > ft_sourceplot(cfg,test) > ft_sourceplot(cfg,test2) > ft_sourceplot(cfg,sourceinterp_same); > ft_sourceplot(cfg,sourceinterp_diff); > ft_sourceplot(cfg,sourceinterp_m0); > ft_sourceplot(cfg,sourceinterp_m6); > ft_sourceplot(cfg,sourceinterp_m3w); > ft_sourceplot(cfg,sourceinterp_m3b); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From sreenivasan.r.nadar at gmail.com Wed Mar 30 16:39:26 2016 From: sreenivasan.r.nadar at gmail.com (Sreenivasan R. Nadar, Ph.D.) Date: Wed, 30 Mar 2016 10:39:26 -0400 Subject: [FieldTrip] please help! sourcemodel and grid don't match In-Reply-To: References: Message-ID: Hi Hasan, The problem is probably related to dimensions (units: mm, cm) and same could be changed by using the command: headmodel = ft_convert_units(headmodel, 'cm'). Good luck! Vasan On Tue, Mar 29, 2016 at 9:19 PM, Hassan Aleem wrote: > Hi all, > > When I plot the sourcemodel and the headmodel, the sourcemodel is many > magnitudes larger than the headmodel. Not sure if it has anything to do > with my code so attaching that below. Also attaching the jpgs. > > %% read the parameters > > %% Parameter 2.2 > > mrifile='Siemens_AF8-MPRAGE_20141022_1.nii'; > mritype='MNI'; > realign='realigned'; > volumereslicing='volumeresliced'; > brainthresh=0.5; > scalpthresh=0.10; > scalpsmooth='scalp_smooth'; > scalp_smooth.parameter=9; > scalpvertices=1000; > skullvertices=1000; > brainvertices=1000; > meshmethod='projectmesh'; > headmodel_method='dipoli'; > subjnum='915'; > time='pre'; > timetype='hassan'; > timewindow=[0 .1]; > gridtype='template10'; > beamformer='lcmv'; > sourcemodeltype= 'templatebased'; > identifier='Parameter2-2'; > =================================== > %%read in mri > > switch mritype > case 'MNI' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='MNI'; > case 'Analyze' > [mri] = ft_read_mri(mrifile); > mri.coordsys ='Analyze'; > case 'SPM' > [mri] = ft_read_mri(mrifile); > mri.coordsys = 'SPM'; > end > save(strcat(mrifile,'_',identifier,'_','mri.mat'),'mri') > cfg=[]; > ft_sourceplot(cfg,mri) > ============================== > > %% realigning > switch realign > case 'realigned' > cfg=[]; > cfg.method='fiducial'; > cfg.fiducial.nas = [6.60688 6.30230 -2.94229]; > cfg.fiducial.lpa = [6.04082 7.65872 0.350950]; > cfg.fiducial.rpa = [4.41106 8.71481 3.50199]; > mri_realigned=ft_volumerealign(cfg,mri); > ft_sourceplot(cfg,mri_realigned) > > save(strcat(mrifile,'_',identifier,'_','mri_realigned.mat'),'mri_realigned') > case 'notrealigned' > %do nothing > end > > ========================= > %% volume reslicing > switch volumereslicing > case 'volumeresliced' > cfg = []; > cfg.resolution = 1; > mri_resliced = ft_volumereslice(cfg, mri); > > save(strcat(mrifile,'_',identifier,'_','mri_resliced.mat'),'mri_resliced') > case 'notresliced' > %do nothing > end > ft_sourceplot(cfg,mri_resliced) > ============================== > > %% segmentation parameters > switch scalpsmooth > case 'noscalpsmooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > case 'scalp_smooth' > cfg = []; > cfg.brainthreshold = brainthresh; > cfg.scalpthreshold = scalpthresh; > cfg.scalpsmooth = scalp_smooth.parameter; > cfg.downsample = 1; %no downsampling > cfg.output = {'brain' 'skull' 'scalp'}; > seg = ft_volumesegment(cfg, mri); > end > > seg.anatomy = mri.anatomy; > cfg = []; > cfg.funparameter = 'trishells'; > cfg.funcolormap = [1 0 0;0 1 0;0 0 1]; > cfg.maskparameter=cfg.funparameter; > ft_sourceplot(cfg,seg) > > save(strcat(mrifile,scalpsmooth,'_',identifier,'_','seg.mat'),'seg') > ================================= > %% prepare mesh > > cfg = []; > cfg.method= meshmethod; > cfg.tissue = {'scalp', 'skull', 'brain'}; > cfg.numvertices = [scalpvertices skullvertices brainvertices]; > bnd = ft_prepare_mesh(cfg, seg); > % i enlarged / reduced the boundary mesh a little bit, because they were > causing errors, probably due to overlapping > bnd(1).pnt = bnd(1).pnt.*1.001; > bnd(2).pnt = bnd(2).pnt.*1; > bnd(3).pnt = bnd(3).pnt.*0.999; > > figure; > ft_plot_mesh(bnd(1))%scalp > figure; > ft_plot_mesh(bnd(2))%skull > figure; > ft_plot_mesh(bnd(3))%brain > > %% save mesh > > save(strcat(mrifile,cfg.method,num2str(scalpvertices),num2str(skullvertices),num2str(brainvertices),'_',identifier,'_','bnd.mat'),'bnd') > ============================================= > > %% build headmodel > > switch headmodel_method > case 'dipoli' > cfg = []; > cfg.method = 'dipoli'; > case 'bemcp' > cfg = []; > cfg.method = 'bemcp'; > end > > headmodel = ft_prepare_headmodel(cfg, bnd); > headmodel = ft_convert_units(headmodel,'cm'); > > > save(strcat(mrifile,cfg.method,'_',identifier,'_','headmodel.mat'),'headmodel'); > > ==================================== > %% adding electrodes to headmodel > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode > file > % visualize head surface (scalp) > figure; > ft_plot_mesh(headmodel.bnd(1), > 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); > hold on; > % plot electrodes > ft_plot_sens(elec,'style', 'sk') > ================================= > %most likely they are not aligned, so for aligning electrodes > cfg = []; > cfg.method = 'interactive';%can try the 'fiducial' method but is very > %likely not to fix it > cfg.elec = elec; > % nas=mri_realigned.cfg.fiducial.nas; > % lpa=mri_realigned.cfg.fiducial.lpa; > % rpa=mri_realigned.cfg.fiducial.rpa; > cfg.headshape = headmodel.bnd(1);%scalp > elec_aligned = ft_electroderealign(cfg);%use the gui to manually align > the electrodes > > save(strcat(mrifile,'_',identifier,'_','elec_aligned.mat'),'elec_aligned') > ================================== > %% load EEG data > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6w') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM0') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3W') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3Bw') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM3Bb') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6b') > load(strcat('subj',subjnum,'_',time,'_FT_bothStim_rejChan500hz0.1hz-30hz_fromContinuous.mat'), > 'dataM6') > ==================================== > %% timelock data > > cfg = []; > cfg.refef= 'yes'; %added at 2-5 > > > same = dataM0; > same.trial = [dataM0.trial dataM3W.trial]; > same.time = [dataM0.time dataM3W.time]; > > diff = dataM6; > diff.trial = [dataM3Bb.trial dataM6.trial]; > diff.time = [dataM3Bb.time dataM6.time]; > > switch timetype > case 'simple' > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > case 'hassan' > cfg.vartrllength = 0; %was changed to 0 from 2 > cfg.covariance = 'yes'; > cfg.covariancewindow = timewindow; > cfg.keeptrials = 'yes'; > timelock_m0 = ft_timelockanalysis(cfg, dataM0); > timelock_m6 = ft_timelockanalysis(cfg, dataM6); > timelock_m3w = ft_timelockanalysis(cfg, dataM3W); > timelock_m3b = ft_timelockanalysis(cfg, dataM3Bb); > timelock_diff = ft_timelockanalysis(cfg, diff); > timelock_same = ft_timelockanalysis(cfg, same); > > end > > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam0.mat'),'timelock_m0') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam6.mat'),'timelock_m6') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_datam3w.mat'),'timelock_m3w') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_data3b.mat'),'timelock_m3b') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_diff.mat'),'timelock_diff') > > save(strcat(mrifile,timetype,time,'_',identifier,'_','timelock_same.mat'),'timelock_same') > > ============================ > %% make sourcemodel > > switch sourcemodeltype > case 'templatebased' > template=load('standard_sourcemodel3d10mm.mat'); > elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load > electrode file > cfg = []; > cfg.headmodel = headmodel; > cfg.mri=mri; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template.sourcemodel; > cfg.grid.nonlinear = 'yes'; > cfg.resolution = 2; % resolution of the template grid in mm > cfg.moveinward = 1; % actually uses vol mesh > cfg.grid.unit ='mm'; > cfg.inwardshift = 0; % needs to be expressed to work with > moveinward > cfg.elec = elec; > % cfg.headshape=('cortex_5124.surf.gii'); > mysourcemodel = ft_prepare_sourcemodel(cfg); > > case 'individual' > load('standard_sourcemodel3d5mm.mat'); > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.resolution = 5; % resolution of the template grid in mm > cfg.grid.nonlinear = 'yes'; % use non linear normalization > cfg.mri = mri; % use subject's mri in mni coordinates > cfg.grid.unit = 'mm'; > mysourcemodel = ft_prepare_sourcemodel(cfg); > case 'template' > mysourcemodel=load('standard_sourcemodel3d10mm.mat');%doensn't work > end > > > > > save(strcat(mrifile,'resolution',num2str(cfg.resolution),'_',subjnum,'_',identifier,'_','sourcemodel.mat'),'mysourcemodel') > ======================= > %% Plot the single subject'e head model and grid positions > > figure > hold on > ft_plot_vol(headmodel,'edgecolor','none','facealpha',0.3); > ft_plot_mesh(mysourcemodel.pos(mysourcemodel.inside,:)); > ======================== > %% Double check that source model is aligned to the segmented volume and > to the electrodes > *HERE IS WHERE I SEE THE ERROR* > figure > hold on > > plot3(mysourcemodel.pos(mysourcemodel.inside,1),mysourcemodel.pos(mysourcemodel.inside,2),mysourcemodel.pos(mysourcemodel.inside,3),'.'); > > ft_plot_vol(headmodel,'facecolor','brain','edgecolor','none','facealpha',0.3); > ft_plot_sens(elec_aligned,'label','label','style','y*','Markersize',10); > ======================================== > %% make leadfield > > > switch gridtype > case 'individual' > cfg = []; > cfg.elec = elec; > cfg.headmodel = headmodel; > cfg.normalize = 'yes'; > cfg.reducerank= 3; > cfg.grid.unit = 'cm';% same unit as above, i.e. in cm > [grid] = ft_prepare_leadfield(cfg); > case 'templatebased' > load('standard_sourcemodel3d10mm.mat') > cfg = []; > cfg.elec = elec; > cfg.template = sourcemodel.cfg.grid; > cfg.grid=mysourcemodel.cfg.grid; > cfg.headmodel = headmodel; > cfg.reducerank = 3; % default is 3 for EEG, 2 for MEG > cfg.channel = 'all'; > cfg.normalize= 'yes'; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > [grid] = ft_prepare_leadfield(cfg); > case 'template10' > load('standard_sourcemodel3d10mm.mat') > cfg.normalize='yes'; > [grid]=sourcemodel.cfg.grid; > end > > > save(strcat(mrifile,gridtype,'_',identifier,'_','leadfield.mat'),'grid') > =========================== > %% Interpolate > cfg = []; > cfg.interpmethod = 'linear'; > cfg.parameter = 'pow'; > sourceinterp_diff = ft_sourceinterpolate(cfg, sourceanalysis_diff, mri); > sourceinterp_same = ft_sourceinterpolate(cfg, sourceanalysis_same, mri); > sourceinterp_m0 = ft_sourceinterpolate(cfg, sourceanalysis_m0, mri); > sourceinterp_m6 = ft_sourceinterpolate(cfg, sourceanalysis_m6, mri); > sourceinterp_m3w = ft_sourceinterpolate(cfg, sourceanalysis_m3w, mri); > sourceinterp_m3b = ft_sourceinterpolate(cfg, sourceanalysis_m3b, mri); > > > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_diff.mat'),'sourceinterp_diff') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m0.mat'),'sourceinterp_m0') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m6.mat'),'sourceinterp_m6') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3w.mat'),'sourceinterp_m3w') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_m3b.mat'),'sourceinterp_m3b') > % > save(strcat(mrifile,'_',identifier,'_','sourceinterp_same.mat'),'sourceinterp_same') > ================================= > > %%beamforming > > cfg = []; > cfg.method = 'slice'; > % cfg.slicedim= 1; > cfg.funcolormap = 'jet'; > % cfg.method = 'ortho'; > % cfg.funcolorlim = 'zeromax'; > % cfg.funcolorlim = [0.01 0.2]; > cfg.funparameter= 'pow'; > > > test2=sourceinterp_diff; > > test2.pow=((sourceinterp_diff.pow-sourceinterp_same.pow)./(sourceinterp_diff.pow+sourceinterp_same.pow)); > test=sourceinterp_diff; > test.pow=sourceinterp_diff.pow-sourceinterp_same.pow; > ft_sourceplot(cfg,test) > ft_sourceplot(cfg,test2) > ft_sourceplot(cfg,sourceinterp_same); > ft_sourceplot(cfg,sourceinterp_diff); > ft_sourceplot(cfg,sourceinterp_m0); > ft_sourceplot(cfg,sourceinterp_m6); > ft_sourceplot(cfg,sourceinterp_m3w); > ft_sourceplot(cfg,sourceinterp_m3b); > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Thu Mar 31 13:11:31 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Thu, 31 Mar 2016 13:11:31 +0200 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr> Message-ID: Dear FielTrip community, Sorry to bother you again... I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... This is my story : - It's a single-subject study - I want to compare two sets of trials observed in different conditions. - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the "unequal sample size problem". - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). Based on the paper, I could refer myself to the point "2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin". - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. - And I can perform the montecarlo simulation. My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? This is what I did : 1) Extract and preprocess the signal from my condition 1. 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → 3) coh1= ft_connectivityanalysis(cfg, freq1) I did the same thing for the other condition → coh2. And then for the statistics : cfg = []; cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) cfg.parameter='cohspctrm'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; stat=ft_freqstatistics(cfg, coh1, coh2); And it gives me the following error : Error using ft_checkconfig (line 153) The field cfg.design is required. Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? Any help will be appreciated ! Thanks a lot for your time, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France -------------- next part -------------- An HTML attachment was scrubbed... URL: From tineke.snijders at donders.ru.nl Thu Mar 31 13:47:19 2016 From: tineke.snijders at donders.ru.nl (Snijders, T.M. (Tineke)) Date: Thu, 31 Mar 2016 11:47:19 +0000 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr>, Message-ID: <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> Hi Laetitia, If you only have one subject you do need individual trial data, otherwise you can't do statistics like this. You need multiple observations (either subjects or trials). Best, Tineke ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of laetitia.lalla at inserm.fr [laetitia.lalla at inserm.fr] Sent: Thursday, March 31, 2016 1:11 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Question about coherence statistics Dear FielTrip community, Sorry to bother you again... I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... This is my story : - It's a single-subject study - I want to compare two sets of trials observed in different conditions. - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the “unequal sample size problem”. - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). Based on the paper, I could refer myself to the point “2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin”. - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. - And I can perform the montecarlo simulation. My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? This is what I did : 1) Extract and preprocess the signal from my condition 1. 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → 3) coh1= ft_connectivityanalysis(cfg, freq1) I did the same thing for the other condition → coh2. And then for the statistics : cfg = []; cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) cfg.parameter='cohspctrm'; cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; stat=ft_freqstatistics(cfg, coh1, coh2); And it gives me the following error : Error using ft_checkconfig (line 153) The field cfg.design is required. Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? Any help will be appreciated ! Thanks a lot for your time, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France -------------- next part -------------- An HTML attachment was scrubbed... URL: From laetitia.lalla at inserm.fr Thu Mar 31 15:22:31 2016 From: laetitia.lalla at inserm.fr (laetitia.lalla at inserm.fr) Date: Thu, 31 Mar 2016 15:22:31 +0200 Subject: [FieldTrip] Question about coherence statistics In-Reply-To: <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> References: <2595287eebb0aeacfe5761a9de10de24@inserm.fr> <68a5ba763224075e6d9ec9aa7684221a@inserm.fr>, <815A9820E75FBC4F96B7CD3A8089D11C378AE3E0@exprd04.hosting.ru.nl> Message-ID: Dear Tineke, thank you very much for your fast answer ! I'm not sure I understand what you mean though... Maybe i did not express myself correctly. I do have individual trial data : I have 26 observations for condition 1 and 26 observations for condition 2. They appear : - In my structure "data" (output of ft_preprocessing) : data.trial is a cell {1 x nbtrials} (in my case : {1, 26}) - in my structure "freq" (output of ft_freqanalysis) : freq.powspctrm is a matrix of dimension : nbtrials X nbchannel X nbfreq (in my case 26x2x25) But I don't have this information anymore in the structure "coh" (output of ft_connectivityanalysis) : coh.cospctrm is a matrix of dimension nbchannelcmb x nbfreq (in my case 1x25) since the coherence is calculated by averaging over trials... You may mean I should give the "freq" structures as inputs to the fonction ft_freqstatistics ? I just tried that : I created a structure data_all by concatenated data1.trial and data2.trial (and every other appropriate attribute). I took the Time Frequency Representation with ft_freqanalysis (with keeptrials='yes') to obtain a structure TFR_all (following this tutorial : http://www.fieldtriptoolbox.org/tutorial/natmeg/statistics This is actually how I did the statistics for the Power). But then, if I give this as an input to ft_freqstatistics, like this : cfg = []; cfg.statistic = 'diff'; cfg.parameter='cohspctrm'; cfg.design= [ones(1,nbtrial)) 2*ones(1, nbtrial))]; %same nb of trials for both condition cfg.method = 'montecarlo'; cfg.numrandomization = 1000; cfg.ivar = 1; cfg.alpha=0.05; cfg.tail=0; cfg.correcttail='alpha'; >> stat=ft_freqstatistics(cfg, FR_alltrials); I have the following error : Error using getdimord (line 15) field "cohspctrm" not present in data which makes a lot of sense, since I did not gave coherence as an input... I gave Frequency representations.. I was hoping that maybe the function would calculate the coherence itself for the statistics ? ^^ But it's clearly not the way to go. Could you be a bit more explicit about what you meant ? Thanks a lot. Best, Laetitia Lalla PhD student in Neurosciences INMED, Marseille, France On 31-03-2016 13:47, Snijders, T.M. (Tineke) wrote: > Hi Laetitia, > > If you only have one subject you do need individual trial data, otherwise you can't do statistics like this. > You need multiple observations (either subjects or trials). > > Best, > Tineke > > ------------------------- > > FROM: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of laetitia.lalla at inserm.fr [laetitia.lalla at inserm.fr] > SENT: Thursday, March 31, 2016 1:11 PM > TO: fieldtrip at science.ru.nl > SUBJECT: [FieldTrip] Question about coherence statistics > > Dear FielTrip community, > > Sorry to bother you again... > > I have a question about the statistical testing to assess coherence differences and the related paper by E Maris, JM Schoffelen and P Fries (Journal of Neuroscience Methods, 2007) > > I believe I am exactly in the framework described in this paper, but I guess there is still some crucial information that I don't understand... > > This is my story : > > - It's a single-subject study > > - I want to compare two sets of trials observed in different conditions. > > - The 2 sets of trials are exactly the same size, so my coherence estimate won't be biased by the "unequal sample size problem". > > - I just want to compare for 1 channel pair, for 1 frequency bin [6Hz 10Hz], so I guess the Multiple Comparison problem won't affect my analysis too much (either in the spatial or the spectral dimension). > > Based on the paper, I could refer myself to the point "2.7.1. A non parametric satistical test for a single signal pair and a single frequency bin". > > - Since my interest is in the coherence difference for a single signal pair, I can choose [|C1(f)|-|C2(f)|] as a test statistic. > > - And I can perform the montecarlo simulation. > > My question is the following : How can I implement the nonparametric test of the coherence difference between my 2 conditions with the fieldtrip functions ? > > This is what I did : > > 1) Extract and preprocess the signal from my condition 1. > > 2) freq1= ft_freqanalysis(cfg, signal1) (with cfg.method='mtmfft', cfg.output='powandcsd') → > > 3) coh1= ft_connectivityanalysis(cfg, freq1) > > I did the same thing for the other condition → coh2. > > And then for the statistics : > > cfg = []; > > cfg.statistic = 'diff'; (% because the statistic test than I chose is the difference [|C1(f)|-|C2(f)|]) > > cfg.parameter='cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.numrandomization = 1000; > > cfg.ivar = 1; > > cfg.alpha=0.05; > > cfg.tail=0; > > cfg.correcttail='alpha'; > > stat=ft_freqstatistics(cfg, coh1, coh2); > > And it gives me the following error : > > Error using ft_checkconfig (line 153) > > The field cfg.design is required. > > Here, I really don't understand why I'm asked for the design matrix... When doing the statistics for the Power, I understood that the design matrix was telling which trial belonged to the condition 1 and which trial belonged to the condition 2. But here, it doesn't make any sense because my coherence was calculated by averaging on the trials... > > Does the design matrix mean something differently here ? Or maybe I forgot one parameter to put in the cfg ? > > Any help will be appreciated ! > > Thanks a lot for your time, > > Laetitia Lalla > > PhD student in Neurosciences > > INMED, Marseille, France > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: