From spa268 at nyu.edu Thu Oct 1 12:49:54 2015 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Thu, 1 Oct 2015 11:49:54 +0100 Subject: [FieldTrip] Artifact rejection Message-ID: Hello Federica, Without seeing your code or the error messages you got, I can't tell why cfg.trl=trl didn't work. As for the ft_read_data error, this sounds like the baseline specified might be longer than what's present in your data. You said your data were previously processed (and I assume epoched) in EEGLAB; what was the length of the baseline interval you left? For instance, if you left a -200ms baseline, that means the first trigger in the dataset is occuring at 201 ms (assuming 1000 Hz sampling). Then if you define a trl structure in Fieldtrip with a longer baseline (say, 250 ms) and try to read the data, fieldtrip will try to read 50 ms of data before the actual beginning of the file, which would cause this error. if this is the case, you'll need to either use a shorter baseline interval when you define trials in Fieldtrip, or you'll need to re-process the data in EEGLAB and leave a longer baseline interval. Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ > Message: 1 > Date: Wed, 30 Sep 2015 15:31:56 +0200 > From: Federica Mauro > To: FieldTrip discussion list > Subject: [FieldTrip] Artifact rejection > Message-ID: > UvsNRV8KEj2Ei-ww at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi everybody, > > I'm trying to use Fieldtrip in order to reject automatically artifacts on > my dataset. I'm working with EEG data previously preprocessed in EEGLAB, > thus their extension is .set. > I'm tryng to follow and adapt the tutorial for MEG data at > http://www.fieldtriptoolbox.org/tutorial/automatic_artifact_rejection, but > I found some problems. > > 1. It doesn't recognize assignment cfg.trl = trl. For this reason I tried > to use ft_definetrial in order to get the matrix cfg.trl, but it still > gives me problems: > 2. Specifically: Error using ==> ft_read_data at 206 - cannot read data > before the begin of the file > > Do you have any suggestion? > > Thank you very much in advance! > Best, > Federica > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Thu Oct 1 16:48:09 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Thu, 1 Oct 2015 16:48:09 +0200 (CEST) Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> Message-ID: <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> 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 From jan.schoffelen at donders.ru.nl Thu Oct 1 17:07:31 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 1 Oct 2015 15:07:31 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> Message-ID: <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> 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 From iris.steinmann at med.uni-goettingen.de Thu Oct 1 17:38:25 2015 From: iris.steinmann at med.uni-goettingen.de (Steinmann, Iris) Date: Thu, 1 Oct 2015 15:38:25 +0000 Subject: [FieldTrip] ft_freqgrandaverage with cfg.inputfile not possible Message-ID: Hi everybody, I have a problem using the cfg.inputfile option with the ft_freqgrandaverage function. When I declare an cfg.inputfile and call the ft_freqgrandaverage(cfg) with only the cfg structure as an argument I get an error: ' cfg.inputfile should not be used in conjunction with giving input data to this function' as if I would call the function with an inputfile AND a data structure (what is in fact not the case) here a short example: I calculated the time-frequency-spectra for all my subjects (like that: TFR1 = ft_freqanalysis(cfg, data)) Now I wanne use the ft_freqgrandaverage function to average time-frequency-spectra over subjects. It worked great when I call the function like that: % code start ================================================== cfg = []; cfg.parameter = 'powspctrm'; grdavg_spec = ft_freqgrandaverage(cfg, TFR1, TFR2, TFR3, TFR4, ...); % code end ==================================================== but I get an error message when I save all my TFRs from single subjects in a cell array to use the cfg.inputfile option % code start ================================================== all_subjects = {TFR1; TFR2; TFR3; TFR4; ....}; save 'all_subject_file' 'all_subjects'; cfg = []; cfg.parameter = 'powspctrm'; cfg.inputfile = 'all_subject_file'; grdavg_spec = ft_freqgrandaverage(cfg); % code end ==================================================== Error message: Error using ft_preamble_loadvar (line 46) cfg.inputfile should not be used in conjunction with giving input data to this function Error in ft_preamble (line 56) evalin('caller', ['ft_preamble_' cmd]); Error in ft_freqgrandaverage (line 63) ft_preamble loadvar varargin Would be nice if someone could help me! Thanx! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at telecom-paristech.fr Thu Oct 1 22:45:46 2015 From: alexandre.gramfort at telecom-paristech.fr (Alexandre Gramfort) Date: Thu, 1 Oct 2015 20:45:46 +0000 Subject: [FieldTrip] [JOB] Post-doc position at Neurospin / Paris Message-ID: hi, Applications are invited for a full-time one-year post-doctoral scientist. The position is funded by the Paris- Saclay IDEX project NOTime - Neural Oscillations & Time - whose main objective is to develop and apply cross-frequency-coupling analyses on electrophysiological and M/EEG data. Applications are invited from committed and enthusiastic researchers with significant experience with M/EEG and substantial research record in cognitive neurosciences, psychology and/or related field. The selected postdoctoral fellow will work in full collaboration with a master student dedicated to the project, and with the following consortium of researchers: - Valérie Doyère, NeuroPsi: http://neuro-psi.cnrs.fr/spip.php?article245&lang=en - Alexandre Gramfort, Telecom ParisTech: http://alexandre.gramfort.net/ - Virginie van Wassenhove, Neurospin: https://sites.google.com/site/virginievanwassenhove/ Full Job Description: https://www.dropbox.com/s/lq4oi0k8cu85jag/NOTIME_postdoc_advert.pdf?dl=0 Application package: - CV (incl. a list of publications) - Two letters of recommendation (or contacts from which those could be obtained) - A letter of intent with a statement of research interests Please put IDEX POSTDOC in the email subject and send your application package to Virginie.van.Wassenhove at gmail.com Applications will be considered until the position is filled. Best, -- Alexandre Gramfort, PhD Assistant Professor, TSI, Telecom ParisTech, CNRS LTCI 46 Rue Barrault, 75013 Paris, France http://alexandre.gramfort.net alexandre.gramfort at telecom-paristech.fr From bibi.raquel at gmail.com Fri Oct 2 06:16:33 2015 From: bibi.raquel at gmail.com (Raquel bibi Cohen) Date: Fri, 2 Oct 2015 00:16:33 -0400 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: References: Message-ID: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad > On Sep 30, 2015, at 10:54 AM, Wu, Jia wrote: > > Hi, > > If I have 100 subjects, do I have to do: > grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? > > Is there a better way? Or is it not what I should be doing? > > best, > -jia > _______________________________________________ > fieldtrip 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.whitmarsh at ki.se Fri Oct 2 10:32:47 2015 From: stephen.whitmarsh at ki.se (Stephen Whitmarsh) Date: Fri, 2 Oct 2015 08:32:47 +0000 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> References: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> Message-ID: Hi Jia, (and hi Raquel!) Perhaps easiest is if you get all your subjects in a MATLAB struct, e.g. data{1}, data{2}, etc. Then you can just enter that structure in the FieldTrip functions that take multiple dataset such as ft_timelockgrandaverage and ft_freqanalysis, with e.g. timelockgrandaverage(cfg,data{:}) Cheers, stephen From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel bibi Cohen Sent: 02 October 2015 06:17 To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad On Sep 30, 2015, at 10:54 AM, Wu, Jia > wrote: Hi, If I have 100 subjects, do I have to do: grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? Is there a better way? Or is it not what I should be doing? best, -jia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Fri Oct 2 11:39:40 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Fri, 2 Oct 2015 11:39:40 +0200 (CEST) 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: <457842304.264271.1443778780929.JavaMail.zimbra@bcbl.eu> Hi Jan Mathijs, Ok, I see what you mean. I will follow your comments then. Thank you very much for your help! All the best, Sara Sara Aurtenetxe ----- Original Message ----- From: "Schoffelen, J.M. (Jan Mathijs)" To: "FieldTrip discussion list" Sent: Thursday, October 1, 2015 5:07:31 PM Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE 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 From jia.wu at yale.edu Fri Oct 2 15:10:44 2015 From: jia.wu at yale.edu (Wu, Jia) Date: Fri, 2 Oct 2015 13:10:44 +0000 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: References: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com>, Message-ID: Hi Stephen (and hi Raquel) Eelke in an previous email suggested the same thing and it worked really well. Thanks everyone for help. best, -jia ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Stephen Whitmarsh [stephen.whitmarsh at ki.se] Sent: Friday, October 02, 2015 4:32 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, (and hi Raquel!) Perhaps easiest is if you get all your subjects in a MATLAB struct, e.g. data{1}, data{2}, etc. Then you can just enter that structure in the FieldTrip functions that take multiple dataset such as ft_timelockgrandaverage and ft_freqanalysis, with e.g. timelockgrandaverage(cfg,data{:}) Cheers, stephen From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel bibi Cohen Sent: 02 October 2015 06:17 To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad On Sep 30, 2015, at 10:54 AM, Wu, Jia > wrote: Hi, If I have 100 subjects, do I have to do: grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? Is there a better way? Or is it not what I should be doing? best, -jia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at donders.ru.nl Fri Oct 2 17:03:55 2015 From: n.lam at donders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 2 Oct 2015 15:03:55 +0000 Subject: [FieldTrip] FieldTrip workshop in Salzburg, Austria Message-ID: Dear FieldTrippers, FieldTrip is holding a workshop in Salzburg in December. The local organizers are currently accepting applications. For more information see here: http://www.fieldtriptoolbox.org/workshop/salzburg Best, Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaminkim at umich.edu Fri Oct 2 20:41:06 2015 From: kaminkim at umich.edu (Kamin Kim) Date: Fri, 2 Oct 2015 13:41:06 -0500 Subject: [FieldTrip] Postdoc position: Electrophysiology of Language Networks, UT Houston Medical School Message-ID: Dear all, Two post-doctoral positions are available in the lab of Nitin Tandon at Houston (www.tandonlab.org), to begin as soon as fall of 2015, for a duration of up to five years. These positions will be supported by recent grants awarded to the PI from the National Science Foundation and the national Institutes of Health ( www.aronlab.org). Candidates for this position should have a background in cognition/ cognitive neuroscience/ intracranial electrophysiology and be interested in understanding speech production in humans. Interactions with our collaborators on these grants, particularly Greg Hickok at UCI, Bob Knight at UC Berkeley and Behnaam Aazhang at Rice University will be encouraged and facilitated. Both positions will involve state-of-the-art analysis of electro-corticographic signals in patients using stereo EEG and subdural grid electrodes and novel electrical stimulation approaches. Opportunities for inter-modal comparisons will also be provided. Candidates must have strong capabilities in one or more of the following disciplines – electrophysiology, signal processing, cognitive neuroscience or computational neuroscience. New members of the lab will benefit from the expertise of several other collaborators, post-docs and graduate students and a proven track record of expertise in intracranial electrophysiology. Applications should consist of a cover letter describing research interests (and how those are a good fit for the position), a curriculum vitae, and contact information for three referees. Applicants will be evaluated on a first come first served basis and applications will be evaluated till the positions are filled, which we expect to happen by the end of this year. Pay will be commensurate with NIH/NSF rates for post-doctoral fellows and full benefits will be provided via the University of Texas. Please send completed applications to nitin.tandon at uth.tmc.edu. *Summary: * Post-docs will analyze human electrocorticographic (ECoG) data collected using intracranial EEG (iEEG) - stereo EEG (sEEG) and subdural grid electrodes (SDE) during language production - and modulate these using novel electrical stimulation approaches. -- ======================================= Kamin Kim, Ph.D. University of Texas Medical School at Houston 6431 Fannin Street, MSB Suite G550D Houston, TX 77030 kamin.kim at uth.tmc.edu ======================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Fri Oct 2 20:44:42 2015 From: bick35 at gmail.com (Steph Bickel) Date: Fri, 2 Oct 2015 11:44:42 -0700 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: Message-ID: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan > On Sep 26, 2015, at 11:54 PM, Steph Bickel wrote: > > Hello fieldtrip experts, > > a script that used to work gives me problems now. > > When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. > > > cfg=[]; > cfg.dataset = edf_file ; > cfg.continuous = ‘yes’; > cfg.demean = ‘yes' ; > cfg.channel = ‘Event' ; > raw = ft_preprocessing(cfg); > > raw = > > hdr: [1x1 struct] > label: {'Event'} > time: {[1x152082 double]} > trial: {[129x152082 double]} > fsample: 499.7071 > sampleinfo: [1 152082] > cfg: [1x1 struct] > > > It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? > > > if isfield(EDF, 'chansel') > chanindx = EDF.chansel; > chanSel = 1; > else > chanindx = [1:EDF.NS]; > chanSel = 0; > end; > > > > Thank you! > > Stephan > > (I’m using the current github field trip version on a mac) -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Sat Oct 3 08:42:27 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Sat, 3 Oct 2015 06:42:27 +0000 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: , Message-ID: <0065FF0A-7B22-4CD6-BA2C-0659CC77F48C@donders.ru.nl> Dear Stephan, Actually, the data structure looks fine to me. The dimension order in the trial field is trialnumber x timepoints, (do you have 129 trials?), not channel x timepoints. Or have I misunderstood your problem? Best, Stan Op 2 okt. 2015 om 20:46 heeft Steph Bickel > het volgende geschreven: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan On Sep 26, 2015, at 11:54 PM, Steph Bickel > wrote: Hello fieldtrip experts, a script that used to work gives me problems now. When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. cfg=[]; cfg.dataset = edf_file ; cfg.continuous = ‘yes’; cfg.demean = ‘yes' ; cfg.channel = ‘Event' ; raw = ft_preprocessing(cfg); raw = hdr: [1x1 struct] label: {'Event'} time: {[1x152082 double]} trial: {[129x152082 double]} fsample: 499.7071 sampleinfo: [1 152082] cfg: [1x1 struct] It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? if isfield(EDF, 'chansel') chanindx = EDF.chansel; chanSel = 1; else chanindx = [1:EDF.NS]; chanSel = 0; end; Thank you! Stephan (I’m using the current github field trip version on a mac) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RICHARDS at mailbox.sc.edu Sun Oct 4 01:37:36 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sat, 3 Oct 2015 23:37:36 +0000 Subject: [FieldTrip] Input to SVD cannot be NAN, and dipole lies on boundary Message-ID: <54048153-CFD2-477D-A707-FD6C2C0BC2E2@mailbox.sc.edu> I am trying to create a lead field matrix for a BEM Dipoli model. For this model I have a 4-compartment BEM model, based on a realistic head model from a participant MRI; meshes for skin, skull, csf, and brain; and source model is a grid on the gray matter. I use the Dipoli external tools (from FT calls) to create a Dipoli head model, and then lead field with the grid and electrodes. I have gotten this to work for a lot of subjects and data, but am stumped on one particular subject. For this one I can get all the way through the pipeline (grid, electrodes, mesh, head model, and leadfield). But when I go to get the source map, I get the error mentioned in other posts “Input to SVD cannot be NAN”. I have not tracked this down, but it appears that the LF matrix has NaN’s in it. I went back to the head model. When it is being created I get: Warning: dipole lies on boundary of volume model > In inf_medium_leadfield (line 54) In eeg_leadfieldb (line 93) In ft_compute_leadfield (line 431) In ft_prepare_leadfield (line 225) In CreateFieldtripLecomputing leadfield 6723/63422 This comes from for i=1:Ndipoles r = pnt - ones(Npnt,1) * rd((1:3) + 3*(i-1)); R = (4*pi*cond) * (sum(r' .^2 ) .^ 1.5)'; if any(R==0) warning('dipole lies on boundary of volume model'); end lf(:,(1:3) + 3*(i-1)) = r ./ [R R R]; End Apparently the dipole locations in the source model grid are right on the boundary of one of the vertices or triangles of the volume mesh, so one of the R’s is zero, and the NaN is apparently from the [R R R] as a div / 0. This is just a guess, because I haven’t tracked down where the “Input to SVD cannot be NaN” is coming from. I tried shrinking or expanding the inner compartment (brain), hoping that it would not then overlap with the source model locations. This did not work. I tried shrinking the source model locations, though don’t want to do this because these are actual GM in the participant, but it did not work anyway. Any suggestions or help on this? Thanks, 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 RICHARDS at mailbox.sc.edu Sun Oct 4 02:40:15 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sun, 4 Oct 2015 00:40:15 +0000 Subject: [FieldTrip] sLORETA Message-ID: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. Thanks, 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 jan.schoffelen at donders.ru.nl Sun Oct 4 10:18:01 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 4 Oct 2015 08:18:01 +0000 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: Message-ID: Hi Stephan, It could be that this is a genuine bug. Could you create an account on bugzilla.fieldtriptoolbox.org, and file a ‘bug’ about this? Then we take it off list, and investigate further. It would be really helpful if you also could get us some of your data (which goes with the script you sent earlier) that is giving you trouble. Some more information about the process can be found on: http://www.fieldtriptoolbox.org/bugzilla Best regards, 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 Oct 2, 2015, at 8:44 PM, Steph Bickel > wrote: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan On Sep 26, 2015, at 11:54 PM, Steph Bickel > wrote: Hello fieldtrip experts, a script that used to work gives me problems now. When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. cfg=[]; cfg.dataset = edf_file ; cfg.continuous = ‘yes’; cfg.demean = ‘yes' ; cfg.channel = ‘Event' ; raw = ft_preprocessing(cfg); raw = hdr: [1x1 struct] label: {'Event'} time: {[1x152082 double]} trial: {[129x152082 double]} fsample: 499.7071 sampleinfo: [1 152082] cfg: [1x1 struct] It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? if isfield(EDF, 'chansel') chanindx = EDF.chansel; chanSel = 1; else chanindx = [1:EDF.NS]; chanSel = 0; end; Thank you! Stephan (I’m using the current github field trip version on a mac) _______________________________________________ fieldtrip 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 Sun Oct 4 10:29:43 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 4 Oct 2015 08:29:43 +0000 Subject: [FieldTrip] sLORETA In-Reply-To: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> References: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> Message-ID: Hi John, I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? The answer to both of these subquestions would be ‘yes’ :o). Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. That sounds like a great plan. I’d suggest to file this as a feature request on bugzilla.fieldtriptoolbox.org, so that we can take it from there. From our end, we can then incorporate your suggested adjustments to the code. One thing you could look into, is the way in which sLORETA (and while you’re at it :o) dSPM) is computed in Brainstorm, which is also open source and matlab-based. Best, Jan-Mathijs Thanks, 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 *********************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Sun Oct 4 21:55:35 2015 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sun, 4 Oct 2015 20:55:35 +0100 Subject: [FieldTrip] sLORETA In-Reply-To: References: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> Message-ID: <97E4469F-24B5-4C9C-9936-8E7253C41285@gmail.com> Dear all, There are self contained low level functions for sLORETA and dSPM in NutMEG. I recently used them to add this functionality to my DAiSS toolbox (https://github.com/SPM/DAiSS, look in /private). Best, Vladimir On 4 Oct 2015, at 09:29, "Schoffelen, J.M. (Jan Mathijs)" wrote: > Hi John, > >> I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html >> >> I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. >> >> Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? > > The answer to both of these subquestions would be ‘yes’ :o). > >> Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. > > That sounds like a great plan. I’d suggest to file this as a feature request on bugzilla.fieldtriptoolbox.org, so that we can take it from there. From our end, we can then incorporate your suggested adjustments to the code. One thing you could look into, is the way in which sLORETA (and while you’re at it :o) dSPM) is computed in Brainstorm, which is also open source and matlab-based. > > Best, > Jan-Mathijs > > >> >> Thanks, 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 >> *********************************************** >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 jrebola at gmail.com Mon Oct 5 12:17:13 2015 From: jrebola at gmail.com (Jose Rebola) Date: Mon, 5 Oct 2015 11:17:13 +0100 Subject: [FieldTrip] Connectivity comparison across conditions Message-ID: Hi! I am trying to assess if there is a difference in connectivity across two conditions in my data. Condition 1 has 240 trials and condition 2 has 252 trials. I have chosen to use the *phase-locking-value* as a measure of connectivity. *My first question is:* Which formula should I use to evaluate the difference between conditions? Would plv1- plv2 be appropriate, or do I have to do some kind of transformation or normalization? If I choose to use other connectivity measures, will it be much different? I have seen for example in the paper of Jan-Mathijs Schoffelen in 2011 that he uses the formula in the following image for the assessment of differences between the coherence values x1 and x2. I should note that I would like to evaluate differences at the intra-subject level. [image: Inline image 1] *My second question is:* In order to do the non-parametric testing, my null hypothesis is that there are no differences between plv1 and plv2 ( I guess). So I can randomize trial labels, evaluate plv1 and plv2 again, do this 1000 times and count the number of times that this difference is bigger than my original difference, right? *My third and fourth questions concern clustering:* In order to do clustering, I should first establish a threshold value for the metric under evaluation. This may be easy to set if I was using t-values, but if I am evaluating differences in means, what should be an appropriate value to use? Regarding spatial clustering, I now have two levels of “neighbour” electrodes, right? At the seed level, and at the destination level. How can these be clustered? I mean, if I consider for example the electrode-pairing T7-P3, both T9-P3 and T7-P5 will be neighbours… *Lastly,* Are these issues already implemented in Fieldtrip or do I have to build my own MATLAB code for the randomization, thresholding and clustering? Thank you so much, José Rebola -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 17815 bytes Desc: not available URL: From azeez.adebimpe5 at gmail.com Mon Oct 5 19:56:30 2015 From: azeez.adebimpe5 at gmail.com (Azeez Adebimpe) Date: Mon, 5 Oct 2015 19:56:30 +0200 Subject: [FieldTrip] Connectivity comparison across conditions In-Reply-To: References: Message-ID: See my opinion within the line On Mon, Oct 5, 2015 at 12:17 PM, Jose Rebola wrote: > Hi! > > > > I am trying to assess if there is a difference in connectivity across two > conditions in my data. Condition 1 has 240 trials and condition 2 has 252 > trials. > > I have chosen to use the *phase-locking-value* as a measure of > connectivity. > > *My first question is:* > > > > Which formula should I use to evaluate the difference between conditions? > > Would plv1- plv2 be appropriate, or do I have to do some kind of > transformation or normalization? If I choose to use other connectivity > measures, will it be much different? > > I have seen for example in the paper of Jan-Mathijs Schoffelen in 2011 > that he uses the formula in the following image for the assessment of > differences between the coherence values x1 and x2. > > I should note that I would like to evaluate differences at the > intra-subject level. > > > [image: Inline image 1] > In simpler form, the PLV is implemented in fieldtrip based on this paper Lachaux 1999 . your formular may be right but seem more complex to me. On comparison of two conditions, you dont need to subtract, you can do statistics in fieldtrip or look for the file name *statcond* in fieldtrip or eeglab, very easy to understand and follow. > > > *My second question is:* > > > > In order to do the non-parametric testing, my null hypothesis is that > there are no differences between plv1 and plv2 ( I guess). So I can > randomize trial labels, evaluate plv1 and plv2 again, do this 1000 times > and count the number of times that this difference is bigger than my > original difference, right? > I didnt get your questions here clearly. Meanwhile, randomization is random sequence of random permutation i.e resampling of original data in 1000 times (in this case -plv). > > > *My third and fourth questions concern clustering:* > > In order to do clustering, I should first establish a threshold value for > the metric under evaluation. This may be easy to set if I was using > t-values, but if I am evaluating differences in means, what should be an > appropriate value to use? > > > > Regarding spatial clustering, I now have two levels of “neighbour” > electrodes, right? At the seed level, and at the destination level. How can > these be clustered? I mean, if I consider for example the electrode-pairing > T7-P3, both T9-P3 and T7-P5 will be neighbours… > > > Ofcourse, you need threshold to threshold the graph, otherwise you can computed weighted clustering coefficient. Thresholding depend on you and your data, there are many ways to threshold. You can threshold within certain range or based on distribution of your data. It is better to read more literature on this aspect. > *Lastly,* > > Are these issues already implemented in Fieldtrip or do I have to build my > own MATLAB code for the randomization, thresholding and clustering? > > > Everything implemented in fieldtrip and sometime you need your own initiative. the best things you can do now is to go through tutorials in fieldtrip first. > Thank you so much, > > > > José Rebola > > I hope it helps. > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 17815 bytes Desc: not available URL: From mitka3 at uniba.sk Tue Oct 6 13:17:25 2015 From: mitka3 at uniba.sk (Milan Mitka) Date: Tue, 6 Oct 2015 13:17:25 +0200 Subject: [FieldTrip] Difference ERP source localisation methodology Message-ID: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> Dear FieldTrip users, I'm a master's student at the Comenius University in Bratislava, Slovakia, currently looking into source reconstruction of event-related potentials. I have a quick methodological question regarding the localisation of event-related potentials which are obtained as difference waves – in my case the rotation-related negativity – by subtracting the standard condition (upright stimuli) from experimental conditions (stimuli rotated to a given degree). Should I a) perform the source reconstruction on the averaged data for each condition and trial, or should I b) first subtract the standard condition from all experimental conditions for every trial and then reconstruct the sources? Thank you. Yours faithfully Milan From RICHARDS at mailbox.sc.edu Tue Oct 6 14:28:33 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Tue, 6 Oct 2015 12:28:33 +0000 Subject: [FieldTrip] re sLORETA Message-ID: <266E8F04-EFD6-4B7B-AC62-6F4E45C73118@mailbox.sc.edu> I received an excellent suggestion and some additional information from Vladimir Litvak. The NUTMEG programs have sLORETA, swLORETA, and dSPM MATLAB routines that are compatible with the FT format. They also have routines that duplicate those in FT (e.g., min norm, LCMV, beamformers) I did the following and it appears to work. Any comments welcome. I have fairly simple source inverse problems, eg. simple grand average ERP (and not beamformer, or dynamic EEG). The FT leadfield is a struct that has lf{nsources} elements, each element is a [nchannels p] vector, where nchannels is the number of channels, p is the number of dipole orientations, and nsources is the number of source vertices or grid points. The NM (NUTMEG) leadfield (Lp) is a matrix, [nchannels p nsources] in size. The following is not my complete code… the LF{nsources} references are conceptual, the programming is somewhat different. 1. Convert the FT LF to the NM Lp. There is a NUTMEG nut_ftgridenutsLpvox which is intended to convert the LF to the Lp. It did not work perfectly, I had to adapt it somewhat to make the Lp matrix correctly from the Lf matrix. 2. Do the call to one of the subrouties Eg cfg=[]; cfg.gamma=.05 nmfilter = nut_sLORETA(Lp,data.cov,cfg) 3--the output is a [nchannel 3 sources] matrix. I used this, and the data.avg, to create the FT source output (e.g., each source.avg.mom{nsources} = inverse[nchannels p]' * data.avg; I added the source.avg.pow, and outsource.time=[1:size(outsource.avg.pow,2)]; outsource.inside=grid.inside; outsource.avg.inside=grid.inside; outsource.pos=grid.pos; outsource.avg.pos=grid.pos; outsource.method='average'; %dim is no of unique values in pos outsource.dim=[size(unique(grid.pos(:,1)),1) size(unique(grid.pos(:,2)),1) size(unique(grid.pos(:,3)),1)]; 4—at this point I have a complete “source” struct similar to that created by ft_sourceanalysis, but the mom and pow are generated by the NUT procedure. I suggest someone doing a help or tutorial file for this. I also invite any suggestions from others. 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 nathanweisz at mac.com Tue Oct 6 15:39:05 2015 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 06 Oct 2015 15:39:05 +0200 Subject: [FieldTrip] opportunity @cimec Message-ID: <179B0B14-B7AB-4F14-B828-88D2226AB695@mac.com> my colleague david melcher asked me to post this info regarding opportunities in his group. best, nathan —————————— Postdoctoral researcher fellowship in Active Perception Center for Mind/Brain Sciences, University of Trento We anticipate opening one or more positions as part of a EU-funded project to study the role of temporal integration in visual and multisensory The ideal candidate will have experience using MEG/EEG and/or tACS to measure the links between perception and neural oscillations. The candidate must have a PhD in cognitive neuroscience, or a related field, and a strong research record including publications. Expertise with creating stimuli and in analyzing neuroimaging data (preferably MEG/EEG) is required. Additional experience with Matlab, image processing, Fieldtrip or analysis of fixation-related potentials (MEG/EEG) will be an advantage. There is some flexibility in the starting date, with a preference for starting by the beginning of 2016. Informal enquiries regarding the position should be directed to Prof. David Melcher (david.melcher @ unitn.it). For further information about the Active Perception Group, see: http://r.unitn.it/en/cimec/map From Don.Rojas at ucdenver.edu Tue Oct 6 20:24:27 2015 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Tue, 6 Oct 2015 18:24:27 +0000 Subject: [FieldTrip] Difference ERP source localisation methodology In-Reply-To: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> References: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> Message-ID: <56B9E03B-AA7E-4304-9B98-25137B063F7C@ucdenver.edu> Dear Milan, In my opinion you are better off trying to do source analyses on the combined activity to all of your conditions, then finding a way to perform the subtraction in source space or statistically. Doing the subtraction first before the source estimate will likely result in poorer signal to noise for your data and that will have a negative impact on the source reconstruction. Best, Don ------------------------ Don Rojas, Ph.D. Professor of Cognitive Neuroscience Molecular, Cellular and Integrative Neuroscience Program Department of Psychology Colorado State University From helen.wieffering at gmail.com Wed Oct 7 16:59:21 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 7 Oct 2015 10:59:21 -0400 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Message-ID: Dear FieldTrip users, I'm writing to see if any one out there has had success with computing Granger causality measures in FieldTrip. We have been working toward making this analysis possible with our EEG data and have now reached the final stages. However, we find that ft_connectivity_analysis (and ft_connectivity_granger for that matter) offers little guidance on how to achieve a good mvar model fit. For example, the function asks the user to specify the model order without offering tests for whiteness, stationarity, or consistency. It seems that Fieldtrip calls on the BSMART toolbox to perform these operations, which further confuses me given that BSMART itself offers these model validation tests. Yet they don't seem to ever be called upon by FieldTrip. We've considered using the BSMART toolbox separately from FieldTrip, yet the toolbox website is rather outdated and the functions are only compatible through 2008 Matlab - seems like a headache. But without tools for validating the mvar model, we can't be confident of any GC results achieved through FieldTrip. Are there perhaps further connectivity tools in FieldTrip that I've overlooked? Or is it worth looking into other toolboxes? We've also considered SIFT and the MVGC toolbox, but would love to keep working with FieldTrip if possible. If anyone can offer advice, or connect me with someone knowledgeable in this area, I'd love to know. Thanks very much, Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From lysne at unm.edu Wed Oct 7 22:55:10 2015 From: lysne at unm.edu (Per Arnold Lysne) Date: Wed, 7 Oct 2015 20:55:10 +0000 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Message-ID: Hi Helen, I am having good luck with ft_connectivity_analysis in MEG using the nonparametric Granger approach of Dhamala, Rangarajan & Ding, 2008, Neuroimage and Physical Review letters. Thanks, Per Lysne University of New Mexico lysne at unm.edu -----Original Message----- From: Helen Wieffering Sent: Oct 7, 2015 8:59 AM To: FieldTrip discussion list Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Dear FieldTrip users, I'm writing to see if any one out there has had success with computing Granger causality measures in FieldTrip. We have been working toward making this analysis possible with our EEG data and have now reached the final stages. However, we find that ft_connectivity_analysis (and ft_connectivity_granger for that matter) offers little guidance on how to achieve a good mvar model fit. For example, the function asks the user to specify the model order without offering tests for whiteness, stationarity, or consistency. It seems that Fieldtrip calls on the BSMART toolbox to perform these operations, which further confuses me given that BSMART itself offers these model validation tests. Yet they don't seem to ever be called upon by FieldTrip. We've considered using the BSMART toolbox separately from FieldTrip, yet the toolbox website is rather outdated and the functions are only compatible through 2008 Matlab - seems like a headache. But without tools for validating the mvar model, we can't be confident of any GC results achieved through FieldTrip. Are there perhaps further connectivity tools in FieldTrip that I've overlooked? Or is it worth looking into other toolboxes? We've also considered SIFT and the MVGC toolbox, but would love to keep working with FieldTrip if possible. If anyone can offer advice, or connect me with someone knowledgeable in this area, I'd love to know. Thanks very much, Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 8 08:56:34 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Thu, 8 Oct 2015 06:56:34 +0000 (UTC) Subject: [FieldTrip] ft_realtime_average References: <1197967334.539643.1444287394485.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1197967334.539643.1444287394485.JavaMail.yahoo@mail.yahoo.com> Hi, Can anyone help me to explain what does the 'average' at the line if isempty (average) in ft_realtime_average refer to?Because when I'm using the function ft_realtime_average, an error of 'Undefined variable of average' is shown.I'm doing the realtime processing.  Thank you. Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Sat Oct 10 13:00:08 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Sat, 10 Oct 2015 13:00:08 +0200 (CEST) Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter Message-ID: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> Dear all, I am working on the localization of oscillatory sources using beamforming (http://www.fieldtriptoolbox.org/tutorial/beamformer). The data are recorded with Elekta-Neuromag, the source estimations are based on individual MNI-aligned grids (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), and the FT version is fieldtrip-20150701. And I have two main issues, which would be very appreciated if someone could help me with: 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. Should I make additional normalization prior to / in the creation of the individual grid? I found this link which is specific to Neuromag data but it says is outdated (?). http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space Or should I interpolate the source estimation to the template, instead of to the individual-mri? When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? Any comment would be very helpful! Thank you in advance, All the best, Sara %% %% Interpolation, normalization and grandaverage load source mri_real template source.pos=template_grid.pos; % right(?) cfg = []; cfg.downsample = 2; cfg.parameter = 'pow'; sourceInt = ft_sourceinterpolate(cfg, source, mri_real); cfg = []; cfg.spmversion = 'spm8'; %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". % However should be one taken by default and unablinginn it works fine so it is confussing (?) sourceIntNorm = ft_volumenormalise(cfg, sourceInt); %% grand average for 7 subjects cfg=[]; cfg.parameter = 'pow'; [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); %% %% -------------- next part -------------- A non-text attachment was scrubbed... Name: gravg_int_templ.jpg Type: image/jpeg Size: 23790 bytes Desc: not available URL: From tzvetan.popov at uni-konstanz.de Sat Oct 10 14:53:33 2015 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 10 Oct 2015 14:53:33 +0200 Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> Message-ID: <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> Hi Sara, 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify source.pos = template_grid.pos source.pnt = template_grid.pos After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. 2.) Yes, ideally all appended. good luck, Tzvetan > Dear all, > > I am working on the localization of oscillatory sources using beamforming > (http://www.fieldtriptoolbox.org/tutorial/beamformer). > The data are recorded with Elekta-Neuromag, > the source estimations are based on individual MNI-aligned grids > (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), > and the FT version is fieldtrip-20150701. > > And I have two main issues, which would be very appreciated if someone could help me with: > > 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. > > Should I make additional normalization prior to / in the creation of the individual grid? > I found this link which is specific to Neuromag data but it says is outdated (?). > http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Or should I interpolate the source estimation to the template, instead of to the individual-mri? > When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). > > 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), > should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? > > > Any comment would be very helpful! > > Thank you in advance, > > All the best, > > Sara > > %% > > %% Interpolation, normalization and grandaverage > > load source mri_real template > > source.pos=template_grid.pos; % right(?) > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'pow'; > sourceInt = ft_sourceinterpolate(cfg, source, mri_real); > > cfg = []; > cfg.spmversion = 'spm8'; > %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; > % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". > % However should be one taken by default and unablinginn it works fine so it is confussing (?) > sourceIntNorm = ft_volumenormalise(cfg, sourceInt); > > %% grand average for 7 subjects > > cfg=[]; > cfg.parameter = 'pow'; > [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); > > %% > > %% > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Sat Oct 10 15:29:54 2015 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 10 Oct 2015 15:29:54 +0200 Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> Message-ID: <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> Sorry second line should read source.pnt =template_grid.pnt > Am 10.10.2015 um 14:53 schrieb Tzvetan Popov : > > Hi Sara, > 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify > source.pos = template_grid.pos > source.pnt = template_grid.pos > After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. > > 2.) Yes, ideally all appended. > > good luck, > Tzvetan > > >> Dear all, >> >> I am working on the localization of oscillatory sources using beamforming >> (http://www.fieldtriptoolbox.org/tutorial/beamformer). >> The data are recorded with Elekta-Neuromag, >> the source estimations are based on individual MNI-aligned grids >> (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), >> and the FT version is fieldtrip-20150701. >> >> And I have two main issues, which would be very appreciated if someone could help me with: >> >> 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. >> >> Should I make additional normalization prior to / in the creation of the individual grid? >> I found this link which is specific to Neuromag data but it says is outdated (?). >> http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> Or should I interpolate the source estimation to the template, instead of to the individual-mri? >> When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). >> >> 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), >> should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? >> >> >> Any comment would be very helpful! >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> %% >> >> %% Interpolation, normalization and grandaverage >> >> load source mri_real template >> >> source.pos=template_grid.pos; % right(?) >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'pow'; >> sourceInt = ft_sourceinterpolate(cfg, source, mri_real); >> >> cfg = []; >> cfg.spmversion = 'spm8'; >> %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; >> % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". >> % However should be one taken by default and unablinginn it works fine so it is confussing (?) >> sourceIntNorm = ft_volumenormalise(cfg, sourceInt); >> >> %% grand average for 7 subjects >> >> cfg=[]; >> cfg.parameter = 'pow'; >> [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); >> >> %% >> >> %% >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 rmontefusco at med.uchile.cl Tue Oct 13 17:59:33 2015 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 13 Oct 2015 11:59:33 -0400 Subject: [FieldTrip] Negative values of debiased wPLI In-Reply-To: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> References: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hello...anybody any guess, explanation? I getting some too...close to zero thought, but still negatives. On Mon, Feb 16, 2015 at 9:09 AM, Marta Bortoletto < marta.bortoletto at cognitiveneuroscience.it> wrote: > Dear Community, > I am using the debiased wPLI to estimate connectivity between 70 EEG > electrodes. I have about 150 trials for each subject. I noticed that some > values of my 70x70 dwPLI matrix are negative. My understanding is that all > values should be between 0 and 1, but for some reason I can get negative > values from the debiasing process. My question is: Shall I calculate the > absolute value of these negative values? Otherwise what shall I do with > them? > > Thank you in advance for your help. > Marta > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Wed Oct 14 02:21:21 2015 From: russgport at gmail.com (russ port) Date: Tue, 13 Oct 2015 20:21:21 -0400 Subject: [FieldTrip] unit gain for Fieldtrip's LCMV beamformer - unit In-Reply-To: References: <2A2B6A5B8C4C174CBCCE0B45E548DEB22A0D8A9B@SKMBXX01.sickkids.ca> Message-ID: <5BA1F9A7-4285-467C-9560-0667E1CCC6A4@gmail.com> Hi All, As an update to this post, which I fear may be otherwise left alone, it seems that the Wiki now states that the virtual channel with be of "the equivalent current dipole source” (http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors ). I assume then if its a ECD ("equivalent current dipole”) is in A(what ever the source model is in i.e. Am, or Am etc etc). Therefore you should just be converting to your units of choice (for me nAm). Does this seem correct? Best, Russ > On Sep 29, 2015, at 10:54 PM, russ port wrote: > > Thanks Marc, > > Sorry for taking so long to respond. I am quite confused now. I think I get what you are talking about with "unit gain" and "unit noise-gain” as defined by Sekihara, as much as I can make out at least with out having the book you refer to (on the bright side I now know what to nag my boss for). I suppose I was a quite mis-leading with what I had in my last email, by which, what I actually did was use the LCMV beamformer to make lead fields to calculate the virtual sensors (see http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors ). Of note, your link to the discussion list is now even more useful. I am using centimeters and a single shell head model. The wiki says "CMV beamformer spatial filter for the location of interest will pass the activity at that location with unit-gain”. From your email, I suspect then that the output would be in Am units. I am a little concerned though that both my output, and the field trip wiki shows values ranging ~ -3 -> 3 (e-4, i.e. mAm not nAm). Or instead would the units be in T/(Am) (if I apply the 1e4 unit conversion). Sorry for not being better at this, I think I do need those books you were mentioning... > > Best, > Russ > > > > > >> On Sep 11, 2015, at 12:40 PM, Marc Lalancette > wrote: >> >> mformer with unit gain would have Am units. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zsoltturi at gmail.com Wed Oct 14 08:20:24 2015 From: zsoltturi at gmail.com (Zsolt Turi) Date: Wed, 14 Oct 2015 08:20:24 +0200 Subject: [FieldTrip] =?utf-8?q?conference_in_G=C3=B6ttingen?= Message-ID: Dear All, On behalf of the program committee it is my great pleasure to invite you to the “Theory and Practice of Transcranial Brain Stimulation (TMS, tDCS/tACS)” that will be held in the University Medical Center, Göttingen, Germany from the 9th – 10th of February 2016. The Conference is being organized by the Department of Clinical Neurophysiology, Georg-August University, Göttingen, Germany. Our laboratory plays a central role in non-invasive brain stimulation researchers for more than 15 years. Our goal is to deliver an outstanding program with the right balance of basic scientific and clinical relevance, which covers the entire spectrum of physiological, methodological, modelling, practice and ethical issues in non-invasive brain stimulation research. The entire conference will be held in English, therefore, it is imperative that the attendants are able to understand and communicate in English. We believe that participants will benefit from the high value scientific program. We would suggest you to register for the conference and make arrangements for travel and stay. Register soon (see attachement) and confirm your participation, as only 50 participants are accepted: First register & pay, first accepted. Yours sincerely, Zsolt Turi (Ph.D.) Post-doctoral Research Fellow Department of Clinical Neurophysiology Georg-August University, Göttingen Robert-Koch-Str. 40 37075 Goettingen -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: GöttingenRegistration_2016.pdf Type: application/pdf Size: 82954 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NWGProgram_2016.pdf Type: application/pdf Size: 368112 bytes Desc: not available URL: From n.komeilipoor at vu.nl Wed Oct 14 09:29:04 2015 From: n.komeilipoor at vu.nl (Komeilipoor, N.) Date: Wed, 14 Oct 2015 07:29:04 +0000 Subject: [FieldTrip] =?windows-1252?q?conference_in_G=F6ttingen?= In-Reply-To: References: Message-ID: Ciao Ivan, Tutto bene. Certo! allora ci sentiamo venerdi, per te va bene alle 5 pm (Italy time)? ________________________________ Van: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] namens Zsolt Turi [zsoltturi at gmail.com] Verzonden: woensdag 14 oktober 2015 8:20 Aan: FieldTrip discussion list Onderwerp: [FieldTrip] conference in Göttingen Dear All, On behalf of the program committee it is my great pleasure to invite you to the “Theory and Practice of Transcranial Brain Stimulation (TMS, tDCS/tACS)” that will be held in the University Medical Center, Göttingen, Germany from the 9th – 10th of February 2016. The Conference is being organized by the Department of Clinical Neurophysiology, Georg-August University, Göttingen, Germany. Our laboratory plays a central role in non-invasive brain stimulation researchers for more than 15 years. Our goal is to deliver an outstanding program with the right balance of basic scientific and clinical relevance, which covers the entire spectrum of physiological, methodological, modelling, practice and ethical issues in non-invasive brain stimulation research. The entire conference will be held in English, therefore, it is imperative that the attendants are able to understand and communicate in English. We believe that participants will benefit from the high value scientific program. We would suggest you to register for the conference and make arrangements for travel and stay. Register soon (see attachement) and confirm your participation, as only 50 participants are accepted: First register & pay, first accepted. Yours sincerely, Zsolt Turi (Ph.D.) Post-doctoral Research Fellow Department of Clinical Neurophysiology Georg-August University, Göttingen Robert-Koch-Str. 40 37075 Goettingen -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Wed Oct 14 10:40:24 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Wed, 14 Oct 2015 10:40:24 +0200 (CEST) Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> Message-ID: <1789381146.505725.1444812024740.JavaMail.zimbra@bcbl.eu> Hi Tzvetan, Sorry for taking that long to respond. Thank you for your answers! 1. As far as I observed, it is sufficient to specify source.pos = template_grid.pos, for the grandaverage and stats. Then interpolate the source estimation with the template. 2. Thanks! All the best, Sara Sara Aurtenetxe ----- Original Message ----- From: "Tzvetan Popov" To: "FieldTrip discussion list" Sent: Saturday, October 10, 2015 3:29:54 PM Subject: Re: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter Sorry second line should read source.pnt =template_grid.pnt > Am 10.10.2015 um 14:53 schrieb Tzvetan Popov : > > Hi Sara, > 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify > source.pos = template_grid.pos > source.pnt = template_grid.pos > After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. > > 2.) Yes, ideally all appended. > > good luck, > Tzvetan > > >> Dear all, >> >> I am working on the localization of oscillatory sources using beamforming >> (http://www.fieldtriptoolbox.org/tutorial/beamformer). >> The data are recorded with Elekta-Neuromag, >> the source estimations are based on individual MNI-aligned grids >> (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), >> and the FT version is fieldtrip-20150701. >> >> And I have two main issues, which would be very appreciated if someone could help me with: >> >> 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. >> >> Should I make additional normalization prior to / in the creation of the individual grid? >> I found this link which is specific to Neuromag data but it says is outdated (?). >> http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> Or should I interpolate the source estimation to the template, instead of to the individual-mri? >> When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). >> >> 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), >> should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? >> >> >> Any comment would be very helpful! >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> %% >> >> %% Interpolation, normalization and grandaverage >> >> load source mri_real template >> >> source.pos=template_grid.pos; % right(?) >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'pow'; >> sourceInt = ft_sourceinterpolate(cfg, source, mri_real); >> >> cfg = []; >> cfg.spmversion = 'spm8'; >> %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; >> % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". >> % However should be one taken by default and unablinginn it works fine so it is confussing (?) >> sourceIntNorm = ft_volumenormalise(cfg, sourceInt); >> >> %% grand average for 7 subjects >> >> cfg=[]; >> cfg.parameter = 'pow'; >> [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); >> >> %% >> >> %% >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 maity_winky at yahoo.es Wed Oct 14 11:31:51 2015 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Wed, 14 Oct 2015 09:31:51 +0000 (UTC) Subject: [FieldTrip] Nonlinear normalization/MNI grid distortions References: <1945557667.185319.1444815111622.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1945557667.185319.1444815111622.JavaMail.yahoo@mail.yahoo.com> Dear community, I performed nonlinear normalizations and plotted theresulting MRIs. I noticed the normalized MRIs had unwanted distortions, and wereclearly different from the normalized MRIs obtained directly in SPM. I noticed the default parameters (flags) in Fieldtrip’s spm_normalise()are different from SPM’s spm_normalise(). In Fieldtrip, the amount of regularizationis too low (= 0.1, line 144 in spm_normalise) compared with SPM’sdefault (=1). This may be a problem not only for normalization but whencomputing MNI-aligned individual grids following the tutorial (“CreateMNI-aligned grids in individual”) because there is an implicit normalizationstep. Possible solutions: -         Call/substitute Fieldtrip’s spm_normalise() bySPM’s function or change Fieldtrip’s default flags values.-         Perform the normalization outside in SPM andprovide the cfg.spmparams.flags. However, there is a bug in ft_volumenormalise()using that option. I think it may be because the flags are not passed to spm_normalise(line 239). As a fix, I have modified the function with the lines below. Butsurely there is a more direct way to avoid the problem.VF        =spm_vol([cfg.intermediatename,'_anatomy.img']);params    =spm_normalise(VG,VF,[],[],[],cfg.spmparams.flags); I wish this report helps.  Best regards,Maité -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 15 08:42:21 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Thu, 15 Oct 2015 06:42:21 +0000 (UTC) Subject: [FieldTrip] segementation based on external trigger References: <1117284429.535148.1444891341551.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1117284429.535148.1444891341551.JavaMail.yahoo@mail.yahoo.com> Hi, I'm doing the EEG realtime processing using TMSI and I want to segment the eeg signal based on the trigger. My questions are: 1) How can I do that in fieldtrip?2) I'm using ft_realtime_average and ft_realtime_selectiveaverage to average the eeg signal, however, there is error shown.    Error using ft_checkconfig(line 153)    The field cfg.datafile is required.    The field cfg.headefile is required.     Thanks.  Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Fri Oct 16 09:28:54 2015 From: joramvandriel at gmail.com (Joram van Driel) Date: Fri, 16 Oct 2015 09:28:54 +0200 Subject: [FieldTrip] Negative values of debiased wPLI In-Reply-To: References: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Marta, It's correct that you can get negative values with dwPLI compared to classic PLI, it's indeed due to the debiasing procedure which involves a linear subtraction. What you want to do with it, depends on how you want to evaluate statistical significance. I wouldn't take the absolute values, though. - You could add a fixed value to all dwPLI values to have everything above zero with a fixed shift, then do a baseline correction such as percent signal change or dB (which you can't do with negative numbers). This is a bit crude though, and I actually wonder whether it's "allowed". - Just use the values as they are, with some being negative, if you want do condition comparisons, and use permutation testing with condition label shuffling at the group level to asses statistical difference between conditions. - Convert the dwPLI values to a z-score within-subject through permutation testing, where you shuffle one phase-angle vector of one of the two channels with respect to the other in e.g. 1000 permutations, thereby creating a null-distribution under the null-hypothesis of chance-level dwPLI, to which you can compare you're observed dwPLI. This approach is blind to the fact that some values are negative. How/what you shuffle depends on whether you compute dwPLI over trials or over time. Good luck, Joram On Tue, Oct 13, 2015 at 5:59 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hello...anybody any guess, explanation? I getting some too...close to zero > thought, but still negatives. > > On Mon, Feb 16, 2015 at 9:09 AM, Marta Bortoletto < > marta.bortoletto at cognitiveneuroscience.it> wrote: > >> Dear Community, >> I am using the debiased wPLI to estimate connectivity between 70 EEG >> electrodes. I have about 150 trials for each subject. I noticed that some >> values of my 70x70 dwPLI matrix are negative. My understanding is that all >> values should be between 0 and 1, but for some reason I can get negative >> values from the debiasing process. My question is: Shall I calculate the >> absolute value of these negative values? Otherwise what shall I do with >> them? >> >> Thank you in advance for your help. >> Marta >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, PhD Postdoc @ Vrije Universiteit Amsterdam Cognitive Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Fri Oct 16 20:10:37 2015 From: balperin07 at gmail.com (Brittany Alperin) Date: Fri, 16 Oct 2015 14:10:37 -0400 Subject: [FieldTrip] average of frequency band Message-ID: Hello I'm importing my already preprocessed data from eeglab and want to run an FFT. I'm using cfg.foilim to specify my frequencies of interest, but the output is in .5 Hz increments rather than just an average over the frequency band. I've tried using a colon instead of a space and I've tried using cfg.foi. Could anyone tell me how to get an average power rather than the power at each frequency? Here's my code for reference: cfg = []; cfg.method = 'mtmfft'; %run an fft cfg.taper = 'hanning'; %chose a hanning window cfg.foilim = [8 13]; %frequencies of interest. In this case, alpha cfg.output = 'pow'; %output in power Brittany Alperin Graduate Student, Behavioral Neuroscience Oregon Health and Science University Portland, OR -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Sat Oct 17 18:17:06 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Sat, 17 Oct 2015 16:17:06 +0000 (UTC) Subject: [FieldTrip] help ft_read_event References: <905698521.1529786.1445098626610.JavaMail.yahoo@mail.yahoo.com> Message-ID: <905698521.1529786.1445098626610.JavaMail.yahoo@mail.yahoo.com> Hi, I'm trying to read the triggers from my eeg channel, however it turn out, the trigger cannot be read.I'm using the coding, event = ft_read_event ( 'buffer://localhost:1972' )But, when I'm using the ft_realtime_signalviewer, the trigger are shown in the figure.How is that so? Anyone can help me? Thanks a lot. Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Oct 19 22:14:42 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 13:14:42 -0700 Subject: [FieldTrip] open position @donders Message-ID: Dear all, There's an open position (phd candidate, but postdocs are also welcome to apply I believe) at the donders centre for cognitive neuroimaging, the netherlands. The project is on the neural mechanisms underlying emotional control, and involves a combination of leading experts in their respective fields. What's more, this is the same site where fieldtrip is being supported. 1 + 1 = 2. For more information: http://www.ru.nl/overons/werken-radboud/details/details_vacature_0/?recid=561663 Yours, Arjen -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Mon Oct 19 23:25:30 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 17:25:30 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Message-ID: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Oct 20 00:01:20 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 15:01:20 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > Dear FieldTrip users, > > This is Xiaoming from University of Maryland Baltimore. My current project > requires to calculate behavioral-power correlation across subjects. Similar > topic was discussed here early this year. > http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html > > According to the suggestions in above mentioned thread, I duplicate my > power dataset and replace the power values at each time-frequency point > with behavioral data. Therefore, those two datasets have same structure and > dimension. I used the following script to test if there are significant > clusters of correlations. > > cfg = []; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'ft_statfun_correlationT'; > ... > etc > ... > design = zeros(2, n1 * 2); % n1 is the number of subjects. > design(1,1:n1) = 1; > design(1,(n1 + 1):(n1 * 2)) = 2; > design(2, :) = [[1:n1 ] [1 : n1]]; > cfg.design = design; > > cfg.ivar = 1; > cfg.uvar = 2; > stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); > > > However, it seems when each time the design matrix is permuted, FieldTrip > is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar > remains the same while cfg.ivar (1 or 2) is randomly assigned to each > subject in design matrix. Although I confirmed this by uncommenting line > 313 (i.e., tmpdesign = design(:,resample(i,:))) in > ft_statistics_montecarlo.m which allows to display the permuted design > matrix in command line, please correct me if this is not the case. > > In my mind, this kind of permutation will cause trouble when dealing with > correlation. For example, in my case, the behavioral data and power data > have different scales. The power data are much larger than behavioral data > in general. When assigning behavioral data into power group or vice versa, > it will induce huge negative correlations between power and behavioral > measurement. Therefore, no negative clusters will survive from permutation > test. > > Please let me know if I have mis-understanding or if I did anything wrong. > Any suggestions will be highly appreciated! > > Thanks. > > Xiaoming > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Tue Oct 20 00:20:13 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 18:20:13 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: <5625345D020000DC00015E6A@MPRC.UMARYLAND.EDU> Hi Arjen, Sorry for the confusion. The stat.rho matrix is similar to the one I calculated using corr. My questions is about the permutation method and the correlation matrix after each permutation for calculating cluster distribution. The permutation method seems interacting with correlation (but not with t tests). Looking forward to your suggestions. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Oct 20 00:33:46 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 15:33:46 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming, Thanks for clarifying. Could you perhaps provide an (replicable) example on how 'the permutation method interacts with the correlations'? Yours, Arjen 2015-10-19 15:20 GMT-07:00 Xiaoming Du : > Hi Arjen, > > Sorry for the confusion. > > The stat.rho matrix is similar to the one I calculated using corr. > > My questions is about the permutation method and the correlation matrix > after each permutation for calculating cluster distribution. The > permutation method seems interacting with correlation (but not with t > tests). > > Looking forward to your suggestions. > > Xiaoming > > >>> Arjen Stolk 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations > be independent of the scaling of the two variables? Looking at the code of > ft_statfun_correlationT it doesn't seem the conversion from correlation to > T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in > a direction change either. Perhaps you could try to first manually > calculate a correlation between signal power and behavioral power, and see > whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > >> Dear FieldTrip users, >> This is Xiaoming from University of Maryland Baltimore. My current >> project requires to calculate behavioral-power correlation across subjects. >> Similar topic was discussed here early this year. >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >> According to the suggestions in above mentioned thread, I duplicate my >> power dataset and replace the power values at each time-frequency point >> with behavioral data. Therefore, those two datasets have same structure and >> dimension. I used the following script to test if there are significant >> clusters of correlations. >> cfg = []; >> cfg.parameter = 'powspctrm'; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'ft_statfun_correlationT'; >> ... >> etc >> ... >> design = zeros(2, n1 * 2); % n1 is the number of subjects. >> design(1,1:n1) = 1; >> design(1,(n1 + 1):(n1 * 2)) = 2; >> design(2, :) = [[1:n1 ] [1 : n1]]; >> cfg.design = design; >> >> cfg.ivar = 1; >> cfg.uvar = 2; >> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >> However, it seems when each time the design matrix is permuted, FieldTrip >> is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar >> remains the same while cfg.ivar (1 or 2) is randomly assigned to each >> subject in design matrix. Although I confirmed this by uncommenting line >> 313 (i.e., tmpdesign = design(:,resample(i,:))) in >> ft_statistics_montecarlo.m which allows to display the permuted design >> matrix in command line, please correct me if this is not the case. >> In my mind, this kind of permutation will cause trouble when dealing with >> correlation. For example, in my case, the behavioral data and power data >> have different scales. The power data are much larger than behavioral data >> in general. When assigning behavioral data into power group or vice versa, >> it will induce huge negative correlations between power and behavioral >> measurement. Therefore, no negative clusters will survive from permutation >> test. >> Please let me know if I have mis-understanding or if I did anything >> wrong. Any suggestions will be highly appreciated! >> Thanks. >> Xiaoming >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Tue Oct 20 00:56:51 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 18:56:51 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: <56253CF3020000DC00015E70@MPRC.UMARYLAND.EDU> For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Oct 20 08:03:02 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 23:03:02 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du : > For example, our power values ranged from 1 to 3 (after log transform); my > behavioral data ranged from 20 to 90; > > by using above mentioned script, there are 14 negative clusters were > reported in variable stat. > > stat = > > prob: [30x50 double] > posclusters: [] > posclusterslabelmat: [30x50 double] > posdistribution: [1x1000 double] > negclusters: [1x14 struct] > negclusterslabelmat: [30x50 double] > negdistribution: [1x1000 double] > cirange: [30x50 double] > mask: [30x50 logical] > stat: [30x50 double] > ref: [30x50 double] > rho: [30x50 double] > dimord: 'chan_freq' > freq: [1x50 double] > label: {30x1 cell} > time: 2.5000 > cfg: [1x1 struct] > > However, the p values of those clusters (i.e., stat.negclusters.prob) are > all ones. The smallest value in stat.negdistribution is way larger than > the largest negative cluster t-sum. This could be real. However, it is more > likely due to the shuffle between power and behavioral group. For example, > design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 > 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, > their power data was labeled as behavioral data and vice versa. Because of > the scale difference between power and behavioral data, large negative > correlations were generated by permutation. This further biased the cluster > distribution. > My limited understanding is that, for correlation, each permutation should > fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute > design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 > 4 4 2 3 1]. THerefore, after permutation, one subject's power data > corresponds to another subject's behavioral data. > > I am not good at statistics. It will be really appreciated if you have any > suggestions or comments. > > Xiaoming > > > > > >>> Arjen Stolk 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations > be independent of the scaling of the two variables? Looking at the code of > ft_statfun_correlationT it doesn't seem the conversion from correlation to > T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in > a direction change either. Perhaps you could try to first manually > calculate a correlation between signal power and behavioral power, and see > whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > >> Dear FieldTrip users, >> This is Xiaoming from University of Maryland Baltimore. My current >> project requires to calculate behavioral-power correlation across subjects. >> Similar topic was discussed here early this year. >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >> According to the suggestions in above mentioned thread, I duplicate my >> power dataset and replace the power values at each time-frequency point >> with behavioral data. Therefore, those two datasets have same structure and >> dimension. I used the following script to test if there are significant >> clusters of correlations. >> cfg = []; >> cfg.parameter = 'powspctrm'; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'ft_statfun_correlationT'; >> ... >> etc >> ... >> design = zeros(2, n1 * 2); % n1 is the number of subjects. >> design(1,1:n1) = 1; >> design(1,(n1 + 1):(n1 * 2)) = 2; >> design(2, :) = [[1:n1 ] [1 : n1]]; >> cfg.design = design; >> >> cfg.ivar = 1; >> cfg.uvar = 2; >> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >> However, it seems when each time the design matrix is permuted, FieldTrip >> is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar >> remains the same while cfg.ivar (1 or 2) is randomly assigned to each >> subject in design matrix. Although I confirmed this by uncommenting line >> 313 (i.e., tmpdesign = design(:,resample(i,:))) in >> ft_statistics_montecarlo.m which allows to display the permuted design >> matrix in command line, please correct me if this is not the case. >> In my mind, this kind of permutation will cause trouble when dealing with >> correlation. For example, in my case, the behavioral data and power data >> have different scales. The power data are much larger than behavioral data >> in general. When assigning behavioral data into power group or vice versa, >> it will induce huge negative correlations between power and behavioral >> measurement. Therefore, no negative clusters will survive from permutation >> test. >> Please let me know if I have mis-understanding or if I did anything >> wrong. Any suggestions will be highly appreciated! >> Thanks. >> Xiaoming >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonas at obleser.de Tue Oct 20 13:07:51 2015 From: jonas at obleser.de (Jonas Obleser) Date: Tue, 20 Oct 2015 06:07:51 -0500 Subject: [FieldTrip] Call for new post docs in the Obleser lab | Auditory Cognition Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8@obleser.de> The research group “Auditory Cognition” (headed by Jonas Obleser; auditorycognition.com), now at the University of Lübeck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. These positions fall into the larger framework of an ERC Consolidator grant “The listening challenge: How ageing brains adapt” (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 Note the application deadline of November 12 (postal receipt). http://auditorycognition.com http://uni-luebeck.de From thomas.wunderle at esi-frankfurt.de Tue Oct 20 16:58:25 2015 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Tue, 20 Oct 2015 14:58:25 +0000 Subject: [FieldTrip] Spectrum normalization Message-ID: <27E5CAD9145EEC41BB9B34C01716A198880C3CD4@UM-excdag-a02.um.gwdg.de> Hi all, I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. This is important for me, because I need the absolute value of the spectrum for a publication. I was scanning through the code trying to find the normalization steps. In particular, I don't understand the following steps: 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) What is the rationale of dividing through this special norm of the taper itself? 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: dum = dum .* sqrt(2 ./ endnsample); (line 251) Later on, to get to the power spectrum, the abs of the spectrum is taken and squared powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) This puzzles me, because scanning through the literature, the power spectrum should be given by (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) and the PSD by (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: sqrt(PSD) -> unit: V/sqrt(Hz) which is still different from (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) The result of these equations are different from what comes out of the FieldTrip code. So what is the unit of the spectrum in FieldTrip? What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? It would help me a lot if someone could clarify these points. Thanks in advance, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel: +49 69 96769 516 Fax: +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Wed Oct 21 10:30:07 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Wed, 21 Oct 2015 10:30:07 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair Message-ID: Dear all, I’m trying to do interpolation to repair some bad channels, but I’m getting the error below. I've read the ft_fetch_sens help but I don’t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) From jorn at artinis.com Wed Oct 21 10:42:03 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Wed, 21 Oct 2015 10:42:03 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> Dear Grazia, try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. Best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I’m trying to do interpolation to repair some bad channels, but I’m getting > the error below. > I've read the ft_fetch_sens help but I don’t understand how I should specify > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From g.dipisa at gmail.com Wed Oct 21 12:27:40 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Wed, 21 Oct 2015 12:27:40 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: Hi Jörn, Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. Any other suggestions? thanks, ~ grazia > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. > > These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >> Sent: Wednesday, October 21, 2015 10:30 AM >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting >> the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should specify >> the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 59, Issue 17 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Wed Oct 21 14:16:10 2015 From: jorn at artinis.com (=?utf-8?Q?J=C3=B6rn_M._Horschig?=) Date: Wed, 21 Oct 2015 14:16:10 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <002301d10bfa$45d6a740$d183f5c0$@artinis.com> Hi Grazia, uh, jah, my bad, try cfg.elec instead ;) 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 Grazia Di Pisa Sent: Wednesday, October 21, 2015 12:28 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Interpolation and ft_channelrepair Hi Jörn, Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. Any other suggestions? thanks, ~ grazia On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Call for new post docs in the Obleser lab | Auditory Cognition (Jonas Obleser) 2. Spectrum normalization (Wunderle, Thomas) 3. Interpolation and ft_channelrepair (Grazia Di Pisa) 4. Re: Interpolation and ft_channelrepair (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) ---------------------------------------------------------------------- Message: 1 Date: Tue, 20 Oct 2015 06:07:51 -0500 From: Jonas Obleser > To: fieldtrip at science.ru.nl , AUDITORY at LISTS.MCGILL.CA Subject: [FieldTrip] Call for new post docs in the Obleser lab | Auditory Cognition Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de > Content-Type: text/plain; charset=utf-8 The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 Note the application deadline of November 12 (postal receipt). http://auditorycognition.com http://uni-luebeck.de ------------------------------ Message: 2 Date: Tue, 20 Oct 2015 14:58:25 +0000 From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl " > Subject: [FieldTrip] Spectrum normalization Message-ID: <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de > Content-Type: text/plain; charset="iso-8859-1" Hi all, I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. This is important for me, because I need the absolute value of the spectrum for a publication. I was scanning through the code trying to find the normalization steps. In particular, I don't understand the following steps: 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) What is the rationale of dividing through this special norm of the taper itself? 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: dum = dum .* sqrt(2 ./ endnsample); (line 251) Later on, to get to the power spectrum, the abs of the spectrum is taken and squared powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) This puzzles me, because scanning through the literature, the power spectrum should be given by (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) and the PSD by (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: sqrt(PSD) -> unit: V/sqrt(Hz) which is still different from (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) The result of these equations are different from what comes out of the FieldTrip code. So what is the unit of the spectrum in FieldTrip? What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? It would help me a lot if someone could clarify these points. Thanks in advance, Thomas ----- Dr. Thomas Wunderle Ernst Str?ngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel: +49 69 96769 516 Fax: +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Gesch?ftsf?hrer: Prof. Dr. Pascal Fries -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Wed, 21 Oct 2015 10:30:07 +0200 From: Grazia Di Pisa > To: fieldtrip at science.ru.nl Subject: [FieldTrip] Interpolation and ft_channelrepair Message-ID: > Content-Type: text/plain; charset=utf-8 Dear all, I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) ------------------------------ Message: 4 Date: Wed, 21 Oct 2015 10:42:03 +0200 From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com > Content-Type: text/plain; charset="UTF-8" Dear Grazia, try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. Best, J?rn -- J?rn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- bounces at science.ru.nl ] On Behalf Of Grazia Di Pisa Sent: Wednesday, October 21, 2015 10:30 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Interpolation and ft_channelrepair Dear all, I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 59, Issue 17 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From daria.laptinskaya at googlemail.com Wed Oct 21 14:46:49 2015 From: daria.laptinskaya at googlemail.com (Daria Laptinskaya) Date: Wed, 21 Oct 2015 14:46:49 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: Dear Grazia, I’m using the following code and it works fine: cfg = []; cfg.method = 'average'; cfg.badchannel = channel; cfg.neighbours = neighbours; cfg.trials = 'all'; cfg.elec = sens; [interpol] = ft_channelrepair(cfg, opt1_dur); Commend out the cfg.elec leads to the same error as you get. “sens” in my code is the result of ft_read_sens, sens=ft_read_sens('GSN-HydroCel-257.sfp' ). I hope, it helps! Best, Daria 2015-10-21 12:27 GMT+02:00 Grazia Di Pisa : > Hi Jörn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but still > the same error. > > Any other suggestions? > > thanks, > ~ grazia > > > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; > auditorycognition.com), now at the University of L?beck, is seeking to > hire two Postdoctoral researchers, initially for 3 years, with the option > of extension. > > These positions fall into the larger framework of an ERC Consolidator > grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) > recently awarded to Jonas Obleser, and will allow the joint development of > cognitive-neuroscience and psychological research projects targeting > adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: > https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral > analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the > spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the > multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper > itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the > function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken > and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in > ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power > spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, > nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = > number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum > by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = > frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the > FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the > same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience< > http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> > in Cooperation with Max Planck Society < > http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151020/eebaf460/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m > getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should > specify the electrodes. > > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor > definition so that ft_channelrepair knows the location of your channels, > which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting > the error below. > I've read the ft_fetch_sens help but I don?t understand how I should > specify > > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 59, Issue 17 > ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Wed Oct 21 19:44:28 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Wed, 21 Oct 2015 10:44:28 -0700 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <5627CEFC.1030608@gmail.com> Hi Grazia, I'm using the following code and it works: cfgn = []; cfgn.method = 'template'; cfgn.layout = 'biosemi64.lay'; cfg = []; cfg.neighbours = ft_prepare_neighbours(cfgn, data); cfg.elec = ft_read_sens('standard_1005.elc'); cfg.missingchannel = []; cfg.badchannel = chanrepair; % these are my channels cfg.trials = [1 3 5]; % for particular trials, otherwise use 'all' data = ft_channelrepair(cfg,data); Hope this helps Vitoria On 10/21/2015 3:27 AM, Grazia Di Pisa wrote: > Hi Jörn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but > still the same error. > > Any other suggestions? > > thanks, > ~ grazia > > >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl >> wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> AuditoryCognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; >> auditorycognition.com), now at the University of L?beck, is seeking >> to hire two Postdoctoral researchers, initially for 3 years, with the >> option of extension. >> >> These positions fall into the larger framework of an ERC Consolidator >> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >> recently awarded to Jonas Obleser, and will allow the joint >> development of cognitive-neuroscience and psychological research >> projects targeting adaptive control in the auditory modality of >> middle-aged adults. >> >> Please download the full job advert here: >> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a >> spectral analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the >> spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the >> multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function >> fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the >> taper itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the >> function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is >> taken and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 >> in ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power >> spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 >> (X=signal, nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, >> nfft = number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power >> spectrum by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >> frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of >> the FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation >> methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for >> Neuroscience >> in Cooperation with Max Planck Society >> >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m >> getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17cfg_neighb.method= 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label= lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain;charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor >> definition so that ft_channelrepair knows the location of your >> channels, which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>> Sent: Wednesday, October 21, 2015 10:30 AM >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m >>> getting >>> the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should >>> specify >>> the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17cfg_neighb.method= 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label= lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>> 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 59, Issue 17 >> ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.krebber at charite.de Wed Oct 21 19:54:40 2015 From: martin.krebber at charite.de (Krebber, Martin) Date: Wed, 21 Oct 2015 17:54:40 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl>, Message-ID: Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk > 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Wed Oct 21 20:22:09 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 11:22:09 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > Hi Xiaoming, hi Arjen, > > I've been encountering the same problem. I believe Xiaoming is right when > he points out that the permutaion step shuffles data across conditions and > that this introduces a negative bias in the distribution. I found the same > thing when I correlated RT data with TFRs (absolute power). My distribution > was shifted strongly to the left and, thus, not a single negative cluster > was significant, but every positive one was. > > Xiaomings explanation made a lot of sense to me when I thought about it > graphically: Imagine correlating two data vectors, one (x) ranging between > .5 and1, the other (y) between 50 and and 100. When plotting this, one gets > a cloud of dots on the upper left corner of the diagram. When you then > switch the variable assignment of half of the data points (which is what > the permutation step seems to do), these dots will now be be shifted to the > lower right corner of the diagram. So no matter what the correlation in the > original data, chances are that (given different scaling) after permutaion, > you get a negative correlation. > > I am not 100% sure about this, so please let me know if I made a mistake. > > What I tried instead of the 'ft_statfun_correlationT' was using a custom > made statfun in which I pass the RTs via the design matrix. With this, my > results looked much better. I am not sure, but I guess this is because > there is no shuffling between the two variables in this case. > > I would really like to know, what is the right way of doing this using > just the FieldTrip functions. Is there a way to permute data within > variables? I tried cfg.resampling = 'bootstrap', but this is not a > permutation, as far as I know. > > > Thanks! > Martin > > > ------------------------------ > *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" > im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] > *Gesendet:* Dienstag, 20. Oktober 2015 08:03 > *An:* FieldTrip discussion list > *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > > Hey Xiaoming, > > It's still pretty hard, for me, to guess on basis of that matlab output > what is going on here and what you mean with 'shuffling design matrices', > and how that shuffling 'biases the cluster distribution'. As you mention > yourself, it could be due to various reasons, and you're open to > suggestions and increasing your understanding. I'd therefore suggest to try > to funnel the number of potential explanations by simulating what you're > doing (using input data for which you know how it should behave), after > you've read more about what the design matrix and monte carlo statistics > are supposed to do. Perhaps the statistics section at the bottom of this > page provides a good starting point: > http://www.fieldtriptoolbox.org/walkthrough > > Hope that helps, > Arjen > > 2015-10-19 15:56 GMT-07:00 Xiaoming Du : > >> For example, our power values ranged from 1 to 3 (after log transform); >> my behavioral data ranged from 20 to 90; >> >> by using above mentioned script, there are 14 negative clusters were >> reported in variable stat. >> >> stat = >> >> prob: [30x50 double] >> posclusters: [] >> posclusterslabelmat: [30x50 double] >> posdistribution: [1x1000 double] >> negclusters: [1x14 struct] >> negclusterslabelmat: [30x50 double] >> negdistribution: [1x1000 double] >> cirange: [30x50 double] >> mask: [30x50 logical] >> stat: [30x50 double] >> ref: [30x50 double] >> rho: [30x50 double] >> dimord: 'chan_freq' >> freq: [1x50 double] >> label: {30x1 cell} >> time: 2.5000 >> cfg: [1x1 struct] >> >> However, the p values of those clusters (i.e., stat.negclusters.prob) are >> all ones. The smallest value in stat.negdistribution is way larger than >> the largest negative cluster t-sum. This could be real. However, it is more >> likely due to the shuffle between power and behavioral group. For example, >> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 >> 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, >> their power data was labeled as behavioral data and vice versa. Because of >> the scale difference between power and behavioral data, large negative >> correlations were generated by permutation. This further biased the cluster >> distribution. >> My limited understanding is that, for correlation, each permutation >> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 >> 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >> corresponds to another subject's behavioral data. >> >> I am not good at statistics. It will be really appreciated if you have >> any suggestions or comments. >> >> Xiaoming >> >> >> >> >> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >> Hey Xiaoming, >> >> Not sure if I understand, but shouldn't the directions of the >> correlations be independent of the scaling of the two variables? Looking at >> the code of ft_statfun_correlationT it doesn't seem the conversion from >> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >> would result in a direction change either. Perhaps you could try to first >> manually calculate a correlation between signal power and behavioral power, >> and see whether anything is behaving unexpectedly? >> >> Yours, >> Arjen >> >> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >> >>> Dear FieldTrip users, >>> This is Xiaoming from University of Maryland Baltimore. My current >>> project requires to calculate behavioral-power correlation across subjects. >>> Similar topic was discussed here early this year. >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>> According to the suggestions in above mentioned thread, I duplicate my >>> power dataset and replace the power values at each time-frequency point >>> with behavioral data. Therefore, those two datasets have same structure and >>> dimension. I used the following script to test if there are significant >>> clusters of correlations. >>> cfg = []; >>> cfg.parameter = 'powspctrm'; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'ft_statfun_correlationT'; >>> ... >>> etc >>> ... >>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>> design(1,1:n1) = 1; >>> design(1,(n1 + 1):(n1 * 2)) = 2; >>> design(2, :) = [[1:n1 ] [1 : n1]]; >>> cfg.design = design; >>> >>> cfg.ivar = 1; >>> cfg.uvar = 2; >>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>> However, it seems when each time the design matrix is permuted, >>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>> each subject in design matrix. Although I confirmed this by uncommenting >>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>> ft_statistics_montecarlo.m which allows to display the permuted design >>> matrix in command line, please correct me if this is not the case. >>> In my mind, this kind of permutation will cause trouble when dealing >>> with correlation. For example, in my case, the behavioral data and power >>> data have different scales. The power data are much larger than behavioral >>> data in general. When assigning behavioral data into power group or vice >>> versa, it will induce huge negative correlations between power and >>> behavioral measurement. Therefore, no negative clusters will survive from >>> permutation test. >>> Please let me know if I have mis-understanding or if I did anything >>> wrong. Any suggestions will be highly appreciated! >>> Thanks. >>> Xiaoming >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Wed Oct 21 23:28:19 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Wed, 21 Oct 2015 17:28:19 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Hi Martin, Thanks Martin to make it more clear. However, my understanding is that the problem is caused by different means of permutation for paired-sample t test and correlation. I am very curious how you solve the problem by customizing statfun. Do you mind sending me a copy of that? I will really appreciate it. Hi Arjen, I think the 'ft_statfun_correlationT' works fine. Using the code in your previous email, the correlation result (stat.rho) is same as using MATLAB function 'corr' with Spearman method. However, In your code, the design matrix for correlation is defined in the same way as for within-UO design (e.g., paired-sample t test). I think Martin's and my concern is that the permutation method for correlation and within-UO design (e.g., paired-sample t test) should be different. For example, there are 10 subjects (patients). Each of them finished a task before (A) and after (B) the treatment . Based on the different null hypothesis, the permutation methods for paired-sample t test and correlation should be different. For paired-sample t test (or within-UO design), the null hypothesis is that there is no different before or after the treatment. In other words, for each subjects, switch the results before and after treatment won't matter. This is exactly how the permutations are done when cfg.design is defined as in your code . On the other hand, the null hypothesis for correlation is that: there is no relationship between the results before and after treatment. Therefore, permutation should be done on after-treatment results among subjects while keep before-treatment results same (or permute before-treatment and keep after-treatment). In terms of permutation, correlation and paired-sample t test (within-UO design) seems treated equally in fieldtrip. Original matrix permutation for paired t test permutation for correlation before (A) after (B) before (A) after (B) before (A) after (B) subj1 A1 B1 subj1 A1 B1 subj1 A1 B2 subj2 A2 B2 subj2 B2 A2 subj2 A2 B4 subj3 A3 B3 subj3 B3 A3 subj3 A3 B3 subj4 A4 B4 subj4 A4 B4 subj4 A4 B1 subj5 A5 B5 subj5 A5 B5 subj5 A5 B10 subj6 A6 B6 subj6 B6 A6 subj6 A6 B8 subj7 A7 B7 subj7 B7 A7 subj7 A7 B9 subj8 A8 B8 subj8 A8 B8 subj8 A8 B6 subj9 A9 B9 subj9 B9 A9 subj9 A9 B5 subj10 A10 B10 subj10 A10 B10 subj10 A10 B7 As follows, I made minor changes in your previous code to show this issue. data_brain ranges from 0 to 1; data_behav ranges from 1000 to 1001; There is no relationship between data_brain and data_behav, because the values are randomly assigned to them. This is the results I got by using the code below: stat = prob: 9.9900e-04 cirange: 0.0020 mask: 1 stat: 0.2941 ref: -10.7655 rho: 0.0297 dimord: 'chan_time' label: {'1'} time: 1 cfg: [1x1 struct] stat.rho (0.0297) is the same as using 'corr' with Spearman option in matlab; However, stat.prob obtained by using permutation test is so small. The reason (I guess) are 1, two-tail test was used. 2, the rho distribution of permutation is biased to negative direction (meaning the rho after each permutation was biased to strong negative correlation. e.g., -0.8 etc ), so the real rho fell into the 5% range of rho distribution of permutations. In other words, real rho (0.0297) is smaller (or larger) than almost all rho from permutation, so that stat.prob is very small (0.000999). Please let me know if this makes sense to you or if I misunderstood anything. Thanks. Xiaoming data_brain = []; data_behav = []; for j=1:100 data_brain{j}.avg = rand; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = rand + 1000; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 1000; n1 = 100; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >>> Arjen Stolk 10/21/2015 2:22 PM >>> Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin : Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du : For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Thu Oct 22 00:33:13 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 15:33:13 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Message-ID: Thanks for clarifying, Xiaoming. It seems indeed that a systematic offset (in averages) across the two sample populations biases the randomization distribution. I'd need to sort this out, but schematically would expect it to look as follow: normal: ~1000 ~1000 ~1000 ~1000 ~1 ~1 ~1 ~1 corr = ~0 post shuffling: ~1000 ~1 ~1000 ~1000 ~1 ~1000 ~1 ~1 corr = negative, that is an anti-correlation This implies a bootstrapping approach is more correct for testing for statistical significance of a correlation (in case of a systematic offset across conditions). Yours, Arjen 2015-10-21 14:28 GMT-07:00 Xiaoming Du : > Hi Martin, > > Thanks Martin to make it more clear. However, my understanding is that the > problem is caused by different means of permutation for paired-sample t > test and correlation. I am very curious how you solve the problem by > customizing statfun. Do you mind sending me a copy of that? I will really > appreciate it. > > Hi Arjen, > > I think the 'ft_statfun_correlationT' works fine. Using the code in your > previous email, the correlation result (stat.rho) is same as using MATLAB > function 'corr' with Spearman method. However, In your code, the design > matrix for correlation is defined in the same way as for within-UO design > (e.g., paired-sample t test). I think Martin's and my concern is that the > permutation method for correlation and within-UO design (e.g., > paired-sample t test) should be different. > > For example, there are 10 subjects (patients). Each of them finished a > task before (A) and after (B) the treatment . Based on the different null > hypothesis, the permutation methods for paired-sample t test and > correlation should be different. For paired-sample t test (or within-UO > design), the null hypothesis is that there is no different before or after > the treatment. In other words, for each subjects, switch the results before > and after treatment won't matter. This is exactly how the permutations are > done when cfg.design is defined as in your code . On the other hand, the > null hypothesis for correlation is that: there is no relationship between > the results before and after treatment. Therefore, permutation should be > done on after-treatment results *among subjects* while keep > before-treatment results same (or permute before-treatment and keep > after-treatment). In terms of permutation, correlation and paired-sample t > test (within-UO design) seems treated equally in fieldtrip. > > Original matrix permutation for > paired t test permutation for correlation > > before (A) after (B) before > (A) after (B) before (A) > after (B) > subj1 A1 B1 subj1 > A1 B1 subj1 A1 B2 > subj2 A2 B2 subj2 > B2 A2 subj2 A2 B4 > subj3 A3 B3 subj3 > B3 A3 subj3 A3 B3 > subj4 A4 B4 subj4 > A4 B4 subj4 A4 B1 > subj5 A5 B5 subj5 > A5 B5 subj5 A5 B10 > subj6 A6 B6 subj6 > B6 A6 subj6 A6 B8 > subj7 A7 B7 subj7 > B7 A7 subj7 A7 B9 > subj8 A8 B8 subj8 > A8 B8 subj8 A8 B6 > subj9 A9 B9 subj9 > B9 A9 subj9 A9 B5 > subj10 A10 B10 subj10 > A10 B10 subj10 A10 B7 > > As follows, I made minor changes in your previous code to show this > issue. > data_brain ranges from 0 to 1; > data_behav ranges from 1000 to 1001; > There is no relationship between data_brain and data_behav, because the > values are randomly assigned to them. > This is the results I got by using the code below: > > stat = > > prob: 9.9900e-04 > cirange: 0.0020 > mask: 1 > stat: 0.2941 > ref: -10.7655 > rho: 0.0297 > dimord: 'chan_time' > label: {'1'} > time: 1 > cfg: [1x1 struct] > > stat.rho (0.0297) is the same as using 'corr' with Spearman option in > matlab; However, stat.prob obtained by using permutation test is so > small. The reason (I guess) are 1, two-tail test was used. 2, the rho > distribution of permutation is biased to negative direction (meaning the > rho after each permutation was biased to strong negative correlation. e.g., > -0.8 etc ), so the real rho fell into the 5% range of rho distribution of > permutations. In other words, real rho (0.0297) is smaller (or larger) than > almost all rho from permutation, so that stat.prob is very small > (0.000999). > > Please let me know if this makes sense to you or if I misunderstood > anything. > > Thanks. > > Xiaoming > > > > > > > > > > data_brain = []; > > data_behav = []; > > for j=1:100 > > data_brain{j}.avg = rand; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = rand + 1000; % add scaling difference > > end > > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 1000; > > n1 = 100; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > > > > > > > > > > > > > > >>> Arjen Stolk 10/21/2015 2:22 PM >>> > Hi Martin, > > Thanks for thinking along. I've briefly tried to replicate/simplify the > situation depicted by you using the code below. It works as I would expect, > no matter whether one variable is scaled differently. But perhaps I'm not > fully capturing the issue, and something still goes awry. This is a > possibility because ft_statfun_correlationT has only recently been > implemented for a specific case, and was never really tested within > different situations (hence it's not well-documented on the wiki). Do you > think you could use this example code to replicate the situation you are > experiencing? > > Yours, > Arjen > > % simulate simple multiple subjects timelock structures > > data_brain = []; > > data_behav = []; > > for j=1:10 > > data_brain{j}.avg = j; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference > > end > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 100; > > n1 = 10; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > assert(isequal(stat.rho, -1)); > > 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > >> Hi Xiaoming, hi Arjen, >> >> I've been encountering the same problem. I believe Xiaoming is right when >> he points out that the permutaion step shuffles data across conditions and >> that this introduces a negative bias in the distribution. I found the same >> thing when I correlated RT data with TFRs (absolute power). My distribution >> was shifted strongly to the left and, thus, not a single negative cluster >> was significant, but every positive one was. >> >> Xiaomings explanation made a lot of sense to me when I thought about it >> graphically: Imagine correlating two data vectors, one (x) ranging between >> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >> a cloud of dots on the upper left corner of the diagram. When you then >> switch the variable assignment of half of the data points (which is what >> the permutation step seems to do), these dots will now be be shifted to the >> lower right corner of the diagram. So no matter what the correlation in the >> original data, chances are that (given different scaling) after permutaion, >> you get a negative correlation. >> >> I am not 100% sure about this, so please let me know if I made a mistake. >> >> What I tried instead of the 'ft_statfun_correlationT' was using a custom >> made statfun in which I pass the RTs via the design matrix. With this, my >> results looked much better. I am not sure, but I guess this is because >> there is no shuffling between the two variables in this case. >> >> I would really like to know, what is the right way of doing this using >> just the FieldTrip functions. Is there a way to permute data within >> variables? I tried cfg.resampling = 'bootstrap', but this is not a >> permutation, as far as I know. >> >> >> Thanks! >> Martin >> >> >> ------------------------------ >> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >> *An:* FieldTrip discussion list >> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >> follow-up questions >> >> Hey Xiaoming, >> >> It's still pretty hard, for me, to guess on basis of that matlab output >> what is going on here and what you mean with 'shuffling design matrices', >> and how that shuffling 'biases the cluster distribution'. As you mention >> yourself, it could be due to various reasons, and you're open to >> suggestions and increasing your understanding. I'd therefore suggest to try >> to funnel the number of potential explanations by simulating what you're >> doing (using input data for which you know how it should behave), after >> you've read more about what the design matrix and monte carlo statistics >> are supposed to do. Perhaps the statistics section at the bottom of this >> page provides a good starting point: >> http://www.fieldtriptoolbox.org/walkthrough >> >> Hope that helps, >> Arjen >> >> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >> >>> For example, our power values ranged from 1 to 3 (after log transform); >>> my behavioral data ranged from 20 to 90; >>> by using above mentioned script, there are 14 negative clusters were >>> reported in variable stat. >>> stat = >>> prob: [30x50 double] >>> posclusters: [] >>> posclusterslabelmat: [30x50 double] >>> posdistribution: [1x1000 double] >>> negclusters: [1x14 struct] >>> negclusterslabelmat: [30x50 double] >>> negdistribution: [1x1000 double] >>> cirange: [30x50 double] >>> mask: [30x50 logical] >>> stat: [30x50 double] >>> ref: [30x50 double] >>> rho: [30x50 double] >>> dimord: 'chan_freq' >>> freq: [1x50 double] >>> label: {30x1 cell} >>> time: 2.5000 >>> cfg: [1x1 struct] >>> However, the p values of those clusters (i.e., stat.negclusters.prob) >>> are all ones. The smallest value in stat.negdistribution is way larger than >>> the largest negative cluster t-sum. This could be real. However, it is more >>> likely due to the shuffle between power and behavioral group. For example, >>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 >>> 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their >>> power data was labeled as behavioral data and vice versa. Because of the >>> scale difference between power and behavioral data, large negative >>> correlations were generated by permutation. This further biased the cluster >>> distribution. >>> My limited understanding is that, for correlation, each permutation >>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; >>> 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>> corresponds to another subject's behavioral data. >>> I am not good at statistics. It will be really appreciated if you have >>> any suggestions or comments. >>> Xiaoming >>> >>> >>> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >>> Hey Xiaoming, >>> >>> Not sure if I understand, but shouldn't the directions of the >>> correlations be independent of the scaling of the two variables? Looking at >>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>> would result in a direction change either. Perhaps you could try to first >>> manually calculate a correlation between signal power and behavioral power, >>> and see whether anything is behaving unexpectedly? >>> >>> Yours, >>> Arjen >>> >>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>> >>>> Dear FieldTrip users, >>>> This is Xiaoming from University of Maryland Baltimore. My current >>>> project requires to calculate behavioral-power correlation across subjects. >>>> Similar topic was discussed here early this year. >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>> According to the suggestions in above mentioned thread, I duplicate my >>>> power dataset and replace the power values at each time-frequency point >>>> with behavioral data. Therefore, those two datasets have same structure and >>>> dimension. I used the following script to test if there are significant >>>> clusters of correlations. >>>> cfg = []; >>>> cfg.parameter = 'powspctrm'; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'ft_statfun_correlationT'; >>>> ... >>>> etc >>>> ... >>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>> design(1,1:n1) = 1; >>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>> cfg.design = design; >>>> >>>> cfg.ivar = 1; >>>> cfg.uvar = 2; >>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>> However, it seems when each time the design matrix is permuted, >>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>> each subject in design matrix. Although I confirmed this by uncommenting >>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>> matrix in command line, please correct me if this is not the case. >>>> In my mind, this kind of permutation will cause trouble when dealing >>>> with correlation. For example, in my case, the behavioral data and power >>>> data have different scales. The power data are much larger than behavioral >>>> data in general. When assigning behavioral data into power group or vice >>>> versa, it will induce huge negative correlations between power and >>>> behavioral measurement. Therefore, no negative clusters will survive from >>>> permutation test. >>>> Please let me know if I have mis-understanding or if I did anything >>>> wrong. Any suggestions will be highly appreciated! >>>> Thanks. >>>> Xiaoming >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksenj at ohsu.edu Thu Oct 22 01:30:25 2015 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 21 Oct 2015 23:30:25 +0000 Subject: [FieldTrip] FEM head model and source model Message-ID: I am thinking of using FieldTrip for EEG source modeling, and wish to use an FEM formulation. I have found documentation on creating an FEM head model, but am unsure how to create a matching source model. Can someone please point me to documentation for this? Ideally I would want to place sources perpendicular to the local cortical surface. Also I would want to be able to create distributed sources combining several adjacent cortical elements. Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Thu Oct 22 06:01:51 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 21:01:51 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming, Martin, Coming back about this issue, I have filed a bug report: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2992 In short, creating a randomization distribution using the permutation method is prone to systematic bias across conditions, as illustrated in our previous email exchanges. One workaround is to use the bootstrapping method (cfg.resampling = 'bootstrap'), or to explicitly remove the systematic bias, e.g by normalizing the data in each condition separately prior to doing statistical testing. I have added these important considerations to the documentation of ft_statfun_correlationT, built in a warning message, and created a latent function that explicitly tests for this issue (to prevent it to re-occur with future code changes). Thank you for your acuteness and contributions. Yours, Arjen 2015-10-21 15:33 GMT-07:00 Arjen Stolk : > Thanks for clarifying, Xiaoming. > > It seems indeed that a systematic offset (in averages) across the two > sample populations biases the randomization distribution. I'd need to sort > this out, but schematically would expect it to look as follow: > > normal: > ~1000 ~1000 ~1000 ~1000 > ~1 ~1 ~1 ~1 > corr = ~0 > > post shuffling: > ~1000 ~1 ~1000 ~1000 > ~1 ~1000 ~1 ~1 > corr = negative, that is an anti-correlation > > This implies a bootstrapping approach is more correct for testing for > statistical significance of a correlation (in case of a systematic offset > across conditions). > > Yours, > Arjen > > 2015-10-21 14:28 GMT-07:00 Xiaoming Du : > >> Hi Martin, >> >> Thanks Martin to make it more clear. However, my understanding is that >> the problem is caused by different means of permutation for paired-sample t >> test and correlation. I am very curious how you solve the problem by >> customizing statfun. Do you mind sending me a copy of that? I will really >> appreciate it. >> >> Hi Arjen, >> >> I think the 'ft_statfun_correlationT' works fine. Using the code in your >> previous email, the correlation result (stat.rho) is same as using MATLAB >> function 'corr' with Spearman method. However, In your code, the design >> matrix for correlation is defined in the same way as for within-UO design >> (e.g., paired-sample t test). I think Martin's and my concern is that the >> permutation method for correlation and within-UO design (e.g., >> paired-sample t test) should be different. >> >> For example, there are 10 subjects (patients). Each of them finished a >> task before (A) and after (B) the treatment . Based on the different null >> hypothesis, the permutation methods for paired-sample t test and >> correlation should be different. For paired-sample t test (or within-UO >> design), the null hypothesis is that there is no different before or after >> the treatment. In other words, for each subjects, switch the results before >> and after treatment won't matter. This is exactly how the permutations are >> done when cfg.design is defined as in your code . On the other hand, the >> null hypothesis for correlation is that: there is no relationship between >> the results before and after treatment. Therefore, permutation should be >> done on after-treatment results *among subjects* while keep >> before-treatment results same (or permute before-treatment and keep >> after-treatment). In terms of permutation, correlation and paired-sample t >> test (within-UO design) seems treated equally in fieldtrip. >> >> Original matrix permutation for >> paired t test permutation for correlation >> >> before (A) after (B) before >> (A) after (B) before (A) >> after (B) >> subj1 A1 B1 subj1 >> A1 B1 subj1 A1 B2 >> subj2 A2 B2 subj2 >> B2 A2 subj2 A2 B4 >> subj3 A3 B3 subj3 >> B3 A3 subj3 A3 B3 >> subj4 A4 B4 subj4 >> A4 B4 subj4 A4 B1 >> subj5 A5 B5 subj5 >> A5 B5 subj5 A5 B10 >> subj6 A6 B6 subj6 >> B6 A6 subj6 A6 B8 >> subj7 A7 B7 subj7 >> B7 A7 subj7 A7 B9 >> subj8 A8 B8 subj8 >> A8 B8 subj8 A8 B6 >> subj9 A9 B9 subj9 >> B9 A9 subj9 A9 B5 >> subj10 A10 B10 subj10 >> A10 B10 subj10 A10 B7 >> >> As follows, I made minor changes in your previous code to show this >> issue. >> data_brain ranges from 0 to 1; >> data_behav ranges from 1000 to 1001; >> There is no relationship between data_brain and data_behav, because the >> values are randomly assigned to them. >> This is the results I got by using the code below: >> >> stat = >> >> prob: 9.9900e-04 >> cirange: 0.0020 >> mask: 1 >> stat: 0.2941 >> ref: -10.7655 >> rho: 0.0297 >> dimord: 'chan_time' >> label: {'1'} >> time: 1 >> cfg: [1x1 struct] >> >> stat.rho (0.0297) is the same as using 'corr' with Spearman option in >> matlab; However, stat.prob obtained by using permutation test is so >> small. The reason (I guess) are 1, two-tail test was used. 2, the rho >> distribution of permutation is biased to negative direction (meaning the >> rho after each permutation was biased to strong negative correlation. e.g., >> -0.8 etc ), so the real rho fell into the 5% range of rho distribution of >> permutations. In other words, real rho (0.0297) is smaller (or larger) than >> almost all rho from permutation, so that stat.prob is very small >> (0.000999). >> >> Please let me know if this makes sense to you or if I misunderstood >> anything. >> >> Thanks. >> >> Xiaoming >> >> >> >> >> >> >> >> >> >> data_brain = []; >> >> data_behav = []; >> >> for j=1:100 >> >> data_brain{j}.avg = rand; % increasing >> >> data_brain{j}.dimord = 'chan_time'; >> >> data_brain{j}.time = 1; >> >> data_brain{j}.label = {'1'}; >> >> >> data_behav{j} = data_brain{j}; >> >> data_behav{j}.avg = rand + 1000; % add scaling difference >> >> end >> >> >> % compute statistics with correlationT >> >> cfg = []; >> >> cfg.method = 'montecarlo'; >> >> cfg.statistic = 'ft_statfun_correlationT'; >> >> cfg.numrandomization = 1000; >> >> n1 = 100; % n1 is the number of subjects >> >> design = zeros(2, n1 * 2); >> >> design(1,1:n1) = 1; >> >> design(1,(n1 + 1):(n1 * 2)) = 2; >> >> design(2, :) = [1:n1 1:n1]; >> >> cfg.design = design; >> >> >> cfg.ivar = 1; >> >> cfg.uvar = 2; >> >> stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>> Arjen Stolk 10/21/2015 2:22 PM >>> >> Hi Martin, >> >> Thanks for thinking along. I've briefly tried to replicate/simplify the >> situation depicted by you using the code below. It works as I would expect, >> no matter whether one variable is scaled differently. But perhaps I'm not >> fully capturing the issue, and something still goes awry. This is a >> possibility because ft_statfun_correlationT has only recently been >> implemented for a specific case, and was never really tested within >> different situations (hence it's not well-documented on the wiki). Do you >> think you could use this example code to replicate the situation you are >> experiencing? >> >> Yours, >> Arjen >> >> % simulate simple multiple subjects timelock structures >> >> data_brain = []; >> >> data_behav = []; >> >> for j=1:10 >> >> data_brain{j}.avg = j; % increasing >> >> data_brain{j}.dimord = 'chan_time'; >> >> data_brain{j}.time = 1; >> >> data_brain{j}.label = {'1'}; >> >> data_behav{j} = data_brain{j}; >> >> data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference >> >> end >> >> % compute statistics with correlationT >> >> cfg = []; >> >> cfg.method = 'montecarlo'; >> >> cfg.statistic = 'ft_statfun_correlationT'; >> >> cfg.numrandomization = 100; >> >> n1 = 10; % n1 is the number of subjects >> >> design = zeros(2, n1 * 2); >> >> design(1,1:n1) = 1; >> >> design(1,(n1 + 1):(n1 * 2)) = 2; >> >> design(2, :) = [1:n1 1:n1]; >> >> cfg.design = design; >> >> cfg.ivar = 1; >> >> cfg.uvar = 2; >> >> stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >> >> assert(isequal(stat.rho, -1)); >> >> 2015-10-21 10:54 GMT-07:00 Krebber, Martin : >> >>> Hi Xiaoming, hi Arjen, >>> >>> I've been encountering the same problem. I believe Xiaoming is right >>> when he points out that the permutaion step shuffles data across conditions >>> and that this introduces a negative bias in the distribution. I found the >>> same thing when I correlated RT data with TFRs (absolute power). My >>> distribution was shifted strongly to the left and, thus, not a single >>> negative cluster was significant, but every positive one was. >>> >>> Xiaomings explanation made a lot of sense to me when I thought about it >>> graphically: Imagine correlating two data vectors, one (x) ranging between >>> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >>> a cloud of dots on the upper left corner of the diagram. When you then >>> switch the variable assignment of half of the data points (which is what >>> the permutation step seems to do), these dots will now be be shifted to the >>> lower right corner of the diagram. So no matter what the correlation in the >>> original data, chances are that (given different scaling) after permutaion, >>> you get a negative correlation. >>> >>> I am not 100% sure about this, so please let me know if I made a mistake. >>> >>> What I tried instead of the 'ft_statfun_correlationT' was using a custom >>> made statfun in which I pass the RTs via the design matrix. With this, my >>> results looked much better. I am not sure, but I guess this is because >>> there is no shuffling between the two variables in this case. >>> >>> I would really like to know, what is the right way of doing this using >>> just the FieldTrip functions. Is there a way to permute data within >>> variables? I tried cfg.resampling = 'bootstrap', but this is not a >>> permutation, as far as I know. >>> >>> >>> Thanks! >>> Martin >>> >>> >>> ------------------------------ >>> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >>> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >>> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >>> *An:* FieldTrip discussion list >>> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >>> follow-up questions >>> >>> Hey Xiaoming, >>> >>> It's still pretty hard, for me, to guess on basis of that matlab output >>> what is going on here and what you mean with 'shuffling design matrices', >>> and how that shuffling 'biases the cluster distribution'. As you mention >>> yourself, it could be due to various reasons, and you're open to >>> suggestions and increasing your understanding. I'd therefore suggest to try >>> to funnel the number of potential explanations by simulating what you're >>> doing (using input data for which you know how it should behave), after >>> you've read more about what the design matrix and monte carlo statistics >>> are supposed to do. Perhaps the statistics section at the bottom of this >>> page provides a good starting point: >>> http://www.fieldtriptoolbox.org/walkthrough >>> >>> Hope that helps, >>> Arjen >>> >>> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >>> >>>> For example, our power values ranged from 1 to 3 (after log transform); >>>> my behavioral data ranged from 20 to 90; >>>> by using above mentioned script, there are 14 negative clusters were >>>> reported in variable stat. >>>> stat = >>>> prob: [30x50 double] >>>> posclusters: [] >>>> posclusterslabelmat: [30x50 double] >>>> posdistribution: [1x1000 double] >>>> negclusters: [1x14 struct] >>>> negclusterslabelmat: [30x50 double] >>>> negdistribution: [1x1000 double] >>>> cirange: [30x50 double] >>>> mask: [30x50 logical] >>>> stat: [30x50 double] >>>> ref: [30x50 double] >>>> rho: [30x50 double] >>>> dimord: 'chan_freq' >>>> freq: [1x50 double] >>>> label: {30x1 cell} >>>> time: 2.5000 >>>> cfg: [1x1 struct] >>>> However, the p values of those clusters (i.e., stat.negclusters.prob) >>>> are all ones. The smallest value in stat.negdistribution is way larger than >>>> the largest negative cluster t-sum. This could be real. However, it is more >>>> likely due to the shuffle between power and behavioral group. For example, >>>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 >>>> 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their >>>> power data was labeled as behavioral data and vice versa. Because of the >>>> scale difference between power and behavioral data, large negative >>>> correlations were generated by permutation. This further biased the cluster >>>> distribution. >>>> My limited understanding is that, for correlation, each permutation >>>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; >>>> 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>>> corresponds to another subject's behavioral data. >>>> I am not good at statistics. It will be really appreciated if you have >>>> any suggestions or comments. >>>> Xiaoming >>>> >>>> >>>> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >>>> Hey Xiaoming, >>>> >>>> Not sure if I understand, but shouldn't the directions of the >>>> correlations be independent of the scaling of the two variables? Looking at >>>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>>> would result in a direction change either. Perhaps you could try to first >>>> manually calculate a correlation between signal power and behavioral power, >>>> and see whether anything is behaving unexpectedly? >>>> >>>> Yours, >>>> Arjen >>>> >>>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>>> >>>>> Dear FieldTrip users, >>>>> This is Xiaoming from University of Maryland Baltimore. My current >>>>> project requires to calculate behavioral-power correlation across subjects. >>>>> Similar topic was discussed here early this year. >>>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>>> According to the suggestions in above mentioned thread, I duplicate my >>>>> power dataset and replace the power values at each time-frequency point >>>>> with behavioral data. Therefore, those two datasets have same structure and >>>>> dimension. I used the following script to test if there are significant >>>>> clusters of correlations. >>>>> cfg = []; >>>>> cfg.parameter = 'powspctrm'; >>>>> cfg.method = 'montecarlo'; >>>>> cfg.statistic = 'ft_statfun_correlationT'; >>>>> ... >>>>> etc >>>>> ... >>>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>>> design(1,1:n1) = 1; >>>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>>> cfg.design = design; >>>>> >>>>> cfg.ivar = 1; >>>>> cfg.uvar = 2; >>>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>>> However, it seems when each time the design matrix is permuted, >>>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>>> each subject in design matrix. Although I confirmed this by uncommenting >>>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>>> matrix in command line, please correct me if this is not the case. >>>>> In my mind, this kind of permutation will cause trouble when dealing >>>>> with correlation. For example, in my case, the behavioral data and power >>>>> data have different scales. The power data are much larger than behavioral >>>>> data in general. When assigning behavioral data into power group or vice >>>>> versa, it will induce huge negative correlations between power and >>>>> behavioral measurement. Therefore, no negative clusters will survive from >>>>> permutation test. >>>>> Please let me know if I have mis-understanding or if I did anything >>>>> wrong. Any suggestions will be highly appreciated! >>>>> Thanks. >>>>> Xiaoming >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 22 09:47:31 2015 From: wanamirahwanazlan at yahoo.com (wan amirah Wan azlan) Date: Thu, 22 Oct 2015 00:47:31 -0700 Subject: [FieldTrip] problem in reading trigger Message-ID: <1445500051.92875.YahooMailMobile@web166106.mail.gq1.yahoo.com> Dear Fieldtrip user, I am doing realtime eeg processing via tmsi porti amplifier. My problem is my trigger not able be recognized. I am using the following command, cfg=[ ]; cfg.dataset='buffer://localhost:1972'; cfg.trialdef.eventtype='?'; cfg=ft_definetrial(cfg); 'no events were found in the datafile' is shown in matlab command window. Why does this happen? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Thu Oct 22 11:39:04 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Thu, 22 Oct 2015 11:39:04 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair (Grazia Di Pisa) In-Reply-To: References: Message-ID: <92896A04-9BF3-4C5F-A1F6-4ED92C5D8740@gmail.com> Thank you all so much for the suggestions!!!! :) After adding /cfg.elec = sens/ it finally worked. have a nice day, ~ grazia > On 21Oct, 2015, at 20:22, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: Interpolation and ft_channelrepair (Grazia Di Pisa) > 2. Re: Interpolation and ft_channelrepair > (=?utf-8?Q?J=C3=B6rn_M._Horschig?=) > 3. Re: Interpolation and ft_channelrepair (Daria Laptinskaya) > 4. Re: Interpolation and ft_channelrepair (Vit?ria Piai) > 5. Re: calculating behavioural-power correlation -- follow-up > questions (Krebber, Martin) > 6. Re: calculating behavioural-power correlation -- follow-up > questions (Arjen Stolk) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 21 Oct 2015 12:27:40 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi J?rn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. > > Any other suggestions? > > thanks, > ~ grazia > > >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> Auditory Cognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. >> >> These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. >> >> Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the taper itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is taken and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of the FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for Neuroscience >> in Cooperation with Max Planck Society >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain; charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>> Sent: Wednesday, October 21, 2015 10:30 AM >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m getting >>> the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should specify >>> the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17 cfg_neighb.method = 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label = lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 59, Issue 17 >> ***************************************** > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Wed, 21 Oct 2015 14:16:10 +0200 > From: "=?utf-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002301d10bfa$45d6a740$d183f5c0$@artinis.com> > Content-Type: text/plain; charset="utf-8" > > Hi Grazia, > > > > uh, jah, my bad, try cfg.elec instead ;) > > > > 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 Grazia Di Pisa > Sent: Wednesday, October 21, 2015 12:28 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > > > > Hi J?rn, > > > > Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. > > > > Any other suggestions? > > > > thanks, > > ~ grazia > > > > > > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > > To: fieldtrip at science.ru.nl , AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de > > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. > > These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > > To: "fieldtrip at science.ru.nl " > > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de > > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > > To: "'FieldTrip discussion list'" > > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com > > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl ] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting > the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 59, Issue 17 > ***************************************** > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 14:46:49 +0200 > From: Daria Laptinskaya > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Grazia, > > I?m using the following code and it works fine: > > cfg = []; > > cfg.method = 'average'; > > cfg.badchannel = channel; > > cfg.neighbours = neighbours; > > cfg.trials = 'all'; > > cfg.elec = sens; > > > > [interpol] = ft_channelrepair(cfg, opt1_dur); > > > > Commend out the cfg.elec leads to the same error as you get. ?sens? in my > code is the result of ft_read_sens, sens=ft_read_sens('GSN-HydroCel-257.sfp' > ). > > > > I hope, it helps! > > > > Best, > > Daria > > 2015-10-21 12:27 GMT+02:00 Grazia Di Pisa : > >> Hi J?rn, >> >> Thanks for the advice - I've just tried to add cfg.sens = sens but still >> the same error. >> >> Any other suggestions? >> >> thanks, >> ~ grazia >> >> >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> Auditory Cognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; >> auditorycognition.com), now at the University of L?beck, is seeking to >> hire two Postdoctoral researchers, initially for 3 years, with the option >> of extension. >> >> These positions fall into the larger framework of an ERC Consolidator >> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >> recently awarded to Jonas Obleser, and will allow the joint development of >> cognitive-neuroscience and psychological research projects targeting >> adaptive control in the auditory modality of middle-aged adults. >> >> Please download the full job advert here: >> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a spectral >> analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the >> spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the >> multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the taper >> itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the >> function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is taken >> and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in >> ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power >> spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, >> nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = >> number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power spectrum >> by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >> frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of the >> FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation methods the >> same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for Neuroscience< >> http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> >> in Cooperation with Max Planck Society < >> http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151020/eebaf460/attachment-0001.html >>> >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m >> getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify the electrodes. >> >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain; charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor >> definition so that ft_channelrepair knows the location of your channels, >> which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >> Sent: Wednesday, October 21, 2015 10:30 AM >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting >> the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify >> >> the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 59, Issue 17 >> ***************************************** >> >> >> >> _______________________________________________ >> 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: Wed, 21 Oct 2015 10:44:28 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <5627CEFC.1030608 at gmail.com> > Content-Type: text/plain; charset="windows-1252"; Format="flowed" > > Hi Grazia, > > I'm using the following code and it works: > > cfgn = []; > cfgn.method = 'template'; > cfgn.layout = 'biosemi64.lay'; > > cfg = []; > cfg.neighbours = ft_prepare_neighbours(cfgn, data); > cfg.elec = ft_read_sens('standard_1005.elc'); > cfg.missingchannel = []; > cfg.badchannel = chanrepair; % these are my channels > cfg.trials = [1 3 5]; % for particular trials, otherwise use 'all' > data = ft_channelrepair(cfg,data); > > Hope this helps > Vitoria > > > > On 10/21/2015 3:27 AM, Grazia Di Pisa wrote: >> Hi J?rn, >> >> Thanks for the advice - I've just tried to add cfg.sens = sens but >> still the same error. >> >> Any other suggestions? >> >> thanks, >> ~ grazia >> >> >>> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl >>> wrote: >>> >>> Send fieldtrip mailing list submissions to >>> fieldtrip at science.ru.nl >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> or, via email, send a message with subject or body 'help' to >>> fieldtrip-request at science.ru.nl >>> >>> You can reach the person managing the list at >>> fieldtrip-owner at science.ru.nl >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of fieldtrip digest..." >>> >>> >>> Today's Topics: >>> >>> 1. Call for new post docs in the Obleser lab | Auditory >>> Cognition (Jonas Obleser) >>> 2. Spectrum normalization (Wunderle, Thomas) >>> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >>> 4. Re: Interpolation and ft_channelrepair >>> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Tue, 20 Oct 2015 06:07:51 -0500 >>> From: Jonas Obleser >>> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >>> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >>> AuditoryCognition >>> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >>> Content-Type: text/plain; charset=utf-8 >>> >>> The research group ?Auditory Cognition? (headed by Jonas Obleser; >>> auditorycognition.com), now at the University of L?beck, is seeking >>> to hire two Postdoctoral researchers, initially for 3 years, with the >>> option of extension. >>> >>> These positions fall into the larger framework of an ERC Consolidator >>> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >>> recently awarded to Jonas Obleser, and will allow the joint >>> development of cognitive-neuroscience and psychological research >>> projects targeting adaptive control in the auditory modality of >>> middle-aged adults. >>> >>> Please download the full job advert here: >>> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >>> >>> >>> Note the application deadline of November 12 (postal receipt). >>> >>> http://auditorycognition.com >>> http://uni-luebeck.de >>> >>> >>> >>> >>> ------------------------------ >>> >>> Message: 2 >>> Date: Tue, 20 Oct 2015 14:58:25 +0000 >>> From: "Wunderle, Thomas" >>> To: "fieldtrip at science.ru.nl" >>> Subject: [FieldTrip] Spectrum normalization >>> Message-ID: >>> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> Hi all, >>> >>> I have a question about how FieldTrip normalizes the output of a >>> spectral analyses using ft_freqanalysis. >>> This is important for me, because I need the absolute value of the >>> spectrum for a publication. >>> >>> I was scanning through the code trying to find the normalization steps. >>> In particular, I don't understand the following steps: >>> >>> >>> 1.) The tapers (e.g. hanning) are normalized prior to the >>> multiplication with the data by the following code: >>> tap = tap./norm(tap, 'fro'); (line 195 in the function >>> fr_specest_mtmfft) >>> What is the rationale of dividing through this special norm of the >>> taper itself? >>> >>> >>> 2.) After calculating the fft, the specrum is scaled (i.e. in the >>> function fr_specest_mtmfft) by: >>> >>> dum = dum .* sqrt(2 ./ endnsample); (line 251) >>> >>> Later on, to get to the power spectrum, the abs of the spectrum is >>> taken and squared >>> >>> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 >>> in ft_frequanalysis) >>> >>> >>> >>> This puzzles me, because scanning through the literature, the power >>> spectrum should be given by >>> >>> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 >>> (X=signal, nfft = number of data points) >>> >>> and the PSD by >>> >>> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, >>> nfft = number of data points, Fs=sampling rate) >>> >>> >>> >>> Alternatively, one can get the amplitude spectrum from the power >>> spectrum by taking the square root of the PSD: >>> >>> sqrt(PSD) -> unit: V/sqrt(Hz) >>> >>> which is still different from >>> >>> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >>> frequency resolution = Fs/nfft) >>> >>> >>> >>> The result of these equations are different from what comes out of >>> the FieldTrip code. >>> >>> So what is the unit of the spectrum in FieldTrip? >>> >>> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >>> >>> Furthermore, is the unit for the different spectral estimation >>> methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >>> >>> It would help me a lot if someone could clarify these points. >>> >>> Thanks in advance, >>> Thomas >>> >>> >>> ----- >>> Dr. Thomas Wunderle >>> Ernst Str?ngmann Institute (ESI) for >>> Neuroscience >>> in Cooperation with Max Planck Society >>> >>> Deutschordenstrasse 46 >>> 60528 Frankfurt am Main, Germany >>> www.esi-frankfurt.de >>> thomas.wunderle at esi-frankfurt.de >>> Tel: +49 69 96769 516 >>> Fax: +49 69 96769 555 >>> >>> Sitz der Gesellschaft: Frankfurt am Main >>> Registergericht: Amtsgericht Frankfurt - HRB 84266 >>> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >>> >>> >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: >>> >>> >>> ------------------------------ >>> >>> Message: 3 >>> Date: Wed, 21 Oct 2015 10:30:07 +0200 >>> From: Grazia Di Pisa >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> Message-ID: >>> Content-Type: text/plain; charset=utf-8 >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m >>> getting the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should >>> specify the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17cfg_neighb.method= 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label= lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>> 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> >>> >>> ------------------------------ >>> >>> Message: 4 >>> Date: Wed, 21 Oct 2015 10:42:03 +0200 >>> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >>> To: "'FieldTrip discussion list'" >>> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >>> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >>> Content-Type: text/plain;charset="UTF-8" >>> >>> Dear Grazia, >>> >>> try adding cfg.sens = sens; before line 42. That will set the sensor >>> definition so that ft_channelrepair knows the location of your >>> channels, which is otherwise not obvious. >>> >>> Best, >>> J?rn >>> >>> -- >>> >>> J?rn M. Horschig, PhD, Software Engineer >>> Artinis Medical Systems | +31 481 350 980 >>> >>>> -----Original Message----- >>>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>>> Sent: Wednesday, October 21, 2015 10:30 AM >>>> To: fieldtrip at science.ru.nl >>>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>>> >>>> Dear all, >>>> >>>> I?m trying to do interpolation to repair some bad channels, but I?m >>>> getting >>>> the error below. >>>> I've read the ft_fetch_sens help but I don?t understand how I should >>>> specify >>>> the electrodes. >>>> >>>> Is there a file I should upload or am I missing something in my code? >>>> Any help or hint is very much appreciated! >>>> >>>> thanks in advance, >>>> ~ grazia >>>> >>>> >>>> // >>>> Error using ft_fetch_sens (line 183) >>>> no electrodes or gradiometers specified. >>>> >>>> Error in ft_channelrepair (line 115) >>>> sens = ft_fetch_sens(cfg, data); >>>> >>>> Error in new_analyse_GDP (line 42) >>>> ft_channelrepair(cfg, data) >>>> // >>>> >>>> This is my code: >>>> >>>> 15 cfg = []; >>>> 16 cfg_neighb = []; >>>> 17cfg_neighb.method= 'triangulation'; >>>> 18 cfg.senstype = 'EEG'; >>>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>>> 21 >>>> 22 cfg.neighbours = neighbours; >>>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>>> 24 cfg.feedback = 'yes'; >>>> 25 cfg.layout = 'biosemi64.lay'; >>>> 26 lay = ft_prepare_layout(cfg); >>>> 27 >>>> 28 sens = data; >>>> 29 sens.type = 'eeg'; >>>> 30 sens.label= lay.label; >>>> 31 sens.chanpos = lay.pos; >>>> 32 sens.chanpos(:,3) = 0; >>>> 33 >>>> 34 ft_neighbourplot(cfg, data) >>>> 35 >>>> 36 cfg = []; >>>> 37 cfg.method = 'nearest'; >>>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>>> 'AF3','AF8','F7','F5','FT9'}; >>>> 39 cfg.neighbours = neighbours; >>>> 40 cfg.trials = 'all'; >>>> 41 >>>> 42 ft_channelrepair(cfg, data) >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 59, Issue 17 >>> ***************************************** >> >> >> >> _______________________________________________ >> 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: 5 > Date: Wed, 21 Oct 2015 17:54:40 +0000 > From: "Krebber, Martin" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Xiaoming, hi Arjen, > > I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. > > Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. > > I am not 100% sure about this, so please let me know if I made a mistake. > > What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. > > I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. > > > Thanks! > Martin > > > ________________________________ > Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] > Gesendet: Dienstag, 20. Oktober 2015 08:03 > An: FieldTrip discussion list > Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions > > Hey Xiaoming, > > It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough > > Hope that helps, > Arjen > > 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: > For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; > > by using above mentioned script, there are 14 negative clusters were reported in variable stat. > > stat = > > prob: [30x50 double] > posclusters: [] > posclusterslabelmat: [30x50 double] > posdistribution: [1x1000 double] > negclusters: [1x14 struct] > negclusterslabelmat: [30x50 double] > negdistribution: [1x1000 double] > cirange: [30x50 double] > mask: [30x50 logical] > stat: [30x50 double] > ref: [30x50 double] > rho: [30x50 double] > dimord: 'chan_freq' > freq: [1x50 double] > label: {30x1 cell} > time: 2.5000 > cfg: [1x1 struct] > > However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. > My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. > > I am not good at statistics. It will be really appreciated if you have any suggestions or comments. > > Xiaoming > > > > >>>> Arjen Stolk > 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: > Dear FieldTrip users, > This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html > According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. > cfg = []; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'ft_statfun_correlationT'; > ... > etc > ... > design = zeros(2, n1 * 2); % n1 is the number of subjects. > design(1,1:n1) = 1; > design(1,(n1 + 1):(n1 * 2)) = 2; > design(2, :) = [[1:n1 ] [1 : n1]]; > cfg.design = design; > > cfg.ivar = 1; > cfg.uvar = 2; > stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); > However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. > In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. > Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! > Thanks. > Xiaoming > > _______________________________________________ > 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: Wed, 21 Oct 2015 11:22:09 -0700 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Martin, > > Thanks for thinking along. I've briefly tried to replicate/simplify the > situation depicted by you using the code below. It works as I would expect, > no matter whether one variable is scaled differently. But perhaps I'm not > fully capturing the issue, and something still goes awry. This is a > possibility because ft_statfun_correlationT has only recently been > implemented for a specific case, and was never really tested within > different situations (hence it's not well-documented on the wiki). Do you > think you could use this example code to replicate the situation you are > experiencing? > > Yours, > Arjen > > % simulate simple multiple subjects timelock structures > > data_brain = []; > > data_behav = []; > > for j=1:10 > > data_brain{j}.avg = j; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference > > end > > > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 100; > > > > n1 = 10; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > > > assert(isequal(stat.rho, -1)); > > 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > >> Hi Xiaoming, hi Arjen, >> >> I've been encountering the same problem. I believe Xiaoming is right when >> he points out that the permutaion step shuffles data across conditions and >> that this introduces a negative bias in the distribution. I found the same >> thing when I correlated RT data with TFRs (absolute power). My distribution >> was shifted strongly to the left and, thus, not a single negative cluster >> was significant, but every positive one was. >> >> Xiaomings explanation made a lot of sense to me when I thought about it >> graphically: Imagine correlating two data vectors, one (x) ranging between >> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >> a cloud of dots on the upper left corner of the diagram. When you then >> switch the variable assignment of half of the data points (which is what >> the permutation step seems to do), these dots will now be be shifted to the >> lower right corner of the diagram. So no matter what the correlation in the >> original data, chances are that (given different scaling) after permutaion, >> you get a negative correlation. >> >> I am not 100% sure about this, so please let me know if I made a mistake. >> >> What I tried instead of the 'ft_statfun_correlationT' was using a custom >> made statfun in which I pass the RTs via the design matrix. With this, my >> results looked much better. I am not sure, but I guess this is because >> there is no shuffling between the two variables in this case. >> >> I would really like to know, what is the right way of doing this using >> just the FieldTrip functions. Is there a way to permute data within >> variables? I tried cfg.resampling = 'bootstrap', but this is not a >> permutation, as far as I know. >> >> >> Thanks! >> Martin >> >> >> ------------------------------ >> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >> *An:* FieldTrip discussion list >> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >> follow-up questions >> >> Hey Xiaoming, >> >> It's still pretty hard, for me, to guess on basis of that matlab output >> what is going on here and what you mean with 'shuffling design matrices', >> and how that shuffling 'biases the cluster distribution'. As you mention >> yourself, it could be due to various reasons, and you're open to >> suggestions and increasing your understanding. I'd therefore suggest to try >> to funnel the number of potential explanations by simulating what you're >> doing (using input data for which you know how it should behave), after >> you've read more about what the design matrix and monte carlo statistics >> are supposed to do. Perhaps the statistics section at the bottom of this >> page provides a good starting point: >> http://www.fieldtriptoolbox.org/walkthrough >> >> Hope that helps, >> Arjen >> >> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >> >>> For example, our power values ranged from 1 to 3 (after log transform); >>> my behavioral data ranged from 20 to 90; >>> >>> by using above mentioned script, there are 14 negative clusters were >>> reported in variable stat. >>> >>> stat = >>> >>> prob: [30x50 double] >>> posclusters: [] >>> posclusterslabelmat: [30x50 double] >>> posdistribution: [1x1000 double] >>> negclusters: [1x14 struct] >>> negclusterslabelmat: [30x50 double] >>> negdistribution: [1x1000 double] >>> cirange: [30x50 double] >>> mask: [30x50 logical] >>> stat: [30x50 double] >>> ref: [30x50 double] >>> rho: [30x50 double] >>> dimord: 'chan_freq' >>> freq: [1x50 double] >>> label: {30x1 cell} >>> time: 2.5000 >>> cfg: [1x1 struct] >>> >>> However, the p values of those clusters (i.e., stat.negclusters.prob) are >>> all ones. The smallest value in stat.negdistribution is way larger than >>> the largest negative cluster t-sum. This could be real. However, it is more >>> likely due to the shuffle between power and behavioral group. For example, >>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 >>> 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, >>> their power data was labeled as behavioral data and vice versa. Because of >>> the scale difference between power and behavioral data, large negative >>> correlations were generated by permutation. This further biased the cluster >>> distribution. >>> My limited understanding is that, for correlation, each permutation >>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 >>> 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>> corresponds to another subject's behavioral data. >>> >>> I am not good at statistics. It will be really appreciated if you have >>> any suggestions or comments. >>> >>> Xiaoming >>> >>> >>> >>> >>>>>> Arjen Stolk 10/19/2015 6:01 PM >>> >>> Hey Xiaoming, >>> >>> Not sure if I understand, but shouldn't the directions of the >>> correlations be independent of the scaling of the two variables? Looking at >>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>> would result in a direction change either. Perhaps you could try to first >>> manually calculate a correlation between signal power and behavioral power, >>> and see whether anything is behaving unexpectedly? >>> >>> Yours, >>> Arjen >>> >>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>> >>>> Dear FieldTrip users, >>>> This is Xiaoming from University of Maryland Baltimore. My current >>>> project requires to calculate behavioral-power correlation across subjects. >>>> Similar topic was discussed here early this year. >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>> According to the suggestions in above mentioned thread, I duplicate my >>>> power dataset and replace the power values at each time-frequency point >>>> with behavioral data. Therefore, those two datasets have same structure and >>>> dimension. I used the following script to test if there are significant >>>> clusters of correlations. >>>> cfg = []; >>>> cfg.parameter = 'powspctrm'; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'ft_statfun_correlationT'; >>>> ... >>>> etc >>>> ... >>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>> design(1,1:n1) = 1; >>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>> cfg.design = design; >>>> >>>> cfg.ivar = 1; >>>> cfg.uvar = 2; >>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>> However, it seems when each time the design matrix is permuted, >>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>> each subject in design matrix. Although I confirmed this by uncommenting >>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>> matrix in command line, please correct me if this is not the case. >>>> In my mind, this kind of permutation will cause trouble when dealing >>>> with correlation. For example, in my case, the behavioral data and power >>>> data have different scales. The power data are much larger than behavioral >>>> data in general. When assigning behavioral data into power group or vice >>>> versa, it will induce huge negative correlations between power and >>>> behavioral measurement. Therefore, no negative clusters will survive from >>>> permutation test. >>>> Please let me know if I have mis-understanding or if I did anything >>>> wrong. Any suggestions will be highly appreciated! >>>> Thanks. >>>> Xiaoming >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 18 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 22 11:53:16 2015 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 22 Oct 2015 09:53:16 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: Message-ID: <0C912A67-0DAD-4A2B-AD72-2191E01AF614@donders.ru.nl> Dear participants in the discussion on behavioural-power correlation, My name is Eric Maris and have contributed most of the older statfuns (but not ft_statfun_correlationT). Together with Arjen, I will try to resolve some of the issues that have been discussed. Give us some time, and we will return to you via the Discussion List. best, Eric From martin.krebber at charite.de Thu Oct 22 12:20:23 2015 From: martin.krebber at charite.de (Krebber, Martin) Date: Thu, 22 Oct 2015 10:20:23 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> , Message-ID: Hi guys, Thanks for getting on top of this so quickly. I'm looking forward to seeing your solution to the problem. @Xiaoming: Nice job with the example you provided! I'll send you a copy of my statfun later. Best, Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Donnerstag, 22. Oktober 2015 06:01 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hi Xiaoming, Martin, Coming back about this issue, I have filed a bug report: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2992 In short, creating a randomization distribution using the permutation method is prone to systematic bias across conditions, as illustrated in our previous email exchanges. One workaround is to use the bootstrapping method (cfg.resampling = 'bootstrap'), or to explicitly remove the systematic bias, e.g by normalizing the data in each condition separately prior to doing statistical testing. I have added these important considerations to the documentation of ft_statfun_correlationT, built in a warning message, and created a latent function that explicitly tests for this issue (to prevent it to re-occur with future code changes). Thank you for your acuteness and contributions. Yours, Arjen 2015-10-21 15:33 GMT-07:00 Arjen Stolk >: Thanks for clarifying, Xiaoming. It seems indeed that a systematic offset (in averages) across the two sample populations biases the randomization distribution. I'd need to sort this out, but schematically would expect it to look as follow: normal: ~1000 ~1000 ~1000 ~1000 ~1 ~1 ~1 ~1 corr = ~0 post shuffling: ~1000 ~1 ~1000 ~1000 ~1 ~1000 ~1 ~1 corr = negative, that is an anti-correlation This implies a bootstrapping approach is more correct for testing for statistical significance of a correlation (in case of a systematic offset across conditions). Yours, Arjen 2015-10-21 14:28 GMT-07:00 Xiaoming Du >: Hi Martin, Thanks Martin to make it more clear. However, my understanding is that the problem is caused by different means of permutation for paired-sample t test and correlation. I am very curious how you solve the problem by customizing statfun. Do you mind sending me a copy of that? I will really appreciate it. Hi Arjen, I think the 'ft_statfun_correlationT' works fine. Using the code in your previous email, the correlation result (stat.rho) is same as using MATLAB function 'corr' with Spearman method. However, In your code, the design matrix for correlation is defined in the same way as for within-UO design (e.g., paired-sample t test). I think Martin's and my concern is that the permutation method for correlation and within-UO design (e.g., paired-sample t test) should be different. For example, there are 10 subjects (patients). Each of them finished a task before (A) and after (B) the treatment . Based on the different null hypothesis, the permutation methods for paired-sample t test and correlation should be different. For paired-sample t test (or within-UO design), the null hypothesis is that there is no different before or after the treatment. In other words, for each subjects, switch the results before and after treatment won't matter. This is exactly how the permutations are done when cfg.design is defined as in your code . On the other hand, the null hypothesis for correlation is that: there is no relationship between the results before and after treatment. Therefore, permutation should be done on after-treatment results among subjects while keep before-treatment results same (or permute before-treatment and keep after-treatment). In terms of permutation, correlation and paired-sample t test (within-UO design) seems treated equally in fieldtrip. Original matrix permutation for paired t test permutation for correlation before (A) after (B) before (A) after (B) before (A) after (B) subj1 A1 B1 subj1 A1 B1 subj1 A1 B2 subj2 A2 B2 subj2 B2 A2 subj2 A2 B4 subj3 A3 B3 subj3 B3 A3 subj3 A3 B3 subj4 A4 B4 subj4 A4 B4 subj4 A4 B1 subj5 A5 B5 subj5 A5 B5 subj5 A5 B10 subj6 A6 B6 subj6 B6 A6 subj6 A6 B8 subj7 A7 B7 subj7 B7 A7 subj7 A7 B9 subj8 A8 B8 subj8 A8 B8 subj8 A8 B6 subj9 A9 B9 subj9 B9 A9 subj9 A9 B5 subj10 A10 B10 subj10 A10 B10 subj10 A10 B7 As follows, I made minor changes in your previous code to show this issue. data_brain ranges from 0 to 1; data_behav ranges from 1000 to 1001; There is no relationship between data_brain and data_behav, because the values are randomly assigned to them. This is the results I got by using the code below: stat = prob: 9.9900e-04 cirange: 0.0020 mask: 1 stat: 0.2941 ref: -10.7655 rho: 0.0297 dimord: 'chan_time' label: {'1'} time: 1 cfg: [1x1 struct] stat.rho (0.0297) is the same as using 'corr' with Spearman option in matlab; However, stat.prob obtained by using permutation test is so small. The reason (I guess) are 1, two-tail test was used. 2, the rho distribution of permutation is biased to negative direction (meaning the rho after each permutation was biased to strong negative correlation. e.g., -0.8 etc ), so the real rho fell into the 5% range of rho distribution of permutations. In other words, real rho (0.0297) is smaller (or larger) than almost all rho from permutation, so that stat.prob is very small (0.000999). Please let me know if this makes sense to you or if I misunderstood anything. Thanks. Xiaoming data_brain = []; data_behav = []; for j=1:100 data_brain{j}.avg = rand; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = rand + 1000; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 1000; n1 = 100; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >>> Arjen Stolk > 10/21/2015 2:22 PM >>> Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin >: Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk > 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Thu Oct 22 16:51:04 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Thu, 22 Oct 2015 16:51:04 +0200 Subject: [FieldTrip] EEG electrode coordinate system transformation Message-ID: Dear all, we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_layout.jpg Type: image/jpeg Size: 34769 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: inverted_localite_layout.jpg Type: image/jpeg Size: 34337 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: localite_layout.jpg Type: image/jpeg Size: 33727 bytes Desc: not available URL: From paolo.belardinelli at gmail.com Thu Oct 22 16:55:28 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Thu, 22 Oct 2015 14:55:28 +0000 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: References: Message-ID: Dear all, we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_layout.jpg Type: image/jpeg Size: 34769 bytes Desc: standard_layout.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: inverted_localite_layout.jpg Type: image/jpeg Size: 34337 bytes Desc: inverted_localite_layout.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: localite_layout.jpg Type: image/jpeg Size: 33727 bytes Desc: localite_layout.jpg URL: From r.oostenveld at donders.ru.nl Thu Oct 22 21:47:51 2015 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 22 Oct 2015 21:47:51 +0200 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: References: Message-ID: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Hi Paolo, You may want to use ft_electroderealign immediately following the reading in. The electrode realign function allows you to rotate and translate (i.e. shift) the electrodes. Getting the electrodes properly aligned with the axes of the coordinate system will make it easier to make the layout with ft_prepare_layout. I have just made a small change to ft_electroderealign that makes it possible to use the function with only electrodes (and no MRI or head shape). You should get the latest fieldtrip version (later this evening on the FTP) or download https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m You can then do cfg = []; cfg.elec = ft_read_sens(‘your localite file’) cfg.method = ‘interactive’; elec_realigned = ft_electroderealign(cfg) cfg = []; cfg.elec = elec_realigned; layout = ft_prepare_layout(cfg); best regards, Robert On 22 Oct 2015, at 16:55, Paolo Belardinelli wrote: > Dear all, > > we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. > The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. > We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). > Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). > Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? > > 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 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 Oct 23 11:34:15 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 23 Oct 2015 11:34:15 +0200 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> References: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Message-ID: Dear Robert, thank you very much for your answer and support. We downloaded the ft_electroderealign from the github link you sent us. We ran the code lines that you inserted in your previous email. In the resulting interactive topoplot, we were able to rotate and realign the electrode configuration properly. However, for some reason, after pushing the 'apply' button, we are still not able to save the modified configuration and manually close the interactive window. As a consequence, when visualizing the new layout, we are still plotting the old configuration. Are we missing a step in the interactive GUI or is the subfunction cb_close not working properly? Best wishes, Paolo On Thu, Oct 22, 2015 at 9:47 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Paolo, > > You may want to use ft_electroderealign immediately following the reading > in. The electrode realign function allows you to rotate and translate (i.e. > shift) the electrodes. Getting the electrodes properly aligned with the > axes of the coordinate system will make it easier to make the layout with > ft_prepare_layout. > > I have just made a small change to ft_electroderealign that makes it > possible to use the function with only electrodes (and no MRI or head > shape). You should get the latest fieldtrip version (later this evening on > the FTP) or download > https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m > > You can then do > > cfg = []; > cfg.elec = ft_read_sens(‘your localite file’) > cfg.method = ‘interactive’; > elec_realigned = ft_electroderealign(cfg) > > cfg = []; > cfg.elec = elec_realigned; > layout = ft_prepare_layout(cfg); > > best regards, > Robert > > > > > On 22 Oct 2015, at 16:55, Paolo Belardinelli > wrote: > > Dear all, > > we are recording EEG electrode positions using the LOCALITE TMS navigator > acquisition software. We dispose over MRI data in DICOM format. > The electrode positions are stored in the (LPS) coordinate system. Unity > measures are mm. > We load the electrode positions in Fieldtrip by means of ft_read_sens. We > use the elec structure to prepare the layout with ft_prepare_layout. > Attached are the obtained layout (localite_layout) and the layout obtained > using standard electrode positions (standard_layout). > Appearantly, besides an inversion of both X and Y axes, we have to deal > with a Z offset we don't know how to exactly calculate ( a simple inversion > of axes does not provide correct results, see attached > inverted_localite_layout). > Is there a way to address this issue in Fieldtrip or with some > mathematical manipulation? > > 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 list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Fri Oct 23 14:52:36 2015 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 23 Oct 2015 14:52:36 +0200 Subject: [FieldTrip] EEG electrode coordinate system transformation In-Reply-To: References: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Message-ID: <4BC7F690-80F5-40FA-8152-BC3968E39BA3@donders.ru.nl> Hi Paolo, After pressing apply and closing the figure from electroderealign, the function returns the updated electrode structure. You are referring to cb_close, which is a subfunction that you would not see under normal situations. So I wonder whether you are running into an error (and that the function name is printed on screen). For me it works fine, both in 2014b and 2015b. But if you have an error in cb_close, the figure would not close properly and the updated electrode structure would not be returned. If you indeed have an error, please report it on http://bugzilla.fieldtriptoolbox.org/ and attach a small mat file with the elec structure in it. You should also report the operating system and the matlab version. best regards, Robert PS I will be traveling the next few days, so probably I won’t be able to respond to follow up emails for some time. On 23 Oct 2015, at 11:34, Paolo Belardinelli wrote: > Dear Robert, > thank you very much for your answer and support. > We downloaded the ft_electroderealign from the github link you sent us. > We ran the code lines that you inserted in your previous email. > In the resulting interactive topoplot, we were able to rotate and realign the electrode configuration properly. > However, for some reason, after pushing the 'apply' button, we are still not able to save the modified configuration and manually close the interactive window. > As a consequence, when visualizing the new layout, we are still plotting the old configuration. > Are we missing a step in the interactive GUI or is the subfunction cb_close not working properly? > > Best wishes, > > Paolo > > > > On Thu, Oct 22, 2015 at 9:47 PM, Robert Oostenveld wrote: > Hi Paolo, > > You may want to use ft_electroderealign immediately following the reading in. The electrode realign function allows you to rotate and translate (i.e. shift) the electrodes. Getting the electrodes properly aligned with the axes of the coordinate system will make it easier to make the layout with ft_prepare_layout. > > I have just made a small change to ft_electroderealign that makes it possible to use the function with only electrodes (and no MRI or head shape). You should get the latest fieldtrip version (later this evening on the FTP) or download https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m > > You can then do > > cfg = []; > cfg.elec = ft_read_sens(‘your localite file’) > cfg.method = ‘interactive’; > elec_realigned = ft_electroderealign(cfg) > > cfg = []; > cfg.elec = elec_realigned; > layout = ft_prepare_layout(cfg); > > best regards, > Robert > > > > > On 22 Oct 2015, at 16:55, Paolo Belardinelli wrote: > >> Dear all, >> >> we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. >> The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. >> We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). >> Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). >> Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? >> >> 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 list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > 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 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From helen.wieffering at gmail.com Fri Oct 23 23:53:48 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Fri, 23 Oct 2015 17:53:48 -0400 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis In-Reply-To: References: Message-ID: Hi Per, Thanks for your suggestion, and I'm sorry for my (much) delayed reply. I've read the paper you mentioned - it seems this could be promising for my work, too. I hadn't considered the non-parametric approach. Could you give me more detail on the pre-processing steps you took and the parameters you're using with the fieldtrip connectivity functions? I'd love to look at the scripts you're using, too, if at all possible. Thanks again. Helen Wieffering Bowdoin College On Wed, Oct 7, 2015 at 4:55 PM, Per Arnold Lysne wrote: > Hi Helen, > > > I am having good luck with ft_connectivity_analysis in MEG using the > nonparametric Granger approach of Dhamala, Rangarajan & Ding, 2008, > Neuroimage and Physical Review letters. > > > Thanks, > > > Per Lysne > > University of New Mexico > > lysne at unm.edu > > > -----Original Message----- > From: Helen Wieffering > Sent: Oct 7, 2015 8:59 AM > To: FieldTrip discussion list > Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis > > Dear FieldTrip users, > > I'm writing to see if any one out there has had success with computing > Granger causality measures in FieldTrip. We have been working toward making > this analysis possible with our EEG data and have now reached the final > stages. > > However, we find that ft_connectivity_analysis (and > ft_connectivity_granger for that matter) offers little guidance on how to > achieve a good mvar model fit. For example, the function asks the user to > specify the model order without offering tests for whiteness, stationarity, > or consistency. It seems that Fieldtrip calls on the BSMART toolbox to > perform these operations, which further confuses me given that BSMART > itself offers these model validation tests. Yet they don't seem to ever be > called upon by FieldTrip. > > We've considered using the BSMART toolbox separately from FieldTrip, yet > the toolbox website is rather outdated and the functions are only > compatible through 2008 Matlab - seems like a headache. But without tools > for validating the mvar model, we can't be confident of any GC results > achieved through FieldTrip. > > Are there perhaps further connectivity tools in FieldTrip that I've > overlooked? Or is it worth looking into other toolboxes? We've also > considered SIFT and the MVGC toolbox, but would love to keep working with > FieldTrip if possible. > > If anyone can offer advice, or connect me with someone knowledgeable in > this area, I'd love to know. > > Thanks very much, > > Helen Wieffering > Bowdoin College > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishwaryaselvaraj1708 at gmail.com Sun Oct 25 08:10:30 2015 From: aishwaryaselvaraj1708 at gmail.com (aishwarya selvaraj) Date: Sun, 25 Oct 2015 12:40:30 +0530 Subject: [FieldTrip] field trip Message-ID: Hi , I am a student who is working on emotiv epoc headset for my project . i just downloaded field trip and added to matlab directory successfully . And i was going through the manual ,but i found it difficult to understand anything . Basically i want to start using emotiv with matlab using field trip toolbox Could you help with a start PS:i would want to have a live streaming from the headset into matlab with field trip Waiting for your reply :) Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Oct 25 13:04:26 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 25 Oct 2015 12:04:26 +0000 Subject: [FieldTrip] field trip Message-ID: It sounds like you want to do real-time analysis; does this link help? http://www.fieldtriptoolbox.org/getting_started/realtime You can also read the general tutorials information: http://www.fieldtriptoolbox.org/tutorial/introduction http://www.fieldtriptoolbox.org/walkthrough http://www.fieldtriptoolbox.org/tutorial Beyond that, it's going to be hard for anyone to give you more detailed help unless you can explain more specifically what you are looking for, what you have read on the site so far, and what about it is lacking. 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: Sun, 25 Oct 2015 12:40:30 +0530 > From: aishwarya selvaraj > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] field trip > Message-ID: > < > CACWTKSr6E2P+58xw4z5YbK_u6KV-230oAsDxgjFMjpw8VeS4Yg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi , > I am a student who is working on emotiv epoc headset for my project . > i just downloaded field trip and added to matlab directory successfully . > And i was going through the manual ,but i found it difficult to understand > anything . > Basically i want to start using emotiv with matlab using field trip toolbox > Could you help with a start > PS:i would want to have a live streaming from the headset into matlab with > field trip > > Waiting for your reply :) > Regards > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151025/d5a10445/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.caballero at bcbl.eu Mon Oct 26 20:50:17 2015 From: c.caballero at bcbl.eu (Cesar Caballero) Date: Mon, 26 Oct 2015 20:50:17 +0100 (CET) Subject: [FieldTrip] error when creating head model in tutorial Message-ID: <1228077923.817774.1445889017673.JavaMail.zimbra@bcbl.eu> Dear all, I'm doing the tutorial to create the head model for EEG with my own nifti dataset. http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg When I try to create the head model, I have the following error: >> cfg = []; >> cfg.method = 'dipoli'; >> vol = ft_prepare_headmodel(cfg, bnd); Illegal right hand side in assignment. Too many elements. Error in ft_datatype_source>fixpos (line 337) source.pos = source.pnt; Error in ft_datatype_source (line 110) source = fixpos(source); Error in ft_checkdata (line 233) data = ft_datatype_source(data); Error in ft_prepare_headmodel (line 193) data = ft_checkdata(data, 'hasunit', 'yes'); I'd be pleased if anyone could point me out to the reason of the error. Thanks in advance for your time. Best wishes, Cesar ---------------------------------------------------------------------- Cesar Caballero MRI engineer www.bcbl.eu Twitter: @caballerogaudes www.researchgate.net/profile/Cesar_Caballero2 Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer From mishra408 at gmail.com Tue Oct 27 09:32:49 2015 From: mishra408 at gmail.com (Ashutosh Mishra) Date: Tue, 27 Oct 2015 14:02:49 +0530 Subject: [FieldTrip] Dipole lies on the boundary of volume model Message-ID: Hi, While computing sources, I get the "warning:dipole lies on boundary of volume model ". I noticed that lead field matrix for those dipoles matrix with NaN values, which further cause a problem in computing sources. 1. Can we neglect those dipoles? 2. If not then how could we fix this? Thanks Ashutosh -- Ashutosh Mishra -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.vanEs at donders.ru.nl Tue Oct 27 15:29:19 2015 From: M.vanEs at donders.ru.nl (Es, M.W.J. van (Mats)) Date: Tue, 27 Oct 2015 14:29:19 +0000 Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Oct 27 15:44:56 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 27 Oct 2015 14:44:56 +0000 Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis In-Reply-To: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> References: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> Message-ID: Hi Mats, Based on your description I suspect an issue with floating point numerical round off. I would assume that the length of your trials is fixed and the time axis supposed to be equal across trials? Could you try and do data.time(1:end) = data.time(1); and report back whether the problem persists (or vanishes)? Best, Jan-Mathijs On Oct 27, 2015, at 3:29 PM, Es, M.W.J. van (Mats) > wrote: Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.vanlier at bsse.ethz.ch Tue Oct 27 16:28:44 2015 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Tue, 27 Oct 2015 15:28:44 +0000 Subject: [FieldTrip] comodugrams (power-power correlation) Message-ID: Hi FieldTrip, I am trying to get the comodugrams of each channel pair to look for power-power correlations across frequencies. It would be great to multiplot them (depending on refchannel) with freqs on x and y, and corrcoefs on z. I can't seem to get the right output from connectivityanalysis. Is there a clever way of doing this within fieldtrip? Will multiplotTFR be able to handle this? Need to trick it into thinking one freq dim is a time dim I guess. cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.vanEs at donders.ru.nl Wed Oct 28 13:13:17 2015 From: M.vanEs at donders.ru.nl (Es, M.W.J. van (Mats)) Date: Wed, 28 Oct 2015 12:13:17 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 59, Issue 27 In-Reply-To: References: Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AF8@exprd01.hosting.ru.nl> Hi Jan-Mathijs, the length of trials is indeed fixed and the time axis was the same for all trials, so your option did not work. I did find the problem however: the time-window I tried to select was inconsistent with the time axis of the trials. I shifted the time-axis with 1/(2*Fs) and now the axes are equal again. Thank you for your help. Best, Mats ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of fieldtrip-request at science.ru.nl [fieldtrip-request at science.ru.nl] Sent: Wednesday, October 28, 2015 12:00 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 59, Issue 27 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. Problem matrix dim in ft_timelockanalysis (Es, M.W.J. van (Mats)) 2. Re: Problem matrix dim in ft_timelockanalysis (Schoffelen, J.M. (Jan Mathijs)) 3. comodugrams (power-power correlation) (van Lier Ben) ---------------------------------------------------------------------- Message: 1 Date: Tue, 27 Oct 2015 14:29:19 +0000 From: "Es, M.W.J. van (Mats)" To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7 at exprd01.hosting.ru.nl> Content-Type: text/plain; charset="iso-8859-1" Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 27 Oct 2015 14:44:56 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Mats, Based on your description I suspect an issue with floating point numerical round off. I would assume that the length of your trials is fixed and the time axis supposed to be equal across trials? Could you try and do data.time(1:end) = data.time(1); and report back whether the problem persists (or vanishes)? Best, Jan-Mathijs On Oct 27, 2015, at 3:29 PM, Es, M.W.J. van (Mats) > wrote: Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es _______________________________________________ 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: 3 Date: Tue, 27 Oct 2015 15:28:44 +0000 From: "van Lier Ben" To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] comodugrams (power-power correlation) Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi FieldTrip, I am trying to get the comodugrams of each channel pair to look for power-power correlations across frequencies. It would be great to multiplot them (depending on refchannel) with freqs on x and y, and corrcoefs on z. I can't seem to get the right output from connectivityanalysis. Is there a clever way of doing this within fieldtrip? Will multiplotTFR be able to handle this? Need to trick it into thinking one freq dim is a time dim I guess. cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 59, Issue 27 ***************************************** From daniel.haehnke at tum.de Wed Oct 28 15:41:03 2015 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 28 Oct 2015 14:41:03 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation Message-ID: Dear fellow Fieldtrip users, I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Thanks in advance for your ideas! All the 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 helen.wieffering at gmail.com Wed Oct 28 23:37:45 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 28 Oct 2015 18:37:45 -0400 Subject: [FieldTrip] Changing dimord of Cross Spectral Density matrix Message-ID: Dear Fieldtrip Users, I am trying to use the function ft_connectivitiy_csd2transfer in order to compute non-parametric Granger Causality measures. In order to do so, I have my frequency analysis data in the following form: freq = label: {129x1 cell} dimord: 'chan_freq_time' freq: [4 4.5000 5 5.5000 6] time: [1x41 double] powspctrm: [129x5x41 double] labelcmb: {8256x2 cell} crsspctrm: [8256x5x41 double] cfg: [1x1 struct] In my data, the crsspctrm matrix has a dimord of chan_freq_time -- however, the function ft_connectivity_csd2transfer requires a dimord of chan_chan_freq(_time). Does anyone have insight on how to change the dimord of my data? I understand that Fieldtrip's ft_freqanalysis function treats (a, b) and (b, a) cross spectra as identical and therefore omits half of all possible combinations. Ideally, though, I'd like for my crsspctrm matrix to contain all possible combinations between channels, including the auto-spectra. Thanks for your help! Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From helen.wieffering at gmail.com Thu Oct 29 00:30:05 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 28 Oct 2015 19:30:05 -0400 Subject: [FieldTrip] Changing dimord of Cross Spectral Density matrix In-Reply-To: References: Message-ID: Hello again, I've just realized the question in my previous e-mail is irrelevant when I proceed with ft_connectivityanalysis instead, using 'granger' as the method. I wasn't aware that this function could also perform nonparametric granger methods. Still, if anyone has insight on this or would like to connect about approaches, I'd love to hear. Best, Helen On Wed, Oct 28, 2015 at 6:37 PM, Helen Wieffering < helen.wieffering at gmail.com> wrote: > Dear Fieldtrip Users, > > I am trying to use the function ft_connectivitiy_csd2transfer in order to > compute non-parametric Granger Causality measures. > > In order to do so, I have my frequency analysis data in the following > form: > freq = > > label: {129x1 cell} > dimord: 'chan_freq_time' > freq: [4 4.5000 5 5.5000 6] > time: [1x41 double] > powspctrm: [129x5x41 double] > labelcmb: {8256x2 cell} > crsspctrm: [8256x5x41 double] > cfg: [1x1 struct] > > In my data, the crsspctrm matrix has a dimord of chan_freq_time -- > however, the function ft_connectivity_csd2transfer requires a dimord of > chan_chan_freq(_time). > > Does anyone have insight on how to change the dimord of my data? > > I understand that Fieldtrip's ft_freqanalysis function treats (a, b) and > (b, a) cross spectra as identical and therefore omits half of all possible > combinations. Ideally, though, I'd like for my crsspctrm matrix to contain > all possible combinations between channels, including the auto-spectra. > > Thanks for your help! > > Helen Wieffering > Bowdoin College > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Thu Oct 29 04:44:26 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Wed, 28 Oct 2015 20:44:26 -0700 Subject: [FieldTrip] many ICA components looking the same Message-ID: <5631961A.1050507@gmail.com> Hi everyone, I'm running ICA (cfg.method = 'runica') on CTF data with 274 sensors. I was restricting my decomposition to 80 components at first, and it worked well for all previous patients. Somehow, for this particular patient, many of the components have similar topography (I'm only showing till 42 below but the similarity continues for more components). Has anyone ever seen this before? If I look at the time course of these components, not all of them are clear eye-movements, but according to the topography, you'd think they are. Any thoughts, like either changing the method or rejecting only those components whose time courses clearly indicate eye movements and keep other components despite their topographies? Thanks, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: jcbdeahi.png Type: image/png Size: 164624 bytes Desc: not available URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Thu Oct 29 07:31:19 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Thu, 29 Oct 2015 06:31:19 +0000 Subject: [FieldTrip] many ICA components looking the same Message-ID: Hello Vitoria, I'm not sure, but one of my guesses would be head movement. That is to say, if the participant moves her head an inch (for example) then the same type of activity is going to start appearing on different sensors, and if that movement isn't corrected for then you can indeed start seeing what looks like many copies of the same component. (If you've done EEG, this is the same thing that happens when, for example, you bring the same participant back for multiple sessions on separate days and concatenate the datasets together, but didn't put the cap on on exactly the same place each time.) Do you have marker measurements you can use to at least check how much the head was moving, and perhaps to correct for movements over the course of the session? Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 5 > Date: Wed, 28 Oct 2015 20:44:26 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: [FieldTrip] many ICA components looking the same > Message-ID: <5631961A.1050507 at gmail.com> > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi everyone, > > I'm running ICA (cfg.method = 'runica') on CTF data with 274 sensors. I > was restricting my decomposition to 80 components at first, and it > worked well for all previous patients. > Somehow, for this particular patient, many of the components have > similar topography (I'm only showing till 42 below but the similarity > continues for more components). Has anyone ever seen this before? > If I look at the time course of these components, not all of them are > clear eye-movements, but according to the topography, you'd think they are. > Any thoughts, like either changing the method or rejecting only those > components whose time courses clearly indicate eye movements and keep > other components despite their topographies? > > Thanks, > Vitoria > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151028/bd0a6b81/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: jcbdeahi.png > Type: image/png > Size: 164624 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151028/bd0a6b81/attachment.png > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 28 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 29 07:49:08 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 29 Oct 2015 06:49:08 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: References: Message-ID: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Hi Daniel > I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. Has anyone said to you it would not be challenging ;o)? > While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data. This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with a leave-one-out approach. > 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? Yes. > 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can be prevented to start from the right format of the data to begin with (as per ft_freqanalysis). > I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Please do. Best, Jan-Mathijs > > Thanks in advance for your ideas! > > All the 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 alik.widge at gmail.com Thu Oct 29 10:42:01 2015 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 29 Oct 2015 05:42:01 -0400 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> References: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Message-ID: You may also find this informative: http://www.sciencedirect.com/science/article/pii/S1053811915003316 Disclaimer: I have not personally tried this yet, although it's on our list for a near future. Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Daniel > > > I am currently computing the Granger causality between LFP signals from > different brain regions. As it turns out, this is a more challenging > endeavour than I had previously thought. > > Has anyone said to you it would not be challenging ;o)? > > > While testing parametric and non-parametric approaches to computing > Granger causality, I came across some behaviour which seems odd to me. I > hope someone can shed light on these issues: > > > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> > ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR > data that contains a trial dimension. The first error is actually that it > can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis > with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ > field. However, if I manually copy the ‘label’ field from the original data > to the MVAR data, ft_freqanalysis stops at some point where it uses an > array that lacks one dimension. > > OK, this could (or could not) be a general issue with the code. The part > of FieldTrip that deals with AR-modelling is quite old, and it could be > that more recent changes in other parts of the code (e.g. concerning with > data bookkeeping) destroyed some of the functionality. None of the > developers are actively using AR-models in their daily research nowadays, > so it could be that this code is a bit stale. This being said, in general I > don’t think it is a good idea to fit an AR-model to a single trial worth of > data. This would probably lead to not so meaningful estimates. It would be > more meaningful to use a jackknife approach, where a variance across trials > (or some measure that quantifies the extent to which a single trial differs > from the rest) can be obtained with a leave-one-out approach. > > > 2. Using the non-parametric approach (ft_freqanalysis -> > ft_connectivityanalysis) I stumbled across the problem that the > implementation of Wilson’s algorithm that computes the factorisation of the > spectral density matrix doesn’t allow non-integer frequencies nor non-equal > distances between frequencies. Is this an inherent limitation of this > algorithm? > > Yes. > > > 3. Again for the non-parametric approach: If I use trial-resolved FREQ > data for ft_connectivityanalysis, the trial dimension is lost at line 389 > if I use data contain a ‘fourierspctrm’ field. If I use data containing a > ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at > line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not > resolved by using FREQ data which has both a ‘powspctrm’ as well as a > ‘crsspctrm’ field. > > The input into ft_connectivityanalysis should be a frequency domain data > structure containing either a ‘fourierspctrm’ (obtained with > cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with > cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I > would expect it to crash, if it doesn’t we should consider making the error > handling more strict. Also, for Wilson’s algorithm, the estimate of the > cross-spectral density needs to be somewhat robust, and a single trial > estimate in my opinion does not really make sense. The step at which the > fourierspctrm representation is converted into the cross-spectrum ‘knows’ > this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata > can in deed be notoriously slow in some cases, which can be prevented to > start from the right format of the data to begin with (as per > ft_freqanalysis). > > > I’m not really sure whether I need trial-resolved Granger-causality, but > in theory this should be possible. Of course, I could work around this > issue by just using 1-trial FREQ data for ft_connectivityanalysis. > > Please do. > > > Best, > Jan-Mathijs > > > > > > > Thanks in advance for your ideas! > > > > All the 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 peyton.finley at my.wheaton.edu Thu Oct 29 16:19:40 2015 From: peyton.finley at my.wheaton.edu (Peyton Finley) Date: Thu, 29 Oct 2015 10:19:40 -0500 Subject: [FieldTrip] Fast Fourier Transform Using EEGLab Message-ID: Hello, My name is Peyton Finley and I am an undergraduate research student at Wheaton College in Wheaton, Illinois. I am emailing you regarding how to conduct a Fast Fourier Transform using FieldTrip. Specifically, I am trying to use the function ft_freqstatistics.m to gather statistics for the FFT. The function requires what is noted as a "design matrix". This is the description: Nxnumobservations: design matrix (for examples/advice, please see the Fieldtrip wiki, especially cluster-permutation tutorial and the 'walkthrough' design-matrix section) I checked the FieldTrip wiki site, but I was unable to find anything on this design matrix. What is the design matrix and how do I construct it? Also, is this the correct way of performing a FFT on EEG data? Is there an alternate method? Before arriving at this point, I have performed the following steps. cfg = []; ft_defaults; cfg.dataset = dataset; preprocdata=ft_preprocessing(cfg); data=struct2single(preprocdata); %% Define cfg for ft_frequanalysis.m and run. cfg = []; cfg.output='fourier'; cfg.method='mtmfft'; cfg.outputfile=outputFileName; cfg.foilim=[0 55]; cfg.tapsmofrq='2'; [freq]=ft_freqanalysis(cfg,data); %% Define cfg for ft_freqstatistics.m and run. cfg = []; cfg.method='analytic'; [stat]=ft_freqstatistics(cfg, freq); Sincerely, Peyton Finley -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Thu Oct 29 16:49:57 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Thu, 29 Oct 2015 16:49:57 +0100 Subject: [FieldTrip] Fast Fourier Transform Using EEGLab In-Reply-To: References: Message-ID: <00aa01d11261$767e4750$637ad5f0$@artinis.com> Dear Peyton, You might want to check this out: http://www.fieldtriptoolbox.org/walkthrough#input_output_structure_of_ft_freqstatistics And the tutorials on statistic, e.g. http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq However, note that doing an FFT has nothing to do with ft_freqstatistics. You need ft_freqanalysis for that and did that just fine with the code you shared (and, as with everything in life, there is not *the* correct way to do anything, but the way you did it should be fine). 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 Peyton Finley Sent: Thursday, October 29, 2015 16:20 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Fast Fourier Transform Using EEGLab Hello, My name is Peyton Finley and I am an undergraduate research student at Wheaton College in Wheaton, Illinois. I am emailing you regarding how to conduct a Fast Fourier Transform using FieldTrip. Specifically, I am trying to use the function ft_freqstatistics.m to gather statistics for the FFT. The function requires what is noted as a "design matrix". This is the description: Nxnumobservations: design matrix (for examples/advice, please see the Fieldtrip wiki, especially cluster-permutation tutorial and the 'walkthrough' design-matrix section) I checked the FieldTrip wiki site, but I was unable to find anything on this design matrix. What is the design matrix and how do I construct it? Also, is this the correct way of performing a FFT on EEG data? Is there an alternate method? Before arriving at this point, I have performed the following steps. cfg = []; ft_defaults; cfg.dataset = dataset; preprocdata=ft_preprocessing(cfg); data=struct2single(preprocdata); %% Define cfg for ft_frequanalysis.m and run. cfg = []; cfg.output='fourier'; cfg.method='mtmfft'; cfg.outputfile=outputFileName; cfg.foilim=[0 55]; cfg.tapsmofrq='2'; [freq]=ft_freqanalysis(cfg,data); %% Define cfg for ft_freqstatistics.m and run. cfg = []; cfg.method='analytic'; [stat]=ft_freqstatistics(cfg, freq); Sincerely, Peyton Finley -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Thu Oct 29 18:25:31 2015 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Thu, 29 Oct 2015 17:25:31 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: References: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Message-ID: Thank you Jan-Mathijs for your opinion and suggestions! Thanks, Alik for the paper, this looks interesting. Now that I applied non-parametrically calculated Granger-causality for my data, I have to follow-up questions: 1. During the computation of spectral factorisation, the implementation of Wilson’s algorithm complains that “when performing non-parametric spectral factorisation the frequency axis should ideally be zero-padded”. I guess this means that the frequency axis should start at 0. However, as far as I can see that’s not possible using ft_freqanalysis. The code then goes on and performs the zero-padding. I don’t really understand why exactly it does the padding the way it does: it seems to add other frequencies as well, so that the frequency axis the algorithm is actually working with starts with 0 and is followed by some frequencies that are even higher than the first frequency from the original axis, before the original axis is starts. So my questions are: Should I be concerned about this warning? Why is the zero-padding of the frequency axis so weird? 2. I found that when I apply the GC computation to my data there seems to be some kind of edge artefact at the highest frequencies when I average across combinations that represent the same anatomical direction (see attached plot). Why do I get this effect and is it related to my first question? Best, Daniel[cid:6282C030-CD90-405E-BCED-AD7F0DDA754A] On 29 Oct 2015, at 10:42, Alik Widge > wrote: You may also find this informative: http://www.sciencedirect.com/science/article/pii/S1053811915003316 Disclaimer: I have not personally tried this yet, although it's on our list for a near future. Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel > I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. Has anyone said to you it would not be challenging ;o)? > While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data. This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with a leave-one-out approach. > 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? Yes. > 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can be prevented to start from the right format of the data to begin with (as per ft_freqanalysis). > I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Please do. Best, Jan-Mathijs > > Thanks in advance for your ideas! > > All the 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: granger.PNG Type: image/png Size: 82768 bytes Desc: granger.PNG URL: From v.piai.research at gmail.com Thu Oct 29 19:01:32 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Thu, 29 Oct 2015 11:01:32 -0700 Subject: [FieldTrip] many ICA components looking the same In-Reply-To: References: Message-ID: <56325EFC.2050802@gmail.com> hi Steve, Thanks, sounds like a very reasonable explanation. I'm wondering whether I could use Arjen's correction for head movement prior to ICA decomposition, but I can imagine there would be problems with doing the regression first... I'll ask Arjen what he thinks and post it here - if he doesn't see this before I see him again - but I'd be curious to hear what you think as well. Thanks a lot! Vitoria On 10/28/2015 11:31 PM, Stephen Politzer-Ahles wrote: > Hello Vitoria, > > I'm not sure, but one of my guesses would be head movement. That is to > say, if the participant moves her head an inch (for example) then the > same type of activity is going to start appearing on different > sensors, and if that movement isn't corrected for then you can indeed > start seeing what looks like many copies of the same component. (If > you've done EEG, this is the same thing that happens when, for > example, you bring the same participant back for multiple sessions on > separate days and concatenate the datasets together, but didn't put > the cap on on exactly the same place each time.) Do you have marker > measurements you can use to at least check how much the head was > moving, and perhaps to correct for movements over the course of the > session? > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > > Message: 5 > Date: Wed, 28 Oct 2015 20:44:26 -0700 > From: Vit?ria Piai > > To: FieldTrip discussion list > > Subject: [FieldTrip] many ICA components looking the same > Message-ID: <5631961A.1050507 at gmail.com > > > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi everyone, > > I'm running ICA (cfg.method = 'runica') on CTF data with 274 > sensors. I > was restricting my decomposition to 80 components at first, and it > worked well for all previous patients. > Somehow, for this particular patient, many of the components have > similar topography (I'm only showing till 42 below but the similarity > continues for more components). Has anyone ever seen this before? > If I look at the time course of these components, not all of them are > clear eye-movements, but according to the topography, you'd think > they are. > Any thoughts, like either changing the method or rejecting only those > components whose time courses clearly indicate eye movements and keep > other components despite their topographies? > > Thanks, > Vitoria > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: jcbdeahi.png > Type: image/png > Size: 164624 bytes > Desc: not available > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 28 > ***************************************** > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Oct 30 18:28:59 2015 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 30 Oct 2015 10:28:59 -0700 Subject: [FieldTrip] many ICA components looking the same In-Reply-To: <56325EFC.2050802@gmail.com> References: <56325EFC.2050802@gmail.com> Message-ID: <5633A8DB.9010103@gmail.com> Hi all, Just adding this info for the sake of completeness. Thanks, Arjen, for clarifying it! As I suspected, it's *really* not a good idea to use ft_regressconfound before ICA. In fact, this function should be used only at the very latest stages of your analysis, either just before doing stats, or by incorporating the approach in the stats itself. Vitória On 10/29/2015 11:01 AM, Vitória Piai wrote: > hi Steve, > > Thanks, sounds like a very reasonable explanation. > I'm wondering whether I could use Arjen's correction for head movement > prior to ICA decomposition, but I can imagine there would be problems > with doing the regression first... I'll ask Arjen what he thinks and > post it here - if he doesn't see this before I see him again - but I'd > be curious to hear what you think as well. > > Thanks a lot! > Vitoria > > On 10/28/2015 11:31 PM, Stephen Politzer-Ahles wrote: >> Hello Vitoria, >> >> I'm not sure, but one of my guesses would be head movement. That is >> to say, if the participant moves her head an inch (for example) then >> the same type of activity is going to start appearing on different >> sensors, and if that movement isn't corrected for then you can indeed >> start seeing what looks like many copies of the same component. (If >> you've done EEG, this is the same thing that happens when, for >> example, you bring the same participant back for multiple sessions on >> separate days and concatenate the datasets together, but didn't put >> the cap on on exactly the same place each time.) Do you have marker >> measurements you can use to at least check how much the head was >> moving, and perhaps to correct for movements over the course of the >> session? >> >> Best, >> Steve >> >> >> >> --- >> Stephen Politzer-Ahles >> University of Oxford >> Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology >> http://users.ox.ac.uk/~cpgl0080/ >> >> Message: 5 >> Date: Wed, 28 Oct 2015 20:44:26 -0700 >> From: Vit?ria Piai > > >> To: FieldTrip discussion list >> Subject: [FieldTrip] many ICA components looking the same >> Message-ID: <5631961A.1050507 at gmail.com >> > >> Content-Type: text/plain; charset="utf-8"; Format="flowed" >> >> Hi everyone, >> >> I'm running ICA (cfg.method = 'runica') on CTF data with 274 >> sensors. I >> was restricting my decomposition to 80 components at first, and it >> worked well for all previous patients. >> Somehow, for this particular patient, many of the components have >> similar topography (I'm only showing till 42 below but the similarity >> continues for more components). Has anyone ever seen this before? >> If I look at the time course of these components, not all of them are >> clear eye-movements, but according to the topography, you'd think >> they are. >> Any thoughts, like either changing the method or rejecting only those >> components whose time courses clearly indicate eye movements and keep >> other components despite their topographies? >> >> Thanks, >> Vitoria >> >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: jcbdeahi.png >> Type: image/png >> Size: 164624 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 59, Issue 28 >> ***************************************** >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Fri Oct 30 18:49:31 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Fri, 30 Oct 2015 18:49:31 +0100 Subject: [FieldTrip] ft_redefinetrial and response correctness Message-ID: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> Hi all, I have a question about ft_redefinetrial. So, I have two conditions S 11 and S 31, respectively ‘in-synch’ and ’not-in-synch’ and participants were instructed to press 1 or 2 in the keyboard to report their answer, S 1 for ‘not-in-synch’ and S 2 for ‘in-synch’. What I need to do is TFR analysis only for the trials where participants answered correctly, that is S 11 & S 2 and S 31 & S 1 (below an extract from a .vmrk file showing a correct match). Mk3=Stimulus,S 11,33182,1,0 Mk4=Stimulus,S 12,33782,1,0 Mk5=Stimulus,S 13,33902,1,0 Mk6=Stimulus,S 14,34582,1,0 Mk7=Stimulus,S 2,37915,1,0 Mk8=Stimulus,S 31,40352,1,0 Mk9=Stimulus,S 63,40952,1,0 Mk10=Stimulus,S 32,40953,1,0 Mk11=Stimulus,S 33,41112,1,0 Mk12=Stimulus,S 35,41792,1,0 Mk13=Stimulus,S 34,41793,1,0 Mk14=Stimulus,S 35,44634,1,0 Mk15=Stimulus,S 1,44635,1,0 From the tutorials, I’ve understood that I should have done this in my trialfun when I defined my trials during the pre-processing step, but today we realised that some subjects perceived as out-of-synch the condition in-synch and viceversa. So, I was wondering how could I do this now - could I do this using the ft_redefinetrial or worst-case-scenario should I do the pre-processing all over again? I wrote the code below before starting the TRF analysis but it’s not correct since it’s not working: %Redefine trials cfg = []; cfg.trials = 'all'; cfg.trialdef.eventtype = 'Stimulus'; % we are interested in Stimulus markers cfg.trialdef.eventvalue = { 'S 11' 'S 31' }; cfg.trialdef.eventcorrect = [ 'S 2' 'S 1' ]; % correct response Stimulus S 2 for S 11 and S 1 for S 31 cfg.toilim = [-1.8 2.0]; data = ft_redefinetrial(cfg, data); Any suggestions/help is more than welcome! thanks in advance, ~ grazia -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sat Oct 31 01:16:58 2015 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 30 Oct 2015 20:16:58 -0400 Subject: [FieldTrip] ft_redefinetrial and response correctness In-Reply-To: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> References: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> Message-ID: Hi Grazia, In the past I ran into difficulty with my trial function when my triggers were strings. can you remove the ’S’ and change your triggers to numeric values? If not, perhaps I can try if you give me a snippet of data (although I am unfamiliar with .vmk), my old trial functions did what you need. Alternatively, break down this process by using ft_read_event ( http://www.fieldtriptoolbox.org/reference/ft_read_event ) and ft_read_header (http://www.fieldtriptoolbox.org/reference/ft_read_header ). Best, Raquel > On Oct 30, 2015, at 1:49 PM, Grazia Di Pisa wrote: > > Hi all, > > I have a question about ft_redefinetrial. So, I have two conditions S 11 and S 31, respectively ‘in-synch’ and ’not-in-synch’ and participants were instructed to press 1 or 2 in the keyboard to report their answer, S 1 for ‘not-in-synch’ and S 2 for ‘in-synch’. > > What I need to do is TFR analysis only for the trials where participants answered correctly, that is S 11 & S 2 and S 31 & S 1 (below an extract from a .vmrk file showing a correct match). > > Mk3=Stimulus,S 11,33182,1,0 > Mk4=Stimulus,S 12,33782,1,0 > Mk5=Stimulus,S 13,33902,1,0 > Mk6=Stimulus,S 14,34582,1,0 > Mk7=Stimulus,S 2,37915,1,0 > > Mk8=Stimulus,S 31,40352,1,0 > Mk9=Stimulus,S 63,40952,1,0 > Mk10=Stimulus,S 32,40953,1,0 > Mk11=Stimulus,S 33,41112,1,0 > Mk12=Stimulus,S 35,41792,1,0 > Mk13=Stimulus,S 34,41793,1,0 > Mk14=Stimulus,S 35,44634,1,0 > Mk15=Stimulus,S 1,44635,1,0 > > From the tutorials, I’ve understood that I should have done this in my trialfun when I defined my trials during the pre-processing step, but today we realised that some subjects perceived as out-of-synch the condition in-synch and viceversa. > > So, I was wondering how could I do this now - could I do this using the ft_redefinetrial or worst-case-scenario should I do the pre-processing all over again? > > I wrote the code below before starting the TRF analysis but it’s not correct since it’s not working: > > %Redefine trials > cfg = []; > cfg.trials = 'all'; > cfg.trialdef.eventtype = 'Stimulus'; % we are interested in Stimulus markers > cfg.trialdef.eventvalue = { 'S 11' 'S 31' }; > cfg.trialdef.eventcorrect = [ 'S 2' 'S 1' ]; % correct response Stimulus S 2 for S 11 and S 1 for S 31 > cfg.toilim = [-1.8 2.0]; > > data = ft_redefinetrial(cfg, data); > > > Any suggestions/help is more than welcome! > > thanks in advance, > ~ grazia > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Sat Oct 31 01:31:55 2015 From: bick35 at gmail.com (steph) Date: Fri, 30 Oct 2015 17:31:55 -0700 Subject: [FieldTrip] ft_connectivity_laggedcoherence error Message-ID: Hello fieldtrip experts, I tried ft_connectivity_laggedcoherence and ran in this error: Error in ft_connectivity_laggedcoherence (line 228) laggedcrossproduct = fcs1(chancmbind(:,1),tcounter).*conj(fcs2(chancmbind(:,2),tcounter)); This is the code starting at line 224: fcs1(:,colswithnans) = []; fcs2(:,colswithnans) = []; % sum laggedcrossproducts and power over all timepoints for tcounter=1:length(t1) laggedcrossproduct = fcs1(chancmbind(:,1),tcounter).*conj(fcs2(chancmbind(:,2),tcounter)); laggedcps(:,lagindx,trialindx) = laggedcps(:,lagindx,trialindx)+ laggedcrossproduct; power(:,lagindx,1,trialindx) = power(:,lagindx,1,trialindx)+ abs(fcs1(chancmbind(:,1),tcounter)).^2; power(:,lagindx,2,trialindx) = power(:,lagindx,2,trialindx)+ abs(fcs2(chancmbind(:,2),tcounter)).^2; hasdata(trialindx,lagindx) = true; nsmplslaggedcps(lagindx,trialindx) = nsmplslaggedcps(lagindx,trialindx)+1; end; I thing my error appeared because I had some columns with NAN’s which were removed (fcs1(:,colswithnans) = []; fcs2(:,colswithnans) = []; ). Then the second dimension of the matrix fcs1 did not match length(t1). The code runs without error when replacing: % for tcounter=1:length(t1) for tcounter=1:size(fcs1,2) Would the output still be correct? Thank you! Stephan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Oct 31 13:56:02 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sat, 31 Oct 2015 12:56:02 +0000 Subject: [FieldTrip] ft_connectivity_laggedcoherence error In-Reply-To: References: Message-ID: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> Hi Stephan, This code has recently been added as a placeholder function. The code is not functional at the moment. You could keep yourself informed, by signing up on the CC list of this bug: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2951 Of course you are free to contribute to the code. Best wishes Jan-Mathijs Jan-Mathijs Schoffelen, MD PhD, Senior researcher Donders Centre for Cognitive Neuroimaging E-mail: j.schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.fieldtriptoolbox.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Sat Oct 31 18:52:31 2015 From: bick35 at gmail.com (Steph Bickel) Date: Sat, 31 Oct 2015 10:52:31 -0700 Subject: [FieldTrip] ft_connectivity_laggedcoherence error In-Reply-To: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> References: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> Message-ID: <3A847F3B-D850-41A2-9D6A-8BB19FDF386C@gmail.com> Hi Jan-Mathijs, thank you for your response! That’s good to know. I will sign up and if I can contribute at all I will. Happy halloween, Stephan > On Oct 31, 2015, at 5:56 AM, Schoffelen, J.M. (Jan Mathijs) wrote: > > Hi Stephan, > > This code has recently been added as a placeholder function. The code is not functional at the moment. You could keep yourself informed, by signing up on the CC list of this bug: > http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2951 > Of course you are free to contribute to the code. > > Best wishes > Jan-Mathijs > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > Donders Centre for Cognitive Neuroimaging > > E-mail: j.schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.fieldtriptoolbox.org > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From guevara.erra at gmail.com Sat Oct 31 22:25:02 2015 From: guevara.erra at gmail.com (GUEVARA ERRA RAMON MARIANO) Date: Sat, 31 Oct 2015 22:25:02 +0100 Subject: [FieldTrip] Call for participation Neural Synchronization Frontiers Topic Message-ID: Dear potential authors on the fieldtrip mailing list, This is a call for participation at a special issue (Frontiers Topic) on neural synchronization, that we are currently editing: 'Large-scale neural synchronization and coordinated dynamics: a foundational approach' Web site: http://journal.frontiersin.org/researchtopic/4079/large-scale-neural-synchronization-and-coordinated-dynamics-a-foundational-approach Description: A fundamental question in neuroscience is how segregation and integration of information takes place by the temporal coordination of differentiated, specialized brain areas. Neural synchronization is often invoked as a mechanism of coordinated activity, and in the last ten years there has been a great effort to understand its significance, to clarify its physiological and computational roles and its relationship with brain rhythms and abnormal brain functioning (as in epilepsy or Parkinson’s disease). But in a broader sense, synchronization is an old concept, arising from the studies of oscillators in non-linear dynamics. It is indeed a widespread phenomenon, reflecting the coupling between self-oscillating units. However, the association between coupling and coordinated activity is not completely understood in the context of brain dynamics, most critically when this relationship is extended to large networks of interacting neurons. What do we mean when we use the term ‘synchronization’ in neuroscience? How can we measure physical coupling when real experiments can only tell us about temporal statistical correlation? Can we freely use concepts from oscillation theory to describe brain dynamics? In this Research Topic we welcome contributions from different backgrounds and perspectives to promote a deeper understanding of the relationship between neural synchronization and physical coupling between neuronal networks, and its implications for functional connectivity in the normal and the pathological brain. This topic will include, among others, contributions with the following themes: 1) Foundations of large-scale neural synchronization, based on physical theories of oscillation. 2) The computational role and metabolic cost of neural synchronization, and its relation to brain rhythms. 3) Behavioral and cognitive consequences of oscillatory activity in the human brain. 4) Synthesis and state-of-the-art on measuring neural synchronization in experimental settings. 5) Recent methods for the reconstruction of connectivity in oscillatory networks. 6) Applications of the concept of neural coupling and oscillatory activity in a medical setting, such as monitoring and control of neural synchronization in brain pathologies affecting coordination dynamics. Looking forward to have your contributions. Those interested please write to Ramon Guevara (guevara.erra at gmail.com ) Best wishes, Ramon Guevara Erra University Paris Descartes, Paris, France Jose Luis Perez Velazquez Hospital for Sick Children and University of Toronto, Toronto, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: From spa268 at nyu.edu Thu Oct 1 12:49:54 2015 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Thu, 1 Oct 2015 11:49:54 +0100 Subject: [FieldTrip] Artifact rejection Message-ID: Hello Federica, Without seeing your code or the error messages you got, I can't tell why cfg.trl=trl didn't work. As for the ft_read_data error, this sounds like the baseline specified might be longer than what's present in your data. You said your data were previously processed (and I assume epoched) in EEGLAB; what was the length of the baseline interval you left? For instance, if you left a -200ms baseline, that means the first trigger in the dataset is occuring at 201 ms (assuming 1000 Hz sampling). Then if you define a trl structure in Fieldtrip with a longer baseline (say, 250 ms) and try to read the data, fieldtrip will try to read 50 ms of data before the actual beginning of the file, which would cause this error. if this is the case, you'll need to either use a shorter baseline interval when you define trials in Fieldtrip, or you'll need to re-process the data in EEGLAB and leave a longer baseline interval. Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ > Message: 1 > Date: Wed, 30 Sep 2015 15:31:56 +0200 > From: Federica Mauro > To: FieldTrip discussion list > Subject: [FieldTrip] Artifact rejection > Message-ID: > UvsNRV8KEj2Ei-ww at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi everybody, > > I'm trying to use Fieldtrip in order to reject automatically artifacts on > my dataset. I'm working with EEG data previously preprocessed in EEGLAB, > thus their extension is .set. > I'm tryng to follow and adapt the tutorial for MEG data at > http://www.fieldtriptoolbox.org/tutorial/automatic_artifact_rejection, but > I found some problems. > > 1. It doesn't recognize assignment cfg.trl = trl. For this reason I tried > to use ft_definetrial in order to get the matrix cfg.trl, but it still > gives me problems: > 2. Specifically: Error using ==> ft_read_data at 206 - cannot read data > before the begin of the file > > Do you have any suggestion? > > Thank you very much in advance! > Best, > Federica > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Thu Oct 1 16:48:09 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Thu, 1 Oct 2015 16:48:09 +0200 (CEST) Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> Message-ID: <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> 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 From jan.schoffelen at donders.ru.nl Thu Oct 1 17:07:31 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 1 Oct 2015 15:07:31 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> Message-ID: <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> 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 From iris.steinmann at med.uni-goettingen.de Thu Oct 1 17:38:25 2015 From: iris.steinmann at med.uni-goettingen.de (Steinmann, Iris) Date: Thu, 1 Oct 2015 15:38:25 +0000 Subject: [FieldTrip] ft_freqgrandaverage with cfg.inputfile not possible Message-ID: Hi everybody, I have a problem using the cfg.inputfile option with the ft_freqgrandaverage function. When I declare an cfg.inputfile and call the ft_freqgrandaverage(cfg) with only the cfg structure as an argument I get an error: ' cfg.inputfile should not be used in conjunction with giving input data to this function' as if I would call the function with an inputfile AND a data structure (what is in fact not the case) here a short example: I calculated the time-frequency-spectra for all my subjects (like that: TFR1 = ft_freqanalysis(cfg, data)) Now I wanne use the ft_freqgrandaverage function to average time-frequency-spectra over subjects. It worked great when I call the function like that: % code start ================================================== cfg = []; cfg.parameter = 'powspctrm'; grdavg_spec = ft_freqgrandaverage(cfg, TFR1, TFR2, TFR3, TFR4, ...); % code end ==================================================== but I get an error message when I save all my TFRs from single subjects in a cell array to use the cfg.inputfile option % code start ================================================== all_subjects = {TFR1; TFR2; TFR3; TFR4; ....}; save 'all_subject_file' 'all_subjects'; cfg = []; cfg.parameter = 'powspctrm'; cfg.inputfile = 'all_subject_file'; grdavg_spec = ft_freqgrandaverage(cfg); % code end ==================================================== Error message: Error using ft_preamble_loadvar (line 46) cfg.inputfile should not be used in conjunction with giving input data to this function Error in ft_preamble (line 56) evalin('caller', ['ft_preamble_' cmd]); Error in ft_freqgrandaverage (line 63) ft_preamble loadvar varargin Would be nice if someone could help me! Thanx! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at telecom-paristech.fr Thu Oct 1 22:45:46 2015 From: alexandre.gramfort at telecom-paristech.fr (Alexandre Gramfort) Date: Thu, 1 Oct 2015 20:45:46 +0000 Subject: [FieldTrip] [JOB] Post-doc position at Neurospin / Paris Message-ID: hi, Applications are invited for a full-time one-year post-doctoral scientist. The position is funded by the Paris- Saclay IDEX project NOTime - Neural Oscillations & Time - whose main objective is to develop and apply cross-frequency-coupling analyses on electrophysiological and M/EEG data. Applications are invited from committed and enthusiastic researchers with significant experience with M/EEG and substantial research record in cognitive neurosciences, psychology and/or related field. The selected postdoctoral fellow will work in full collaboration with a master student dedicated to the project, and with the following consortium of researchers: - Valérie Doyère, NeuroPsi: http://neuro-psi.cnrs.fr/spip.php?article245&lang=en - Alexandre Gramfort, Telecom ParisTech: http://alexandre.gramfort.net/ - Virginie van Wassenhove, Neurospin: https://sites.google.com/site/virginievanwassenhove/ Full Job Description: https://www.dropbox.com/s/lq4oi0k8cu85jag/NOTIME_postdoc_advert.pdf?dl=0 Application package: - CV (incl. a list of publications) - Two letters of recommendation (or contacts from which those could be obtained) - A letter of intent with a statement of research interests Please put IDEX POSTDOC in the email subject and send your application package to Virginie.van.Wassenhove at gmail.com Applications will be considered until the position is filled. Best, -- Alexandre Gramfort, PhD Assistant Professor, TSI, Telecom ParisTech, CNRS LTCI 46 Rue Barrault, 75013 Paris, France http://alexandre.gramfort.net alexandre.gramfort at telecom-paristech.fr From bibi.raquel at gmail.com Fri Oct 2 06:16:33 2015 From: bibi.raquel at gmail.com (Raquel bibi Cohen) Date: Fri, 2 Oct 2015 00:16:33 -0400 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: References: Message-ID: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad > On Sep 30, 2015, at 10:54 AM, Wu, Jia wrote: > > Hi, > > If I have 100 subjects, do I have to do: > grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? > > Is there a better way? Or is it not what I should be doing? > > best, > -jia > _______________________________________________ > fieldtrip 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.whitmarsh at ki.se Fri Oct 2 10:32:47 2015 From: stephen.whitmarsh at ki.se (Stephen Whitmarsh) Date: Fri, 2 Oct 2015 08:32:47 +0000 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> References: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> Message-ID: Hi Jia, (and hi Raquel!) Perhaps easiest is if you get all your subjects in a MATLAB struct, e.g. data{1}, data{2}, etc. Then you can just enter that structure in the FieldTrip functions that take multiple dataset such as ft_timelockgrandaverage and ft_freqanalysis, with e.g. timelockgrandaverage(cfg,data{:}) Cheers, stephen From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel bibi Cohen Sent: 02 October 2015 06:17 To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad On Sep 30, 2015, at 10:54 AM, Wu, Jia > wrote: Hi, If I have 100 subjects, do I have to do: grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? Is there a better way? Or is it not what I should be doing? best, -jia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Fri Oct 2 11:39:40 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Fri, 2 Oct 2015 11:39:40 +0200 (CEST) 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: <457842304.264271.1443778780929.JavaMail.zimbra@bcbl.eu> Hi Jan Mathijs, Ok, I see what you mean. I will follow your comments then. Thank you very much for your help! All the best, Sara Sara Aurtenetxe ----- Original Message ----- From: "Schoffelen, J.M. (Jan Mathijs)" To: "FieldTrip discussion list" Sent: Thursday, October 1, 2015 5:07:31 PM Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE 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 From jia.wu at yale.edu Fri Oct 2 15:10:44 2015 From: jia.wu at yale.edu (Wu, Jia) Date: Fri, 2 Oct 2015 13:10:44 +0000 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: References: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com>, Message-ID: Hi Stephen (and hi Raquel) Eelke in an previous email suggested the same thing and it worked really well. Thanks everyone for help. best, -jia ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Stephen Whitmarsh [stephen.whitmarsh at ki.se] Sent: Friday, October 02, 2015 4:32 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, (and hi Raquel!) Perhaps easiest is if you get all your subjects in a MATLAB struct, e.g. data{1}, data{2}, etc. Then you can just enter that structure in the FieldTrip functions that take multiple dataset such as ft_timelockgrandaverage and ft_freqanalysis, with e.g. timelockgrandaverage(cfg,data{:}) Cheers, stephen From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel bibi Cohen Sent: 02 October 2015 06:17 To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad On Sep 30, 2015, at 10:54 AM, Wu, Jia > wrote: Hi, If I have 100 subjects, do I have to do: grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? Is there a better way? Or is it not what I should be doing? best, -jia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at donders.ru.nl Fri Oct 2 17:03:55 2015 From: n.lam at donders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 2 Oct 2015 15:03:55 +0000 Subject: [FieldTrip] FieldTrip workshop in Salzburg, Austria Message-ID: Dear FieldTrippers, FieldTrip is holding a workshop in Salzburg in December. The local organizers are currently accepting applications. For more information see here: http://www.fieldtriptoolbox.org/workshop/salzburg Best, Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaminkim at umich.edu Fri Oct 2 20:41:06 2015 From: kaminkim at umich.edu (Kamin Kim) Date: Fri, 2 Oct 2015 13:41:06 -0500 Subject: [FieldTrip] Postdoc position: Electrophysiology of Language Networks, UT Houston Medical School Message-ID: Dear all, Two post-doctoral positions are available in the lab of Nitin Tandon at Houston (www.tandonlab.org), to begin as soon as fall of 2015, for a duration of up to five years. These positions will be supported by recent grants awarded to the PI from the National Science Foundation and the national Institutes of Health ( www.aronlab.org). Candidates for this position should have a background in cognition/ cognitive neuroscience/ intracranial electrophysiology and be interested in understanding speech production in humans. Interactions with our collaborators on these grants, particularly Greg Hickok at UCI, Bob Knight at UC Berkeley and Behnaam Aazhang at Rice University will be encouraged and facilitated. Both positions will involve state-of-the-art analysis of electro-corticographic signals in patients using stereo EEG and subdural grid electrodes and novel electrical stimulation approaches. Opportunities for inter-modal comparisons will also be provided. Candidates must have strong capabilities in one or more of the following disciplines – electrophysiology, signal processing, cognitive neuroscience or computational neuroscience. New members of the lab will benefit from the expertise of several other collaborators, post-docs and graduate students and a proven track record of expertise in intracranial electrophysiology. Applications should consist of a cover letter describing research interests (and how those are a good fit for the position), a curriculum vitae, and contact information for three referees. Applicants will be evaluated on a first come first served basis and applications will be evaluated till the positions are filled, which we expect to happen by the end of this year. Pay will be commensurate with NIH/NSF rates for post-doctoral fellows and full benefits will be provided via the University of Texas. Please send completed applications to nitin.tandon at uth.tmc.edu. *Summary: * Post-docs will analyze human electrocorticographic (ECoG) data collected using intracranial EEG (iEEG) - stereo EEG (sEEG) and subdural grid electrodes (SDE) during language production - and modulate these using novel electrical stimulation approaches. -- ======================================= Kamin Kim, Ph.D. University of Texas Medical School at Houston 6431 Fannin Street, MSB Suite G550D Houston, TX 77030 kamin.kim at uth.tmc.edu ======================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Fri Oct 2 20:44:42 2015 From: bick35 at gmail.com (Steph Bickel) Date: Fri, 2 Oct 2015 11:44:42 -0700 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: Message-ID: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan > On Sep 26, 2015, at 11:54 PM, Steph Bickel wrote: > > Hello fieldtrip experts, > > a script that used to work gives me problems now. > > When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. > > > cfg=[]; > cfg.dataset = edf_file ; > cfg.continuous = ‘yes’; > cfg.demean = ‘yes' ; > cfg.channel = ‘Event' ; > raw = ft_preprocessing(cfg); > > raw = > > hdr: [1x1 struct] > label: {'Event'} > time: {[1x152082 double]} > trial: {[129x152082 double]} > fsample: 499.7071 > sampleinfo: [1 152082] > cfg: [1x1 struct] > > > It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? > > > if isfield(EDF, 'chansel') > chanindx = EDF.chansel; > chanSel = 1; > else > chanindx = [1:EDF.NS]; > chanSel = 0; > end; > > > > Thank you! > > Stephan > > (I’m using the current github field trip version on a mac) -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Sat Oct 3 08:42:27 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Sat, 3 Oct 2015 06:42:27 +0000 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: , Message-ID: <0065FF0A-7B22-4CD6-BA2C-0659CC77F48C@donders.ru.nl> Dear Stephan, Actually, the data structure looks fine to me. The dimension order in the trial field is trialnumber x timepoints, (do you have 129 trials?), not channel x timepoints. Or have I misunderstood your problem? Best, Stan Op 2 okt. 2015 om 20:46 heeft Steph Bickel > het volgende geschreven: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan On Sep 26, 2015, at 11:54 PM, Steph Bickel > wrote: Hello fieldtrip experts, a script that used to work gives me problems now. When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. cfg=[]; cfg.dataset = edf_file ; cfg.continuous = ‘yes’; cfg.demean = ‘yes' ; cfg.channel = ‘Event' ; raw = ft_preprocessing(cfg); raw = hdr: [1x1 struct] label: {'Event'} time: {[1x152082 double]} trial: {[129x152082 double]} fsample: 499.7071 sampleinfo: [1 152082] cfg: [1x1 struct] It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? if isfield(EDF, 'chansel') chanindx = EDF.chansel; chanSel = 1; else chanindx = [1:EDF.NS]; chanSel = 0; end; Thank you! Stephan (I’m using the current github field trip version on a mac) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RICHARDS at mailbox.sc.edu Sun Oct 4 01:37:36 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sat, 3 Oct 2015 23:37:36 +0000 Subject: [FieldTrip] Input to SVD cannot be NAN, and dipole lies on boundary Message-ID: <54048153-CFD2-477D-A707-FD6C2C0BC2E2@mailbox.sc.edu> I am trying to create a lead field matrix for a BEM Dipoli model. For this model I have a 4-compartment BEM model, based on a realistic head model from a participant MRI; meshes for skin, skull, csf, and brain; and source model is a grid on the gray matter. I use the Dipoli external tools (from FT calls) to create a Dipoli head model, and then lead field with the grid and electrodes. I have gotten this to work for a lot of subjects and data, but am stumped on one particular subject. For this one I can get all the way through the pipeline (grid, electrodes, mesh, head model, and leadfield). But when I go to get the source map, I get the error mentioned in other posts “Input to SVD cannot be NAN”. I have not tracked this down, but it appears that the LF matrix has NaN’s in it. I went back to the head model. When it is being created I get: Warning: dipole lies on boundary of volume model > In inf_medium_leadfield (line 54) In eeg_leadfieldb (line 93) In ft_compute_leadfield (line 431) In ft_prepare_leadfield (line 225) In CreateFieldtripLecomputing leadfield 6723/63422 This comes from for i=1:Ndipoles r = pnt - ones(Npnt,1) * rd((1:3) + 3*(i-1)); R = (4*pi*cond) * (sum(r' .^2 ) .^ 1.5)'; if any(R==0) warning('dipole lies on boundary of volume model'); end lf(:,(1:3) + 3*(i-1)) = r ./ [R R R]; End Apparently the dipole locations in the source model grid are right on the boundary of one of the vertices or triangles of the volume mesh, so one of the R’s is zero, and the NaN is apparently from the [R R R] as a div / 0. This is just a guess, because I haven’t tracked down where the “Input to SVD cannot be NaN” is coming from. I tried shrinking or expanding the inner compartment (brain), hoping that it would not then overlap with the source model locations. This did not work. I tried shrinking the source model locations, though don’t want to do this because these are actual GM in the participant, but it did not work anyway. Any suggestions or help on this? Thanks, 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 RICHARDS at mailbox.sc.edu Sun Oct 4 02:40:15 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sun, 4 Oct 2015 00:40:15 +0000 Subject: [FieldTrip] sLORETA Message-ID: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. Thanks, 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 jan.schoffelen at donders.ru.nl Sun Oct 4 10:18:01 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 4 Oct 2015 08:18:01 +0000 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: Message-ID: Hi Stephan, It could be that this is a genuine bug. Could you create an account on bugzilla.fieldtriptoolbox.org, and file a ‘bug’ about this? Then we take it off list, and investigate further. It would be really helpful if you also could get us some of your data (which goes with the script you sent earlier) that is giving you trouble. Some more information about the process can be found on: http://www.fieldtriptoolbox.org/bugzilla Best regards, 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 Oct 2, 2015, at 8:44 PM, Steph Bickel > wrote: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan On Sep 26, 2015, at 11:54 PM, Steph Bickel > wrote: Hello fieldtrip experts, a script that used to work gives me problems now. When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. cfg=[]; cfg.dataset = edf_file ; cfg.continuous = ‘yes’; cfg.demean = ‘yes' ; cfg.channel = ‘Event' ; raw = ft_preprocessing(cfg); raw = hdr: [1x1 struct] label: {'Event'} time: {[1x152082 double]} trial: {[129x152082 double]} fsample: 499.7071 sampleinfo: [1 152082] cfg: [1x1 struct] It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? if isfield(EDF, 'chansel') chanindx = EDF.chansel; chanSel = 1; else chanindx = [1:EDF.NS]; chanSel = 0; end; Thank you! Stephan (I’m using the current github field trip version on a mac) _______________________________________________ fieldtrip 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 Sun Oct 4 10:29:43 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 4 Oct 2015 08:29:43 +0000 Subject: [FieldTrip] sLORETA In-Reply-To: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> References: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> Message-ID: Hi John, I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? The answer to both of these subquestions would be ‘yes’ :o). Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. That sounds like a great plan. I’d suggest to file this as a feature request on bugzilla.fieldtriptoolbox.org, so that we can take it from there. From our end, we can then incorporate your suggested adjustments to the code. One thing you could look into, is the way in which sLORETA (and while you’re at it :o) dSPM) is computed in Brainstorm, which is also open source and matlab-based. Best, Jan-Mathijs Thanks, 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 *********************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Sun Oct 4 21:55:35 2015 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sun, 4 Oct 2015 20:55:35 +0100 Subject: [FieldTrip] sLORETA In-Reply-To: References: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> Message-ID: <97E4469F-24B5-4C9C-9936-8E7253C41285@gmail.com> Dear all, There are self contained low level functions for sLORETA and dSPM in NutMEG. I recently used them to add this functionality to my DAiSS toolbox (https://github.com/SPM/DAiSS, look in /private). Best, Vladimir On 4 Oct 2015, at 09:29, "Schoffelen, J.M. (Jan Mathijs)" wrote: > Hi John, > >> I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html >> >> I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. >> >> Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? > > The answer to both of these subquestions would be ‘yes’ :o). > >> Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. > > That sounds like a great plan. I’d suggest to file this as a feature request on bugzilla.fieldtriptoolbox.org, so that we can take it from there. From our end, we can then incorporate your suggested adjustments to the code. One thing you could look into, is the way in which sLORETA (and while you’re at it :o) dSPM) is computed in Brainstorm, which is also open source and matlab-based. > > Best, > Jan-Mathijs > > >> >> Thanks, 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 >> *********************************************** >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 jrebola at gmail.com Mon Oct 5 12:17:13 2015 From: jrebola at gmail.com (Jose Rebola) Date: Mon, 5 Oct 2015 11:17:13 +0100 Subject: [FieldTrip] Connectivity comparison across conditions Message-ID: Hi! I am trying to assess if there is a difference in connectivity across two conditions in my data. Condition 1 has 240 trials and condition 2 has 252 trials. I have chosen to use the *phase-locking-value* as a measure of connectivity. *My first question is:* Which formula should I use to evaluate the difference between conditions? Would plv1- plv2 be appropriate, or do I have to do some kind of transformation or normalization? If I choose to use other connectivity measures, will it be much different? I have seen for example in the paper of Jan-Mathijs Schoffelen in 2011 that he uses the formula in the following image for the assessment of differences between the coherence values x1 and x2. I should note that I would like to evaluate differences at the intra-subject level. [image: Inline image 1] *My second question is:* In order to do the non-parametric testing, my null hypothesis is that there are no differences between plv1 and plv2 ( I guess). So I can randomize trial labels, evaluate plv1 and plv2 again, do this 1000 times and count the number of times that this difference is bigger than my original difference, right? *My third and fourth questions concern clustering:* In order to do clustering, I should first establish a threshold value for the metric under evaluation. This may be easy to set if I was using t-values, but if I am evaluating differences in means, what should be an appropriate value to use? Regarding spatial clustering, I now have two levels of “neighbour” electrodes, right? At the seed level, and at the destination level. How can these be clustered? I mean, if I consider for example the electrode-pairing T7-P3, both T9-P3 and T7-P5 will be neighbours… *Lastly,* Are these issues already implemented in Fieldtrip or do I have to build my own MATLAB code for the randomization, thresholding and clustering? Thank you so much, José Rebola -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 17815 bytes Desc: not available URL: From azeez.adebimpe5 at gmail.com Mon Oct 5 19:56:30 2015 From: azeez.adebimpe5 at gmail.com (Azeez Adebimpe) Date: Mon, 5 Oct 2015 19:56:30 +0200 Subject: [FieldTrip] Connectivity comparison across conditions In-Reply-To: References: Message-ID: See my opinion within the line On Mon, Oct 5, 2015 at 12:17 PM, Jose Rebola wrote: > Hi! > > > > I am trying to assess if there is a difference in connectivity across two > conditions in my data. Condition 1 has 240 trials and condition 2 has 252 > trials. > > I have chosen to use the *phase-locking-value* as a measure of > connectivity. > > *My first question is:* > > > > Which formula should I use to evaluate the difference between conditions? > > Would plv1- plv2 be appropriate, or do I have to do some kind of > transformation or normalization? If I choose to use other connectivity > measures, will it be much different? > > I have seen for example in the paper of Jan-Mathijs Schoffelen in 2011 > that he uses the formula in the following image for the assessment of > differences between the coherence values x1 and x2. > > I should note that I would like to evaluate differences at the > intra-subject level. > > > [image: Inline image 1] > In simpler form, the PLV is implemented in fieldtrip based on this paper Lachaux 1999 . your formular may be right but seem more complex to me. On comparison of two conditions, you dont need to subtract, you can do statistics in fieldtrip or look for the file name *statcond* in fieldtrip or eeglab, very easy to understand and follow. > > > *My second question is:* > > > > In order to do the non-parametric testing, my null hypothesis is that > there are no differences between plv1 and plv2 ( I guess). So I can > randomize trial labels, evaluate plv1 and plv2 again, do this 1000 times > and count the number of times that this difference is bigger than my > original difference, right? > I didnt get your questions here clearly. Meanwhile, randomization is random sequence of random permutation i.e resampling of original data in 1000 times (in this case -plv). > > > *My third and fourth questions concern clustering:* > > In order to do clustering, I should first establish a threshold value for > the metric under evaluation. This may be easy to set if I was using > t-values, but if I am evaluating differences in means, what should be an > appropriate value to use? > > > > Regarding spatial clustering, I now have two levels of “neighbour” > electrodes, right? At the seed level, and at the destination level. How can > these be clustered? I mean, if I consider for example the electrode-pairing > T7-P3, both T9-P3 and T7-P5 will be neighbours… > > > Ofcourse, you need threshold to threshold the graph, otherwise you can computed weighted clustering coefficient. Thresholding depend on you and your data, there are many ways to threshold. You can threshold within certain range or based on distribution of your data. It is better to read more literature on this aspect. > *Lastly,* > > Are these issues already implemented in Fieldtrip or do I have to build my > own MATLAB code for the randomization, thresholding and clustering? > > > Everything implemented in fieldtrip and sometime you need your own initiative. the best things you can do now is to go through tutorials in fieldtrip first. > Thank you so much, > > > > José Rebola > > I hope it helps. > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 17815 bytes Desc: not available URL: From mitka3 at uniba.sk Tue Oct 6 13:17:25 2015 From: mitka3 at uniba.sk (Milan Mitka) Date: Tue, 6 Oct 2015 13:17:25 +0200 Subject: [FieldTrip] Difference ERP source localisation methodology Message-ID: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> Dear FieldTrip users, I'm a master's student at the Comenius University in Bratislava, Slovakia, currently looking into source reconstruction of event-related potentials. I have a quick methodological question regarding the localisation of event-related potentials which are obtained as difference waves – in my case the rotation-related negativity – by subtracting the standard condition (upright stimuli) from experimental conditions (stimuli rotated to a given degree). Should I a) perform the source reconstruction on the averaged data for each condition and trial, or should I b) first subtract the standard condition from all experimental conditions for every trial and then reconstruct the sources? Thank you. Yours faithfully Milan From RICHARDS at mailbox.sc.edu Tue Oct 6 14:28:33 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Tue, 6 Oct 2015 12:28:33 +0000 Subject: [FieldTrip] re sLORETA Message-ID: <266E8F04-EFD6-4B7B-AC62-6F4E45C73118@mailbox.sc.edu> I received an excellent suggestion and some additional information from Vladimir Litvak. The NUTMEG programs have sLORETA, swLORETA, and dSPM MATLAB routines that are compatible with the FT format. They also have routines that duplicate those in FT (e.g., min norm, LCMV, beamformers) I did the following and it appears to work. Any comments welcome. I have fairly simple source inverse problems, eg. simple grand average ERP (and not beamformer, or dynamic EEG). The FT leadfield is a struct that has lf{nsources} elements, each element is a [nchannels p] vector, where nchannels is the number of channels, p is the number of dipole orientations, and nsources is the number of source vertices or grid points. The NM (NUTMEG) leadfield (Lp) is a matrix, [nchannels p nsources] in size. The following is not my complete code… the LF{nsources} references are conceptual, the programming is somewhat different. 1. Convert the FT LF to the NM Lp. There is a NUTMEG nut_ftgridenutsLpvox which is intended to convert the LF to the Lp. It did not work perfectly, I had to adapt it somewhat to make the Lp matrix correctly from the Lf matrix. 2. Do the call to one of the subrouties Eg cfg=[]; cfg.gamma=.05 nmfilter = nut_sLORETA(Lp,data.cov,cfg) 3--the output is a [nchannel 3 sources] matrix. I used this, and the data.avg, to create the FT source output (e.g., each source.avg.mom{nsources} = inverse[nchannels p]' * data.avg; I added the source.avg.pow, and outsource.time=[1:size(outsource.avg.pow,2)]; outsource.inside=grid.inside; outsource.avg.inside=grid.inside; outsource.pos=grid.pos; outsource.avg.pos=grid.pos; outsource.method='average'; %dim is no of unique values in pos outsource.dim=[size(unique(grid.pos(:,1)),1) size(unique(grid.pos(:,2)),1) size(unique(grid.pos(:,3)),1)]; 4—at this point I have a complete “source” struct similar to that created by ft_sourceanalysis, but the mom and pow are generated by the NUT procedure. I suggest someone doing a help or tutorial file for this. I also invite any suggestions from others. 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 nathanweisz at mac.com Tue Oct 6 15:39:05 2015 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 06 Oct 2015 15:39:05 +0200 Subject: [FieldTrip] opportunity @cimec Message-ID: <179B0B14-B7AB-4F14-B828-88D2226AB695@mac.com> my colleague david melcher asked me to post this info regarding opportunities in his group. best, nathan —————————— Postdoctoral researcher fellowship in Active Perception Center for Mind/Brain Sciences, University of Trento We anticipate opening one or more positions as part of a EU-funded project to study the role of temporal integration in visual and multisensory The ideal candidate will have experience using MEG/EEG and/or tACS to measure the links between perception and neural oscillations. The candidate must have a PhD in cognitive neuroscience, or a related field, and a strong research record including publications. Expertise with creating stimuli and in analyzing neuroimaging data (preferably MEG/EEG) is required. Additional experience with Matlab, image processing, Fieldtrip or analysis of fixation-related potentials (MEG/EEG) will be an advantage. There is some flexibility in the starting date, with a preference for starting by the beginning of 2016. Informal enquiries regarding the position should be directed to Prof. David Melcher (david.melcher @ unitn.it). For further information about the Active Perception Group, see: http://r.unitn.it/en/cimec/map From Don.Rojas at ucdenver.edu Tue Oct 6 20:24:27 2015 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Tue, 6 Oct 2015 18:24:27 +0000 Subject: [FieldTrip] Difference ERP source localisation methodology In-Reply-To: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> References: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> Message-ID: <56B9E03B-AA7E-4304-9B98-25137B063F7C@ucdenver.edu> Dear Milan, In my opinion you are better off trying to do source analyses on the combined activity to all of your conditions, then finding a way to perform the subtraction in source space or statistically. Doing the subtraction first before the source estimate will likely result in poorer signal to noise for your data and that will have a negative impact on the source reconstruction. Best, Don ------------------------ Don Rojas, Ph.D. Professor of Cognitive Neuroscience Molecular, Cellular and Integrative Neuroscience Program Department of Psychology Colorado State University From helen.wieffering at gmail.com Wed Oct 7 16:59:21 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 7 Oct 2015 10:59:21 -0400 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Message-ID: Dear FieldTrip users, I'm writing to see if any one out there has had success with computing Granger causality measures in FieldTrip. We have been working toward making this analysis possible with our EEG data and have now reached the final stages. However, we find that ft_connectivity_analysis (and ft_connectivity_granger for that matter) offers little guidance on how to achieve a good mvar model fit. For example, the function asks the user to specify the model order without offering tests for whiteness, stationarity, or consistency. It seems that Fieldtrip calls on the BSMART toolbox to perform these operations, which further confuses me given that BSMART itself offers these model validation tests. Yet they don't seem to ever be called upon by FieldTrip. We've considered using the BSMART toolbox separately from FieldTrip, yet the toolbox website is rather outdated and the functions are only compatible through 2008 Matlab - seems like a headache. But without tools for validating the mvar model, we can't be confident of any GC results achieved through FieldTrip. Are there perhaps further connectivity tools in FieldTrip that I've overlooked? Or is it worth looking into other toolboxes? We've also considered SIFT and the MVGC toolbox, but would love to keep working with FieldTrip if possible. If anyone can offer advice, or connect me with someone knowledgeable in this area, I'd love to know. Thanks very much, Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From lysne at unm.edu Wed Oct 7 22:55:10 2015 From: lysne at unm.edu (Per Arnold Lysne) Date: Wed, 7 Oct 2015 20:55:10 +0000 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Message-ID: Hi Helen, I am having good luck with ft_connectivity_analysis in MEG using the nonparametric Granger approach of Dhamala, Rangarajan & Ding, 2008, Neuroimage and Physical Review letters. Thanks, Per Lysne University of New Mexico lysne at unm.edu -----Original Message----- From: Helen Wieffering Sent: Oct 7, 2015 8:59 AM To: FieldTrip discussion list Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Dear FieldTrip users, I'm writing to see if any one out there has had success with computing Granger causality measures in FieldTrip. We have been working toward making this analysis possible with our EEG data and have now reached the final stages. However, we find that ft_connectivity_analysis (and ft_connectivity_granger for that matter) offers little guidance on how to achieve a good mvar model fit. For example, the function asks the user to specify the model order without offering tests for whiteness, stationarity, or consistency. It seems that Fieldtrip calls on the BSMART toolbox to perform these operations, which further confuses me given that BSMART itself offers these model validation tests. Yet they don't seem to ever be called upon by FieldTrip. We've considered using the BSMART toolbox separately from FieldTrip, yet the toolbox website is rather outdated and the functions are only compatible through 2008 Matlab - seems like a headache. But without tools for validating the mvar model, we can't be confident of any GC results achieved through FieldTrip. Are there perhaps further connectivity tools in FieldTrip that I've overlooked? Or is it worth looking into other toolboxes? We've also considered SIFT and the MVGC toolbox, but would love to keep working with FieldTrip if possible. If anyone can offer advice, or connect me with someone knowledgeable in this area, I'd love to know. Thanks very much, Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 8 08:56:34 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Thu, 8 Oct 2015 06:56:34 +0000 (UTC) Subject: [FieldTrip] ft_realtime_average References: <1197967334.539643.1444287394485.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1197967334.539643.1444287394485.JavaMail.yahoo@mail.yahoo.com> Hi, Can anyone help me to explain what does the 'average' at the line if isempty (average) in ft_realtime_average refer to?Because when I'm using the function ft_realtime_average, an error of 'Undefined variable of average' is shown.I'm doing the realtime processing.  Thank you. Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Sat Oct 10 13:00:08 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Sat, 10 Oct 2015 13:00:08 +0200 (CEST) Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter Message-ID: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> Dear all, I am working on the localization of oscillatory sources using beamforming (http://www.fieldtriptoolbox.org/tutorial/beamformer). The data are recorded with Elekta-Neuromag, the source estimations are based on individual MNI-aligned grids (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), and the FT version is fieldtrip-20150701. And I have two main issues, which would be very appreciated if someone could help me with: 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. Should I make additional normalization prior to / in the creation of the individual grid? I found this link which is specific to Neuromag data but it says is outdated (?). http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space Or should I interpolate the source estimation to the template, instead of to the individual-mri? When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? Any comment would be very helpful! Thank you in advance, All the best, Sara %% %% Interpolation, normalization and grandaverage load source mri_real template source.pos=template_grid.pos; % right(?) cfg = []; cfg.downsample = 2; cfg.parameter = 'pow'; sourceInt = ft_sourceinterpolate(cfg, source, mri_real); cfg = []; cfg.spmversion = 'spm8'; %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". % However should be one taken by default and unablinginn it works fine so it is confussing (?) sourceIntNorm = ft_volumenormalise(cfg, sourceInt); %% grand average for 7 subjects cfg=[]; cfg.parameter = 'pow'; [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); %% %% -------------- next part -------------- A non-text attachment was scrubbed... Name: gravg_int_templ.jpg Type: image/jpeg Size: 23790 bytes Desc: not available URL: From tzvetan.popov at uni-konstanz.de Sat Oct 10 14:53:33 2015 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 10 Oct 2015 14:53:33 +0200 Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> Message-ID: <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> Hi Sara, 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify source.pos = template_grid.pos source.pnt = template_grid.pos After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. 2.) Yes, ideally all appended. good luck, Tzvetan > Dear all, > > I am working on the localization of oscillatory sources using beamforming > (http://www.fieldtriptoolbox.org/tutorial/beamformer). > The data are recorded with Elekta-Neuromag, > the source estimations are based on individual MNI-aligned grids > (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), > and the FT version is fieldtrip-20150701. > > And I have two main issues, which would be very appreciated if someone could help me with: > > 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. > > Should I make additional normalization prior to / in the creation of the individual grid? > I found this link which is specific to Neuromag data but it says is outdated (?). > http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Or should I interpolate the source estimation to the template, instead of to the individual-mri? > When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). > > 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), > should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? > > > Any comment would be very helpful! > > Thank you in advance, > > All the best, > > Sara > > %% > > %% Interpolation, normalization and grandaverage > > load source mri_real template > > source.pos=template_grid.pos; % right(?) > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'pow'; > sourceInt = ft_sourceinterpolate(cfg, source, mri_real); > > cfg = []; > cfg.spmversion = 'spm8'; > %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; > % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". > % However should be one taken by default and unablinginn it works fine so it is confussing (?) > sourceIntNorm = ft_volumenormalise(cfg, sourceInt); > > %% grand average for 7 subjects > > cfg=[]; > cfg.parameter = 'pow'; > [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); > > %% > > %% > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Sat Oct 10 15:29:54 2015 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 10 Oct 2015 15:29:54 +0200 Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> Message-ID: <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> Sorry second line should read source.pnt =template_grid.pnt > Am 10.10.2015 um 14:53 schrieb Tzvetan Popov : > > Hi Sara, > 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify > source.pos = template_grid.pos > source.pnt = template_grid.pos > After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. > > 2.) Yes, ideally all appended. > > good luck, > Tzvetan > > >> Dear all, >> >> I am working on the localization of oscillatory sources using beamforming >> (http://www.fieldtriptoolbox.org/tutorial/beamformer). >> The data are recorded with Elekta-Neuromag, >> the source estimations are based on individual MNI-aligned grids >> (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), >> and the FT version is fieldtrip-20150701. >> >> And I have two main issues, which would be very appreciated if someone could help me with: >> >> 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. >> >> Should I make additional normalization prior to / in the creation of the individual grid? >> I found this link which is specific to Neuromag data but it says is outdated (?). >> http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> Or should I interpolate the source estimation to the template, instead of to the individual-mri? >> When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). >> >> 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), >> should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? >> >> >> Any comment would be very helpful! >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> %% >> >> %% Interpolation, normalization and grandaverage >> >> load source mri_real template >> >> source.pos=template_grid.pos; % right(?) >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'pow'; >> sourceInt = ft_sourceinterpolate(cfg, source, mri_real); >> >> cfg = []; >> cfg.spmversion = 'spm8'; >> %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; >> % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". >> % However should be one taken by default and unablinginn it works fine so it is confussing (?) >> sourceIntNorm = ft_volumenormalise(cfg, sourceInt); >> >> %% grand average for 7 subjects >> >> cfg=[]; >> cfg.parameter = 'pow'; >> [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); >> >> %% >> >> %% >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 rmontefusco at med.uchile.cl Tue Oct 13 17:59:33 2015 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 13 Oct 2015 11:59:33 -0400 Subject: [FieldTrip] Negative values of debiased wPLI In-Reply-To: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> References: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hello...anybody any guess, explanation? I getting some too...close to zero thought, but still negatives. On Mon, Feb 16, 2015 at 9:09 AM, Marta Bortoletto < marta.bortoletto at cognitiveneuroscience.it> wrote: > Dear Community, > I am using the debiased wPLI to estimate connectivity between 70 EEG > electrodes. I have about 150 trials for each subject. I noticed that some > values of my 70x70 dwPLI matrix are negative. My understanding is that all > values should be between 0 and 1, but for some reason I can get negative > values from the debiasing process. My question is: Shall I calculate the > absolute value of these negative values? Otherwise what shall I do with > them? > > Thank you in advance for your help. > Marta > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Wed Oct 14 02:21:21 2015 From: russgport at gmail.com (russ port) Date: Tue, 13 Oct 2015 20:21:21 -0400 Subject: [FieldTrip] unit gain for Fieldtrip's LCMV beamformer - unit In-Reply-To: References: <2A2B6A5B8C4C174CBCCE0B45E548DEB22A0D8A9B@SKMBXX01.sickkids.ca> Message-ID: <5BA1F9A7-4285-467C-9560-0667E1CCC6A4@gmail.com> Hi All, As an update to this post, which I fear may be otherwise left alone, it seems that the Wiki now states that the virtual channel with be of "the equivalent current dipole source” (http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors ). I assume then if its a ECD ("equivalent current dipole”) is in A(what ever the source model is in i.e. Am, or Am etc etc). Therefore you should just be converting to your units of choice (for me nAm). Does this seem correct? Best, Russ > On Sep 29, 2015, at 10:54 PM, russ port wrote: > > Thanks Marc, > > Sorry for taking so long to respond. I am quite confused now. I think I get what you are talking about with "unit gain" and "unit noise-gain” as defined by Sekihara, as much as I can make out at least with out having the book you refer to (on the bright side I now know what to nag my boss for). I suppose I was a quite mis-leading with what I had in my last email, by which, what I actually did was use the LCMV beamformer to make lead fields to calculate the virtual sensors (see http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors ). Of note, your link to the discussion list is now even more useful. I am using centimeters and a single shell head model. The wiki says "CMV beamformer spatial filter for the location of interest will pass the activity at that location with unit-gain”. From your email, I suspect then that the output would be in Am units. I am a little concerned though that both my output, and the field trip wiki shows values ranging ~ -3 -> 3 (e-4, i.e. mAm not nAm). Or instead would the units be in T/(Am) (if I apply the 1e4 unit conversion). Sorry for not being better at this, I think I do need those books you were mentioning... > > Best, > Russ > > > > > >> On Sep 11, 2015, at 12:40 PM, Marc Lalancette > wrote: >> >> mformer with unit gain would have Am units. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zsoltturi at gmail.com Wed Oct 14 08:20:24 2015 From: zsoltturi at gmail.com (Zsolt Turi) Date: Wed, 14 Oct 2015 08:20:24 +0200 Subject: [FieldTrip] =?utf-8?q?conference_in_G=C3=B6ttingen?= Message-ID: Dear All, On behalf of the program committee it is my great pleasure to invite you to the “Theory and Practice of Transcranial Brain Stimulation (TMS, tDCS/tACS)” that will be held in the University Medical Center, Göttingen, Germany from the 9th – 10th of February 2016. The Conference is being organized by the Department of Clinical Neurophysiology, Georg-August University, Göttingen, Germany. Our laboratory plays a central role in non-invasive brain stimulation researchers for more than 15 years. Our goal is to deliver an outstanding program with the right balance of basic scientific and clinical relevance, which covers the entire spectrum of physiological, methodological, modelling, practice and ethical issues in non-invasive brain stimulation research. The entire conference will be held in English, therefore, it is imperative that the attendants are able to understand and communicate in English. We believe that participants will benefit from the high value scientific program. We would suggest you to register for the conference and make arrangements for travel and stay. Register soon (see attachement) and confirm your participation, as only 50 participants are accepted: First register & pay, first accepted. Yours sincerely, Zsolt Turi (Ph.D.) Post-doctoral Research Fellow Department of Clinical Neurophysiology Georg-August University, Göttingen Robert-Koch-Str. 40 37075 Goettingen -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: GöttingenRegistration_2016.pdf Type: application/pdf Size: 82954 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NWGProgram_2016.pdf Type: application/pdf Size: 368112 bytes Desc: not available URL: From n.komeilipoor at vu.nl Wed Oct 14 09:29:04 2015 From: n.komeilipoor at vu.nl (Komeilipoor, N.) Date: Wed, 14 Oct 2015 07:29:04 +0000 Subject: [FieldTrip] =?windows-1252?q?conference_in_G=F6ttingen?= In-Reply-To: References: Message-ID: Ciao Ivan, Tutto bene. Certo! allora ci sentiamo venerdi, per te va bene alle 5 pm (Italy time)? ________________________________ Van: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] namens Zsolt Turi [zsoltturi at gmail.com] Verzonden: woensdag 14 oktober 2015 8:20 Aan: FieldTrip discussion list Onderwerp: [FieldTrip] conference in Göttingen Dear All, On behalf of the program committee it is my great pleasure to invite you to the “Theory and Practice of Transcranial Brain Stimulation (TMS, tDCS/tACS)” that will be held in the University Medical Center, Göttingen, Germany from the 9th – 10th of February 2016. The Conference is being organized by the Department of Clinical Neurophysiology, Georg-August University, Göttingen, Germany. Our laboratory plays a central role in non-invasive brain stimulation researchers for more than 15 years. Our goal is to deliver an outstanding program with the right balance of basic scientific and clinical relevance, which covers the entire spectrum of physiological, methodological, modelling, practice and ethical issues in non-invasive brain stimulation research. The entire conference will be held in English, therefore, it is imperative that the attendants are able to understand and communicate in English. We believe that participants will benefit from the high value scientific program. We would suggest you to register for the conference and make arrangements for travel and stay. Register soon (see attachement) and confirm your participation, as only 50 participants are accepted: First register & pay, first accepted. Yours sincerely, Zsolt Turi (Ph.D.) Post-doctoral Research Fellow Department of Clinical Neurophysiology Georg-August University, Göttingen Robert-Koch-Str. 40 37075 Goettingen -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Wed Oct 14 10:40:24 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Wed, 14 Oct 2015 10:40:24 +0200 (CEST) Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> Message-ID: <1789381146.505725.1444812024740.JavaMail.zimbra@bcbl.eu> Hi Tzvetan, Sorry for taking that long to respond. Thank you for your answers! 1. As far as I observed, it is sufficient to specify source.pos = template_grid.pos, for the grandaverage and stats. Then interpolate the source estimation with the template. 2. Thanks! All the best, Sara Sara Aurtenetxe ----- Original Message ----- From: "Tzvetan Popov" To: "FieldTrip discussion list" Sent: Saturday, October 10, 2015 3:29:54 PM Subject: Re: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter Sorry second line should read source.pnt =template_grid.pnt > Am 10.10.2015 um 14:53 schrieb Tzvetan Popov : > > Hi Sara, > 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify > source.pos = template_grid.pos > source.pnt = template_grid.pos > After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. > > 2.) Yes, ideally all appended. > > good luck, > Tzvetan > > >> Dear all, >> >> I am working on the localization of oscillatory sources using beamforming >> (http://www.fieldtriptoolbox.org/tutorial/beamformer). >> The data are recorded with Elekta-Neuromag, >> the source estimations are based on individual MNI-aligned grids >> (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), >> and the FT version is fieldtrip-20150701. >> >> And I have two main issues, which would be very appreciated if someone could help me with: >> >> 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. >> >> Should I make additional normalization prior to / in the creation of the individual grid? >> I found this link which is specific to Neuromag data but it says is outdated (?). >> http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> Or should I interpolate the source estimation to the template, instead of to the individual-mri? >> When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). >> >> 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), >> should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? >> >> >> Any comment would be very helpful! >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> %% >> >> %% Interpolation, normalization and grandaverage >> >> load source mri_real template >> >> source.pos=template_grid.pos; % right(?) >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'pow'; >> sourceInt = ft_sourceinterpolate(cfg, source, mri_real); >> >> cfg = []; >> cfg.spmversion = 'spm8'; >> %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; >> % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". >> % However should be one taken by default and unablinginn it works fine so it is confussing (?) >> sourceIntNorm = ft_volumenormalise(cfg, sourceInt); >> >> %% grand average for 7 subjects >> >> cfg=[]; >> cfg.parameter = 'pow'; >> [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); >> >> %% >> >> %% >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 maity_winky at yahoo.es Wed Oct 14 11:31:51 2015 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Wed, 14 Oct 2015 09:31:51 +0000 (UTC) Subject: [FieldTrip] Nonlinear normalization/MNI grid distortions References: <1945557667.185319.1444815111622.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1945557667.185319.1444815111622.JavaMail.yahoo@mail.yahoo.com> Dear community, I performed nonlinear normalizations and plotted theresulting MRIs. I noticed the normalized MRIs had unwanted distortions, and wereclearly different from the normalized MRIs obtained directly in SPM. I noticed the default parameters (flags) in Fieldtrip’s spm_normalise()are different from SPM’s spm_normalise(). In Fieldtrip, the amount of regularizationis too low (= 0.1, line 144 in spm_normalise) compared with SPM’sdefault (=1). This may be a problem not only for normalization but whencomputing MNI-aligned individual grids following the tutorial (“CreateMNI-aligned grids in individual”) because there is an implicit normalizationstep. Possible solutions: -         Call/substitute Fieldtrip’s spm_normalise() bySPM’s function or change Fieldtrip’s default flags values.-         Perform the normalization outside in SPM andprovide the cfg.spmparams.flags. However, there is a bug in ft_volumenormalise()using that option. I think it may be because the flags are not passed to spm_normalise(line 239). As a fix, I have modified the function with the lines below. Butsurely there is a more direct way to avoid the problem.VF        =spm_vol([cfg.intermediatename,'_anatomy.img']);params    =spm_normalise(VG,VF,[],[],[],cfg.spmparams.flags); I wish this report helps.  Best regards,Maité -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 15 08:42:21 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Thu, 15 Oct 2015 06:42:21 +0000 (UTC) Subject: [FieldTrip] segementation based on external trigger References: <1117284429.535148.1444891341551.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1117284429.535148.1444891341551.JavaMail.yahoo@mail.yahoo.com> Hi, I'm doing the EEG realtime processing using TMSI and I want to segment the eeg signal based on the trigger. My questions are: 1) How can I do that in fieldtrip?2) I'm using ft_realtime_average and ft_realtime_selectiveaverage to average the eeg signal, however, there is error shown.    Error using ft_checkconfig(line 153)    The field cfg.datafile is required.    The field cfg.headefile is required.     Thanks.  Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Fri Oct 16 09:28:54 2015 From: joramvandriel at gmail.com (Joram van Driel) Date: Fri, 16 Oct 2015 09:28:54 +0200 Subject: [FieldTrip] Negative values of debiased wPLI In-Reply-To: References: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Marta, It's correct that you can get negative values with dwPLI compared to classic PLI, it's indeed due to the debiasing procedure which involves a linear subtraction. What you want to do with it, depends on how you want to evaluate statistical significance. I wouldn't take the absolute values, though. - You could add a fixed value to all dwPLI values to have everything above zero with a fixed shift, then do a baseline correction such as percent signal change or dB (which you can't do with negative numbers). This is a bit crude though, and I actually wonder whether it's "allowed". - Just use the values as they are, with some being negative, if you want do condition comparisons, and use permutation testing with condition label shuffling at the group level to asses statistical difference between conditions. - Convert the dwPLI values to a z-score within-subject through permutation testing, where you shuffle one phase-angle vector of one of the two channels with respect to the other in e.g. 1000 permutations, thereby creating a null-distribution under the null-hypothesis of chance-level dwPLI, to which you can compare you're observed dwPLI. This approach is blind to the fact that some values are negative. How/what you shuffle depends on whether you compute dwPLI over trials or over time. Good luck, Joram On Tue, Oct 13, 2015 at 5:59 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hello...anybody any guess, explanation? I getting some too...close to zero > thought, but still negatives. > > On Mon, Feb 16, 2015 at 9:09 AM, Marta Bortoletto < > marta.bortoletto at cognitiveneuroscience.it> wrote: > >> Dear Community, >> I am using the debiased wPLI to estimate connectivity between 70 EEG >> electrodes. I have about 150 trials for each subject. I noticed that some >> values of my 70x70 dwPLI matrix are negative. My understanding is that all >> values should be between 0 and 1, but for some reason I can get negative >> values from the debiasing process. My question is: Shall I calculate the >> absolute value of these negative values? Otherwise what shall I do with >> them? >> >> Thank you in advance for your help. >> Marta >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, PhD Postdoc @ Vrije Universiteit Amsterdam Cognitive Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Fri Oct 16 20:10:37 2015 From: balperin07 at gmail.com (Brittany Alperin) Date: Fri, 16 Oct 2015 14:10:37 -0400 Subject: [FieldTrip] average of frequency band Message-ID: Hello I'm importing my already preprocessed data from eeglab and want to run an FFT. I'm using cfg.foilim to specify my frequencies of interest, but the output is in .5 Hz increments rather than just an average over the frequency band. I've tried using a colon instead of a space and I've tried using cfg.foi. Could anyone tell me how to get an average power rather than the power at each frequency? Here's my code for reference: cfg = []; cfg.method = 'mtmfft'; %run an fft cfg.taper = 'hanning'; %chose a hanning window cfg.foilim = [8 13]; %frequencies of interest. In this case, alpha cfg.output = 'pow'; %output in power Brittany Alperin Graduate Student, Behavioral Neuroscience Oregon Health and Science University Portland, OR -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Sat Oct 17 18:17:06 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Sat, 17 Oct 2015 16:17:06 +0000 (UTC) Subject: [FieldTrip] help ft_read_event References: <905698521.1529786.1445098626610.JavaMail.yahoo@mail.yahoo.com> Message-ID: <905698521.1529786.1445098626610.JavaMail.yahoo@mail.yahoo.com> Hi, I'm trying to read the triggers from my eeg channel, however it turn out, the trigger cannot be read.I'm using the coding, event = ft_read_event ( 'buffer://localhost:1972' )But, when I'm using the ft_realtime_signalviewer, the trigger are shown in the figure.How is that so? Anyone can help me? Thanks a lot. Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Oct 19 22:14:42 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 13:14:42 -0700 Subject: [FieldTrip] open position @donders Message-ID: Dear all, There's an open position (phd candidate, but postdocs are also welcome to apply I believe) at the donders centre for cognitive neuroimaging, the netherlands. The project is on the neural mechanisms underlying emotional control, and involves a combination of leading experts in their respective fields. What's more, this is the same site where fieldtrip is being supported. 1 + 1 = 2. For more information: http://www.ru.nl/overons/werken-radboud/details/details_vacature_0/?recid=561663 Yours, Arjen -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Mon Oct 19 23:25:30 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 17:25:30 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Message-ID: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Oct 20 00:01:20 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 15:01:20 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > Dear FieldTrip users, > > This is Xiaoming from University of Maryland Baltimore. My current project > requires to calculate behavioral-power correlation across subjects. Similar > topic was discussed here early this year. > http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html > > According to the suggestions in above mentioned thread, I duplicate my > power dataset and replace the power values at each time-frequency point > with behavioral data. Therefore, those two datasets have same structure and > dimension. I used the following script to test if there are significant > clusters of correlations. > > cfg = []; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'ft_statfun_correlationT'; > ... > etc > ... > design = zeros(2, n1 * 2); % n1 is the number of subjects. > design(1,1:n1) = 1; > design(1,(n1 + 1):(n1 * 2)) = 2; > design(2, :) = [[1:n1 ] [1 : n1]]; > cfg.design = design; > > cfg.ivar = 1; > cfg.uvar = 2; > stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); > > > However, it seems when each time the design matrix is permuted, FieldTrip > is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar > remains the same while cfg.ivar (1 or 2) is randomly assigned to each > subject in design matrix. Although I confirmed this by uncommenting line > 313 (i.e., tmpdesign = design(:,resample(i,:))) in > ft_statistics_montecarlo.m which allows to display the permuted design > matrix in command line, please correct me if this is not the case. > > In my mind, this kind of permutation will cause trouble when dealing with > correlation. For example, in my case, the behavioral data and power data > have different scales. The power data are much larger than behavioral data > in general. When assigning behavioral data into power group or vice versa, > it will induce huge negative correlations between power and behavioral > measurement. Therefore, no negative clusters will survive from permutation > test. > > Please let me know if I have mis-understanding or if I did anything wrong. > Any suggestions will be highly appreciated! > > Thanks. > > Xiaoming > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Tue Oct 20 00:20:13 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 18:20:13 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: <5625345D020000DC00015E6A@MPRC.UMARYLAND.EDU> Hi Arjen, Sorry for the confusion. The stat.rho matrix is similar to the one I calculated using corr. My questions is about the permutation method and the correlation matrix after each permutation for calculating cluster distribution. The permutation method seems interacting with correlation (but not with t tests). Looking forward to your suggestions. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Oct 20 00:33:46 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 15:33:46 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming, Thanks for clarifying. Could you perhaps provide an (replicable) example on how 'the permutation method interacts with the correlations'? Yours, Arjen 2015-10-19 15:20 GMT-07:00 Xiaoming Du : > Hi Arjen, > > Sorry for the confusion. > > The stat.rho matrix is similar to the one I calculated using corr. > > My questions is about the permutation method and the correlation matrix > after each permutation for calculating cluster distribution. The > permutation method seems interacting with correlation (but not with t > tests). > > Looking forward to your suggestions. > > Xiaoming > > >>> Arjen Stolk 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations > be independent of the scaling of the two variables? Looking at the code of > ft_statfun_correlationT it doesn't seem the conversion from correlation to > T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in > a direction change either. Perhaps you could try to first manually > calculate a correlation between signal power and behavioral power, and see > whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > >> Dear FieldTrip users, >> This is Xiaoming from University of Maryland Baltimore. My current >> project requires to calculate behavioral-power correlation across subjects. >> Similar topic was discussed here early this year. >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >> According to the suggestions in above mentioned thread, I duplicate my >> power dataset and replace the power values at each time-frequency point >> with behavioral data. Therefore, those two datasets have same structure and >> dimension. I used the following script to test if there are significant >> clusters of correlations. >> cfg = []; >> cfg.parameter = 'powspctrm'; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'ft_statfun_correlationT'; >> ... >> etc >> ... >> design = zeros(2, n1 * 2); % n1 is the number of subjects. >> design(1,1:n1) = 1; >> design(1,(n1 + 1):(n1 * 2)) = 2; >> design(2, :) = [[1:n1 ] [1 : n1]]; >> cfg.design = design; >> >> cfg.ivar = 1; >> cfg.uvar = 2; >> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >> However, it seems when each time the design matrix is permuted, FieldTrip >> is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar >> remains the same while cfg.ivar (1 or 2) is randomly assigned to each >> subject in design matrix. Although I confirmed this by uncommenting line >> 313 (i.e., tmpdesign = design(:,resample(i,:))) in >> ft_statistics_montecarlo.m which allows to display the permuted design >> matrix in command line, please correct me if this is not the case. >> In my mind, this kind of permutation will cause trouble when dealing with >> correlation. For example, in my case, the behavioral data and power data >> have different scales. The power data are much larger than behavioral data >> in general. When assigning behavioral data into power group or vice versa, >> it will induce huge negative correlations between power and behavioral >> measurement. Therefore, no negative clusters will survive from permutation >> test. >> Please let me know if I have mis-understanding or if I did anything >> wrong. Any suggestions will be highly appreciated! >> Thanks. >> Xiaoming >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Tue Oct 20 00:56:51 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 18:56:51 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: <56253CF3020000DC00015E70@MPRC.UMARYLAND.EDU> For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Oct 20 08:03:02 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 23:03:02 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du : > For example, our power values ranged from 1 to 3 (after log transform); my > behavioral data ranged from 20 to 90; > > by using above mentioned script, there are 14 negative clusters were > reported in variable stat. > > stat = > > prob: [30x50 double] > posclusters: [] > posclusterslabelmat: [30x50 double] > posdistribution: [1x1000 double] > negclusters: [1x14 struct] > negclusterslabelmat: [30x50 double] > negdistribution: [1x1000 double] > cirange: [30x50 double] > mask: [30x50 logical] > stat: [30x50 double] > ref: [30x50 double] > rho: [30x50 double] > dimord: 'chan_freq' > freq: [1x50 double] > label: {30x1 cell} > time: 2.5000 > cfg: [1x1 struct] > > However, the p values of those clusters (i.e., stat.negclusters.prob) are > all ones. The smallest value in stat.negdistribution is way larger than > the largest negative cluster t-sum. This could be real. However, it is more > likely due to the shuffle between power and behavioral group. For example, > design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 > 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, > their power data was labeled as behavioral data and vice versa. Because of > the scale difference between power and behavioral data, large negative > correlations were generated by permutation. This further biased the cluster > distribution. > My limited understanding is that, for correlation, each permutation should > fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute > design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 > 4 4 2 3 1]. THerefore, after permutation, one subject's power data > corresponds to another subject's behavioral data. > > I am not good at statistics. It will be really appreciated if you have any > suggestions or comments. > > Xiaoming > > > > > >>> Arjen Stolk 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations > be independent of the scaling of the two variables? Looking at the code of > ft_statfun_correlationT it doesn't seem the conversion from correlation to > T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in > a direction change either. Perhaps you could try to first manually > calculate a correlation between signal power and behavioral power, and see > whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > >> Dear FieldTrip users, >> This is Xiaoming from University of Maryland Baltimore. My current >> project requires to calculate behavioral-power correlation across subjects. >> Similar topic was discussed here early this year. >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >> According to the suggestions in above mentioned thread, I duplicate my >> power dataset and replace the power values at each time-frequency point >> with behavioral data. Therefore, those two datasets have same structure and >> dimension. I used the following script to test if there are significant >> clusters of correlations. >> cfg = []; >> cfg.parameter = 'powspctrm'; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'ft_statfun_correlationT'; >> ... >> etc >> ... >> design = zeros(2, n1 * 2); % n1 is the number of subjects. >> design(1,1:n1) = 1; >> design(1,(n1 + 1):(n1 * 2)) = 2; >> design(2, :) = [[1:n1 ] [1 : n1]]; >> cfg.design = design; >> >> cfg.ivar = 1; >> cfg.uvar = 2; >> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >> However, it seems when each time the design matrix is permuted, FieldTrip >> is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar >> remains the same while cfg.ivar (1 or 2) is randomly assigned to each >> subject in design matrix. Although I confirmed this by uncommenting line >> 313 (i.e., tmpdesign = design(:,resample(i,:))) in >> ft_statistics_montecarlo.m which allows to display the permuted design >> matrix in command line, please correct me if this is not the case. >> In my mind, this kind of permutation will cause trouble when dealing with >> correlation. For example, in my case, the behavioral data and power data >> have different scales. The power data are much larger than behavioral data >> in general. When assigning behavioral data into power group or vice versa, >> it will induce huge negative correlations between power and behavioral >> measurement. Therefore, no negative clusters will survive from permutation >> test. >> Please let me know if I have mis-understanding or if I did anything >> wrong. Any suggestions will be highly appreciated! >> Thanks. >> Xiaoming >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonas at obleser.de Tue Oct 20 13:07:51 2015 From: jonas at obleser.de (Jonas Obleser) Date: Tue, 20 Oct 2015 06:07:51 -0500 Subject: [FieldTrip] Call for new post docs in the Obleser lab | Auditory Cognition Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8@obleser.de> The research group “Auditory Cognition” (headed by Jonas Obleser; auditorycognition.com), now at the University of Lübeck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. These positions fall into the larger framework of an ERC Consolidator grant “The listening challenge: How ageing brains adapt” (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 Note the application deadline of November 12 (postal receipt). http://auditorycognition.com http://uni-luebeck.de From thomas.wunderle at esi-frankfurt.de Tue Oct 20 16:58:25 2015 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Tue, 20 Oct 2015 14:58:25 +0000 Subject: [FieldTrip] Spectrum normalization Message-ID: <27E5CAD9145EEC41BB9B34C01716A198880C3CD4@UM-excdag-a02.um.gwdg.de> Hi all, I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. This is important for me, because I need the absolute value of the spectrum for a publication. I was scanning through the code trying to find the normalization steps. In particular, I don't understand the following steps: 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) What is the rationale of dividing through this special norm of the taper itself? 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: dum = dum .* sqrt(2 ./ endnsample); (line 251) Later on, to get to the power spectrum, the abs of the spectrum is taken and squared powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) This puzzles me, because scanning through the literature, the power spectrum should be given by (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) and the PSD by (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: sqrt(PSD) -> unit: V/sqrt(Hz) which is still different from (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) The result of these equations are different from what comes out of the FieldTrip code. So what is the unit of the spectrum in FieldTrip? What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? It would help me a lot if someone could clarify these points. Thanks in advance, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel: +49 69 96769 516 Fax: +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Wed Oct 21 10:30:07 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Wed, 21 Oct 2015 10:30:07 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair Message-ID: Dear all, I’m trying to do interpolation to repair some bad channels, but I’m getting the error below. I've read the ft_fetch_sens help but I don’t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) From jorn at artinis.com Wed Oct 21 10:42:03 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Wed, 21 Oct 2015 10:42:03 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> Dear Grazia, try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. Best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I’m trying to do interpolation to repair some bad channels, but I’m getting > the error below. > I've read the ft_fetch_sens help but I don’t understand how I should specify > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From g.dipisa at gmail.com Wed Oct 21 12:27:40 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Wed, 21 Oct 2015 12:27:40 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: Hi Jörn, Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. Any other suggestions? thanks, ~ grazia > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. > > These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >> Sent: Wednesday, October 21, 2015 10:30 AM >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting >> the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should specify >> the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 59, Issue 17 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Wed Oct 21 14:16:10 2015 From: jorn at artinis.com (=?utf-8?Q?J=C3=B6rn_M._Horschig?=) Date: Wed, 21 Oct 2015 14:16:10 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <002301d10bfa$45d6a740$d183f5c0$@artinis.com> Hi Grazia, uh, jah, my bad, try cfg.elec instead ;) 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 Grazia Di Pisa Sent: Wednesday, October 21, 2015 12:28 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Interpolation and ft_channelrepair Hi Jörn, Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. Any other suggestions? thanks, ~ grazia On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Call for new post docs in the Obleser lab | Auditory Cognition (Jonas Obleser) 2. Spectrum normalization (Wunderle, Thomas) 3. Interpolation and ft_channelrepair (Grazia Di Pisa) 4. Re: Interpolation and ft_channelrepair (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) ---------------------------------------------------------------------- Message: 1 Date: Tue, 20 Oct 2015 06:07:51 -0500 From: Jonas Obleser > To: fieldtrip at science.ru.nl , AUDITORY at LISTS.MCGILL.CA Subject: [FieldTrip] Call for new post docs in the Obleser lab | Auditory Cognition Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de > Content-Type: text/plain; charset=utf-8 The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 Note the application deadline of November 12 (postal receipt). http://auditorycognition.com http://uni-luebeck.de ------------------------------ Message: 2 Date: Tue, 20 Oct 2015 14:58:25 +0000 From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl " > Subject: [FieldTrip] Spectrum normalization Message-ID: <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de > Content-Type: text/plain; charset="iso-8859-1" Hi all, I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. This is important for me, because I need the absolute value of the spectrum for a publication. I was scanning through the code trying to find the normalization steps. In particular, I don't understand the following steps: 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) What is the rationale of dividing through this special norm of the taper itself? 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: dum = dum .* sqrt(2 ./ endnsample); (line 251) Later on, to get to the power spectrum, the abs of the spectrum is taken and squared powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) This puzzles me, because scanning through the literature, the power spectrum should be given by (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) and the PSD by (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: sqrt(PSD) -> unit: V/sqrt(Hz) which is still different from (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) The result of these equations are different from what comes out of the FieldTrip code. So what is the unit of the spectrum in FieldTrip? What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? It would help me a lot if someone could clarify these points. Thanks in advance, Thomas ----- Dr. Thomas Wunderle Ernst Str?ngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel: +49 69 96769 516 Fax: +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Gesch?ftsf?hrer: Prof. Dr. Pascal Fries -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Wed, 21 Oct 2015 10:30:07 +0200 From: Grazia Di Pisa > To: fieldtrip at science.ru.nl Subject: [FieldTrip] Interpolation and ft_channelrepair Message-ID: > Content-Type: text/plain; charset=utf-8 Dear all, I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) ------------------------------ Message: 4 Date: Wed, 21 Oct 2015 10:42:03 +0200 From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com > Content-Type: text/plain; charset="UTF-8" Dear Grazia, try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. Best, J?rn -- J?rn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- bounces at science.ru.nl ] On Behalf Of Grazia Di Pisa Sent: Wednesday, October 21, 2015 10:30 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Interpolation and ft_channelrepair Dear all, I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 59, Issue 17 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From daria.laptinskaya at googlemail.com Wed Oct 21 14:46:49 2015 From: daria.laptinskaya at googlemail.com (Daria Laptinskaya) Date: Wed, 21 Oct 2015 14:46:49 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: Dear Grazia, I’m using the following code and it works fine: cfg = []; cfg.method = 'average'; cfg.badchannel = channel; cfg.neighbours = neighbours; cfg.trials = 'all'; cfg.elec = sens; [interpol] = ft_channelrepair(cfg, opt1_dur); Commend out the cfg.elec leads to the same error as you get. “sens” in my code is the result of ft_read_sens, sens=ft_read_sens('GSN-HydroCel-257.sfp' ). I hope, it helps! Best, Daria 2015-10-21 12:27 GMT+02:00 Grazia Di Pisa : > Hi Jörn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but still > the same error. > > Any other suggestions? > > thanks, > ~ grazia > > > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; > auditorycognition.com), now at the University of L?beck, is seeking to > hire two Postdoctoral researchers, initially for 3 years, with the option > of extension. > > These positions fall into the larger framework of an ERC Consolidator > grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) > recently awarded to Jonas Obleser, and will allow the joint development of > cognitive-neuroscience and psychological research projects targeting > adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: > https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral > analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the > spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the > multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper > itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the > function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken > and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in > ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power > spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, > nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = > number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum > by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = > frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the > FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the > same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience< > http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> > in Cooperation with Max Planck Society < > http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151020/eebaf460/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m > getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should > specify the electrodes. > > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor > definition so that ft_channelrepair knows the location of your channels, > which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting > the error below. > I've read the ft_fetch_sens help but I don?t understand how I should > specify > > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 59, Issue 17 > ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Wed Oct 21 19:44:28 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Wed, 21 Oct 2015 10:44:28 -0700 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <5627CEFC.1030608@gmail.com> Hi Grazia, I'm using the following code and it works: cfgn = []; cfgn.method = 'template'; cfgn.layout = 'biosemi64.lay'; cfg = []; cfg.neighbours = ft_prepare_neighbours(cfgn, data); cfg.elec = ft_read_sens('standard_1005.elc'); cfg.missingchannel = []; cfg.badchannel = chanrepair; % these are my channels cfg.trials = [1 3 5]; % for particular trials, otherwise use 'all' data = ft_channelrepair(cfg,data); Hope this helps Vitoria On 10/21/2015 3:27 AM, Grazia Di Pisa wrote: > Hi Jörn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but > still the same error. > > Any other suggestions? > > thanks, > ~ grazia > > >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl >> wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> AuditoryCognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; >> auditorycognition.com), now at the University of L?beck, is seeking >> to hire two Postdoctoral researchers, initially for 3 years, with the >> option of extension. >> >> These positions fall into the larger framework of an ERC Consolidator >> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >> recently awarded to Jonas Obleser, and will allow the joint >> development of cognitive-neuroscience and psychological research >> projects targeting adaptive control in the auditory modality of >> middle-aged adults. >> >> Please download the full job advert here: >> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a >> spectral analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the >> spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the >> multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function >> fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the >> taper itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the >> function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is >> taken and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 >> in ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power >> spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 >> (X=signal, nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, >> nfft = number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power >> spectrum by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >> frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of >> the FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation >> methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for >> Neuroscience >> in Cooperation with Max Planck Society >> >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m >> getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17cfg_neighb.method= 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label= lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain;charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor >> definition so that ft_channelrepair knows the location of your >> channels, which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>> Sent: Wednesday, October 21, 2015 10:30 AM >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m >>> getting >>> the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should >>> specify >>> the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17cfg_neighb.method= 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label= lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>> 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 59, Issue 17 >> ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.krebber at charite.de Wed Oct 21 19:54:40 2015 From: martin.krebber at charite.de (Krebber, Martin) Date: Wed, 21 Oct 2015 17:54:40 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl>, Message-ID: Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk > 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Wed Oct 21 20:22:09 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 11:22:09 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > Hi Xiaoming, hi Arjen, > > I've been encountering the same problem. I believe Xiaoming is right when > he points out that the permutaion step shuffles data across conditions and > that this introduces a negative bias in the distribution. I found the same > thing when I correlated RT data with TFRs (absolute power). My distribution > was shifted strongly to the left and, thus, not a single negative cluster > was significant, but every positive one was. > > Xiaomings explanation made a lot of sense to me when I thought about it > graphically: Imagine correlating two data vectors, one (x) ranging between > .5 and1, the other (y) between 50 and and 100. When plotting this, one gets > a cloud of dots on the upper left corner of the diagram. When you then > switch the variable assignment of half of the data points (which is what > the permutation step seems to do), these dots will now be be shifted to the > lower right corner of the diagram. So no matter what the correlation in the > original data, chances are that (given different scaling) after permutaion, > you get a negative correlation. > > I am not 100% sure about this, so please let me know if I made a mistake. > > What I tried instead of the 'ft_statfun_correlationT' was using a custom > made statfun in which I pass the RTs via the design matrix. With this, my > results looked much better. I am not sure, but I guess this is because > there is no shuffling between the two variables in this case. > > I would really like to know, what is the right way of doing this using > just the FieldTrip functions. Is there a way to permute data within > variables? I tried cfg.resampling = 'bootstrap', but this is not a > permutation, as far as I know. > > > Thanks! > Martin > > > ------------------------------ > *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" > im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] > *Gesendet:* Dienstag, 20. Oktober 2015 08:03 > *An:* FieldTrip discussion list > *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > > Hey Xiaoming, > > It's still pretty hard, for me, to guess on basis of that matlab output > what is going on here and what you mean with 'shuffling design matrices', > and how that shuffling 'biases the cluster distribution'. As you mention > yourself, it could be due to various reasons, and you're open to > suggestions and increasing your understanding. I'd therefore suggest to try > to funnel the number of potential explanations by simulating what you're > doing (using input data for which you know how it should behave), after > you've read more about what the design matrix and monte carlo statistics > are supposed to do. Perhaps the statistics section at the bottom of this > page provides a good starting point: > http://www.fieldtriptoolbox.org/walkthrough > > Hope that helps, > Arjen > > 2015-10-19 15:56 GMT-07:00 Xiaoming Du : > >> For example, our power values ranged from 1 to 3 (after log transform); >> my behavioral data ranged from 20 to 90; >> >> by using above mentioned script, there are 14 negative clusters were >> reported in variable stat. >> >> stat = >> >> prob: [30x50 double] >> posclusters: [] >> posclusterslabelmat: [30x50 double] >> posdistribution: [1x1000 double] >> negclusters: [1x14 struct] >> negclusterslabelmat: [30x50 double] >> negdistribution: [1x1000 double] >> cirange: [30x50 double] >> mask: [30x50 logical] >> stat: [30x50 double] >> ref: [30x50 double] >> rho: [30x50 double] >> dimord: 'chan_freq' >> freq: [1x50 double] >> label: {30x1 cell} >> time: 2.5000 >> cfg: [1x1 struct] >> >> However, the p values of those clusters (i.e., stat.negclusters.prob) are >> all ones. The smallest value in stat.negdistribution is way larger than >> the largest negative cluster t-sum. This could be real. However, it is more >> likely due to the shuffle between power and behavioral group. For example, >> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 >> 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, >> their power data was labeled as behavioral data and vice versa. Because of >> the scale difference between power and behavioral data, large negative >> correlations were generated by permutation. This further biased the cluster >> distribution. >> My limited understanding is that, for correlation, each permutation >> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 >> 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >> corresponds to another subject's behavioral data. >> >> I am not good at statistics. It will be really appreciated if you have >> any suggestions or comments. >> >> Xiaoming >> >> >> >> >> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >> Hey Xiaoming, >> >> Not sure if I understand, but shouldn't the directions of the >> correlations be independent of the scaling of the two variables? Looking at >> the code of ft_statfun_correlationT it doesn't seem the conversion from >> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >> would result in a direction change either. Perhaps you could try to first >> manually calculate a correlation between signal power and behavioral power, >> and see whether anything is behaving unexpectedly? >> >> Yours, >> Arjen >> >> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >> >>> Dear FieldTrip users, >>> This is Xiaoming from University of Maryland Baltimore. My current >>> project requires to calculate behavioral-power correlation across subjects. >>> Similar topic was discussed here early this year. >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>> According to the suggestions in above mentioned thread, I duplicate my >>> power dataset and replace the power values at each time-frequency point >>> with behavioral data. Therefore, those two datasets have same structure and >>> dimension. I used the following script to test if there are significant >>> clusters of correlations. >>> cfg = []; >>> cfg.parameter = 'powspctrm'; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'ft_statfun_correlationT'; >>> ... >>> etc >>> ... >>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>> design(1,1:n1) = 1; >>> design(1,(n1 + 1):(n1 * 2)) = 2; >>> design(2, :) = [[1:n1 ] [1 : n1]]; >>> cfg.design = design; >>> >>> cfg.ivar = 1; >>> cfg.uvar = 2; >>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>> However, it seems when each time the design matrix is permuted, >>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>> each subject in design matrix. Although I confirmed this by uncommenting >>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>> ft_statistics_montecarlo.m which allows to display the permuted design >>> matrix in command line, please correct me if this is not the case. >>> In my mind, this kind of permutation will cause trouble when dealing >>> with correlation. For example, in my case, the behavioral data and power >>> data have different scales. The power data are much larger than behavioral >>> data in general. When assigning behavioral data into power group or vice >>> versa, it will induce huge negative correlations between power and >>> behavioral measurement. Therefore, no negative clusters will survive from >>> permutation test. >>> Please let me know if I have mis-understanding or if I did anything >>> wrong. Any suggestions will be highly appreciated! >>> Thanks. >>> Xiaoming >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Wed Oct 21 23:28:19 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Wed, 21 Oct 2015 17:28:19 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Hi Martin, Thanks Martin to make it more clear. However, my understanding is that the problem is caused by different means of permutation for paired-sample t test and correlation. I am very curious how you solve the problem by customizing statfun. Do you mind sending me a copy of that? I will really appreciate it. Hi Arjen, I think the 'ft_statfun_correlationT' works fine. Using the code in your previous email, the correlation result (stat.rho) is same as using MATLAB function 'corr' with Spearman method. However, In your code, the design matrix for correlation is defined in the same way as for within-UO design (e.g., paired-sample t test). I think Martin's and my concern is that the permutation method for correlation and within-UO design (e.g., paired-sample t test) should be different. For example, there are 10 subjects (patients). Each of them finished a task before (A) and after (B) the treatment . Based on the different null hypothesis, the permutation methods for paired-sample t test and correlation should be different. For paired-sample t test (or within-UO design), the null hypothesis is that there is no different before or after the treatment. In other words, for each subjects, switch the results before and after treatment won't matter. This is exactly how the permutations are done when cfg.design is defined as in your code . On the other hand, the null hypothesis for correlation is that: there is no relationship between the results before and after treatment. Therefore, permutation should be done on after-treatment results among subjects while keep before-treatment results same (or permute before-treatment and keep after-treatment). In terms of permutation, correlation and paired-sample t test (within-UO design) seems treated equally in fieldtrip. Original matrix permutation for paired t test permutation for correlation before (A) after (B) before (A) after (B) before (A) after (B) subj1 A1 B1 subj1 A1 B1 subj1 A1 B2 subj2 A2 B2 subj2 B2 A2 subj2 A2 B4 subj3 A3 B3 subj3 B3 A3 subj3 A3 B3 subj4 A4 B4 subj4 A4 B4 subj4 A4 B1 subj5 A5 B5 subj5 A5 B5 subj5 A5 B10 subj6 A6 B6 subj6 B6 A6 subj6 A6 B8 subj7 A7 B7 subj7 B7 A7 subj7 A7 B9 subj8 A8 B8 subj8 A8 B8 subj8 A8 B6 subj9 A9 B9 subj9 B9 A9 subj9 A9 B5 subj10 A10 B10 subj10 A10 B10 subj10 A10 B7 As follows, I made minor changes in your previous code to show this issue. data_brain ranges from 0 to 1; data_behav ranges from 1000 to 1001; There is no relationship between data_brain and data_behav, because the values are randomly assigned to them. This is the results I got by using the code below: stat = prob: 9.9900e-04 cirange: 0.0020 mask: 1 stat: 0.2941 ref: -10.7655 rho: 0.0297 dimord: 'chan_time' label: {'1'} time: 1 cfg: [1x1 struct] stat.rho (0.0297) is the same as using 'corr' with Spearman option in matlab; However, stat.prob obtained by using permutation test is so small. The reason (I guess) are 1, two-tail test was used. 2, the rho distribution of permutation is biased to negative direction (meaning the rho after each permutation was biased to strong negative correlation. e.g., -0.8 etc ), so the real rho fell into the 5% range of rho distribution of permutations. In other words, real rho (0.0297) is smaller (or larger) than almost all rho from permutation, so that stat.prob is very small (0.000999). Please let me know if this makes sense to you or if I misunderstood anything. Thanks. Xiaoming data_brain = []; data_behav = []; for j=1:100 data_brain{j}.avg = rand; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = rand + 1000; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 1000; n1 = 100; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >>> Arjen Stolk 10/21/2015 2:22 PM >>> Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin : Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du : For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Thu Oct 22 00:33:13 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 15:33:13 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Message-ID: Thanks for clarifying, Xiaoming. It seems indeed that a systematic offset (in averages) across the two sample populations biases the randomization distribution. I'd need to sort this out, but schematically would expect it to look as follow: normal: ~1000 ~1000 ~1000 ~1000 ~1 ~1 ~1 ~1 corr = ~0 post shuffling: ~1000 ~1 ~1000 ~1000 ~1 ~1000 ~1 ~1 corr = negative, that is an anti-correlation This implies a bootstrapping approach is more correct for testing for statistical significance of a correlation (in case of a systematic offset across conditions). Yours, Arjen 2015-10-21 14:28 GMT-07:00 Xiaoming Du : > Hi Martin, > > Thanks Martin to make it more clear. However, my understanding is that the > problem is caused by different means of permutation for paired-sample t > test and correlation. I am very curious how you solve the problem by > customizing statfun. Do you mind sending me a copy of that? I will really > appreciate it. > > Hi Arjen, > > I think the 'ft_statfun_correlationT' works fine. Using the code in your > previous email, the correlation result (stat.rho) is same as using MATLAB > function 'corr' with Spearman method. However, In your code, the design > matrix for correlation is defined in the same way as for within-UO design > (e.g., paired-sample t test). I think Martin's and my concern is that the > permutation method for correlation and within-UO design (e.g., > paired-sample t test) should be different. > > For example, there are 10 subjects (patients). Each of them finished a > task before (A) and after (B) the treatment . Based on the different null > hypothesis, the permutation methods for paired-sample t test and > correlation should be different. For paired-sample t test (or within-UO > design), the null hypothesis is that there is no different before or after > the treatment. In other words, for each subjects, switch the results before > and after treatment won't matter. This is exactly how the permutations are > done when cfg.design is defined as in your code . On the other hand, the > null hypothesis for correlation is that: there is no relationship between > the results before and after treatment. Therefore, permutation should be > done on after-treatment results *among subjects* while keep > before-treatment results same (or permute before-treatment and keep > after-treatment). In terms of permutation, correlation and paired-sample t > test (within-UO design) seems treated equally in fieldtrip. > > Original matrix permutation for > paired t test permutation for correlation > > before (A) after (B) before > (A) after (B) before (A) > after (B) > subj1 A1 B1 subj1 > A1 B1 subj1 A1 B2 > subj2 A2 B2 subj2 > B2 A2 subj2 A2 B4 > subj3 A3 B3 subj3 > B3 A3 subj3 A3 B3 > subj4 A4 B4 subj4 > A4 B4 subj4 A4 B1 > subj5 A5 B5 subj5 > A5 B5 subj5 A5 B10 > subj6 A6 B6 subj6 > B6 A6 subj6 A6 B8 > subj7 A7 B7 subj7 > B7 A7 subj7 A7 B9 > subj8 A8 B8 subj8 > A8 B8 subj8 A8 B6 > subj9 A9 B9 subj9 > B9 A9 subj9 A9 B5 > subj10 A10 B10 subj10 > A10 B10 subj10 A10 B7 > > As follows, I made minor changes in your previous code to show this > issue. > data_brain ranges from 0 to 1; > data_behav ranges from 1000 to 1001; > There is no relationship between data_brain and data_behav, because the > values are randomly assigned to them. > This is the results I got by using the code below: > > stat = > > prob: 9.9900e-04 > cirange: 0.0020 > mask: 1 > stat: 0.2941 > ref: -10.7655 > rho: 0.0297 > dimord: 'chan_time' > label: {'1'} > time: 1 > cfg: [1x1 struct] > > stat.rho (0.0297) is the same as using 'corr' with Spearman option in > matlab; However, stat.prob obtained by using permutation test is so > small. The reason (I guess) are 1, two-tail test was used. 2, the rho > distribution of permutation is biased to negative direction (meaning the > rho after each permutation was biased to strong negative correlation. e.g., > -0.8 etc ), so the real rho fell into the 5% range of rho distribution of > permutations. In other words, real rho (0.0297) is smaller (or larger) than > almost all rho from permutation, so that stat.prob is very small > (0.000999). > > Please let me know if this makes sense to you or if I misunderstood > anything. > > Thanks. > > Xiaoming > > > > > > > > > > data_brain = []; > > data_behav = []; > > for j=1:100 > > data_brain{j}.avg = rand; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = rand + 1000; % add scaling difference > > end > > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 1000; > > n1 = 100; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > > > > > > > > > > > > > > >>> Arjen Stolk 10/21/2015 2:22 PM >>> > Hi Martin, > > Thanks for thinking along. I've briefly tried to replicate/simplify the > situation depicted by you using the code below. It works as I would expect, > no matter whether one variable is scaled differently. But perhaps I'm not > fully capturing the issue, and something still goes awry. This is a > possibility because ft_statfun_correlationT has only recently been > implemented for a specific case, and was never really tested within > different situations (hence it's not well-documented on the wiki). Do you > think you could use this example code to replicate the situation you are > experiencing? > > Yours, > Arjen > > % simulate simple multiple subjects timelock structures > > data_brain = []; > > data_behav = []; > > for j=1:10 > > data_brain{j}.avg = j; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference > > end > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 100; > > n1 = 10; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > assert(isequal(stat.rho, -1)); > > 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > >> Hi Xiaoming, hi Arjen, >> >> I've been encountering the same problem. I believe Xiaoming is right when >> he points out that the permutaion step shuffles data across conditions and >> that this introduces a negative bias in the distribution. I found the same >> thing when I correlated RT data with TFRs (absolute power). My distribution >> was shifted strongly to the left and, thus, not a single negative cluster >> was significant, but every positive one was. >> >> Xiaomings explanation made a lot of sense to me when I thought about it >> graphically: Imagine correlating two data vectors, one (x) ranging between >> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >> a cloud of dots on the upper left corner of the diagram. When you then >> switch the variable assignment of half of the data points (which is what >> the permutation step seems to do), these dots will now be be shifted to the >> lower right corner of the diagram. So no matter what the correlation in the >> original data, chances are that (given different scaling) after permutaion, >> you get a negative correlation. >> >> I am not 100% sure about this, so please let me know if I made a mistake. >> >> What I tried instead of the 'ft_statfun_correlationT' was using a custom >> made statfun in which I pass the RTs via the design matrix. With this, my >> results looked much better. I am not sure, but I guess this is because >> there is no shuffling between the two variables in this case. >> >> I would really like to know, what is the right way of doing this using >> just the FieldTrip functions. Is there a way to permute data within >> variables? I tried cfg.resampling = 'bootstrap', but this is not a >> permutation, as far as I know. >> >> >> Thanks! >> Martin >> >> >> ------------------------------ >> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >> *An:* FieldTrip discussion list >> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >> follow-up questions >> >> Hey Xiaoming, >> >> It's still pretty hard, for me, to guess on basis of that matlab output >> what is going on here and what you mean with 'shuffling design matrices', >> and how that shuffling 'biases the cluster distribution'. As you mention >> yourself, it could be due to various reasons, and you're open to >> suggestions and increasing your understanding. I'd therefore suggest to try >> to funnel the number of potential explanations by simulating what you're >> doing (using input data for which you know how it should behave), after >> you've read more about what the design matrix and monte carlo statistics >> are supposed to do. Perhaps the statistics section at the bottom of this >> page provides a good starting point: >> http://www.fieldtriptoolbox.org/walkthrough >> >> Hope that helps, >> Arjen >> >> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >> >>> For example, our power values ranged from 1 to 3 (after log transform); >>> my behavioral data ranged from 20 to 90; >>> by using above mentioned script, there are 14 negative clusters were >>> reported in variable stat. >>> stat = >>> prob: [30x50 double] >>> posclusters: [] >>> posclusterslabelmat: [30x50 double] >>> posdistribution: [1x1000 double] >>> negclusters: [1x14 struct] >>> negclusterslabelmat: [30x50 double] >>> negdistribution: [1x1000 double] >>> cirange: [30x50 double] >>> mask: [30x50 logical] >>> stat: [30x50 double] >>> ref: [30x50 double] >>> rho: [30x50 double] >>> dimord: 'chan_freq' >>> freq: [1x50 double] >>> label: {30x1 cell} >>> time: 2.5000 >>> cfg: [1x1 struct] >>> However, the p values of those clusters (i.e., stat.negclusters.prob) >>> are all ones. The smallest value in stat.negdistribution is way larger than >>> the largest negative cluster t-sum. This could be real. However, it is more >>> likely due to the shuffle between power and behavioral group. For example, >>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 >>> 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their >>> power data was labeled as behavioral data and vice versa. Because of the >>> scale difference between power and behavioral data, large negative >>> correlations were generated by permutation. This further biased the cluster >>> distribution. >>> My limited understanding is that, for correlation, each permutation >>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; >>> 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>> corresponds to another subject's behavioral data. >>> I am not good at statistics. It will be really appreciated if you have >>> any suggestions or comments. >>> Xiaoming >>> >>> >>> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >>> Hey Xiaoming, >>> >>> Not sure if I understand, but shouldn't the directions of the >>> correlations be independent of the scaling of the two variables? Looking at >>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>> would result in a direction change either. Perhaps you could try to first >>> manually calculate a correlation between signal power and behavioral power, >>> and see whether anything is behaving unexpectedly? >>> >>> Yours, >>> Arjen >>> >>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>> >>>> Dear FieldTrip users, >>>> This is Xiaoming from University of Maryland Baltimore. My current >>>> project requires to calculate behavioral-power correlation across subjects. >>>> Similar topic was discussed here early this year. >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>> According to the suggestions in above mentioned thread, I duplicate my >>>> power dataset and replace the power values at each time-frequency point >>>> with behavioral data. Therefore, those two datasets have same structure and >>>> dimension. I used the following script to test if there are significant >>>> clusters of correlations. >>>> cfg = []; >>>> cfg.parameter = 'powspctrm'; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'ft_statfun_correlationT'; >>>> ... >>>> etc >>>> ... >>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>> design(1,1:n1) = 1; >>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>> cfg.design = design; >>>> >>>> cfg.ivar = 1; >>>> cfg.uvar = 2; >>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>> However, it seems when each time the design matrix is permuted, >>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>> each subject in design matrix. Although I confirmed this by uncommenting >>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>> matrix in command line, please correct me if this is not the case. >>>> In my mind, this kind of permutation will cause trouble when dealing >>>> with correlation. For example, in my case, the behavioral data and power >>>> data have different scales. The power data are much larger than behavioral >>>> data in general. When assigning behavioral data into power group or vice >>>> versa, it will induce huge negative correlations between power and >>>> behavioral measurement. Therefore, no negative clusters will survive from >>>> permutation test. >>>> Please let me know if I have mis-understanding or if I did anything >>>> wrong. Any suggestions will be highly appreciated! >>>> Thanks. >>>> Xiaoming >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksenj at ohsu.edu Thu Oct 22 01:30:25 2015 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 21 Oct 2015 23:30:25 +0000 Subject: [FieldTrip] FEM head model and source model Message-ID: I am thinking of using FieldTrip for EEG source modeling, and wish to use an FEM formulation. I have found documentation on creating an FEM head model, but am unsure how to create a matching source model. Can someone please point me to documentation for this? Ideally I would want to place sources perpendicular to the local cortical surface. Also I would want to be able to create distributed sources combining several adjacent cortical elements. Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Thu Oct 22 06:01:51 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 21:01:51 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming, Martin, Coming back about this issue, I have filed a bug report: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2992 In short, creating a randomization distribution using the permutation method is prone to systematic bias across conditions, as illustrated in our previous email exchanges. One workaround is to use the bootstrapping method (cfg.resampling = 'bootstrap'), or to explicitly remove the systematic bias, e.g by normalizing the data in each condition separately prior to doing statistical testing. I have added these important considerations to the documentation of ft_statfun_correlationT, built in a warning message, and created a latent function that explicitly tests for this issue (to prevent it to re-occur with future code changes). Thank you for your acuteness and contributions. Yours, Arjen 2015-10-21 15:33 GMT-07:00 Arjen Stolk : > Thanks for clarifying, Xiaoming. > > It seems indeed that a systematic offset (in averages) across the two > sample populations biases the randomization distribution. I'd need to sort > this out, but schematically would expect it to look as follow: > > normal: > ~1000 ~1000 ~1000 ~1000 > ~1 ~1 ~1 ~1 > corr = ~0 > > post shuffling: > ~1000 ~1 ~1000 ~1000 > ~1 ~1000 ~1 ~1 > corr = negative, that is an anti-correlation > > This implies a bootstrapping approach is more correct for testing for > statistical significance of a correlation (in case of a systematic offset > across conditions). > > Yours, > Arjen > > 2015-10-21 14:28 GMT-07:00 Xiaoming Du : > >> Hi Martin, >> >> Thanks Martin to make it more clear. However, my understanding is that >> the problem is caused by different means of permutation for paired-sample t >> test and correlation. I am very curious how you solve the problem by >> customizing statfun. Do you mind sending me a copy of that? I will really >> appreciate it. >> >> Hi Arjen, >> >> I think the 'ft_statfun_correlationT' works fine. Using the code in your >> previous email, the correlation result (stat.rho) is same as using MATLAB >> function 'corr' with Spearman method. However, In your code, the design >> matrix for correlation is defined in the same way as for within-UO design >> (e.g., paired-sample t test). I think Martin's and my concern is that the >> permutation method for correlation and within-UO design (e.g., >> paired-sample t test) should be different. >> >> For example, there are 10 subjects (patients). Each of them finished a >> task before (A) and after (B) the treatment . Based on the different null >> hypothesis, the permutation methods for paired-sample t test and >> correlation should be different. For paired-sample t test (or within-UO >> design), the null hypothesis is that there is no different before or after >> the treatment. In other words, for each subjects, switch the results before >> and after treatment won't matter. This is exactly how the permutations are >> done when cfg.design is defined as in your code . On the other hand, the >> null hypothesis for correlation is that: there is no relationship between >> the results before and after treatment. Therefore, permutation should be >> done on after-treatment results *among subjects* while keep >> before-treatment results same (or permute before-treatment and keep >> after-treatment). In terms of permutation, correlation and paired-sample t >> test (within-UO design) seems treated equally in fieldtrip. >> >> Original matrix permutation for >> paired t test permutation for correlation >> >> before (A) after (B) before >> (A) after (B) before (A) >> after (B) >> subj1 A1 B1 subj1 >> A1 B1 subj1 A1 B2 >> subj2 A2 B2 subj2 >> B2 A2 subj2 A2 B4 >> subj3 A3 B3 subj3 >> B3 A3 subj3 A3 B3 >> subj4 A4 B4 subj4 >> A4 B4 subj4 A4 B1 >> subj5 A5 B5 subj5 >> A5 B5 subj5 A5 B10 >> subj6 A6 B6 subj6 >> B6 A6 subj6 A6 B8 >> subj7 A7 B7 subj7 >> B7 A7 subj7 A7 B9 >> subj8 A8 B8 subj8 >> A8 B8 subj8 A8 B6 >> subj9 A9 B9 subj9 >> B9 A9 subj9 A9 B5 >> subj10 A10 B10 subj10 >> A10 B10 subj10 A10 B7 >> >> As follows, I made minor changes in your previous code to show this >> issue. >> data_brain ranges from 0 to 1; >> data_behav ranges from 1000 to 1001; >> There is no relationship between data_brain and data_behav, because the >> values are randomly assigned to them. >> This is the results I got by using the code below: >> >> stat = >> >> prob: 9.9900e-04 >> cirange: 0.0020 >> mask: 1 >> stat: 0.2941 >> ref: -10.7655 >> rho: 0.0297 >> dimord: 'chan_time' >> label: {'1'} >> time: 1 >> cfg: [1x1 struct] >> >> stat.rho (0.0297) is the same as using 'corr' with Spearman option in >> matlab; However, stat.prob obtained by using permutation test is so >> small. The reason (I guess) are 1, two-tail test was used. 2, the rho >> distribution of permutation is biased to negative direction (meaning the >> rho after each permutation was biased to strong negative correlation. e.g., >> -0.8 etc ), so the real rho fell into the 5% range of rho distribution of >> permutations. In other words, real rho (0.0297) is smaller (or larger) than >> almost all rho from permutation, so that stat.prob is very small >> (0.000999). >> >> Please let me know if this makes sense to you or if I misunderstood >> anything. >> >> Thanks. >> >> Xiaoming >> >> >> >> >> >> >> >> >> >> data_brain = []; >> >> data_behav = []; >> >> for j=1:100 >> >> data_brain{j}.avg = rand; % increasing >> >> data_brain{j}.dimord = 'chan_time'; >> >> data_brain{j}.time = 1; >> >> data_brain{j}.label = {'1'}; >> >> >> data_behav{j} = data_brain{j}; >> >> data_behav{j}.avg = rand + 1000; % add scaling difference >> >> end >> >> >> % compute statistics with correlationT >> >> cfg = []; >> >> cfg.method = 'montecarlo'; >> >> cfg.statistic = 'ft_statfun_correlationT'; >> >> cfg.numrandomization = 1000; >> >> n1 = 100; % n1 is the number of subjects >> >> design = zeros(2, n1 * 2); >> >> design(1,1:n1) = 1; >> >> design(1,(n1 + 1):(n1 * 2)) = 2; >> >> design(2, :) = [1:n1 1:n1]; >> >> cfg.design = design; >> >> >> cfg.ivar = 1; >> >> cfg.uvar = 2; >> >> stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>> Arjen Stolk 10/21/2015 2:22 PM >>> >> Hi Martin, >> >> Thanks for thinking along. I've briefly tried to replicate/simplify the >> situation depicted by you using the code below. It works as I would expect, >> no matter whether one variable is scaled differently. But perhaps I'm not >> fully capturing the issue, and something still goes awry. This is a >> possibility because ft_statfun_correlationT has only recently been >> implemented for a specific case, and was never really tested within >> different situations (hence it's not well-documented on the wiki). Do you >> think you could use this example code to replicate the situation you are >> experiencing? >> >> Yours, >> Arjen >> >> % simulate simple multiple subjects timelock structures >> >> data_brain = []; >> >> data_behav = []; >> >> for j=1:10 >> >> data_brain{j}.avg = j; % increasing >> >> data_brain{j}.dimord = 'chan_time'; >> >> data_brain{j}.time = 1; >> >> data_brain{j}.label = {'1'}; >> >> data_behav{j} = data_brain{j}; >> >> data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference >> >> end >> >> % compute statistics with correlationT >> >> cfg = []; >> >> cfg.method = 'montecarlo'; >> >> cfg.statistic = 'ft_statfun_correlationT'; >> >> cfg.numrandomization = 100; >> >> n1 = 10; % n1 is the number of subjects >> >> design = zeros(2, n1 * 2); >> >> design(1,1:n1) = 1; >> >> design(1,(n1 + 1):(n1 * 2)) = 2; >> >> design(2, :) = [1:n1 1:n1]; >> >> cfg.design = design; >> >> cfg.ivar = 1; >> >> cfg.uvar = 2; >> >> stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >> >> assert(isequal(stat.rho, -1)); >> >> 2015-10-21 10:54 GMT-07:00 Krebber, Martin : >> >>> Hi Xiaoming, hi Arjen, >>> >>> I've been encountering the same problem. I believe Xiaoming is right >>> when he points out that the permutaion step shuffles data across conditions >>> and that this introduces a negative bias in the distribution. I found the >>> same thing when I correlated RT data with TFRs (absolute power). My >>> distribution was shifted strongly to the left and, thus, not a single >>> negative cluster was significant, but every positive one was. >>> >>> Xiaomings explanation made a lot of sense to me when I thought about it >>> graphically: Imagine correlating two data vectors, one (x) ranging between >>> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >>> a cloud of dots on the upper left corner of the diagram. When you then >>> switch the variable assignment of half of the data points (which is what >>> the permutation step seems to do), these dots will now be be shifted to the >>> lower right corner of the diagram. So no matter what the correlation in the >>> original data, chances are that (given different scaling) after permutaion, >>> you get a negative correlation. >>> >>> I am not 100% sure about this, so please let me know if I made a mistake. >>> >>> What I tried instead of the 'ft_statfun_correlationT' was using a custom >>> made statfun in which I pass the RTs via the design matrix. With this, my >>> results looked much better. I am not sure, but I guess this is because >>> there is no shuffling between the two variables in this case. >>> >>> I would really like to know, what is the right way of doing this using >>> just the FieldTrip functions. Is there a way to permute data within >>> variables? I tried cfg.resampling = 'bootstrap', but this is not a >>> permutation, as far as I know. >>> >>> >>> Thanks! >>> Martin >>> >>> >>> ------------------------------ >>> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >>> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >>> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >>> *An:* FieldTrip discussion list >>> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >>> follow-up questions >>> >>> Hey Xiaoming, >>> >>> It's still pretty hard, for me, to guess on basis of that matlab output >>> what is going on here and what you mean with 'shuffling design matrices', >>> and how that shuffling 'biases the cluster distribution'. As you mention >>> yourself, it could be due to various reasons, and you're open to >>> suggestions and increasing your understanding. I'd therefore suggest to try >>> to funnel the number of potential explanations by simulating what you're >>> doing (using input data for which you know how it should behave), after >>> you've read more about what the design matrix and monte carlo statistics >>> are supposed to do. Perhaps the statistics section at the bottom of this >>> page provides a good starting point: >>> http://www.fieldtriptoolbox.org/walkthrough >>> >>> Hope that helps, >>> Arjen >>> >>> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >>> >>>> For example, our power values ranged from 1 to 3 (after log transform); >>>> my behavioral data ranged from 20 to 90; >>>> by using above mentioned script, there are 14 negative clusters were >>>> reported in variable stat. >>>> stat = >>>> prob: [30x50 double] >>>> posclusters: [] >>>> posclusterslabelmat: [30x50 double] >>>> posdistribution: [1x1000 double] >>>> negclusters: [1x14 struct] >>>> negclusterslabelmat: [30x50 double] >>>> negdistribution: [1x1000 double] >>>> cirange: [30x50 double] >>>> mask: [30x50 logical] >>>> stat: [30x50 double] >>>> ref: [30x50 double] >>>> rho: [30x50 double] >>>> dimord: 'chan_freq' >>>> freq: [1x50 double] >>>> label: {30x1 cell} >>>> time: 2.5000 >>>> cfg: [1x1 struct] >>>> However, the p values of those clusters (i.e., stat.negclusters.prob) >>>> are all ones. The smallest value in stat.negdistribution is way larger than >>>> the largest negative cluster t-sum. This could be real. However, it is more >>>> likely due to the shuffle between power and behavioral group. For example, >>>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 >>>> 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their >>>> power data was labeled as behavioral data and vice versa. Because of the >>>> scale difference between power and behavioral data, large negative >>>> correlations were generated by permutation. This further biased the cluster >>>> distribution. >>>> My limited understanding is that, for correlation, each permutation >>>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; >>>> 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>>> corresponds to another subject's behavioral data. >>>> I am not good at statistics. It will be really appreciated if you have >>>> any suggestions or comments. >>>> Xiaoming >>>> >>>> >>>> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >>>> Hey Xiaoming, >>>> >>>> Not sure if I understand, but shouldn't the directions of the >>>> correlations be independent of the scaling of the two variables? Looking at >>>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>>> would result in a direction change either. Perhaps you could try to first >>>> manually calculate a correlation between signal power and behavioral power, >>>> and see whether anything is behaving unexpectedly? >>>> >>>> Yours, >>>> Arjen >>>> >>>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>>> >>>>> Dear FieldTrip users, >>>>> This is Xiaoming from University of Maryland Baltimore. My current >>>>> project requires to calculate behavioral-power correlation across subjects. >>>>> Similar topic was discussed here early this year. >>>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>>> According to the suggestions in above mentioned thread, I duplicate my >>>>> power dataset and replace the power values at each time-frequency point >>>>> with behavioral data. Therefore, those two datasets have same structure and >>>>> dimension. I used the following script to test if there are significant >>>>> clusters of correlations. >>>>> cfg = []; >>>>> cfg.parameter = 'powspctrm'; >>>>> cfg.method = 'montecarlo'; >>>>> cfg.statistic = 'ft_statfun_correlationT'; >>>>> ... >>>>> etc >>>>> ... >>>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>>> design(1,1:n1) = 1; >>>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>>> cfg.design = design; >>>>> >>>>> cfg.ivar = 1; >>>>> cfg.uvar = 2; >>>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>>> However, it seems when each time the design matrix is permuted, >>>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>>> each subject in design matrix. Although I confirmed this by uncommenting >>>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>>> matrix in command line, please correct me if this is not the case. >>>>> In my mind, this kind of permutation will cause trouble when dealing >>>>> with correlation. For example, in my case, the behavioral data and power >>>>> data have different scales. The power data are much larger than behavioral >>>>> data in general. When assigning behavioral data into power group or vice >>>>> versa, it will induce huge negative correlations between power and >>>>> behavioral measurement. Therefore, no negative clusters will survive from >>>>> permutation test. >>>>> Please let me know if I have mis-understanding or if I did anything >>>>> wrong. Any suggestions will be highly appreciated! >>>>> Thanks. >>>>> Xiaoming >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 22 09:47:31 2015 From: wanamirahwanazlan at yahoo.com (wan amirah Wan azlan) Date: Thu, 22 Oct 2015 00:47:31 -0700 Subject: [FieldTrip] problem in reading trigger Message-ID: <1445500051.92875.YahooMailMobile@web166106.mail.gq1.yahoo.com> Dear Fieldtrip user, I am doing realtime eeg processing via tmsi porti amplifier. My problem is my trigger not able be recognized. I am using the following command, cfg=[ ]; cfg.dataset='buffer://localhost:1972'; cfg.trialdef.eventtype='?'; cfg=ft_definetrial(cfg); 'no events were found in the datafile' is shown in matlab command window. Why does this happen? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Thu Oct 22 11:39:04 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Thu, 22 Oct 2015 11:39:04 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair (Grazia Di Pisa) In-Reply-To: References: Message-ID: <92896A04-9BF3-4C5F-A1F6-4ED92C5D8740@gmail.com> Thank you all so much for the suggestions!!!! :) After adding /cfg.elec = sens/ it finally worked. have a nice day, ~ grazia > On 21Oct, 2015, at 20:22, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: Interpolation and ft_channelrepair (Grazia Di Pisa) > 2. Re: Interpolation and ft_channelrepair > (=?utf-8?Q?J=C3=B6rn_M._Horschig?=) > 3. Re: Interpolation and ft_channelrepair (Daria Laptinskaya) > 4. Re: Interpolation and ft_channelrepair (Vit?ria Piai) > 5. Re: calculating behavioural-power correlation -- follow-up > questions (Krebber, Martin) > 6. Re: calculating behavioural-power correlation -- follow-up > questions (Arjen Stolk) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 21 Oct 2015 12:27:40 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi J?rn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. > > Any other suggestions? > > thanks, > ~ grazia > > >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> Auditory Cognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. >> >> These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. >> >> Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the taper itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is taken and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of the FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for Neuroscience >> in Cooperation with Max Planck Society >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain; charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>> Sent: Wednesday, October 21, 2015 10:30 AM >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m getting >>> the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should specify >>> the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17 cfg_neighb.method = 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label = lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 59, Issue 17 >> ***************************************** > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Wed, 21 Oct 2015 14:16:10 +0200 > From: "=?utf-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002301d10bfa$45d6a740$d183f5c0$@artinis.com> > Content-Type: text/plain; charset="utf-8" > > Hi Grazia, > > > > uh, jah, my bad, try cfg.elec instead ;) > > > > 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 Grazia Di Pisa > Sent: Wednesday, October 21, 2015 12:28 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > > > > Hi J?rn, > > > > Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. > > > > Any other suggestions? > > > > thanks, > > ~ grazia > > > > > > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > > To: fieldtrip at science.ru.nl , AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de > > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. > > These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > > To: "fieldtrip at science.ru.nl " > > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de > > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > > To: "'FieldTrip discussion list'" > > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com > > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl ] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting > the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 59, Issue 17 > ***************************************** > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 14:46:49 +0200 > From: Daria Laptinskaya > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Grazia, > > I?m using the following code and it works fine: > > cfg = []; > > cfg.method = 'average'; > > cfg.badchannel = channel; > > cfg.neighbours = neighbours; > > cfg.trials = 'all'; > > cfg.elec = sens; > > > > [interpol] = ft_channelrepair(cfg, opt1_dur); > > > > Commend out the cfg.elec leads to the same error as you get. ?sens? in my > code is the result of ft_read_sens, sens=ft_read_sens('GSN-HydroCel-257.sfp' > ). > > > > I hope, it helps! > > > > Best, > > Daria > > 2015-10-21 12:27 GMT+02:00 Grazia Di Pisa : > >> Hi J?rn, >> >> Thanks for the advice - I've just tried to add cfg.sens = sens but still >> the same error. >> >> Any other suggestions? >> >> thanks, >> ~ grazia >> >> >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> Auditory Cognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; >> auditorycognition.com), now at the University of L?beck, is seeking to >> hire two Postdoctoral researchers, initially for 3 years, with the option >> of extension. >> >> These positions fall into the larger framework of an ERC Consolidator >> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >> recently awarded to Jonas Obleser, and will allow the joint development of >> cognitive-neuroscience and psychological research projects targeting >> adaptive control in the auditory modality of middle-aged adults. >> >> Please download the full job advert here: >> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a spectral >> analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the >> spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the >> multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the taper >> itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the >> function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is taken >> and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in >> ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power >> spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, >> nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = >> number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power spectrum >> by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >> frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of the >> FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation methods the >> same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for Neuroscience< >> http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> >> in Cooperation with Max Planck Society < >> http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151020/eebaf460/attachment-0001.html >>> >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m >> getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify the electrodes. >> >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain; charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor >> definition so that ft_channelrepair knows the location of your channels, >> which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >> Sent: Wednesday, October 21, 2015 10:30 AM >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting >> the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify >> >> the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 59, Issue 17 >> ***************************************** >> >> >> >> _______________________________________________ >> 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: Wed, 21 Oct 2015 10:44:28 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <5627CEFC.1030608 at gmail.com> > Content-Type: text/plain; charset="windows-1252"; Format="flowed" > > Hi Grazia, > > I'm using the following code and it works: > > cfgn = []; > cfgn.method = 'template'; > cfgn.layout = 'biosemi64.lay'; > > cfg = []; > cfg.neighbours = ft_prepare_neighbours(cfgn, data); > cfg.elec = ft_read_sens('standard_1005.elc'); > cfg.missingchannel = []; > cfg.badchannel = chanrepair; % these are my channels > cfg.trials = [1 3 5]; % for particular trials, otherwise use 'all' > data = ft_channelrepair(cfg,data); > > Hope this helps > Vitoria > > > > On 10/21/2015 3:27 AM, Grazia Di Pisa wrote: >> Hi J?rn, >> >> Thanks for the advice - I've just tried to add cfg.sens = sens but >> still the same error. >> >> Any other suggestions? >> >> thanks, >> ~ grazia >> >> >>> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl >>> wrote: >>> >>> Send fieldtrip mailing list submissions to >>> fieldtrip at science.ru.nl >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> or, via email, send a message with subject or body 'help' to >>> fieldtrip-request at science.ru.nl >>> >>> You can reach the person managing the list at >>> fieldtrip-owner at science.ru.nl >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of fieldtrip digest..." >>> >>> >>> Today's Topics: >>> >>> 1. Call for new post docs in the Obleser lab | Auditory >>> Cognition (Jonas Obleser) >>> 2. Spectrum normalization (Wunderle, Thomas) >>> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >>> 4. Re: Interpolation and ft_channelrepair >>> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Tue, 20 Oct 2015 06:07:51 -0500 >>> From: Jonas Obleser >>> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >>> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >>> AuditoryCognition >>> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >>> Content-Type: text/plain; charset=utf-8 >>> >>> The research group ?Auditory Cognition? (headed by Jonas Obleser; >>> auditorycognition.com), now at the University of L?beck, is seeking >>> to hire two Postdoctoral researchers, initially for 3 years, with the >>> option of extension. >>> >>> These positions fall into the larger framework of an ERC Consolidator >>> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >>> recently awarded to Jonas Obleser, and will allow the joint >>> development of cognitive-neuroscience and psychological research >>> projects targeting adaptive control in the auditory modality of >>> middle-aged adults. >>> >>> Please download the full job advert here: >>> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >>> >>> >>> Note the application deadline of November 12 (postal receipt). >>> >>> http://auditorycognition.com >>> http://uni-luebeck.de >>> >>> >>> >>> >>> ------------------------------ >>> >>> Message: 2 >>> Date: Tue, 20 Oct 2015 14:58:25 +0000 >>> From: "Wunderle, Thomas" >>> To: "fieldtrip at science.ru.nl" >>> Subject: [FieldTrip] Spectrum normalization >>> Message-ID: >>> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> Hi all, >>> >>> I have a question about how FieldTrip normalizes the output of a >>> spectral analyses using ft_freqanalysis. >>> This is important for me, because I need the absolute value of the >>> spectrum for a publication. >>> >>> I was scanning through the code trying to find the normalization steps. >>> In particular, I don't understand the following steps: >>> >>> >>> 1.) The tapers (e.g. hanning) are normalized prior to the >>> multiplication with the data by the following code: >>> tap = tap./norm(tap, 'fro'); (line 195 in the function >>> fr_specest_mtmfft) >>> What is the rationale of dividing through this special norm of the >>> taper itself? >>> >>> >>> 2.) After calculating the fft, the specrum is scaled (i.e. in the >>> function fr_specest_mtmfft) by: >>> >>> dum = dum .* sqrt(2 ./ endnsample); (line 251) >>> >>> Later on, to get to the power spectrum, the abs of the spectrum is >>> taken and squared >>> >>> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 >>> in ft_frequanalysis) >>> >>> >>> >>> This puzzles me, because scanning through the literature, the power >>> spectrum should be given by >>> >>> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 >>> (X=signal, nfft = number of data points) >>> >>> and the PSD by >>> >>> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, >>> nfft = number of data points, Fs=sampling rate) >>> >>> >>> >>> Alternatively, one can get the amplitude spectrum from the power >>> spectrum by taking the square root of the PSD: >>> >>> sqrt(PSD) -> unit: V/sqrt(Hz) >>> >>> which is still different from >>> >>> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >>> frequency resolution = Fs/nfft) >>> >>> >>> >>> The result of these equations are different from what comes out of >>> the FieldTrip code. >>> >>> So what is the unit of the spectrum in FieldTrip? >>> >>> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >>> >>> Furthermore, is the unit for the different spectral estimation >>> methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >>> >>> It would help me a lot if someone could clarify these points. >>> >>> Thanks in advance, >>> Thomas >>> >>> >>> ----- >>> Dr. Thomas Wunderle >>> Ernst Str?ngmann Institute (ESI) for >>> Neuroscience >>> in Cooperation with Max Planck Society >>> >>> Deutschordenstrasse 46 >>> 60528 Frankfurt am Main, Germany >>> www.esi-frankfurt.de >>> thomas.wunderle at esi-frankfurt.de >>> Tel: +49 69 96769 516 >>> Fax: +49 69 96769 555 >>> >>> Sitz der Gesellschaft: Frankfurt am Main >>> Registergericht: Amtsgericht Frankfurt - HRB 84266 >>> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >>> >>> >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: >>> >>> >>> ------------------------------ >>> >>> Message: 3 >>> Date: Wed, 21 Oct 2015 10:30:07 +0200 >>> From: Grazia Di Pisa >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> Message-ID: >>> Content-Type: text/plain; charset=utf-8 >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m >>> getting the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should >>> specify the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17cfg_neighb.method= 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label= lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>> 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> >>> >>> ------------------------------ >>> >>> Message: 4 >>> Date: Wed, 21 Oct 2015 10:42:03 +0200 >>> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >>> To: "'FieldTrip discussion list'" >>> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >>> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >>> Content-Type: text/plain;charset="UTF-8" >>> >>> Dear Grazia, >>> >>> try adding cfg.sens = sens; before line 42. That will set the sensor >>> definition so that ft_channelrepair knows the location of your >>> channels, which is otherwise not obvious. >>> >>> Best, >>> J?rn >>> >>> -- >>> >>> J?rn M. Horschig, PhD, Software Engineer >>> Artinis Medical Systems | +31 481 350 980 >>> >>>> -----Original Message----- >>>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>>> Sent: Wednesday, October 21, 2015 10:30 AM >>>> To: fieldtrip at science.ru.nl >>>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>>> >>>> Dear all, >>>> >>>> I?m trying to do interpolation to repair some bad channels, but I?m >>>> getting >>>> the error below. >>>> I've read the ft_fetch_sens help but I don?t understand how I should >>>> specify >>>> the electrodes. >>>> >>>> Is there a file I should upload or am I missing something in my code? >>>> Any help or hint is very much appreciated! >>>> >>>> thanks in advance, >>>> ~ grazia >>>> >>>> >>>> // >>>> Error using ft_fetch_sens (line 183) >>>> no electrodes or gradiometers specified. >>>> >>>> Error in ft_channelrepair (line 115) >>>> sens = ft_fetch_sens(cfg, data); >>>> >>>> Error in new_analyse_GDP (line 42) >>>> ft_channelrepair(cfg, data) >>>> // >>>> >>>> This is my code: >>>> >>>> 15 cfg = []; >>>> 16 cfg_neighb = []; >>>> 17cfg_neighb.method= 'triangulation'; >>>> 18 cfg.senstype = 'EEG'; >>>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>>> 21 >>>> 22 cfg.neighbours = neighbours; >>>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>>> 24 cfg.feedback = 'yes'; >>>> 25 cfg.layout = 'biosemi64.lay'; >>>> 26 lay = ft_prepare_layout(cfg); >>>> 27 >>>> 28 sens = data; >>>> 29 sens.type = 'eeg'; >>>> 30 sens.label= lay.label; >>>> 31 sens.chanpos = lay.pos; >>>> 32 sens.chanpos(:,3) = 0; >>>> 33 >>>> 34 ft_neighbourplot(cfg, data) >>>> 35 >>>> 36 cfg = []; >>>> 37 cfg.method = 'nearest'; >>>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>>> 'AF3','AF8','F7','F5','FT9'}; >>>> 39 cfg.neighbours = neighbours; >>>> 40 cfg.trials = 'all'; >>>> 41 >>>> 42 ft_channelrepair(cfg, data) >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 59, Issue 17 >>> ***************************************** >> >> >> >> _______________________________________________ >> 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: 5 > Date: Wed, 21 Oct 2015 17:54:40 +0000 > From: "Krebber, Martin" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Xiaoming, hi Arjen, > > I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. > > Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. > > I am not 100% sure about this, so please let me know if I made a mistake. > > What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. > > I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. > > > Thanks! > Martin > > > ________________________________ > Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] > Gesendet: Dienstag, 20. Oktober 2015 08:03 > An: FieldTrip discussion list > Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions > > Hey Xiaoming, > > It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough > > Hope that helps, > Arjen > > 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: > For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; > > by using above mentioned script, there are 14 negative clusters were reported in variable stat. > > stat = > > prob: [30x50 double] > posclusters: [] > posclusterslabelmat: [30x50 double] > posdistribution: [1x1000 double] > negclusters: [1x14 struct] > negclusterslabelmat: [30x50 double] > negdistribution: [1x1000 double] > cirange: [30x50 double] > mask: [30x50 logical] > stat: [30x50 double] > ref: [30x50 double] > rho: [30x50 double] > dimord: 'chan_freq' > freq: [1x50 double] > label: {30x1 cell} > time: 2.5000 > cfg: [1x1 struct] > > However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. > My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. > > I am not good at statistics. It will be really appreciated if you have any suggestions or comments. > > Xiaoming > > > > >>>> Arjen Stolk > 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: > Dear FieldTrip users, > This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html > According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. > cfg = []; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'ft_statfun_correlationT'; > ... > etc > ... > design = zeros(2, n1 * 2); % n1 is the number of subjects. > design(1,1:n1) = 1; > design(1,(n1 + 1):(n1 * 2)) = 2; > design(2, :) = [[1:n1 ] [1 : n1]]; > cfg.design = design; > > cfg.ivar = 1; > cfg.uvar = 2; > stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); > However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. > In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. > Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! > Thanks. > Xiaoming > > _______________________________________________ > 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: Wed, 21 Oct 2015 11:22:09 -0700 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Martin, > > Thanks for thinking along. I've briefly tried to replicate/simplify the > situation depicted by you using the code below. It works as I would expect, > no matter whether one variable is scaled differently. But perhaps I'm not > fully capturing the issue, and something still goes awry. This is a > possibility because ft_statfun_correlationT has only recently been > implemented for a specific case, and was never really tested within > different situations (hence it's not well-documented on the wiki). Do you > think you could use this example code to replicate the situation you are > experiencing? > > Yours, > Arjen > > % simulate simple multiple subjects timelock structures > > data_brain = []; > > data_behav = []; > > for j=1:10 > > data_brain{j}.avg = j; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference > > end > > > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 100; > > > > n1 = 10; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > > > assert(isequal(stat.rho, -1)); > > 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > >> Hi Xiaoming, hi Arjen, >> >> I've been encountering the same problem. I believe Xiaoming is right when >> he points out that the permutaion step shuffles data across conditions and >> that this introduces a negative bias in the distribution. I found the same >> thing when I correlated RT data with TFRs (absolute power). My distribution >> was shifted strongly to the left and, thus, not a single negative cluster >> was significant, but every positive one was. >> >> Xiaomings explanation made a lot of sense to me when I thought about it >> graphically: Imagine correlating two data vectors, one (x) ranging between >> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >> a cloud of dots on the upper left corner of the diagram. When you then >> switch the variable assignment of half of the data points (which is what >> the permutation step seems to do), these dots will now be be shifted to the >> lower right corner of the diagram. So no matter what the correlation in the >> original data, chances are that (given different scaling) after permutaion, >> you get a negative correlation. >> >> I am not 100% sure about this, so please let me know if I made a mistake. >> >> What I tried instead of the 'ft_statfun_correlationT' was using a custom >> made statfun in which I pass the RTs via the design matrix. With this, my >> results looked much better. I am not sure, but I guess this is because >> there is no shuffling between the two variables in this case. >> >> I would really like to know, what is the right way of doing this using >> just the FieldTrip functions. Is there a way to permute data within >> variables? I tried cfg.resampling = 'bootstrap', but this is not a >> permutation, as far as I know. >> >> >> Thanks! >> Martin >> >> >> ------------------------------ >> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >> *An:* FieldTrip discussion list >> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >> follow-up questions >> >> Hey Xiaoming, >> >> It's still pretty hard, for me, to guess on basis of that matlab output >> what is going on here and what you mean with 'shuffling design matrices', >> and how that shuffling 'biases the cluster distribution'. As you mention >> yourself, it could be due to various reasons, and you're open to >> suggestions and increasing your understanding. I'd therefore suggest to try >> to funnel the number of potential explanations by simulating what you're >> doing (using input data for which you know how it should behave), after >> you've read more about what the design matrix and monte carlo statistics >> are supposed to do. Perhaps the statistics section at the bottom of this >> page provides a good starting point: >> http://www.fieldtriptoolbox.org/walkthrough >> >> Hope that helps, >> Arjen >> >> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >> >>> For example, our power values ranged from 1 to 3 (after log transform); >>> my behavioral data ranged from 20 to 90; >>> >>> by using above mentioned script, there are 14 negative clusters were >>> reported in variable stat. >>> >>> stat = >>> >>> prob: [30x50 double] >>> posclusters: [] >>> posclusterslabelmat: [30x50 double] >>> posdistribution: [1x1000 double] >>> negclusters: [1x14 struct] >>> negclusterslabelmat: [30x50 double] >>> negdistribution: [1x1000 double] >>> cirange: [30x50 double] >>> mask: [30x50 logical] >>> stat: [30x50 double] >>> ref: [30x50 double] >>> rho: [30x50 double] >>> dimord: 'chan_freq' >>> freq: [1x50 double] >>> label: {30x1 cell} >>> time: 2.5000 >>> cfg: [1x1 struct] >>> >>> However, the p values of those clusters (i.e., stat.negclusters.prob) are >>> all ones. The smallest value in stat.negdistribution is way larger than >>> the largest negative cluster t-sum. This could be real. However, it is more >>> likely due to the shuffle between power and behavioral group. For example, >>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 >>> 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, >>> their power data was labeled as behavioral data and vice versa. Because of >>> the scale difference between power and behavioral data, large negative >>> correlations were generated by permutation. This further biased the cluster >>> distribution. >>> My limited understanding is that, for correlation, each permutation >>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 >>> 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>> corresponds to another subject's behavioral data. >>> >>> I am not good at statistics. It will be really appreciated if you have >>> any suggestions or comments. >>> >>> Xiaoming >>> >>> >>> >>> >>>>>> Arjen Stolk 10/19/2015 6:01 PM >>> >>> Hey Xiaoming, >>> >>> Not sure if I understand, but shouldn't the directions of the >>> correlations be independent of the scaling of the two variables? Looking at >>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>> would result in a direction change either. Perhaps you could try to first >>> manually calculate a correlation between signal power and behavioral power, >>> and see whether anything is behaving unexpectedly? >>> >>> Yours, >>> Arjen >>> >>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>> >>>> Dear FieldTrip users, >>>> This is Xiaoming from University of Maryland Baltimore. My current >>>> project requires to calculate behavioral-power correlation across subjects. >>>> Similar topic was discussed here early this year. >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>> According to the suggestions in above mentioned thread, I duplicate my >>>> power dataset and replace the power values at each time-frequency point >>>> with behavioral data. Therefore, those two datasets have same structure and >>>> dimension. I used the following script to test if there are significant >>>> clusters of correlations. >>>> cfg = []; >>>> cfg.parameter = 'powspctrm'; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'ft_statfun_correlationT'; >>>> ... >>>> etc >>>> ... >>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>> design(1,1:n1) = 1; >>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>> cfg.design = design; >>>> >>>> cfg.ivar = 1; >>>> cfg.uvar = 2; >>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>> However, it seems when each time the design matrix is permuted, >>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>> each subject in design matrix. Although I confirmed this by uncommenting >>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>> matrix in command line, please correct me if this is not the case. >>>> In my mind, this kind of permutation will cause trouble when dealing >>>> with correlation. For example, in my case, the behavioral data and power >>>> data have different scales. The power data are much larger than behavioral >>>> data in general. When assigning behavioral data into power group or vice >>>> versa, it will induce huge negative correlations between power and >>>> behavioral measurement. Therefore, no negative clusters will survive from >>>> permutation test. >>>> Please let me know if I have mis-understanding or if I did anything >>>> wrong. Any suggestions will be highly appreciated! >>>> Thanks. >>>> Xiaoming >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 18 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 22 11:53:16 2015 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 22 Oct 2015 09:53:16 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: Message-ID: <0C912A67-0DAD-4A2B-AD72-2191E01AF614@donders.ru.nl> Dear participants in the discussion on behavioural-power correlation, My name is Eric Maris and have contributed most of the older statfuns (but not ft_statfun_correlationT). Together with Arjen, I will try to resolve some of the issues that have been discussed. Give us some time, and we will return to you via the Discussion List. best, Eric From martin.krebber at charite.de Thu Oct 22 12:20:23 2015 From: martin.krebber at charite.de (Krebber, Martin) Date: Thu, 22 Oct 2015 10:20:23 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> , Message-ID: Hi guys, Thanks for getting on top of this so quickly. I'm looking forward to seeing your solution to the problem. @Xiaoming: Nice job with the example you provided! I'll send you a copy of my statfun later. Best, Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Donnerstag, 22. Oktober 2015 06:01 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hi Xiaoming, Martin, Coming back about this issue, I have filed a bug report: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2992 In short, creating a randomization distribution using the permutation method is prone to systematic bias across conditions, as illustrated in our previous email exchanges. One workaround is to use the bootstrapping method (cfg.resampling = 'bootstrap'), or to explicitly remove the systematic bias, e.g by normalizing the data in each condition separately prior to doing statistical testing. I have added these important considerations to the documentation of ft_statfun_correlationT, built in a warning message, and created a latent function that explicitly tests for this issue (to prevent it to re-occur with future code changes). Thank you for your acuteness and contributions. Yours, Arjen 2015-10-21 15:33 GMT-07:00 Arjen Stolk >: Thanks for clarifying, Xiaoming. It seems indeed that a systematic offset (in averages) across the two sample populations biases the randomization distribution. I'd need to sort this out, but schematically would expect it to look as follow: normal: ~1000 ~1000 ~1000 ~1000 ~1 ~1 ~1 ~1 corr = ~0 post shuffling: ~1000 ~1 ~1000 ~1000 ~1 ~1000 ~1 ~1 corr = negative, that is an anti-correlation This implies a bootstrapping approach is more correct for testing for statistical significance of a correlation (in case of a systematic offset across conditions). Yours, Arjen 2015-10-21 14:28 GMT-07:00 Xiaoming Du >: Hi Martin, Thanks Martin to make it more clear. However, my understanding is that the problem is caused by different means of permutation for paired-sample t test and correlation. I am very curious how you solve the problem by customizing statfun. Do you mind sending me a copy of that? I will really appreciate it. Hi Arjen, I think the 'ft_statfun_correlationT' works fine. Using the code in your previous email, the correlation result (stat.rho) is same as using MATLAB function 'corr' with Spearman method. However, In your code, the design matrix for correlation is defined in the same way as for within-UO design (e.g., paired-sample t test). I think Martin's and my concern is that the permutation method for correlation and within-UO design (e.g., paired-sample t test) should be different. For example, there are 10 subjects (patients). Each of them finished a task before (A) and after (B) the treatment . Based on the different null hypothesis, the permutation methods for paired-sample t test and correlation should be different. For paired-sample t test (or within-UO design), the null hypothesis is that there is no different before or after the treatment. In other words, for each subjects, switch the results before and after treatment won't matter. This is exactly how the permutations are done when cfg.design is defined as in your code . On the other hand, the null hypothesis for correlation is that: there is no relationship between the results before and after treatment. Therefore, permutation should be done on after-treatment results among subjects while keep before-treatment results same (or permute before-treatment and keep after-treatment). In terms of permutation, correlation and paired-sample t test (within-UO design) seems treated equally in fieldtrip. Original matrix permutation for paired t test permutation for correlation before (A) after (B) before (A) after (B) before (A) after (B) subj1 A1 B1 subj1 A1 B1 subj1 A1 B2 subj2 A2 B2 subj2 B2 A2 subj2 A2 B4 subj3 A3 B3 subj3 B3 A3 subj3 A3 B3 subj4 A4 B4 subj4 A4 B4 subj4 A4 B1 subj5 A5 B5 subj5 A5 B5 subj5 A5 B10 subj6 A6 B6 subj6 B6 A6 subj6 A6 B8 subj7 A7 B7 subj7 B7 A7 subj7 A7 B9 subj8 A8 B8 subj8 A8 B8 subj8 A8 B6 subj9 A9 B9 subj9 B9 A9 subj9 A9 B5 subj10 A10 B10 subj10 A10 B10 subj10 A10 B7 As follows, I made minor changes in your previous code to show this issue. data_brain ranges from 0 to 1; data_behav ranges from 1000 to 1001; There is no relationship between data_brain and data_behav, because the values are randomly assigned to them. This is the results I got by using the code below: stat = prob: 9.9900e-04 cirange: 0.0020 mask: 1 stat: 0.2941 ref: -10.7655 rho: 0.0297 dimord: 'chan_time' label: {'1'} time: 1 cfg: [1x1 struct] stat.rho (0.0297) is the same as using 'corr' with Spearman option in matlab; However, stat.prob obtained by using permutation test is so small. The reason (I guess) are 1, two-tail test was used. 2, the rho distribution of permutation is biased to negative direction (meaning the rho after each permutation was biased to strong negative correlation. e.g., -0.8 etc ), so the real rho fell into the 5% range of rho distribution of permutations. In other words, real rho (0.0297) is smaller (or larger) than almost all rho from permutation, so that stat.prob is very small (0.000999). Please let me know if this makes sense to you or if I misunderstood anything. Thanks. Xiaoming data_brain = []; data_behav = []; for j=1:100 data_brain{j}.avg = rand; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = rand + 1000; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 1000; n1 = 100; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >>> Arjen Stolk > 10/21/2015 2:22 PM >>> Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin >: Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk > 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Thu Oct 22 16:51:04 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Thu, 22 Oct 2015 16:51:04 +0200 Subject: [FieldTrip] EEG electrode coordinate system transformation Message-ID: Dear all, we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_layout.jpg Type: image/jpeg Size: 34769 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: inverted_localite_layout.jpg Type: image/jpeg Size: 34337 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: localite_layout.jpg Type: image/jpeg Size: 33727 bytes Desc: not available URL: From paolo.belardinelli at gmail.com Thu Oct 22 16:55:28 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Thu, 22 Oct 2015 14:55:28 +0000 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: References: Message-ID: Dear all, we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_layout.jpg Type: image/jpeg Size: 34769 bytes Desc: standard_layout.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: inverted_localite_layout.jpg Type: image/jpeg Size: 34337 bytes Desc: inverted_localite_layout.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: localite_layout.jpg Type: image/jpeg Size: 33727 bytes Desc: localite_layout.jpg URL: From r.oostenveld at donders.ru.nl Thu Oct 22 21:47:51 2015 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 22 Oct 2015 21:47:51 +0200 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: References: Message-ID: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Hi Paolo, You may want to use ft_electroderealign immediately following the reading in. The electrode realign function allows you to rotate and translate (i.e. shift) the electrodes. Getting the electrodes properly aligned with the axes of the coordinate system will make it easier to make the layout with ft_prepare_layout. I have just made a small change to ft_electroderealign that makes it possible to use the function with only electrodes (and no MRI or head shape). You should get the latest fieldtrip version (later this evening on the FTP) or download https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m You can then do cfg = []; cfg.elec = ft_read_sens(‘your localite file’) cfg.method = ‘interactive’; elec_realigned = ft_electroderealign(cfg) cfg = []; cfg.elec = elec_realigned; layout = ft_prepare_layout(cfg); best regards, Robert On 22 Oct 2015, at 16:55, Paolo Belardinelli wrote: > Dear all, > > we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. > The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. > We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). > Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). > Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? > > 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 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 Oct 23 11:34:15 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 23 Oct 2015 11:34:15 +0200 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> References: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Message-ID: Dear Robert, thank you very much for your answer and support. We downloaded the ft_electroderealign from the github link you sent us. We ran the code lines that you inserted in your previous email. In the resulting interactive topoplot, we were able to rotate and realign the electrode configuration properly. However, for some reason, after pushing the 'apply' button, we are still not able to save the modified configuration and manually close the interactive window. As a consequence, when visualizing the new layout, we are still plotting the old configuration. Are we missing a step in the interactive GUI or is the subfunction cb_close not working properly? Best wishes, Paolo On Thu, Oct 22, 2015 at 9:47 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Paolo, > > You may want to use ft_electroderealign immediately following the reading > in. The electrode realign function allows you to rotate and translate (i.e. > shift) the electrodes. Getting the electrodes properly aligned with the > axes of the coordinate system will make it easier to make the layout with > ft_prepare_layout. > > I have just made a small change to ft_electroderealign that makes it > possible to use the function with only electrodes (and no MRI or head > shape). You should get the latest fieldtrip version (later this evening on > the FTP) or download > https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m > > You can then do > > cfg = []; > cfg.elec = ft_read_sens(‘your localite file’) > cfg.method = ‘interactive’; > elec_realigned = ft_electroderealign(cfg) > > cfg = []; > cfg.elec = elec_realigned; > layout = ft_prepare_layout(cfg); > > best regards, > Robert > > > > > On 22 Oct 2015, at 16:55, Paolo Belardinelli > wrote: > > Dear all, > > we are recording EEG electrode positions using the LOCALITE TMS navigator > acquisition software. We dispose over MRI data in DICOM format. > The electrode positions are stored in the (LPS) coordinate system. Unity > measures are mm. > We load the electrode positions in Fieldtrip by means of ft_read_sens. We > use the elec structure to prepare the layout with ft_prepare_layout. > Attached are the obtained layout (localite_layout) and the layout obtained > using standard electrode positions (standard_layout). > Appearantly, besides an inversion of both X and Y axes, we have to deal > with a Z offset we don't know how to exactly calculate ( a simple inversion > of axes does not provide correct results, see attached > inverted_localite_layout). > Is there a way to address this issue in Fieldtrip or with some > mathematical manipulation? > > 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 list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Fri Oct 23 14:52:36 2015 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 23 Oct 2015 14:52:36 +0200 Subject: [FieldTrip] EEG electrode coordinate system transformation In-Reply-To: References: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Message-ID: <4BC7F690-80F5-40FA-8152-BC3968E39BA3@donders.ru.nl> Hi Paolo, After pressing apply and closing the figure from electroderealign, the function returns the updated electrode structure. You are referring to cb_close, which is a subfunction that you would not see under normal situations. So I wonder whether you are running into an error (and that the function name is printed on screen). For me it works fine, both in 2014b and 2015b. But if you have an error in cb_close, the figure would not close properly and the updated electrode structure would not be returned. If you indeed have an error, please report it on http://bugzilla.fieldtriptoolbox.org/ and attach a small mat file with the elec structure in it. You should also report the operating system and the matlab version. best regards, Robert PS I will be traveling the next few days, so probably I won’t be able to respond to follow up emails for some time. On 23 Oct 2015, at 11:34, Paolo Belardinelli wrote: > Dear Robert, > thank you very much for your answer and support. > We downloaded the ft_electroderealign from the github link you sent us. > We ran the code lines that you inserted in your previous email. > In the resulting interactive topoplot, we were able to rotate and realign the electrode configuration properly. > However, for some reason, after pushing the 'apply' button, we are still not able to save the modified configuration and manually close the interactive window. > As a consequence, when visualizing the new layout, we are still plotting the old configuration. > Are we missing a step in the interactive GUI or is the subfunction cb_close not working properly? > > Best wishes, > > Paolo > > > > On Thu, Oct 22, 2015 at 9:47 PM, Robert Oostenveld wrote: > Hi Paolo, > > You may want to use ft_electroderealign immediately following the reading in. The electrode realign function allows you to rotate and translate (i.e. shift) the electrodes. Getting the electrodes properly aligned with the axes of the coordinate system will make it easier to make the layout with ft_prepare_layout. > > I have just made a small change to ft_electroderealign that makes it possible to use the function with only electrodes (and no MRI or head shape). You should get the latest fieldtrip version (later this evening on the FTP) or download https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m > > You can then do > > cfg = []; > cfg.elec = ft_read_sens(‘your localite file’) > cfg.method = ‘interactive’; > elec_realigned = ft_electroderealign(cfg) > > cfg = []; > cfg.elec = elec_realigned; > layout = ft_prepare_layout(cfg); > > best regards, > Robert > > > > > On 22 Oct 2015, at 16:55, Paolo Belardinelli wrote: > >> Dear all, >> >> we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. >> The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. >> We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). >> Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). >> Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? >> >> 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 list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > 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 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From helen.wieffering at gmail.com Fri Oct 23 23:53:48 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Fri, 23 Oct 2015 17:53:48 -0400 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis In-Reply-To: References: Message-ID: Hi Per, Thanks for your suggestion, and I'm sorry for my (much) delayed reply. I've read the paper you mentioned - it seems this could be promising for my work, too. I hadn't considered the non-parametric approach. Could you give me more detail on the pre-processing steps you took and the parameters you're using with the fieldtrip connectivity functions? I'd love to look at the scripts you're using, too, if at all possible. Thanks again. Helen Wieffering Bowdoin College On Wed, Oct 7, 2015 at 4:55 PM, Per Arnold Lysne wrote: > Hi Helen, > > > I am having good luck with ft_connectivity_analysis in MEG using the > nonparametric Granger approach of Dhamala, Rangarajan & Ding, 2008, > Neuroimage and Physical Review letters. > > > Thanks, > > > Per Lysne > > University of New Mexico > > lysne at unm.edu > > > -----Original Message----- > From: Helen Wieffering > Sent: Oct 7, 2015 8:59 AM > To: FieldTrip discussion list > Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis > > Dear FieldTrip users, > > I'm writing to see if any one out there has had success with computing > Granger causality measures in FieldTrip. We have been working toward making > this analysis possible with our EEG data and have now reached the final > stages. > > However, we find that ft_connectivity_analysis (and > ft_connectivity_granger for that matter) offers little guidance on how to > achieve a good mvar model fit. For example, the function asks the user to > specify the model order without offering tests for whiteness, stationarity, > or consistency. It seems that Fieldtrip calls on the BSMART toolbox to > perform these operations, which further confuses me given that BSMART > itself offers these model validation tests. Yet they don't seem to ever be > called upon by FieldTrip. > > We've considered using the BSMART toolbox separately from FieldTrip, yet > the toolbox website is rather outdated and the functions are only > compatible through 2008 Matlab - seems like a headache. But without tools > for validating the mvar model, we can't be confident of any GC results > achieved through FieldTrip. > > Are there perhaps further connectivity tools in FieldTrip that I've > overlooked? Or is it worth looking into other toolboxes? We've also > considered SIFT and the MVGC toolbox, but would love to keep working with > FieldTrip if possible. > > If anyone can offer advice, or connect me with someone knowledgeable in > this area, I'd love to know. > > Thanks very much, > > Helen Wieffering > Bowdoin College > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishwaryaselvaraj1708 at gmail.com Sun Oct 25 08:10:30 2015 From: aishwaryaselvaraj1708 at gmail.com (aishwarya selvaraj) Date: Sun, 25 Oct 2015 12:40:30 +0530 Subject: [FieldTrip] field trip Message-ID: Hi , I am a student who is working on emotiv epoc headset for my project . i just downloaded field trip and added to matlab directory successfully . And i was going through the manual ,but i found it difficult to understand anything . Basically i want to start using emotiv with matlab using field trip toolbox Could you help with a start PS:i would want to have a live streaming from the headset into matlab with field trip Waiting for your reply :) Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Oct 25 13:04:26 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 25 Oct 2015 12:04:26 +0000 Subject: [FieldTrip] field trip Message-ID: It sounds like you want to do real-time analysis; does this link help? http://www.fieldtriptoolbox.org/getting_started/realtime You can also read the general tutorials information: http://www.fieldtriptoolbox.org/tutorial/introduction http://www.fieldtriptoolbox.org/walkthrough http://www.fieldtriptoolbox.org/tutorial Beyond that, it's going to be hard for anyone to give you more detailed help unless you can explain more specifically what you are looking for, what you have read on the site so far, and what about it is lacking. 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: Sun, 25 Oct 2015 12:40:30 +0530 > From: aishwarya selvaraj > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] field trip > Message-ID: > < > CACWTKSr6E2P+58xw4z5YbK_u6KV-230oAsDxgjFMjpw8VeS4Yg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi , > I am a student who is working on emotiv epoc headset for my project . > i just downloaded field trip and added to matlab directory successfully . > And i was going through the manual ,but i found it difficult to understand > anything . > Basically i want to start using emotiv with matlab using field trip toolbox > Could you help with a start > PS:i would want to have a live streaming from the headset into matlab with > field trip > > Waiting for your reply :) > Regards > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151025/d5a10445/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.caballero at bcbl.eu Mon Oct 26 20:50:17 2015 From: c.caballero at bcbl.eu (Cesar Caballero) Date: Mon, 26 Oct 2015 20:50:17 +0100 (CET) Subject: [FieldTrip] error when creating head model in tutorial Message-ID: <1228077923.817774.1445889017673.JavaMail.zimbra@bcbl.eu> Dear all, I'm doing the tutorial to create the head model for EEG with my own nifti dataset. http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg When I try to create the head model, I have the following error: >> cfg = []; >> cfg.method = 'dipoli'; >> vol = ft_prepare_headmodel(cfg, bnd); Illegal right hand side in assignment. Too many elements. Error in ft_datatype_source>fixpos (line 337) source.pos = source.pnt; Error in ft_datatype_source (line 110) source = fixpos(source); Error in ft_checkdata (line 233) data = ft_datatype_source(data); Error in ft_prepare_headmodel (line 193) data = ft_checkdata(data, 'hasunit', 'yes'); I'd be pleased if anyone could point me out to the reason of the error. Thanks in advance for your time. Best wishes, Cesar ---------------------------------------------------------------------- Cesar Caballero MRI engineer www.bcbl.eu Twitter: @caballerogaudes www.researchgate.net/profile/Cesar_Caballero2 Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer From mishra408 at gmail.com Tue Oct 27 09:32:49 2015 From: mishra408 at gmail.com (Ashutosh Mishra) Date: Tue, 27 Oct 2015 14:02:49 +0530 Subject: [FieldTrip] Dipole lies on the boundary of volume model Message-ID: Hi, While computing sources, I get the "warning:dipole lies on boundary of volume model ". I noticed that lead field matrix for those dipoles matrix with NaN values, which further cause a problem in computing sources. 1. Can we neglect those dipoles? 2. If not then how could we fix this? Thanks Ashutosh -- Ashutosh Mishra -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.vanEs at donders.ru.nl Tue Oct 27 15:29:19 2015 From: M.vanEs at donders.ru.nl (Es, M.W.J. van (Mats)) Date: Tue, 27 Oct 2015 14:29:19 +0000 Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Oct 27 15:44:56 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 27 Oct 2015 14:44:56 +0000 Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis In-Reply-To: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> References: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> Message-ID: Hi Mats, Based on your description I suspect an issue with floating point numerical round off. I would assume that the length of your trials is fixed and the time axis supposed to be equal across trials? Could you try and do data.time(1:end) = data.time(1); and report back whether the problem persists (or vanishes)? Best, Jan-Mathijs On Oct 27, 2015, at 3:29 PM, Es, M.W.J. van (Mats) > wrote: Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.vanlier at bsse.ethz.ch Tue Oct 27 16:28:44 2015 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Tue, 27 Oct 2015 15:28:44 +0000 Subject: [FieldTrip] comodugrams (power-power correlation) Message-ID: Hi FieldTrip, I am trying to get the comodugrams of each channel pair to look for power-power correlations across frequencies. It would be great to multiplot them (depending on refchannel) with freqs on x and y, and corrcoefs on z. I can't seem to get the right output from connectivityanalysis. Is there a clever way of doing this within fieldtrip? Will multiplotTFR be able to handle this? Need to trick it into thinking one freq dim is a time dim I guess. cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.vanEs at donders.ru.nl Wed Oct 28 13:13:17 2015 From: M.vanEs at donders.ru.nl (Es, M.W.J. van (Mats)) Date: Wed, 28 Oct 2015 12:13:17 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 59, Issue 27 In-Reply-To: References: Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AF8@exprd01.hosting.ru.nl> Hi Jan-Mathijs, the length of trials is indeed fixed and the time axis was the same for all trials, so your option did not work. I did find the problem however: the time-window I tried to select was inconsistent with the time axis of the trials. I shifted the time-axis with 1/(2*Fs) and now the axes are equal again. Thank you for your help. Best, Mats ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of fieldtrip-request at science.ru.nl [fieldtrip-request at science.ru.nl] Sent: Wednesday, October 28, 2015 12:00 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 59, Issue 27 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. Problem matrix dim in ft_timelockanalysis (Es, M.W.J. van (Mats)) 2. Re: Problem matrix dim in ft_timelockanalysis (Schoffelen, J.M. (Jan Mathijs)) 3. comodugrams (power-power correlation) (van Lier Ben) ---------------------------------------------------------------------- Message: 1 Date: Tue, 27 Oct 2015 14:29:19 +0000 From: "Es, M.W.J. van (Mats)" To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7 at exprd01.hosting.ru.nl> Content-Type: text/plain; charset="iso-8859-1" Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 27 Oct 2015 14:44:56 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Mats, Based on your description I suspect an issue with floating point numerical round off. I would assume that the length of your trials is fixed and the time axis supposed to be equal across trials? Could you try and do data.time(1:end) = data.time(1); and report back whether the problem persists (or vanishes)? Best, Jan-Mathijs On Oct 27, 2015, at 3:29 PM, Es, M.W.J. van (Mats) > wrote: Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es _______________________________________________ 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: 3 Date: Tue, 27 Oct 2015 15:28:44 +0000 From: "van Lier Ben" To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] comodugrams (power-power correlation) Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi FieldTrip, I am trying to get the comodugrams of each channel pair to look for power-power correlations across frequencies. It would be great to multiplot them (depending on refchannel) with freqs on x and y, and corrcoefs on z. I can't seem to get the right output from connectivityanalysis. Is there a clever way of doing this within fieldtrip? Will multiplotTFR be able to handle this? Need to trick it into thinking one freq dim is a time dim I guess. cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 59, Issue 27 ***************************************** From daniel.haehnke at tum.de Wed Oct 28 15:41:03 2015 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 28 Oct 2015 14:41:03 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation Message-ID: Dear fellow Fieldtrip users, I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Thanks in advance for your ideas! All the 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 helen.wieffering at gmail.com Wed Oct 28 23:37:45 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 28 Oct 2015 18:37:45 -0400 Subject: [FieldTrip] Changing dimord of Cross Spectral Density matrix Message-ID: Dear Fieldtrip Users, I am trying to use the function ft_connectivitiy_csd2transfer in order to compute non-parametric Granger Causality measures. In order to do so, I have my frequency analysis data in the following form: freq = label: {129x1 cell} dimord: 'chan_freq_time' freq: [4 4.5000 5 5.5000 6] time: [1x41 double] powspctrm: [129x5x41 double] labelcmb: {8256x2 cell} crsspctrm: [8256x5x41 double] cfg: [1x1 struct] In my data, the crsspctrm matrix has a dimord of chan_freq_time -- however, the function ft_connectivity_csd2transfer requires a dimord of chan_chan_freq(_time). Does anyone have insight on how to change the dimord of my data? I understand that Fieldtrip's ft_freqanalysis function treats (a, b) and (b, a) cross spectra as identical and therefore omits half of all possible combinations. Ideally, though, I'd like for my crsspctrm matrix to contain all possible combinations between channels, including the auto-spectra. Thanks for your help! Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From helen.wieffering at gmail.com Thu Oct 29 00:30:05 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 28 Oct 2015 19:30:05 -0400 Subject: [FieldTrip] Changing dimord of Cross Spectral Density matrix In-Reply-To: References: Message-ID: Hello again, I've just realized the question in my previous e-mail is irrelevant when I proceed with ft_connectivityanalysis instead, using 'granger' as the method. I wasn't aware that this function could also perform nonparametric granger methods. Still, if anyone has insight on this or would like to connect about approaches, I'd love to hear. Best, Helen On Wed, Oct 28, 2015 at 6:37 PM, Helen Wieffering < helen.wieffering at gmail.com> wrote: > Dear Fieldtrip Users, > > I am trying to use the function ft_connectivitiy_csd2transfer in order to > compute non-parametric Granger Causality measures. > > In order to do so, I have my frequency analysis data in the following > form: > freq = > > label: {129x1 cell} > dimord: 'chan_freq_time' > freq: [4 4.5000 5 5.5000 6] > time: [1x41 double] > powspctrm: [129x5x41 double] > labelcmb: {8256x2 cell} > crsspctrm: [8256x5x41 double] > cfg: [1x1 struct] > > In my data, the crsspctrm matrix has a dimord of chan_freq_time -- > however, the function ft_connectivity_csd2transfer requires a dimord of > chan_chan_freq(_time). > > Does anyone have insight on how to change the dimord of my data? > > I understand that Fieldtrip's ft_freqanalysis function treats (a, b) and > (b, a) cross spectra as identical and therefore omits half of all possible > combinations. Ideally, though, I'd like for my crsspctrm matrix to contain > all possible combinations between channels, including the auto-spectra. > > Thanks for your help! > > Helen Wieffering > Bowdoin College > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Thu Oct 29 04:44:26 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Wed, 28 Oct 2015 20:44:26 -0700 Subject: [FieldTrip] many ICA components looking the same Message-ID: <5631961A.1050507@gmail.com> Hi everyone, I'm running ICA (cfg.method = 'runica') on CTF data with 274 sensors. I was restricting my decomposition to 80 components at first, and it worked well for all previous patients. Somehow, for this particular patient, many of the components have similar topography (I'm only showing till 42 below but the similarity continues for more components). Has anyone ever seen this before? If I look at the time course of these components, not all of them are clear eye-movements, but according to the topography, you'd think they are. Any thoughts, like either changing the method or rejecting only those components whose time courses clearly indicate eye movements and keep other components despite their topographies? Thanks, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: jcbdeahi.png Type: image/png Size: 164624 bytes Desc: not available URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Thu Oct 29 07:31:19 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Thu, 29 Oct 2015 06:31:19 +0000 Subject: [FieldTrip] many ICA components looking the same Message-ID: Hello Vitoria, I'm not sure, but one of my guesses would be head movement. That is to say, if the participant moves her head an inch (for example) then the same type of activity is going to start appearing on different sensors, and if that movement isn't corrected for then you can indeed start seeing what looks like many copies of the same component. (If you've done EEG, this is the same thing that happens when, for example, you bring the same participant back for multiple sessions on separate days and concatenate the datasets together, but didn't put the cap on on exactly the same place each time.) Do you have marker measurements you can use to at least check how much the head was moving, and perhaps to correct for movements over the course of the session? Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 5 > Date: Wed, 28 Oct 2015 20:44:26 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: [FieldTrip] many ICA components looking the same > Message-ID: <5631961A.1050507 at gmail.com> > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi everyone, > > I'm running ICA (cfg.method = 'runica') on CTF data with 274 sensors. I > was restricting my decomposition to 80 components at first, and it > worked well for all previous patients. > Somehow, for this particular patient, many of the components have > similar topography (I'm only showing till 42 below but the similarity > continues for more components). Has anyone ever seen this before? > If I look at the time course of these components, not all of them are > clear eye-movements, but according to the topography, you'd think they are. > Any thoughts, like either changing the method or rejecting only those > components whose time courses clearly indicate eye movements and keep > other components despite their topographies? > > Thanks, > Vitoria > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151028/bd0a6b81/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: jcbdeahi.png > Type: image/png > Size: 164624 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151028/bd0a6b81/attachment.png > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 28 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 29 07:49:08 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 29 Oct 2015 06:49:08 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: References: Message-ID: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Hi Daniel > I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. Has anyone said to you it would not be challenging ;o)? > While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data. This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with a leave-one-out approach. > 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? Yes. > 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can be prevented to start from the right format of the data to begin with (as per ft_freqanalysis). > I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Please do. Best, Jan-Mathijs > > Thanks in advance for your ideas! > > All the 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 alik.widge at gmail.com Thu Oct 29 10:42:01 2015 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 29 Oct 2015 05:42:01 -0400 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> References: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Message-ID: You may also find this informative: http://www.sciencedirect.com/science/article/pii/S1053811915003316 Disclaimer: I have not personally tried this yet, although it's on our list for a near future. Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Daniel > > > I am currently computing the Granger causality between LFP signals from > different brain regions. As it turns out, this is a more challenging > endeavour than I had previously thought. > > Has anyone said to you it would not be challenging ;o)? > > > While testing parametric and non-parametric approaches to computing > Granger causality, I came across some behaviour which seems odd to me. I > hope someone can shed light on these issues: > > > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> > ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR > data that contains a trial dimension. The first error is actually that it > can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis > with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ > field. However, if I manually copy the ‘label’ field from the original data > to the MVAR data, ft_freqanalysis stops at some point where it uses an > array that lacks one dimension. > > OK, this could (or could not) be a general issue with the code. The part > of FieldTrip that deals with AR-modelling is quite old, and it could be > that more recent changes in other parts of the code (e.g. concerning with > data bookkeeping) destroyed some of the functionality. None of the > developers are actively using AR-models in their daily research nowadays, > so it could be that this code is a bit stale. This being said, in general I > don’t think it is a good idea to fit an AR-model to a single trial worth of > data. This would probably lead to not so meaningful estimates. It would be > more meaningful to use a jackknife approach, where a variance across trials > (or some measure that quantifies the extent to which a single trial differs > from the rest) can be obtained with a leave-one-out approach. > > > 2. Using the non-parametric approach (ft_freqanalysis -> > ft_connectivityanalysis) I stumbled across the problem that the > implementation of Wilson’s algorithm that computes the factorisation of the > spectral density matrix doesn’t allow non-integer frequencies nor non-equal > distances between frequencies. Is this an inherent limitation of this > algorithm? > > Yes. > > > 3. Again for the non-parametric approach: If I use trial-resolved FREQ > data for ft_connectivityanalysis, the trial dimension is lost at line 389 > if I use data contain a ‘fourierspctrm’ field. If I use data containing a > ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at > line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not > resolved by using FREQ data which has both a ‘powspctrm’ as well as a > ‘crsspctrm’ field. > > The input into ft_connectivityanalysis should be a frequency domain data > structure containing either a ‘fourierspctrm’ (obtained with > cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with > cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I > would expect it to crash, if it doesn’t we should consider making the error > handling more strict. Also, for Wilson’s algorithm, the estimate of the > cross-spectral density needs to be somewhat robust, and a single trial > estimate in my opinion does not really make sense. The step at which the > fourierspctrm representation is converted into the cross-spectrum ‘knows’ > this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata > can in deed be notoriously slow in some cases, which can be prevented to > start from the right format of the data to begin with (as per > ft_freqanalysis). > > > I’m not really sure whether I need trial-resolved Granger-causality, but > in theory this should be possible. Of course, I could work around this > issue by just using 1-trial FREQ data for ft_connectivityanalysis. > > Please do. > > > Best, > Jan-Mathijs > > > > > > > Thanks in advance for your ideas! > > > > All the 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 peyton.finley at my.wheaton.edu Thu Oct 29 16:19:40 2015 From: peyton.finley at my.wheaton.edu (Peyton Finley) Date: Thu, 29 Oct 2015 10:19:40 -0500 Subject: [FieldTrip] Fast Fourier Transform Using EEGLab Message-ID: Hello, My name is Peyton Finley and I am an undergraduate research student at Wheaton College in Wheaton, Illinois. I am emailing you regarding how to conduct a Fast Fourier Transform using FieldTrip. Specifically, I am trying to use the function ft_freqstatistics.m to gather statistics for the FFT. The function requires what is noted as a "design matrix". This is the description: Nxnumobservations: design matrix (for examples/advice, please see the Fieldtrip wiki, especially cluster-permutation tutorial and the 'walkthrough' design-matrix section) I checked the FieldTrip wiki site, but I was unable to find anything on this design matrix. What is the design matrix and how do I construct it? Also, is this the correct way of performing a FFT on EEG data? Is there an alternate method? Before arriving at this point, I have performed the following steps. cfg = []; ft_defaults; cfg.dataset = dataset; preprocdata=ft_preprocessing(cfg); data=struct2single(preprocdata); %% Define cfg for ft_frequanalysis.m and run. cfg = []; cfg.output='fourier'; cfg.method='mtmfft'; cfg.outputfile=outputFileName; cfg.foilim=[0 55]; cfg.tapsmofrq='2'; [freq]=ft_freqanalysis(cfg,data); %% Define cfg for ft_freqstatistics.m and run. cfg = []; cfg.method='analytic'; [stat]=ft_freqstatistics(cfg, freq); Sincerely, Peyton Finley -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Thu Oct 29 16:49:57 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Thu, 29 Oct 2015 16:49:57 +0100 Subject: [FieldTrip] Fast Fourier Transform Using EEGLab In-Reply-To: References: Message-ID: <00aa01d11261$767e4750$637ad5f0$@artinis.com> Dear Peyton, You might want to check this out: http://www.fieldtriptoolbox.org/walkthrough#input_output_structure_of_ft_freqstatistics And the tutorials on statistic, e.g. http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq However, note that doing an FFT has nothing to do with ft_freqstatistics. You need ft_freqanalysis for that and did that just fine with the code you shared (and, as with everything in life, there is not *the* correct way to do anything, but the way you did it should be fine). 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 Peyton Finley Sent: Thursday, October 29, 2015 16:20 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Fast Fourier Transform Using EEGLab Hello, My name is Peyton Finley and I am an undergraduate research student at Wheaton College in Wheaton, Illinois. I am emailing you regarding how to conduct a Fast Fourier Transform using FieldTrip. Specifically, I am trying to use the function ft_freqstatistics.m to gather statistics for the FFT. The function requires what is noted as a "design matrix". This is the description: Nxnumobservations: design matrix (for examples/advice, please see the Fieldtrip wiki, especially cluster-permutation tutorial and the 'walkthrough' design-matrix section) I checked the FieldTrip wiki site, but I was unable to find anything on this design matrix. What is the design matrix and how do I construct it? Also, is this the correct way of performing a FFT on EEG data? Is there an alternate method? Before arriving at this point, I have performed the following steps. cfg = []; ft_defaults; cfg.dataset = dataset; preprocdata=ft_preprocessing(cfg); data=struct2single(preprocdata); %% Define cfg for ft_frequanalysis.m and run. cfg = []; cfg.output='fourier'; cfg.method='mtmfft'; cfg.outputfile=outputFileName; cfg.foilim=[0 55]; cfg.tapsmofrq='2'; [freq]=ft_freqanalysis(cfg,data); %% Define cfg for ft_freqstatistics.m and run. cfg = []; cfg.method='analytic'; [stat]=ft_freqstatistics(cfg, freq); Sincerely, Peyton Finley -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Thu Oct 29 18:25:31 2015 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Thu, 29 Oct 2015 17:25:31 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: References: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Message-ID: Thank you Jan-Mathijs for your opinion and suggestions! Thanks, Alik for the paper, this looks interesting. Now that I applied non-parametrically calculated Granger-causality for my data, I have to follow-up questions: 1. During the computation of spectral factorisation, the implementation of Wilson’s algorithm complains that “when performing non-parametric spectral factorisation the frequency axis should ideally be zero-padded”. I guess this means that the frequency axis should start at 0. However, as far as I can see that’s not possible using ft_freqanalysis. The code then goes on and performs the zero-padding. I don’t really understand why exactly it does the padding the way it does: it seems to add other frequencies as well, so that the frequency axis the algorithm is actually working with starts with 0 and is followed by some frequencies that are even higher than the first frequency from the original axis, before the original axis is starts. So my questions are: Should I be concerned about this warning? Why is the zero-padding of the frequency axis so weird? 2. I found that when I apply the GC computation to my data there seems to be some kind of edge artefact at the highest frequencies when I average across combinations that represent the same anatomical direction (see attached plot). Why do I get this effect and is it related to my first question? Best, Daniel[cid:6282C030-CD90-405E-BCED-AD7F0DDA754A] On 29 Oct 2015, at 10:42, Alik Widge > wrote: You may also find this informative: http://www.sciencedirect.com/science/article/pii/S1053811915003316 Disclaimer: I have not personally tried this yet, although it's on our list for a near future. Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel > I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. Has anyone said to you it would not be challenging ;o)? > While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data. This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with a leave-one-out approach. > 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? Yes. > 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can be prevented to start from the right format of the data to begin with (as per ft_freqanalysis). > I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Please do. Best, Jan-Mathijs > > Thanks in advance for your ideas! > > All the 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: granger.PNG Type: image/png Size: 82768 bytes Desc: granger.PNG URL: From v.piai.research at gmail.com Thu Oct 29 19:01:32 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Thu, 29 Oct 2015 11:01:32 -0700 Subject: [FieldTrip] many ICA components looking the same In-Reply-To: References: Message-ID: <56325EFC.2050802@gmail.com> hi Steve, Thanks, sounds like a very reasonable explanation. I'm wondering whether I could use Arjen's correction for head movement prior to ICA decomposition, but I can imagine there would be problems with doing the regression first... I'll ask Arjen what he thinks and post it here - if he doesn't see this before I see him again - but I'd be curious to hear what you think as well. Thanks a lot! Vitoria On 10/28/2015 11:31 PM, Stephen Politzer-Ahles wrote: > Hello Vitoria, > > I'm not sure, but one of my guesses would be head movement. That is to > say, if the participant moves her head an inch (for example) then the > same type of activity is going to start appearing on different > sensors, and if that movement isn't corrected for then you can indeed > start seeing what looks like many copies of the same component. (If > you've done EEG, this is the same thing that happens when, for > example, you bring the same participant back for multiple sessions on > separate days and concatenate the datasets together, but didn't put > the cap on on exactly the same place each time.) Do you have marker > measurements you can use to at least check how much the head was > moving, and perhaps to correct for movements over the course of the > session? > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > > Message: 5 > Date: Wed, 28 Oct 2015 20:44:26 -0700 > From: Vit?ria Piai > > To: FieldTrip discussion list > > Subject: [FieldTrip] many ICA components looking the same > Message-ID: <5631961A.1050507 at gmail.com > > > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi everyone, > > I'm running ICA (cfg.method = 'runica') on CTF data with 274 > sensors. I > was restricting my decomposition to 80 components at first, and it > worked well for all previous patients. > Somehow, for this particular patient, many of the components have > similar topography (I'm only showing till 42 below but the similarity > continues for more components). Has anyone ever seen this before? > If I look at the time course of these components, not all of them are > clear eye-movements, but according to the topography, you'd think > they are. > Any thoughts, like either changing the method or rejecting only those > components whose time courses clearly indicate eye movements and keep > other components despite their topographies? > > Thanks, > Vitoria > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: jcbdeahi.png > Type: image/png > Size: 164624 bytes > Desc: not available > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 28 > ***************************************** > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Oct 30 18:28:59 2015 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 30 Oct 2015 10:28:59 -0700 Subject: [FieldTrip] many ICA components looking the same In-Reply-To: <56325EFC.2050802@gmail.com> References: <56325EFC.2050802@gmail.com> Message-ID: <5633A8DB.9010103@gmail.com> Hi all, Just adding this info for the sake of completeness. Thanks, Arjen, for clarifying it! As I suspected, it's *really* not a good idea to use ft_regressconfound before ICA. In fact, this function should be used only at the very latest stages of your analysis, either just before doing stats, or by incorporating the approach in the stats itself. Vitória On 10/29/2015 11:01 AM, Vitória Piai wrote: > hi Steve, > > Thanks, sounds like a very reasonable explanation. > I'm wondering whether I could use Arjen's correction for head movement > prior to ICA decomposition, but I can imagine there would be problems > with doing the regression first... I'll ask Arjen what he thinks and > post it here - if he doesn't see this before I see him again - but I'd > be curious to hear what you think as well. > > Thanks a lot! > Vitoria > > On 10/28/2015 11:31 PM, Stephen Politzer-Ahles wrote: >> Hello Vitoria, >> >> I'm not sure, but one of my guesses would be head movement. That is >> to say, if the participant moves her head an inch (for example) then >> the same type of activity is going to start appearing on different >> sensors, and if that movement isn't corrected for then you can indeed >> start seeing what looks like many copies of the same component. (If >> you've done EEG, this is the same thing that happens when, for >> example, you bring the same participant back for multiple sessions on >> separate days and concatenate the datasets together, but didn't put >> the cap on on exactly the same place each time.) Do you have marker >> measurements you can use to at least check how much the head was >> moving, and perhaps to correct for movements over the course of the >> session? >> >> Best, >> Steve >> >> >> >> --- >> Stephen Politzer-Ahles >> University of Oxford >> Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology >> http://users.ox.ac.uk/~cpgl0080/ >> >> Message: 5 >> Date: Wed, 28 Oct 2015 20:44:26 -0700 >> From: Vit?ria Piai > > >> To: FieldTrip discussion list >> Subject: [FieldTrip] many ICA components looking the same >> Message-ID: <5631961A.1050507 at gmail.com >> > >> Content-Type: text/plain; charset="utf-8"; Format="flowed" >> >> Hi everyone, >> >> I'm running ICA (cfg.method = 'runica') on CTF data with 274 >> sensors. I >> was restricting my decomposition to 80 components at first, and it >> worked well for all previous patients. >> Somehow, for this particular patient, many of the components have >> similar topography (I'm only showing till 42 below but the similarity >> continues for more components). Has anyone ever seen this before? >> If I look at the time course of these components, not all of them are >> clear eye-movements, but according to the topography, you'd think >> they are. >> Any thoughts, like either changing the method or rejecting only those >> components whose time courses clearly indicate eye movements and keep >> other components despite their topographies? >> >> Thanks, >> Vitoria >> >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: jcbdeahi.png >> Type: image/png >> Size: 164624 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 59, Issue 28 >> ***************************************** >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Fri Oct 30 18:49:31 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Fri, 30 Oct 2015 18:49:31 +0100 Subject: [FieldTrip] ft_redefinetrial and response correctness Message-ID: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> Hi all, I have a question about ft_redefinetrial. So, I have two conditions S 11 and S 31, respectively ‘in-synch’ and ’not-in-synch’ and participants were instructed to press 1 or 2 in the keyboard to report their answer, S 1 for ‘not-in-synch’ and S 2 for ‘in-synch’. What I need to do is TFR analysis only for the trials where participants answered correctly, that is S 11 & S 2 and S 31 & S 1 (below an extract from a .vmrk file showing a correct match). Mk3=Stimulus,S 11,33182,1,0 Mk4=Stimulus,S 12,33782,1,0 Mk5=Stimulus,S 13,33902,1,0 Mk6=Stimulus,S 14,34582,1,0 Mk7=Stimulus,S 2,37915,1,0 Mk8=Stimulus,S 31,40352,1,0 Mk9=Stimulus,S 63,40952,1,0 Mk10=Stimulus,S 32,40953,1,0 Mk11=Stimulus,S 33,41112,1,0 Mk12=Stimulus,S 35,41792,1,0 Mk13=Stimulus,S 34,41793,1,0 Mk14=Stimulus,S 35,44634,1,0 Mk15=Stimulus,S 1,44635,1,0 From the tutorials, I’ve understood that I should have done this in my trialfun when I defined my trials during the pre-processing step, but today we realised that some subjects perceived as out-of-synch the condition in-synch and viceversa. So, I was wondering how could I do this now - could I do this using the ft_redefinetrial or worst-case-scenario should I do the pre-processing all over again? I wrote the code below before starting the TRF analysis but it’s not correct since it’s not working: %Redefine trials cfg = []; cfg.trials = 'all'; cfg.trialdef.eventtype = 'Stimulus'; % we are interested in Stimulus markers cfg.trialdef.eventvalue = { 'S 11' 'S 31' }; cfg.trialdef.eventcorrect = [ 'S 2' 'S 1' ]; % correct response Stimulus S 2 for S 11 and S 1 for S 31 cfg.toilim = [-1.8 2.0]; data = ft_redefinetrial(cfg, data); Any suggestions/help is more than welcome! thanks in advance, ~ grazia -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sat Oct 31 01:16:58 2015 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 30 Oct 2015 20:16:58 -0400 Subject: [FieldTrip] ft_redefinetrial and response correctness In-Reply-To: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> References: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> Message-ID: Hi Grazia, In the past I ran into difficulty with my trial function when my triggers were strings. can you remove the ’S’ and change your triggers to numeric values? If not, perhaps I can try if you give me a snippet of data (although I am unfamiliar with .vmk), my old trial functions did what you need. Alternatively, break down this process by using ft_read_event ( http://www.fieldtriptoolbox.org/reference/ft_read_event ) and ft_read_header (http://www.fieldtriptoolbox.org/reference/ft_read_header ). Best, Raquel > On Oct 30, 2015, at 1:49 PM, Grazia Di Pisa wrote: > > Hi all, > > I have a question about ft_redefinetrial. So, I have two conditions S 11 and S 31, respectively ‘in-synch’ and ’not-in-synch’ and participants were instructed to press 1 or 2 in the keyboard to report their answer, S 1 for ‘not-in-synch’ and S 2 for ‘in-synch’. > > What I need to do is TFR analysis only for the trials where participants answered correctly, that is S 11 & S 2 and S 31 & S 1 (below an extract from a .vmrk file showing a correct match). > > Mk3=Stimulus,S 11,33182,1,0 > Mk4=Stimulus,S 12,33782,1,0 > Mk5=Stimulus,S 13,33902,1,0 > Mk6=Stimulus,S 14,34582,1,0 > Mk7=Stimulus,S 2,37915,1,0 > > Mk8=Stimulus,S 31,40352,1,0 > Mk9=Stimulus,S 63,40952,1,0 > Mk10=Stimulus,S 32,40953,1,0 > Mk11=Stimulus,S 33,41112,1,0 > Mk12=Stimulus,S 35,41792,1,0 > Mk13=Stimulus,S 34,41793,1,0 > Mk14=Stimulus,S 35,44634,1,0 > Mk15=Stimulus,S 1,44635,1,0 > > From the tutorials, I’ve understood that I should have done this in my trialfun when I defined my trials during the pre-processing step, but today we realised that some subjects perceived as out-of-synch the condition in-synch and viceversa. > > So, I was wondering how could I do this now - could I do this using the ft_redefinetrial or worst-case-scenario should I do the pre-processing all over again? > > I wrote the code below before starting the TRF analysis but it’s not correct since it’s not working: > > %Redefine trials > cfg = []; > cfg.trials = 'all'; > cfg.trialdef.eventtype = 'Stimulus'; % we are interested in Stimulus markers > cfg.trialdef.eventvalue = { 'S 11' 'S 31' }; > cfg.trialdef.eventcorrect = [ 'S 2' 'S 1' ]; % correct response Stimulus S 2 for S 11 and S 1 for S 31 > cfg.toilim = [-1.8 2.0]; > > data = ft_redefinetrial(cfg, data); > > > Any suggestions/help is more than welcome! > > thanks in advance, > ~ grazia > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Sat Oct 31 01:31:55 2015 From: bick35 at gmail.com (steph) Date: Fri, 30 Oct 2015 17:31:55 -0700 Subject: [FieldTrip] ft_connectivity_laggedcoherence error Message-ID: Hello fieldtrip experts, I tried ft_connectivity_laggedcoherence and ran in this error: Error in ft_connectivity_laggedcoherence (line 228) laggedcrossproduct = fcs1(chancmbind(:,1),tcounter).*conj(fcs2(chancmbind(:,2),tcounter)); This is the code starting at line 224: fcs1(:,colswithnans) = []; fcs2(:,colswithnans) = []; % sum laggedcrossproducts and power over all timepoints for tcounter=1:length(t1) laggedcrossproduct = fcs1(chancmbind(:,1),tcounter).*conj(fcs2(chancmbind(:,2),tcounter)); laggedcps(:,lagindx,trialindx) = laggedcps(:,lagindx,trialindx)+ laggedcrossproduct; power(:,lagindx,1,trialindx) = power(:,lagindx,1,trialindx)+ abs(fcs1(chancmbind(:,1),tcounter)).^2; power(:,lagindx,2,trialindx) = power(:,lagindx,2,trialindx)+ abs(fcs2(chancmbind(:,2),tcounter)).^2; hasdata(trialindx,lagindx) = true; nsmplslaggedcps(lagindx,trialindx) = nsmplslaggedcps(lagindx,trialindx)+1; end; I thing my error appeared because I had some columns with NAN’s which were removed (fcs1(:,colswithnans) = []; fcs2(:,colswithnans) = []; ). Then the second dimension of the matrix fcs1 did not match length(t1). The code runs without error when replacing: % for tcounter=1:length(t1) for tcounter=1:size(fcs1,2) Would the output still be correct? Thank you! Stephan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Oct 31 13:56:02 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sat, 31 Oct 2015 12:56:02 +0000 Subject: [FieldTrip] ft_connectivity_laggedcoherence error In-Reply-To: References: Message-ID: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> Hi Stephan, This code has recently been added as a placeholder function. The code is not functional at the moment. You could keep yourself informed, by signing up on the CC list of this bug: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2951 Of course you are free to contribute to the code. Best wishes Jan-Mathijs Jan-Mathijs Schoffelen, MD PhD, Senior researcher Donders Centre for Cognitive Neuroimaging E-mail: j.schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.fieldtriptoolbox.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Sat Oct 31 18:52:31 2015 From: bick35 at gmail.com (Steph Bickel) Date: Sat, 31 Oct 2015 10:52:31 -0700 Subject: [FieldTrip] ft_connectivity_laggedcoherence error In-Reply-To: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> References: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> Message-ID: <3A847F3B-D850-41A2-9D6A-8BB19FDF386C@gmail.com> Hi Jan-Mathijs, thank you for your response! That’s good to know. I will sign up and if I can contribute at all I will. Happy halloween, Stephan > On Oct 31, 2015, at 5:56 AM, Schoffelen, J.M. (Jan Mathijs) wrote: > > Hi Stephan, > > This code has recently been added as a placeholder function. The code is not functional at the moment. You could keep yourself informed, by signing up on the CC list of this bug: > http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2951 > Of course you are free to contribute to the code. > > Best wishes > Jan-Mathijs > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > Donders Centre for Cognitive Neuroimaging > > E-mail: j.schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.fieldtriptoolbox.org > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From guevara.erra at gmail.com Sat Oct 31 22:25:02 2015 From: guevara.erra at gmail.com (GUEVARA ERRA RAMON MARIANO) Date: Sat, 31 Oct 2015 22:25:02 +0100 Subject: [FieldTrip] Call for participation Neural Synchronization Frontiers Topic Message-ID: Dear potential authors on the fieldtrip mailing list, This is a call for participation at a special issue (Frontiers Topic) on neural synchronization, that we are currently editing: 'Large-scale neural synchronization and coordinated dynamics: a foundational approach' Web site: http://journal.frontiersin.org/researchtopic/4079/large-scale-neural-synchronization-and-coordinated-dynamics-a-foundational-approach Description: A fundamental question in neuroscience is how segregation and integration of information takes place by the temporal coordination of differentiated, specialized brain areas. Neural synchronization is often invoked as a mechanism of coordinated activity, and in the last ten years there has been a great effort to understand its significance, to clarify its physiological and computational roles and its relationship with brain rhythms and abnormal brain functioning (as in epilepsy or Parkinson’s disease). But in a broader sense, synchronization is an old concept, arising from the studies of oscillators in non-linear dynamics. It is indeed a widespread phenomenon, reflecting the coupling between self-oscillating units. However, the association between coupling and coordinated activity is not completely understood in the context of brain dynamics, most critically when this relationship is extended to large networks of interacting neurons. What do we mean when we use the term ‘synchronization’ in neuroscience? How can we measure physical coupling when real experiments can only tell us about temporal statistical correlation? Can we freely use concepts from oscillation theory to describe brain dynamics? In this Research Topic we welcome contributions from different backgrounds and perspectives to promote a deeper understanding of the relationship between neural synchronization and physical coupling between neuronal networks, and its implications for functional connectivity in the normal and the pathological brain. This topic will include, among others, contributions with the following themes: 1) Foundations of large-scale neural synchronization, based on physical theories of oscillation. 2) The computational role and metabolic cost of neural synchronization, and its relation to brain rhythms. 3) Behavioral and cognitive consequences of oscillatory activity in the human brain. 4) Synthesis and state-of-the-art on measuring neural synchronization in experimental settings. 5) Recent methods for the reconstruction of connectivity in oscillatory networks. 6) Applications of the concept of neural coupling and oscillatory activity in a medical setting, such as monitoring and control of neural synchronization in brain pathologies affecting coordination dynamics. Looking forward to have your contributions. Those interested please write to Ramon Guevara (guevara.erra at gmail.com ) Best wishes, Ramon Guevara Erra University Paris Descartes, Paris, France Jose Luis Perez Velazquez Hospital for Sick Children and University of Toronto, Toronto, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: From spa268 at nyu.edu Thu Oct 1 12:49:54 2015 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Thu, 1 Oct 2015 11:49:54 +0100 Subject: [FieldTrip] Artifact rejection Message-ID: Hello Federica, Without seeing your code or the error messages you got, I can't tell why cfg.trl=trl didn't work. As for the ft_read_data error, this sounds like the baseline specified might be longer than what's present in your data. You said your data were previously processed (and I assume epoched) in EEGLAB; what was the length of the baseline interval you left? For instance, if you left a -200ms baseline, that means the first trigger in the dataset is occuring at 201 ms (assuming 1000 Hz sampling). Then if you define a trl structure in Fieldtrip with a longer baseline (say, 250 ms) and try to read the data, fieldtrip will try to read 50 ms of data before the actual beginning of the file, which would cause this error. if this is the case, you'll need to either use a shorter baseline interval when you define trials in Fieldtrip, or you'll need to re-process the data in EEGLAB and leave a longer baseline interval. Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ > Message: 1 > Date: Wed, 30 Sep 2015 15:31:56 +0200 > From: Federica Mauro > To: FieldTrip discussion list > Subject: [FieldTrip] Artifact rejection > Message-ID: > UvsNRV8KEj2Ei-ww at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi everybody, > > I'm trying to use Fieldtrip in order to reject automatically artifacts on > my dataset. I'm working with EEG data previously preprocessed in EEGLAB, > thus their extension is .set. > I'm tryng to follow and adapt the tutorial for MEG data at > http://www.fieldtriptoolbox.org/tutorial/automatic_artifact_rejection, but > I found some problems. > > 1. It doesn't recognize assignment cfg.trl = trl. For this reason I tried > to use ft_definetrial in order to get the matrix cfg.trl, but it still > gives me problems: > 2. Specifically: Error using ==> ft_read_data at 206 - cannot read data > before the begin of the file > > Do you have any suggestion? > > Thank you very much in advance! > Best, > Federica > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Thu Oct 1 16:48:09 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Thu, 1 Oct 2015 16:48:09 +0200 (CEST) Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> Message-ID: <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> 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 From jan.schoffelen at donders.ru.nl Thu Oct 1 17:07:31 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 1 Oct 2015 15:07:31 +0000 Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE In-Reply-To: <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu> <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl> <1709052781.246787.1443710889055.JavaMail.zimbra@bcbl.eu> Message-ID: <55FD4284-BB34-43B9-BCA8-265C043E6C8A@fcdonders.ru.nl> 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 From iris.steinmann at med.uni-goettingen.de Thu Oct 1 17:38:25 2015 From: iris.steinmann at med.uni-goettingen.de (Steinmann, Iris) Date: Thu, 1 Oct 2015 15:38:25 +0000 Subject: [FieldTrip] ft_freqgrandaverage with cfg.inputfile not possible Message-ID: Hi everybody, I have a problem using the cfg.inputfile option with the ft_freqgrandaverage function. When I declare an cfg.inputfile and call the ft_freqgrandaverage(cfg) with only the cfg structure as an argument I get an error: ' cfg.inputfile should not be used in conjunction with giving input data to this function' as if I would call the function with an inputfile AND a data structure (what is in fact not the case) here a short example: I calculated the time-frequency-spectra for all my subjects (like that: TFR1 = ft_freqanalysis(cfg, data)) Now I wanne use the ft_freqgrandaverage function to average time-frequency-spectra over subjects. It worked great when I call the function like that: % code start ================================================== cfg = []; cfg.parameter = 'powspctrm'; grdavg_spec = ft_freqgrandaverage(cfg, TFR1, TFR2, TFR3, TFR4, ...); % code end ==================================================== but I get an error message when I save all my TFRs from single subjects in a cell array to use the cfg.inputfile option % code start ================================================== all_subjects = {TFR1; TFR2; TFR3; TFR4; ....}; save 'all_subject_file' 'all_subjects'; cfg = []; cfg.parameter = 'powspctrm'; cfg.inputfile = 'all_subject_file'; grdavg_spec = ft_freqgrandaverage(cfg); % code end ==================================================== Error message: Error using ft_preamble_loadvar (line 46) cfg.inputfile should not be used in conjunction with giving input data to this function Error in ft_preamble (line 56) evalin('caller', ['ft_preamble_' cmd]); Error in ft_freqgrandaverage (line 63) ft_preamble loadvar varargin Would be nice if someone could help me! Thanx! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gramfort at telecom-paristech.fr Thu Oct 1 22:45:46 2015 From: alexandre.gramfort at telecom-paristech.fr (Alexandre Gramfort) Date: Thu, 1 Oct 2015 20:45:46 +0000 Subject: [FieldTrip] [JOB] Post-doc position at Neurospin / Paris Message-ID: hi, Applications are invited for a full-time one-year post-doctoral scientist. The position is funded by the Paris- Saclay IDEX project NOTime - Neural Oscillations & Time - whose main objective is to develop and apply cross-frequency-coupling analyses on electrophysiological and M/EEG data. Applications are invited from committed and enthusiastic researchers with significant experience with M/EEG and substantial research record in cognitive neurosciences, psychology and/or related field. The selected postdoctoral fellow will work in full collaboration with a master student dedicated to the project, and with the following consortium of researchers: - Valérie Doyère, NeuroPsi: http://neuro-psi.cnrs.fr/spip.php?article245&lang=en - Alexandre Gramfort, Telecom ParisTech: http://alexandre.gramfort.net/ - Virginie van Wassenhove, Neurospin: https://sites.google.com/site/virginievanwassenhove/ Full Job Description: https://www.dropbox.com/s/lq4oi0k8cu85jag/NOTIME_postdoc_advert.pdf?dl=0 Application package: - CV (incl. a list of publications) - Two letters of recommendation (or contacts from which those could be obtained) - A letter of intent with a statement of research interests Please put IDEX POSTDOC in the email subject and send your application package to Virginie.van.Wassenhove at gmail.com Applications will be considered until the position is filled. Best, -- Alexandre Gramfort, PhD Assistant Professor, TSI, Telecom ParisTech, CNRS LTCI 46 Rue Barrault, 75013 Paris, France http://alexandre.gramfort.net alexandre.gramfort at telecom-paristech.fr From bibi.raquel at gmail.com Fri Oct 2 06:16:33 2015 From: bibi.raquel at gmail.com (Raquel bibi Cohen) Date: Fri, 2 Oct 2015 00:16:33 -0400 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: References: Message-ID: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad > On Sep 30, 2015, at 10:54 AM, Wu, Jia wrote: > > Hi, > > If I have 100 subjects, do I have to do: > grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? > > Is there a better way? Or is it not what I should be doing? > > best, > -jia > _______________________________________________ > fieldtrip 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.whitmarsh at ki.se Fri Oct 2 10:32:47 2015 From: stephen.whitmarsh at ki.se (Stephen Whitmarsh) Date: Fri, 2 Oct 2015 08:32:47 +0000 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> References: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com> Message-ID: Hi Jia, (and hi Raquel!) Perhaps easiest is if you get all your subjects in a MATLAB struct, e.g. data{1}, data{2}, etc. Then you can just enter that structure in the FieldTrip functions that take multiple dataset such as ft_timelockgrandaverage and ft_freqanalysis, with e.g. timelockgrandaverage(cfg,data{:}) Cheers, stephen From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel bibi Cohen Sent: 02 October 2015 06:17 To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad On Sep 30, 2015, at 10:54 AM, Wu, Jia > wrote: Hi, If I have 100 subjects, do I have to do: grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? Is there a better way? Or is it not what I should be doing? best, -jia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Fri Oct 2 11:39:40 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Fri, 2 Oct 2015 11:39:40 +0200 (CEST) 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: <457842304.264271.1443778780929.JavaMail.zimbra@bcbl.eu> Hi Jan Mathijs, Ok, I see what you mean. I will follow your comments then. Thank you very much for your help! All the best, Sara Sara Aurtenetxe ----- Original Message ----- From: "Schoffelen, J.M. (Jan Mathijs)" To: "FieldTrip discussion list" Sent: Thursday, October 1, 2015 5:07:31 PM Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE 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 From jia.wu at yale.edu Fri Oct 2 15:10:44 2015 From: jia.wu at yale.edu (Wu, Jia) Date: Fri, 2 Oct 2015 13:10:44 +0000 Subject: [FieldTrip] ft_sourcegrandaverage In-Reply-To: References: <7FC35D45-1B03-4A27-93D7-8519BC15BB7F@gmail.com>, Message-ID: Hi Stephen (and hi Raquel) Eelke in an previous email suggested the same thing and it worked really well. Thanks everyone for help. best, -jia ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Stephen Whitmarsh [stephen.whitmarsh at ki.se] Sent: Friday, October 02, 2015 4:32 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, (and hi Raquel!) Perhaps easiest is if you get all your subjects in a MATLAB struct, e.g. data{1}, data{2}, etc. Then you can just enter that structure in the FieldTrip functions that take multiple dataset such as ft_timelockgrandaverage and ft_freqanalysis, with e.g. timelockgrandaverage(cfg,data{:}) Cheers, stephen From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Raquel bibi Cohen Sent: 02 October 2015 06:17 To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_sourcegrandaverage Hi Jia, Here is the Matlab code I wrote to automate this work for a study when this came up as an issue for me. I don't have Matlab on my iPad ;) forgive me - the condition and trial types make my example unnecessarily complicated. In the following example replace commandA with ft_source... This assumes you have loaded the individual data into the workspace, and you're familiar with eval and sprintf. It can be annoying trying to get it right the first time - but well worth it in the end. I hope it helps you. for itype = 1:3% loop over the target, predistractor, postdistractor, for shifting the timelock data and two distractor types conditions for icond = 1:4 % congruent incongruent neutral %cfg.keeptrials = 'yes'; commandA = ['grand_avg_A(' int2str(floor((itask+1)/2)) ',' int2str(itype) ',' int2str(icond) ') = ft_timelockgrandaverage(cfg']; for isub = 1:length(subj) commandA = [commandA sprintf(',%stimelock{%d,%d,%d}', subj{isub}, floor((itask+1)/2), itype, icond)]; %all subject grand average ends commandA = [commandA ')']; cfg=[]; cfg.keepindividual = 'yes'; cfg.latency = [-.4 1]; eval(commandA) end Sent from my iPad On Sep 30, 2015, at 10:54 AM, Wu, Jia > wrote: Hi, If I have 100 subjects, do I have to do: grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)? Is there a better way? Or is it not what I should be doing? best, -jia _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at donders.ru.nl Fri Oct 2 17:03:55 2015 From: n.lam at donders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 2 Oct 2015 15:03:55 +0000 Subject: [FieldTrip] FieldTrip workshop in Salzburg, Austria Message-ID: Dear FieldTrippers, FieldTrip is holding a workshop in Salzburg in December. The local organizers are currently accepting applications. For more information see here: http://www.fieldtriptoolbox.org/workshop/salzburg Best, Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaminkim at umich.edu Fri Oct 2 20:41:06 2015 From: kaminkim at umich.edu (Kamin Kim) Date: Fri, 2 Oct 2015 13:41:06 -0500 Subject: [FieldTrip] Postdoc position: Electrophysiology of Language Networks, UT Houston Medical School Message-ID: Dear all, Two post-doctoral positions are available in the lab of Nitin Tandon at Houston (www.tandonlab.org), to begin as soon as fall of 2015, for a duration of up to five years. These positions will be supported by recent grants awarded to the PI from the National Science Foundation and the national Institutes of Health ( www.aronlab.org). Candidates for this position should have a background in cognition/ cognitive neuroscience/ intracranial electrophysiology and be interested in understanding speech production in humans. Interactions with our collaborators on these grants, particularly Greg Hickok at UCI, Bob Knight at UC Berkeley and Behnaam Aazhang at Rice University will be encouraged and facilitated. Both positions will involve state-of-the-art analysis of electro-corticographic signals in patients using stereo EEG and subdural grid electrodes and novel electrical stimulation approaches. Opportunities for inter-modal comparisons will also be provided. Candidates must have strong capabilities in one or more of the following disciplines – electrophysiology, signal processing, cognitive neuroscience or computational neuroscience. New members of the lab will benefit from the expertise of several other collaborators, post-docs and graduate students and a proven track record of expertise in intracranial electrophysiology. Applications should consist of a cover letter describing research interests (and how those are a good fit for the position), a curriculum vitae, and contact information for three referees. Applicants will be evaluated on a first come first served basis and applications will be evaluated till the positions are filled, which we expect to happen by the end of this year. Pay will be commensurate with NIH/NSF rates for post-doctoral fellows and full benefits will be provided via the University of Texas. Please send completed applications to nitin.tandon at uth.tmc.edu. *Summary: * Post-docs will analyze human electrocorticographic (ECoG) data collected using intracranial EEG (iEEG) - stereo EEG (sEEG) and subdural grid electrodes (SDE) during language production - and modulate these using novel electrical stimulation approaches. -- ======================================= Kamin Kim, Ph.D. University of Texas Medical School at Houston 6431 Fannin Street, MSB Suite G550D Houston, TX 77030 kamin.kim at uth.tmc.edu ======================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Fri Oct 2 20:44:42 2015 From: bick35 at gmail.com (Steph Bickel) Date: Fri, 2 Oct 2015 11:44:42 -0700 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: Message-ID: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan > On Sep 26, 2015, at 11:54 PM, Steph Bickel wrote: > > Hello fieldtrip experts, > > a script that used to work gives me problems now. > > When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. > > > cfg=[]; > cfg.dataset = edf_file ; > cfg.continuous = ‘yes’; > cfg.demean = ‘yes' ; > cfg.channel = ‘Event' ; > raw = ft_preprocessing(cfg); > > raw = > > hdr: [1x1 struct] > label: {'Event'} > time: {[1x152082 double]} > trial: {[129x152082 double]} > fsample: 499.7071 > sampleinfo: [1 152082] > cfg: [1x1 struct] > > > It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? > > > if isfield(EDF, 'chansel') > chanindx = EDF.chansel; > chanSel = 1; > else > chanindx = [1:EDF.NS]; > chanSel = 0; > end; > > > > Thank you! > > Stephan > > (I’m using the current github field trip version on a mac) -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.vanpelt at donders.ru.nl Sat Oct 3 08:42:27 2015 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Sat, 3 Oct 2015 06:42:27 +0000 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: , Message-ID: <0065FF0A-7B22-4CD6-BA2C-0659CC77F48C@donders.ru.nl> Dear Stephan, Actually, the data structure looks fine to me. The dimension order in the trial field is trialnumber x timepoints, (do you have 129 trials?), not channel x timepoints. Or have I misunderstood your problem? Best, Stan Op 2 okt. 2015 om 20:46 heeft Steph Bickel > het volgende geschreven: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan On Sep 26, 2015, at 11:54 PM, Steph Bickel > wrote: Hello fieldtrip experts, a script that used to work gives me problems now. When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. cfg=[]; cfg.dataset = edf_file ; cfg.continuous = ‘yes’; cfg.demean = ‘yes' ; cfg.channel = ‘Event' ; raw = ft_preprocessing(cfg); raw = hdr: [1x1 struct] label: {'Event'} time: {[1x152082 double]} trial: {[129x152082 double]} fsample: 499.7071 sampleinfo: [1 152082] cfg: [1x1 struct] It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? if isfield(EDF, 'chansel') chanindx = EDF.chansel; chanSel = 1; else chanindx = [1:EDF.NS]; chanSel = 0; end; Thank you! Stephan (I’m using the current github field trip version on a mac) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RICHARDS at mailbox.sc.edu Sun Oct 4 01:37:36 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sat, 3 Oct 2015 23:37:36 +0000 Subject: [FieldTrip] Input to SVD cannot be NAN, and dipole lies on boundary Message-ID: <54048153-CFD2-477D-A707-FD6C2C0BC2E2@mailbox.sc.edu> I am trying to create a lead field matrix for a BEM Dipoli model. For this model I have a 4-compartment BEM model, based on a realistic head model from a participant MRI; meshes for skin, skull, csf, and brain; and source model is a grid on the gray matter. I use the Dipoli external tools (from FT calls) to create a Dipoli head model, and then lead field with the grid and electrodes. I have gotten this to work for a lot of subjects and data, but am stumped on one particular subject. For this one I can get all the way through the pipeline (grid, electrodes, mesh, head model, and leadfield). But when I go to get the source map, I get the error mentioned in other posts “Input to SVD cannot be NAN”. I have not tracked this down, but it appears that the LF matrix has NaN’s in it. I went back to the head model. When it is being created I get: Warning: dipole lies on boundary of volume model > In inf_medium_leadfield (line 54) In eeg_leadfieldb (line 93) In ft_compute_leadfield (line 431) In ft_prepare_leadfield (line 225) In CreateFieldtripLecomputing leadfield 6723/63422 This comes from for i=1:Ndipoles r = pnt - ones(Npnt,1) * rd((1:3) + 3*(i-1)); R = (4*pi*cond) * (sum(r' .^2 ) .^ 1.5)'; if any(R==0) warning('dipole lies on boundary of volume model'); end lf(:,(1:3) + 3*(i-1)) = r ./ [R R R]; End Apparently the dipole locations in the source model grid are right on the boundary of one of the vertices or triangles of the volume mesh, so one of the R’s is zero, and the NaN is apparently from the [R R R] as a div / 0. This is just a guess, because I haven’t tracked down where the “Input to SVD cannot be NaN” is coming from. I tried shrinking or expanding the inner compartment (brain), hoping that it would not then overlap with the source model locations. This did not work. I tried shrinking the source model locations, though don’t want to do this because these are actual GM in the participant, but it did not work anyway. Any suggestions or help on this? Thanks, 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 RICHARDS at mailbox.sc.edu Sun Oct 4 02:40:15 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Sun, 4 Oct 2015 00:40:15 +0000 Subject: [FieldTrip] sLORETA Message-ID: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. Thanks, 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 jan.schoffelen at donders.ru.nl Sun Oct 4 10:18:01 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 4 Oct 2015 08:18:01 +0000 Subject: [FieldTrip] ft_preprocessing ignores channel selection In-Reply-To: References: Message-ID: Hi Stephan, It could be that this is a genuine bug. Could you create an account on bugzilla.fieldtriptoolbox.org, and file a ‘bug’ about this? Then we take it off list, and investigate further. It would be really helpful if you also could get us some of your data (which goes with the script you sent earlier) that is giving you trouble. Some more information about the process can be found on: http://www.fieldtriptoolbox.org/bugzilla Best regards, 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 Oct 2, 2015, at 8:44 PM, Steph Bickel > wrote: Hello, sorry for re-posting this, but I was wondering if someone had an idea what is going wrong here? Is there something wrong with my configuration? Thank you! Stephan On Sep 26, 2015, at 11:54 PM, Steph Bickel > wrote: Hello fieldtrip experts, a script that used to work gives me problems now. When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. cfg=[]; cfg.dataset = edf_file ; cfg.continuous = ‘yes’; cfg.demean = ‘yes' ; cfg.channel = ‘Event' ; raw = ft_preprocessing(cfg); raw = hdr: [1x1 struct] label: {'Event'} time: {[1x152082 double]} trial: {[129x152082 double]} fsample: 499.7071 sampleinfo: [1 152082] cfg: [1x1 struct] It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters? if isfield(EDF, 'chansel') chanindx = EDF.chansel; chanSel = 1; else chanindx = [1:EDF.NS]; chanSel = 0; end; Thank you! Stephan (I’m using the current github field trip version on a mac) _______________________________________________ fieldtrip 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 Sun Oct 4 10:29:43 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 4 Oct 2015 08:29:43 +0000 Subject: [FieldTrip] sLORETA In-Reply-To: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> References: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> Message-ID: Hi John, I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? The answer to both of these subquestions would be ‘yes’ :o). Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. That sounds like a great plan. I’d suggest to file this as a feature request on bugzilla.fieldtriptoolbox.org, so that we can take it from there. From our end, we can then incorporate your suggested adjustments to the code. One thing you could look into, is the way in which sLORETA (and while you’re at it :o) dSPM) is computed in Brainstorm, which is also open source and matlab-based. Best, Jan-Mathijs Thanks, 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 *********************************************** _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Sun Oct 4 21:55:35 2015 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Sun, 4 Oct 2015 20:55:35 +0100 Subject: [FieldTrip] sLORETA In-Reply-To: References: <42F1E126-6E1C-4B76-B822-8D147B0F617B@mailbox.sc.edu> Message-ID: <97E4469F-24B5-4C9C-9936-8E7253C41285@gmail.com> Dear all, There are self contained low level functions for sLORETA and dSPM in NutMEG. I recently used them to add this functionality to my DAiSS toolbox (https://github.com/SPM/DAiSS, look in /private). Best, Vladimir On 4 Oct 2015, at 09:29, "Schoffelen, J.M. (Jan Mathijs)" wrote: > Hi John, > >> I have found several sLORETA inquires on the FT discussion list, including one of my own. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-January/008794.html >> >> I am using MNE and eLORETA in the source analysis routines, but wanted to see if I could get a sLORETA type algorithm. My understanding is that the sLORETA is the STD of the MNE estimate times the MNE estimate (e.g., J * STD-inverse * J in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm). I have used the EMSE and CURRY sLORETA algorithms with the same data in am using in FT, and like some of those results vis-a-vis MNE and eLORETA from FT. >> >> Would there be some straightfoward way to calculate the STD of the MNE estimate, then use this with the MNE estimate in FT to get the sLORETA solution? > > The answer to both of these subquestions would be ‘yes’ :o). > >> Is there anyone interested in working with me on this? I understand the concepts in http://www.uzh.ch/keyinst/NewLORETA/sLORETA/sLORETA.htm, but don’t know how these would be implemented in FT. I have a lot of data set up in FT format that could be used to test this. > > That sounds like a great plan. I’d suggest to file this as a feature request on bugzilla.fieldtriptoolbox.org, so that we can take it from there. From our end, we can then incorporate your suggested adjustments to the code. One thing you could look into, is the way in which sLORETA (and while you’re at it :o) dSPM) is computed in Brainstorm, which is also open source and matlab-based. > > Best, > Jan-Mathijs > > >> >> Thanks, 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 >> *********************************************** >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 jrebola at gmail.com Mon Oct 5 12:17:13 2015 From: jrebola at gmail.com (Jose Rebola) Date: Mon, 5 Oct 2015 11:17:13 +0100 Subject: [FieldTrip] Connectivity comparison across conditions Message-ID: Hi! I am trying to assess if there is a difference in connectivity across two conditions in my data. Condition 1 has 240 trials and condition 2 has 252 trials. I have chosen to use the *phase-locking-value* as a measure of connectivity. *My first question is:* Which formula should I use to evaluate the difference between conditions? Would plv1- plv2 be appropriate, or do I have to do some kind of transformation or normalization? If I choose to use other connectivity measures, will it be much different? I have seen for example in the paper of Jan-Mathijs Schoffelen in 2011 that he uses the formula in the following image for the assessment of differences between the coherence values x1 and x2. I should note that I would like to evaluate differences at the intra-subject level. [image: Inline image 1] *My second question is:* In order to do the non-parametric testing, my null hypothesis is that there are no differences between plv1 and plv2 ( I guess). So I can randomize trial labels, evaluate plv1 and plv2 again, do this 1000 times and count the number of times that this difference is bigger than my original difference, right? *My third and fourth questions concern clustering:* In order to do clustering, I should first establish a threshold value for the metric under evaluation. This may be easy to set if I was using t-values, but if I am evaluating differences in means, what should be an appropriate value to use? Regarding spatial clustering, I now have two levels of “neighbour” electrodes, right? At the seed level, and at the destination level. How can these be clustered? I mean, if I consider for example the electrode-pairing T7-P3, both T9-P3 and T7-P5 will be neighbours… *Lastly,* Are these issues already implemented in Fieldtrip or do I have to build my own MATLAB code for the randomization, thresholding and clustering? Thank you so much, José Rebola -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 17815 bytes Desc: not available URL: From azeez.adebimpe5 at gmail.com Mon Oct 5 19:56:30 2015 From: azeez.adebimpe5 at gmail.com (Azeez Adebimpe) Date: Mon, 5 Oct 2015 19:56:30 +0200 Subject: [FieldTrip] Connectivity comparison across conditions In-Reply-To: References: Message-ID: See my opinion within the line On Mon, Oct 5, 2015 at 12:17 PM, Jose Rebola wrote: > Hi! > > > > I am trying to assess if there is a difference in connectivity across two > conditions in my data. Condition 1 has 240 trials and condition 2 has 252 > trials. > > I have chosen to use the *phase-locking-value* as a measure of > connectivity. > > *My first question is:* > > > > Which formula should I use to evaluate the difference between conditions? > > Would plv1- plv2 be appropriate, or do I have to do some kind of > transformation or normalization? If I choose to use other connectivity > measures, will it be much different? > > I have seen for example in the paper of Jan-Mathijs Schoffelen in 2011 > that he uses the formula in the following image for the assessment of > differences between the coherence values x1 and x2. > > I should note that I would like to evaluate differences at the > intra-subject level. > > > [image: Inline image 1] > In simpler form, the PLV is implemented in fieldtrip based on this paper Lachaux 1999 . your formular may be right but seem more complex to me. On comparison of two conditions, you dont need to subtract, you can do statistics in fieldtrip or look for the file name *statcond* in fieldtrip or eeglab, very easy to understand and follow. > > > *My second question is:* > > > > In order to do the non-parametric testing, my null hypothesis is that > there are no differences between plv1 and plv2 ( I guess). So I can > randomize trial labels, evaluate plv1 and plv2 again, do this 1000 times > and count the number of times that this difference is bigger than my > original difference, right? > I didnt get your questions here clearly. Meanwhile, randomization is random sequence of random permutation i.e resampling of original data in 1000 times (in this case -plv). > > > *My third and fourth questions concern clustering:* > > In order to do clustering, I should first establish a threshold value for > the metric under evaluation. This may be easy to set if I was using > t-values, but if I am evaluating differences in means, what should be an > appropriate value to use? > > > > Regarding spatial clustering, I now have two levels of “neighbour” > electrodes, right? At the seed level, and at the destination level. How can > these be clustered? I mean, if I consider for example the electrode-pairing > T7-P3, both T9-P3 and T7-P5 will be neighbours… > > > Ofcourse, you need threshold to threshold the graph, otherwise you can computed weighted clustering coefficient. Thresholding depend on you and your data, there are many ways to threshold. You can threshold within certain range or based on distribution of your data. It is better to read more literature on this aspect. > *Lastly,* > > Are these issues already implemented in Fieldtrip or do I have to build my > own MATLAB code for the randomization, thresholding and clustering? > > > Everything implemented in fieldtrip and sometime you need your own initiative. the best things you can do now is to go through tutorials in fieldtrip first. > Thank you so much, > > > > José Rebola > > I hope it helps. > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 17815 bytes Desc: not available URL: From mitka3 at uniba.sk Tue Oct 6 13:17:25 2015 From: mitka3 at uniba.sk (Milan Mitka) Date: Tue, 6 Oct 2015 13:17:25 +0200 Subject: [FieldTrip] Difference ERP source localisation methodology Message-ID: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> Dear FieldTrip users, I'm a master's student at the Comenius University in Bratislava, Slovakia, currently looking into source reconstruction of event-related potentials. I have a quick methodological question regarding the localisation of event-related potentials which are obtained as difference waves – in my case the rotation-related negativity – by subtracting the standard condition (upright stimuli) from experimental conditions (stimuli rotated to a given degree). Should I a) perform the source reconstruction on the averaged data for each condition and trial, or should I b) first subtract the standard condition from all experimental conditions for every trial and then reconstruct the sources? Thank you. Yours faithfully Milan From RICHARDS at mailbox.sc.edu Tue Oct 6 14:28:33 2015 From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN) Date: Tue, 6 Oct 2015 12:28:33 +0000 Subject: [FieldTrip] re sLORETA Message-ID: <266E8F04-EFD6-4B7B-AC62-6F4E45C73118@mailbox.sc.edu> I received an excellent suggestion and some additional information from Vladimir Litvak. The NUTMEG programs have sLORETA, swLORETA, and dSPM MATLAB routines that are compatible with the FT format. They also have routines that duplicate those in FT (e.g., min norm, LCMV, beamformers) I did the following and it appears to work. Any comments welcome. I have fairly simple source inverse problems, eg. simple grand average ERP (and not beamformer, or dynamic EEG). The FT leadfield is a struct that has lf{nsources} elements, each element is a [nchannels p] vector, where nchannels is the number of channels, p is the number of dipole orientations, and nsources is the number of source vertices or grid points. The NM (NUTMEG) leadfield (Lp) is a matrix, [nchannels p nsources] in size. The following is not my complete code… the LF{nsources} references are conceptual, the programming is somewhat different. 1. Convert the FT LF to the NM Lp. There is a NUTMEG nut_ftgridenutsLpvox which is intended to convert the LF to the Lp. It did not work perfectly, I had to adapt it somewhat to make the Lp matrix correctly from the Lf matrix. 2. Do the call to one of the subrouties Eg cfg=[]; cfg.gamma=.05 nmfilter = nut_sLORETA(Lp,data.cov,cfg) 3--the output is a [nchannel 3 sources] matrix. I used this, and the data.avg, to create the FT source output (e.g., each source.avg.mom{nsources} = inverse[nchannels p]' * data.avg; I added the source.avg.pow, and outsource.time=[1:size(outsource.avg.pow,2)]; outsource.inside=grid.inside; outsource.avg.inside=grid.inside; outsource.pos=grid.pos; outsource.avg.pos=grid.pos; outsource.method='average'; %dim is no of unique values in pos outsource.dim=[size(unique(grid.pos(:,1)),1) size(unique(grid.pos(:,2)),1) size(unique(grid.pos(:,3)),1)]; 4—at this point I have a complete “source” struct similar to that created by ft_sourceanalysis, but the mom and pow are generated by the NUT procedure. I suggest someone doing a help or tutorial file for this. I also invite any suggestions from others. 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 nathanweisz at mac.com Tue Oct 6 15:39:05 2015 From: nathanweisz at mac.com (Nathan Weisz) Date: Tue, 06 Oct 2015 15:39:05 +0200 Subject: [FieldTrip] opportunity @cimec Message-ID: <179B0B14-B7AB-4F14-B828-88D2226AB695@mac.com> my colleague david melcher asked me to post this info regarding opportunities in his group. best, nathan —————————— Postdoctoral researcher fellowship in Active Perception Center for Mind/Brain Sciences, University of Trento We anticipate opening one or more positions as part of a EU-funded project to study the role of temporal integration in visual and multisensory The ideal candidate will have experience using MEG/EEG and/or tACS to measure the links between perception and neural oscillations. The candidate must have a PhD in cognitive neuroscience, or a related field, and a strong research record including publications. Expertise with creating stimuli and in analyzing neuroimaging data (preferably MEG/EEG) is required. Additional experience with Matlab, image processing, Fieldtrip or analysis of fixation-related potentials (MEG/EEG) will be an advantage. There is some flexibility in the starting date, with a preference for starting by the beginning of 2016. Informal enquiries regarding the position should be directed to Prof. David Melcher (david.melcher @ unitn.it). For further information about the Active Perception Group, see: http://r.unitn.it/en/cimec/map From Don.Rojas at ucdenver.edu Tue Oct 6 20:24:27 2015 From: Don.Rojas at ucdenver.edu (Rojas, Don) Date: Tue, 6 Oct 2015 18:24:27 +0000 Subject: [FieldTrip] Difference ERP source localisation methodology In-Reply-To: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> References: <9032F013-1EF6-4619-B1E1-4A44EF2E380A@uniba.sk> Message-ID: <56B9E03B-AA7E-4304-9B98-25137B063F7C@ucdenver.edu> Dear Milan, In my opinion you are better off trying to do source analyses on the combined activity to all of your conditions, then finding a way to perform the subtraction in source space or statistically. Doing the subtraction first before the source estimate will likely result in poorer signal to noise for your data and that will have a negative impact on the source reconstruction. Best, Don ------------------------ Don Rojas, Ph.D. Professor of Cognitive Neuroscience Molecular, Cellular and Integrative Neuroscience Program Department of Psychology Colorado State University From helen.wieffering at gmail.com Wed Oct 7 16:59:21 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 7 Oct 2015 10:59:21 -0400 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Message-ID: Dear FieldTrip users, I'm writing to see if any one out there has had success with computing Granger causality measures in FieldTrip. We have been working toward making this analysis possible with our EEG data and have now reached the final stages. However, we find that ft_connectivity_analysis (and ft_connectivity_granger for that matter) offers little guidance on how to achieve a good mvar model fit. For example, the function asks the user to specify the model order without offering tests for whiteness, stationarity, or consistency. It seems that Fieldtrip calls on the BSMART toolbox to perform these operations, which further confuses me given that BSMART itself offers these model validation tests. Yet they don't seem to ever be called upon by FieldTrip. We've considered using the BSMART toolbox separately from FieldTrip, yet the toolbox website is rather outdated and the functions are only compatible through 2008 Matlab - seems like a headache. But without tools for validating the mvar model, we can't be confident of any GC results achieved through FieldTrip. Are there perhaps further connectivity tools in FieldTrip that I've overlooked? Or is it worth looking into other toolboxes? We've also considered SIFT and the MVGC toolbox, but would love to keep working with FieldTrip if possible. If anyone can offer advice, or connect me with someone knowledgeable in this area, I'd love to know. Thanks very much, Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From lysne at unm.edu Wed Oct 7 22:55:10 2015 From: lysne at unm.edu (Per Arnold Lysne) Date: Wed, 7 Oct 2015 20:55:10 +0000 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Message-ID: Hi Helen, I am having good luck with ft_connectivity_analysis in MEG using the nonparametric Granger approach of Dhamala, Rangarajan & Ding, 2008, Neuroimage and Physical Review letters. Thanks, Per Lysne University of New Mexico lysne at unm.edu -----Original Message----- From: Helen Wieffering Sent: Oct 7, 2015 8:59 AM To: FieldTrip discussion list Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis Dear FieldTrip users, I'm writing to see if any one out there has had success with computing Granger causality measures in FieldTrip. We have been working toward making this analysis possible with our EEG data and have now reached the final stages. However, we find that ft_connectivity_analysis (and ft_connectivity_granger for that matter) offers little guidance on how to achieve a good mvar model fit. For example, the function asks the user to specify the model order without offering tests for whiteness, stationarity, or consistency. It seems that Fieldtrip calls on the BSMART toolbox to perform these operations, which further confuses me given that BSMART itself offers these model validation tests. Yet they don't seem to ever be called upon by FieldTrip. We've considered using the BSMART toolbox separately from FieldTrip, yet the toolbox website is rather outdated and the functions are only compatible through 2008 Matlab - seems like a headache. But without tools for validating the mvar model, we can't be confident of any GC results achieved through FieldTrip. Are there perhaps further connectivity tools in FieldTrip that I've overlooked? Or is it worth looking into other toolboxes? We've also considered SIFT and the MVGC toolbox, but would love to keep working with FieldTrip if possible. If anyone can offer advice, or connect me with someone knowledgeable in this area, I'd love to know. Thanks very much, Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 8 08:56:34 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Thu, 8 Oct 2015 06:56:34 +0000 (UTC) Subject: [FieldTrip] ft_realtime_average References: <1197967334.539643.1444287394485.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1197967334.539643.1444287394485.JavaMail.yahoo@mail.yahoo.com> Hi, Can anyone help me to explain what does the 'average' at the line if isempty (average) in ft_realtime_average refer to?Because when I'm using the function ft_realtime_average, an error of 'Undefined variable of average' is shown.I'm doing the realtime processing.  Thank you. Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Sat Oct 10 13:00:08 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Sat, 10 Oct 2015 13:00:08 +0200 (CEST) Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter Message-ID: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> Dear all, I am working on the localization of oscillatory sources using beamforming (http://www.fieldtriptoolbox.org/tutorial/beamformer). The data are recorded with Elekta-Neuromag, the source estimations are based on individual MNI-aligned grids (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), and the FT version is fieldtrip-20150701. And I have two main issues, which would be very appreciated if someone could help me with: 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. Should I make additional normalization prior to / in the creation of the individual grid? I found this link which is specific to Neuromag data but it says is outdated (?). http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space Or should I interpolate the source estimation to the template, instead of to the individual-mri? When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? Any comment would be very helpful! Thank you in advance, All the best, Sara %% %% Interpolation, normalization and grandaverage load source mri_real template source.pos=template_grid.pos; % right(?) cfg = []; cfg.downsample = 2; cfg.parameter = 'pow'; sourceInt = ft_sourceinterpolate(cfg, source, mri_real); cfg = []; cfg.spmversion = 'spm8'; %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". % However should be one taken by default and unablinginn it works fine so it is confussing (?) sourceIntNorm = ft_volumenormalise(cfg, sourceInt); %% grand average for 7 subjects cfg=[]; cfg.parameter = 'pow'; [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); %% %% -------------- next part -------------- A non-text attachment was scrubbed... Name: gravg_int_templ.jpg Type: image/jpeg Size: 23790 bytes Desc: not available URL: From tzvetan.popov at uni-konstanz.de Sat Oct 10 14:53:33 2015 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 10 Oct 2015 14:53:33 +0200 Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> Message-ID: <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> Hi Sara, 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify source.pos = template_grid.pos source.pnt = template_grid.pos After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. 2.) Yes, ideally all appended. good luck, Tzvetan > Dear all, > > I am working on the localization of oscillatory sources using beamforming > (http://www.fieldtriptoolbox.org/tutorial/beamformer). > The data are recorded with Elekta-Neuromag, > the source estimations are based on individual MNI-aligned grids > (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), > and the FT version is fieldtrip-20150701. > > And I have two main issues, which would be very appreciated if someone could help me with: > > 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. > > Should I make additional normalization prior to / in the creation of the individual grid? > I found this link which is specific to Neuromag data but it says is outdated (?). > http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space > > Or should I interpolate the source estimation to the template, instead of to the individual-mri? > When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). > > 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), > should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? > > > Any comment would be very helpful! > > Thank you in advance, > > All the best, > > Sara > > %% > > %% Interpolation, normalization and grandaverage > > load source mri_real template > > source.pos=template_grid.pos; % right(?) > > cfg = []; > cfg.downsample = 2; > cfg.parameter = 'pow'; > sourceInt = ft_sourceinterpolate(cfg, source, mri_real); > > cfg = []; > cfg.spmversion = 'spm8'; > %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; > % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". > % However should be one taken by default and unablinginn it works fine so it is confussing (?) > sourceIntNorm = ft_volumenormalise(cfg, sourceInt); > > %% grand average for 7 subjects > > cfg=[]; > cfg.parameter = 'pow'; > [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); > > %% > > %% > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Sat Oct 10 15:29:54 2015 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 10 Oct 2015 15:29:54 +0200 Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> Message-ID: <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> Sorry second line should read source.pnt =template_grid.pnt > Am 10.10.2015 um 14:53 schrieb Tzvetan Popov : > > Hi Sara, > 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify > source.pos = template_grid.pos > source.pnt = template_grid.pos > After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. > > 2.) Yes, ideally all appended. > > good luck, > Tzvetan > > >> Dear all, >> >> I am working on the localization of oscillatory sources using beamforming >> (http://www.fieldtriptoolbox.org/tutorial/beamformer). >> The data are recorded with Elekta-Neuromag, >> the source estimations are based on individual MNI-aligned grids >> (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), >> and the FT version is fieldtrip-20150701. >> >> And I have two main issues, which would be very appreciated if someone could help me with: >> >> 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. >> >> Should I make additional normalization prior to / in the creation of the individual grid? >> I found this link which is specific to Neuromag data but it says is outdated (?). >> http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> Or should I interpolate the source estimation to the template, instead of to the individual-mri? >> When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). >> >> 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), >> should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? >> >> >> Any comment would be very helpful! >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> %% >> >> %% Interpolation, normalization and grandaverage >> >> load source mri_real template >> >> source.pos=template_grid.pos; % right(?) >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'pow'; >> sourceInt = ft_sourceinterpolate(cfg, source, mri_real); >> >> cfg = []; >> cfg.spmversion = 'spm8'; >> %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; >> % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". >> % However should be one taken by default and unablinginn it works fine so it is confussing (?) >> sourceIntNorm = ft_volumenormalise(cfg, sourceInt); >> >> %% grand average for 7 subjects >> >> cfg=[]; >> cfg.parameter = 'pow'; >> [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); >> >> %% >> >> %% >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 rmontefusco at med.uchile.cl Tue Oct 13 17:59:33 2015 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Tue, 13 Oct 2015 11:59:33 -0400 Subject: [FieldTrip] Negative values of debiased wPLI In-Reply-To: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> References: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hello...anybody any guess, explanation? I getting some too...close to zero thought, but still negatives. On Mon, Feb 16, 2015 at 9:09 AM, Marta Bortoletto < marta.bortoletto at cognitiveneuroscience.it> wrote: > Dear Community, > I am using the debiased wPLI to estimate connectivity between 70 EEG > electrodes. I have about 150 trials for each subject. I noticed that some > values of my 70x70 dwPLI matrix are negative. My understanding is that all > values should be between 0 and 1, but for some reason I can get negative > values from the debiasing process. My question is: Shall I calculate the > absolute value of these negative values? Otherwise what shall I do with > them? > > Thank you in advance for your help. > Marta > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Wed Oct 14 02:21:21 2015 From: russgport at gmail.com (russ port) Date: Tue, 13 Oct 2015 20:21:21 -0400 Subject: [FieldTrip] unit gain for Fieldtrip's LCMV beamformer - unit In-Reply-To: References: <2A2B6A5B8C4C174CBCCE0B45E548DEB22A0D8A9B@SKMBXX01.sickkids.ca> Message-ID: <5BA1F9A7-4285-467C-9560-0667E1CCC6A4@gmail.com> Hi All, As an update to this post, which I fear may be otherwise left alone, it seems that the Wiki now states that the virtual channel with be of "the equivalent current dipole source” (http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors ). I assume then if its a ECD ("equivalent current dipole”) is in A(what ever the source model is in i.e. Am, or Am etc etc). Therefore you should just be converting to your units of choice (for me nAm). Does this seem correct? Best, Russ > On Sep 29, 2015, at 10:54 PM, russ port wrote: > > Thanks Marc, > > Sorry for taking so long to respond. I am quite confused now. I think I get what you are talking about with "unit gain" and "unit noise-gain” as defined by Sekihara, as much as I can make out at least with out having the book you refer to (on the bright side I now know what to nag my boss for). I suppose I was a quite mis-leading with what I had in my last email, by which, what I actually did was use the LCMV beamformer to make lead fields to calculate the virtual sensors (see http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors ). Of note, your link to the discussion list is now even more useful. I am using centimeters and a single shell head model. The wiki says "CMV beamformer spatial filter for the location of interest will pass the activity at that location with unit-gain”. From your email, I suspect then that the output would be in Am units. I am a little concerned though that both my output, and the field trip wiki shows values ranging ~ -3 -> 3 (e-4, i.e. mAm not nAm). Or instead would the units be in T/(Am) (if I apply the 1e4 unit conversion). Sorry for not being better at this, I think I do need those books you were mentioning... > > Best, > Russ > > > > > >> On Sep 11, 2015, at 12:40 PM, Marc Lalancette > wrote: >> >> mformer with unit gain would have Am units. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zsoltturi at gmail.com Wed Oct 14 08:20:24 2015 From: zsoltturi at gmail.com (Zsolt Turi) Date: Wed, 14 Oct 2015 08:20:24 +0200 Subject: [FieldTrip] =?utf-8?q?conference_in_G=C3=B6ttingen?= Message-ID: Dear All, On behalf of the program committee it is my great pleasure to invite you to the “Theory and Practice of Transcranial Brain Stimulation (TMS, tDCS/tACS)” that will be held in the University Medical Center, Göttingen, Germany from the 9th – 10th of February 2016. The Conference is being organized by the Department of Clinical Neurophysiology, Georg-August University, Göttingen, Germany. Our laboratory plays a central role in non-invasive brain stimulation researchers for more than 15 years. Our goal is to deliver an outstanding program with the right balance of basic scientific and clinical relevance, which covers the entire spectrum of physiological, methodological, modelling, practice and ethical issues in non-invasive brain stimulation research. The entire conference will be held in English, therefore, it is imperative that the attendants are able to understand and communicate in English. We believe that participants will benefit from the high value scientific program. We would suggest you to register for the conference and make arrangements for travel and stay. Register soon (see attachement) and confirm your participation, as only 50 participants are accepted: First register & pay, first accepted. Yours sincerely, Zsolt Turi (Ph.D.) Post-doctoral Research Fellow Department of Clinical Neurophysiology Georg-August University, Göttingen Robert-Koch-Str. 40 37075 Goettingen -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: GöttingenRegistration_2016.pdf Type: application/pdf Size: 82954 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NWGProgram_2016.pdf Type: application/pdf Size: 368112 bytes Desc: not available URL: From n.komeilipoor at vu.nl Wed Oct 14 09:29:04 2015 From: n.komeilipoor at vu.nl (Komeilipoor, N.) Date: Wed, 14 Oct 2015 07:29:04 +0000 Subject: [FieldTrip] =?windows-1252?q?conference_in_G=F6ttingen?= In-Reply-To: References: Message-ID: Ciao Ivan, Tutto bene. Certo! allora ci sentiamo venerdi, per te va bene alle 5 pm (Italy time)? ________________________________ Van: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] namens Zsolt Turi [zsoltturi at gmail.com] Verzonden: woensdag 14 oktober 2015 8:20 Aan: FieldTrip discussion list Onderwerp: [FieldTrip] conference in Göttingen Dear All, On behalf of the program committee it is my great pleasure to invite you to the “Theory and Practice of Transcranial Brain Stimulation (TMS, tDCS/tACS)” that will be held in the University Medical Center, Göttingen, Germany from the 9th – 10th of February 2016. The Conference is being organized by the Department of Clinical Neurophysiology, Georg-August University, Göttingen, Germany. Our laboratory plays a central role in non-invasive brain stimulation researchers for more than 15 years. Our goal is to deliver an outstanding program with the right balance of basic scientific and clinical relevance, which covers the entire spectrum of physiological, methodological, modelling, practice and ethical issues in non-invasive brain stimulation research. The entire conference will be held in English, therefore, it is imperative that the attendants are able to understand and communicate in English. We believe that participants will benefit from the high value scientific program. We would suggest you to register for the conference and make arrangements for travel and stay. Register soon (see attachement) and confirm your participation, as only 50 participants are accepted: First register & pay, first accepted. Yours sincerely, Zsolt Turi (Ph.D.) Post-doctoral Research Fellow Department of Clinical Neurophysiology Georg-August University, Göttingen Robert-Koch-Str. 40 37075 Goettingen -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.aurtenetxe at bcbl.eu Wed Oct 14 10:40:24 2015 From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe) Date: Wed, 14 Oct 2015 10:40:24 +0200 (CEST) Subject: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter In-Reply-To: <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> References: <1211466317.450795.1444474808390.JavaMail.zimbra@bcbl.eu> <4C78F71F-FD0A-418F-9553-ADDAE4FBEF94@uni-konstanz.de> <9D0F3CEE-FADC-474B-A49E-FE4E4841435D@uni-konstanz.de> Message-ID: <1789381146.505725.1444812024740.JavaMail.zimbra@bcbl.eu> Hi Tzvetan, Sorry for taking that long to respond. Thank you for your answers! 1. As far as I observed, it is sufficient to specify source.pos = template_grid.pos, for the grandaverage and stats. Then interpolate the source estimation with the template. 2. Thanks! All the best, Sara Sara Aurtenetxe ----- Original Message ----- From: "Tzvetan Popov" To: "FieldTrip discussion list" Sent: Saturday, October 10, 2015 3:29:54 PM Subject: Re: [FieldTrip] Issues with: Sourcegrandaverage & Spatial Common Filter Sorry second line should read source.pnt =template_grid.pnt > Am 10.10.2015 um 14:53 schrieb Tzvetan Popov : > > Hi Sara, > 1. The error stems from the fact that all dipole locations and their positions are warped in individual anatomy. After each individual source reconstruction you have to specify > source.pos = template_grid.pos > source.pnt = template_grid.pos > After this you can use ft_sourcegrandaverage, ft_sourcestatistics etc. > > 2.) Yes, ideally all appended. > > good luck, > Tzvetan > > >> Dear all, >> >> I am working on the localization of oscillatory sources using beamforming >> (http://www.fieldtriptoolbox.org/tutorial/beamformer). >> The data are recorded with Elekta-Neuromag, >> the source estimations are based on individual MNI-aligned grids >> (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), >> and the FT version is fieldtrip-20150701. >> >> And I have two main issues, which would be very appreciated if someone could help me with: >> >> 1. When SOURCEGRANDAVERAGING, "ERROR: the input sources vary in the field inside". Below this message you can see the code I am using. >> >> Should I make additional normalization prior to / in the creation of the individual grid? >> I found this link which is specific to Neuromag data but it says is outdated (?). >> http://www.fieldtriptoolbox.org/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space >> >> Or should I interpolate the source estimation to the template, instead of to the individual-mri? >> When doing so (without after normalizing it), everything works fine but my plots looks like attached (grandavg of 7 subjects). >> >> 2. When creating a SPATIAL COMMON FILTER for comparing the Post stimulus sources of two conditions (effects were baseline corrected within condition in sensor space), >> should the Allappended input data include the Post-stimulus and Pre-stimulus intervals of each condition (e.g. PrestimA + PrestimB + PoststimA + PoststimB)? >> >> >> Any comment would be very helpful! >> >> Thank you in advance, >> >> All the best, >> >> Sara >> >> %% >> >> %% Interpolation, normalization and grandaverage >> >> load source mri_real template >> >> source.pos=template_grid.pos; % right(?) >> >> cfg = []; >> cfg.downsample = 2; >> cfg.parameter = 'pow'; >> sourceInt = ft_sourceinterpolate(cfg, source, mri_real); >> >> cfg = []; >> cfg.spmversion = 'spm8'; >> %cfg.template = '~/fieldtrip/external/spm8/templates/T1.nii'; >> % When enabling this parameter i get this error: "the head coordinate system of the template does not seem to be correspond with the mni/spm convention". >> % However should be one taken by default and unablinginn it works fine so it is confussing (?) >> sourceIntNorm = ft_volumenormalise(cfg, sourceInt); >> >> %% grand average for 7 subjects >> >> cfg=[]; >> cfg.parameter = 'pow'; >> [grandavg] = ft_sourcegrandaverage(cfg, sourceIntNorm{:}); >> >> %% >> >> %% >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 maity_winky at yahoo.es Wed Oct 14 11:31:51 2015 From: maity_winky at yahoo.es (=?UTF-8?Q?Mait=C3=A9_Crespo_Garc=C3=ADa?=) Date: Wed, 14 Oct 2015 09:31:51 +0000 (UTC) Subject: [FieldTrip] Nonlinear normalization/MNI grid distortions References: <1945557667.185319.1444815111622.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1945557667.185319.1444815111622.JavaMail.yahoo@mail.yahoo.com> Dear community, I performed nonlinear normalizations and plotted theresulting MRIs. I noticed the normalized MRIs had unwanted distortions, and wereclearly different from the normalized MRIs obtained directly in SPM. I noticed the default parameters (flags) in Fieldtrip’s spm_normalise()are different from SPM’s spm_normalise(). In Fieldtrip, the amount of regularizationis too low (= 0.1, line 144 in spm_normalise) compared with SPM’sdefault (=1). This may be a problem not only for normalization but whencomputing MNI-aligned individual grids following the tutorial (“CreateMNI-aligned grids in individual”) because there is an implicit normalizationstep. Possible solutions: -         Call/substitute Fieldtrip’s spm_normalise() bySPM’s function or change Fieldtrip’s default flags values.-         Perform the normalization outside in SPM andprovide the cfg.spmparams.flags. However, there is a bug in ft_volumenormalise()using that option. I think it may be because the flags are not passed to spm_normalise(line 239). As a fix, I have modified the function with the lines below. Butsurely there is a more direct way to avoid the problem.VF        =spm_vol([cfg.intermediatename,'_anatomy.img']);params    =spm_normalise(VG,VF,[],[],[],cfg.spmparams.flags); I wish this report helps.  Best regards,Maité -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 15 08:42:21 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Thu, 15 Oct 2015 06:42:21 +0000 (UTC) Subject: [FieldTrip] segementation based on external trigger References: <1117284429.535148.1444891341551.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1117284429.535148.1444891341551.JavaMail.yahoo@mail.yahoo.com> Hi, I'm doing the EEG realtime processing using TMSI and I want to segment the eeg signal based on the trigger. My questions are: 1) How can I do that in fieldtrip?2) I'm using ft_realtime_average and ft_realtime_selectiveaverage to average the eeg signal, however, there is error shown.    Error using ft_checkconfig(line 153)    The field cfg.datafile is required.    The field cfg.headefile is required.     Thanks.  Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Fri Oct 16 09:28:54 2015 From: joramvandriel at gmail.com (Joram van Driel) Date: Fri, 16 Oct 2015 09:28:54 +0200 Subject: [FieldTrip] Negative values of debiased wPLI In-Reply-To: References: <1260984826.7627092.1424095740727.JavaMail.yahoo@mail.yahoo.com> Message-ID: Hi Marta, It's correct that you can get negative values with dwPLI compared to classic PLI, it's indeed due to the debiasing procedure which involves a linear subtraction. What you want to do with it, depends on how you want to evaluate statistical significance. I wouldn't take the absolute values, though. - You could add a fixed value to all dwPLI values to have everything above zero with a fixed shift, then do a baseline correction such as percent signal change or dB (which you can't do with negative numbers). This is a bit crude though, and I actually wonder whether it's "allowed". - Just use the values as they are, with some being negative, if you want do condition comparisons, and use permutation testing with condition label shuffling at the group level to asses statistical difference between conditions. - Convert the dwPLI values to a z-score within-subject through permutation testing, where you shuffle one phase-angle vector of one of the two channels with respect to the other in e.g. 1000 permutations, thereby creating a null-distribution under the null-hypothesis of chance-level dwPLI, to which you can compare you're observed dwPLI. This approach is blind to the fact that some values are negative. How/what you shuffle depends on whether you compute dwPLI over trials or over time. Good luck, Joram On Tue, Oct 13, 2015 at 5:59 PM, Rodrigo Montefusco < rmontefusco at med.uchile.cl> wrote: > Hello...anybody any guess, explanation? I getting some too...close to zero > thought, but still negatives. > > On Mon, Feb 16, 2015 at 9:09 AM, Marta Bortoletto < > marta.bortoletto at cognitiveneuroscience.it> wrote: > >> Dear Community, >> I am using the debiased wPLI to estimate connectivity between 70 EEG >> electrodes. I have about 150 trials for each subject. I noticed that some >> values of my 70x70 dwPLI matrix are negative. My understanding is that all >> values should be between 0 and 1, but for some reason I can get negative >> values from the debiasing process. My question is: Shall I calculate the >> absolute value of these negative values? Otherwise what shall I do with >> them? >> >> Thank you in advance for your help. >> Marta >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, PhD Postdoc @ Vrije Universiteit Amsterdam Cognitive Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Fri Oct 16 20:10:37 2015 From: balperin07 at gmail.com (Brittany Alperin) Date: Fri, 16 Oct 2015 14:10:37 -0400 Subject: [FieldTrip] average of frequency band Message-ID: Hello I'm importing my already preprocessed data from eeglab and want to run an FFT. I'm using cfg.foilim to specify my frequencies of interest, but the output is in .5 Hz increments rather than just an average over the frequency band. I've tried using a colon instead of a space and I've tried using cfg.foi. Could anyone tell me how to get an average power rather than the power at each frequency? Here's my code for reference: cfg = []; cfg.method = 'mtmfft'; %run an fft cfg.taper = 'hanning'; %chose a hanning window cfg.foilim = [8 13]; %frequencies of interest. In this case, alpha cfg.output = 'pow'; %output in power Brittany Alperin Graduate Student, Behavioral Neuroscience Oregon Health and Science University Portland, OR -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Sat Oct 17 18:17:06 2015 From: wanamirahwanazlan at yahoo.com (Wan Amirah W Azlan) Date: Sat, 17 Oct 2015 16:17:06 +0000 (UTC) Subject: [FieldTrip] help ft_read_event References: <905698521.1529786.1445098626610.JavaMail.yahoo@mail.yahoo.com> Message-ID: <905698521.1529786.1445098626610.JavaMail.yahoo@mail.yahoo.com> Hi, I'm trying to read the triggers from my eeg channel, however it turn out, the trigger cannot be read.I'm using the coding, event = ft_read_event ( 'buffer://localhost:1972' )But, when I'm using the ft_realtime_signalviewer, the trigger are shown in the figure.How is that so? Anyone can help me? Thanks a lot. Regards,Wan Amirah binti W Azlan,Postgraduate student,Universiti Teknikal Malaysia Melaka,Hang Tuah Jaya, 76100 Durian Tunggal,  Melaka, Malaysia.Tel (H/P): +60193702134 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Mon Oct 19 22:14:42 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 13:14:42 -0700 Subject: [FieldTrip] open position @donders Message-ID: Dear all, There's an open position (phd candidate, but postdocs are also welcome to apply I believe) at the donders centre for cognitive neuroimaging, the netherlands. The project is on the neural mechanisms underlying emotional control, and involves a combination of leading experts in their respective fields. What's more, this is the same site where fieldtrip is being supported. 1 + 1 = 2. For more information: http://www.ru.nl/overons/werken-radboud/details/details_vacature_0/?recid=561663 Yours, Arjen -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Mon Oct 19 23:25:30 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 17:25:30 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Message-ID: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Oct 20 00:01:20 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 15:01:20 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > Dear FieldTrip users, > > This is Xiaoming from University of Maryland Baltimore. My current project > requires to calculate behavioral-power correlation across subjects. Similar > topic was discussed here early this year. > http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html > > According to the suggestions in above mentioned thread, I duplicate my > power dataset and replace the power values at each time-frequency point > with behavioral data. Therefore, those two datasets have same structure and > dimension. I used the following script to test if there are significant > clusters of correlations. > > cfg = []; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'ft_statfun_correlationT'; > ... > etc > ... > design = zeros(2, n1 * 2); % n1 is the number of subjects. > design(1,1:n1) = 1; > design(1,(n1 + 1):(n1 * 2)) = 2; > design(2, :) = [[1:n1 ] [1 : n1]]; > cfg.design = design; > > cfg.ivar = 1; > cfg.uvar = 2; > stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); > > > However, it seems when each time the design matrix is permuted, FieldTrip > is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar > remains the same while cfg.ivar (1 or 2) is randomly assigned to each > subject in design matrix. Although I confirmed this by uncommenting line > 313 (i.e., tmpdesign = design(:,resample(i,:))) in > ft_statistics_montecarlo.m which allows to display the permuted design > matrix in command line, please correct me if this is not the case. > > In my mind, this kind of permutation will cause trouble when dealing with > correlation. For example, in my case, the behavioral data and power data > have different scales. The power data are much larger than behavioral data > in general. When assigning behavioral data into power group or vice versa, > it will induce huge negative correlations between power and behavioral > measurement. Therefore, no negative clusters will survive from permutation > test. > > Please let me know if I have mis-understanding or if I did anything wrong. > Any suggestions will be highly appreciated! > > Thanks. > > Xiaoming > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Tue Oct 20 00:20:13 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 18:20:13 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: <5625345D020000DC00015E6A@MPRC.UMARYLAND.EDU> Hi Arjen, Sorry for the confusion. The stat.rho matrix is similar to the one I calculated using corr. My questions is about the permutation method and the correlation matrix after each permutation for calculating cluster distribution. The permutation method seems interacting with correlation (but not with t tests). Looking forward to your suggestions. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Oct 20 00:33:46 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 15:33:46 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming, Thanks for clarifying. Could you perhaps provide an (replicable) example on how 'the permutation method interacts with the correlations'? Yours, Arjen 2015-10-19 15:20 GMT-07:00 Xiaoming Du : > Hi Arjen, > > Sorry for the confusion. > > The stat.rho matrix is similar to the one I calculated using corr. > > My questions is about the permutation method and the correlation matrix > after each permutation for calculating cluster distribution. The > permutation method seems interacting with correlation (but not with t > tests). > > Looking forward to your suggestions. > > Xiaoming > > >>> Arjen Stolk 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations > be independent of the scaling of the two variables? Looking at the code of > ft_statfun_correlationT it doesn't seem the conversion from correlation to > T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in > a direction change either. Perhaps you could try to first manually > calculate a correlation between signal power and behavioral power, and see > whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > >> Dear FieldTrip users, >> This is Xiaoming from University of Maryland Baltimore. My current >> project requires to calculate behavioral-power correlation across subjects. >> Similar topic was discussed here early this year. >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >> According to the suggestions in above mentioned thread, I duplicate my >> power dataset and replace the power values at each time-frequency point >> with behavioral data. Therefore, those two datasets have same structure and >> dimension. I used the following script to test if there are significant >> clusters of correlations. >> cfg = []; >> cfg.parameter = 'powspctrm'; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'ft_statfun_correlationT'; >> ... >> etc >> ... >> design = zeros(2, n1 * 2); % n1 is the number of subjects. >> design(1,1:n1) = 1; >> design(1,(n1 + 1):(n1 * 2)) = 2; >> design(2, :) = [[1:n1 ] [1 : n1]]; >> cfg.design = design; >> >> cfg.ivar = 1; >> cfg.uvar = 2; >> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >> However, it seems when each time the design matrix is permuted, FieldTrip >> is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar >> remains the same while cfg.ivar (1 or 2) is randomly assigned to each >> subject in design matrix. Although I confirmed this by uncommenting line >> 313 (i.e., tmpdesign = design(:,resample(i,:))) in >> ft_statistics_montecarlo.m which allows to display the permuted design >> matrix in command line, please correct me if this is not the case. >> In my mind, this kind of permutation will cause trouble when dealing with >> correlation. For example, in my case, the behavioral data and power data >> have different scales. The power data are much larger than behavioral data >> in general. When assigning behavioral data into power group or vice versa, >> it will induce huge negative correlations between power and behavioral >> measurement. Therefore, no negative clusters will survive from permutation >> test. >> Please let me know if I have mis-understanding or if I did anything >> wrong. Any suggestions will be highly appreciated! >> Thanks. >> Xiaoming >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Tue Oct 20 00:56:51 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Mon, 19 Oct 2015 18:56:51 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> Message-ID: <56253CF3020000DC00015E70@MPRC.UMARYLAND.EDU> For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Oct 20 08:03:02 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 19 Oct 2015 23:03:02 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du : > For example, our power values ranged from 1 to 3 (after log transform); my > behavioral data ranged from 20 to 90; > > by using above mentioned script, there are 14 negative clusters were > reported in variable stat. > > stat = > > prob: [30x50 double] > posclusters: [] > posclusterslabelmat: [30x50 double] > posdistribution: [1x1000 double] > negclusters: [1x14 struct] > negclusterslabelmat: [30x50 double] > negdistribution: [1x1000 double] > cirange: [30x50 double] > mask: [30x50 logical] > stat: [30x50 double] > ref: [30x50 double] > rho: [30x50 double] > dimord: 'chan_freq' > freq: [1x50 double] > label: {30x1 cell} > time: 2.5000 > cfg: [1x1 struct] > > However, the p values of those clusters (i.e., stat.negclusters.prob) are > all ones. The smallest value in stat.negdistribution is way larger than > the largest negative cluster t-sum. This could be real. However, it is more > likely due to the shuffle between power and behavioral group. For example, > design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 > 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, > their power data was labeled as behavioral data and vice versa. Because of > the scale difference between power and behavioral data, large negative > correlations were generated by permutation. This further biased the cluster > distribution. > My limited understanding is that, for correlation, each permutation should > fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute > design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 > 4 4 2 3 1]. THerefore, after permutation, one subject's power data > corresponds to another subject's behavioral data. > > I am not good at statistics. It will be really appreciated if you have any > suggestions or comments. > > Xiaoming > > > > > >>> Arjen Stolk 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations > be independent of the scaling of the two variables? Looking at the code of > ft_statfun_correlationT it doesn't seem the conversion from correlation to > T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in > a direction change either. Perhaps you could try to first manually > calculate a correlation between signal power and behavioral power, and see > whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du : > >> Dear FieldTrip users, >> This is Xiaoming from University of Maryland Baltimore. My current >> project requires to calculate behavioral-power correlation across subjects. >> Similar topic was discussed here early this year. >> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >> According to the suggestions in above mentioned thread, I duplicate my >> power dataset and replace the power values at each time-frequency point >> with behavioral data. Therefore, those two datasets have same structure and >> dimension. I used the following script to test if there are significant >> clusters of correlations. >> cfg = []; >> cfg.parameter = 'powspctrm'; >> cfg.method = 'montecarlo'; >> cfg.statistic = 'ft_statfun_correlationT'; >> ... >> etc >> ... >> design = zeros(2, n1 * 2); % n1 is the number of subjects. >> design(1,1:n1) = 1; >> design(1,(n1 + 1):(n1 * 2)) = 2; >> design(2, :) = [[1:n1 ] [1 : n1]]; >> cfg.design = design; >> >> cfg.ivar = 1; >> cfg.uvar = 2; >> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >> However, it seems when each time the design matrix is permuted, FieldTrip >> is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar >> remains the same while cfg.ivar (1 or 2) is randomly assigned to each >> subject in design matrix. Although I confirmed this by uncommenting line >> 313 (i.e., tmpdesign = design(:,resample(i,:))) in >> ft_statistics_montecarlo.m which allows to display the permuted design >> matrix in command line, please correct me if this is not the case. >> In my mind, this kind of permutation will cause trouble when dealing with >> correlation. For example, in my case, the behavioral data and power data >> have different scales. The power data are much larger than behavioral data >> in general. When assigning behavioral data into power group or vice versa, >> it will induce huge negative correlations between power and behavioral >> measurement. Therefore, no negative clusters will survive from permutation >> test. >> Please let me know if I have mis-understanding or if I did anything >> wrong. Any suggestions will be highly appreciated! >> Thanks. >> Xiaoming >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonas at obleser.de Tue Oct 20 13:07:51 2015 From: jonas at obleser.de (Jonas Obleser) Date: Tue, 20 Oct 2015 06:07:51 -0500 Subject: [FieldTrip] Call for new post docs in the Obleser lab | Auditory Cognition Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8@obleser.de> The research group “Auditory Cognition” (headed by Jonas Obleser; auditorycognition.com), now at the University of Lübeck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. These positions fall into the larger framework of an ERC Consolidator grant “The listening challenge: How ageing brains adapt” (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 Note the application deadline of November 12 (postal receipt). http://auditorycognition.com http://uni-luebeck.de From thomas.wunderle at esi-frankfurt.de Tue Oct 20 16:58:25 2015 From: thomas.wunderle at esi-frankfurt.de (Wunderle, Thomas) Date: Tue, 20 Oct 2015 14:58:25 +0000 Subject: [FieldTrip] Spectrum normalization Message-ID: <27E5CAD9145EEC41BB9B34C01716A198880C3CD4@UM-excdag-a02.um.gwdg.de> Hi all, I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. This is important for me, because I need the absolute value of the spectrum for a publication. I was scanning through the code trying to find the normalization steps. In particular, I don't understand the following steps: 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) What is the rationale of dividing through this special norm of the taper itself? 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: dum = dum .* sqrt(2 ./ endnsample); (line 251) Later on, to get to the power spectrum, the abs of the spectrum is taken and squared powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) This puzzles me, because scanning through the literature, the power spectrum should be given by (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) and the PSD by (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: sqrt(PSD) -> unit: V/sqrt(Hz) which is still different from (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) The result of these equations are different from what comes out of the FieldTrip code. So what is the unit of the spectrum in FieldTrip? What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? It would help me a lot if someone could clarify these points. Thanks in advance, Thomas ----- Dr. Thomas Wunderle Ernst Strüngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel: +49 69 96769 516 Fax: +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Geschäftsführer: Prof. Dr. Pascal Fries -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Wed Oct 21 10:30:07 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Wed, 21 Oct 2015 10:30:07 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair Message-ID: Dear all, I’m trying to do interpolation to repair some bad channels, but I’m getting the error below. I've read the ft_fetch_sens help but I don’t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) From jorn at artinis.com Wed Oct 21 10:42:03 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Wed, 21 Oct 2015 10:42:03 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> Dear Grazia, try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. Best, Jörn -- Jörn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I’m trying to do interpolation to repair some bad channels, but I’m getting > the error below. > I've read the ft_fetch_sens help but I don’t understand how I should specify > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From g.dipisa at gmail.com Wed Oct 21 12:27:40 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Wed, 21 Oct 2015 12:27:40 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: Hi Jörn, Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. Any other suggestions? thanks, ~ grazia > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. > > These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >> Sent: Wednesday, October 21, 2015 10:30 AM >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting >> the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should specify >> the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 59, Issue 17 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Wed Oct 21 14:16:10 2015 From: jorn at artinis.com (=?utf-8?Q?J=C3=B6rn_M._Horschig?=) Date: Wed, 21 Oct 2015 14:16:10 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <002301d10bfa$45d6a740$d183f5c0$@artinis.com> Hi Grazia, uh, jah, my bad, try cfg.elec instead ;) 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 Grazia Di Pisa Sent: Wednesday, October 21, 2015 12:28 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Interpolation and ft_channelrepair Hi Jörn, Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. Any other suggestions? thanks, ~ grazia On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Call for new post docs in the Obleser lab | Auditory Cognition (Jonas Obleser) 2. Spectrum normalization (Wunderle, Thomas) 3. Interpolation and ft_channelrepair (Grazia Di Pisa) 4. Re: Interpolation and ft_channelrepair (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) ---------------------------------------------------------------------- Message: 1 Date: Tue, 20 Oct 2015 06:07:51 -0500 From: Jonas Obleser > To: fieldtrip at science.ru.nl , AUDITORY at LISTS.MCGILL.CA Subject: [FieldTrip] Call for new post docs in the Obleser lab | Auditory Cognition Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de > Content-Type: text/plain; charset=utf-8 The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 Note the application deadline of November 12 (postal receipt). http://auditorycognition.com http://uni-luebeck.de ------------------------------ Message: 2 Date: Tue, 20 Oct 2015 14:58:25 +0000 From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl " > Subject: [FieldTrip] Spectrum normalization Message-ID: <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de > Content-Type: text/plain; charset="iso-8859-1" Hi all, I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. This is important for me, because I need the absolute value of the spectrum for a publication. I was scanning through the code trying to find the normalization steps. In particular, I don't understand the following steps: 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) What is the rationale of dividing through this special norm of the taper itself? 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: dum = dum .* sqrt(2 ./ endnsample); (line 251) Later on, to get to the power spectrum, the abs of the spectrum is taken and squared powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) This puzzles me, because scanning through the literature, the power spectrum should be given by (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) and the PSD by (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: sqrt(PSD) -> unit: V/sqrt(Hz) which is still different from (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) The result of these equations are different from what comes out of the FieldTrip code. So what is the unit of the spectrum in FieldTrip? What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? It would help me a lot if someone could clarify these points. Thanks in advance, Thomas ----- Dr. Thomas Wunderle Ernst Str?ngmann Institute (ESI) for Neuroscience in Cooperation with Max Planck Society Deutschordenstrasse 46 60528 Frankfurt am Main, Germany www.esi-frankfurt.de thomas.wunderle at esi-frankfurt.de Tel: +49 69 96769 516 Fax: +49 69 96769 555 Sitz der Gesellschaft: Frankfurt am Main Registergericht: Amtsgericht Frankfurt - HRB 84266 Gesch?ftsf?hrer: Prof. Dr. Pascal Fries -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Wed, 21 Oct 2015 10:30:07 +0200 From: Grazia Di Pisa > To: fieldtrip at science.ru.nl Subject: [FieldTrip] Interpolation and ft_channelrepair Message-ID: > Content-Type: text/plain; charset=utf-8 Dear all, I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) ------------------------------ Message: 4 Date: Wed, 21 Oct 2015 10:42:03 +0200 From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com > Content-Type: text/plain; charset="UTF-8" Dear Grazia, try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. Best, J?rn -- J?rn M. Horschig, PhD, Software Engineer Artinis Medical Systems | +31 481 350 980 -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- bounces at science.ru.nl ] On Behalf Of Grazia Di Pisa Sent: Wednesday, October 21, 2015 10:30 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] Interpolation and ft_channelrepair Dear all, I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. Is there a file I should upload or am I missing something in my code? Any help or hint is very much appreciated! thanks in advance, ~ grazia // Error using ft_fetch_sens (line 183) no electrodes or gradiometers specified. Error in ft_channelrepair (line 115) sens = ft_fetch_sens(cfg, data); Error in new_analyse_GDP (line 42) ft_channelrepair(cfg, data) // This is my code: 15 cfg = []; 16 cfg_neighb = []; 17 cfg_neighb.method = 'triangulation'; 18 cfg.senstype = 'EEG'; 19 cfg_neighb.layout = 'biosemi64.lay'; 20 neighbours = ft_prepare_neighbours(cfg_neighb); 21 22 cfg.neighbours = neighbours; 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; 24 cfg.feedback = 'yes'; 25 cfg.layout = 'biosemi64.lay'; 26 lay = ft_prepare_layout(cfg); 27 28 sens = data; 29 sens.type = 'eeg'; 30 sens.label = lay.label; 31 sens.chanpos = lay.pos; 32 sens.chanpos(:,3) = 0; 33 34 ft_neighbourplot(cfg, data) 35 36 cfg = []; 37 cfg.method = 'nearest'; 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; 39 cfg.neighbours = neighbours; 40 cfg.trials = 'all'; 41 42 ft_channelrepair(cfg, data) _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl 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 59, Issue 17 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From daria.laptinskaya at googlemail.com Wed Oct 21 14:46:49 2015 From: daria.laptinskaya at googlemail.com (Daria Laptinskaya) Date: Wed, 21 Oct 2015 14:46:49 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: Dear Grazia, I’m using the following code and it works fine: cfg = []; cfg.method = 'average'; cfg.badchannel = channel; cfg.neighbours = neighbours; cfg.trials = 'all'; cfg.elec = sens; [interpol] = ft_channelrepair(cfg, opt1_dur); Commend out the cfg.elec leads to the same error as you get. “sens” in my code is the result of ft_read_sens, sens=ft_read_sens('GSN-HydroCel-257.sfp' ). I hope, it helps! Best, Daria 2015-10-21 12:27 GMT+02:00 Grazia Di Pisa : > Hi Jörn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but still > the same error. > > Any other suggestions? > > thanks, > ~ grazia > > > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; > auditorycognition.com), now at the University of L?beck, is seeking to > hire two Postdoctoral researchers, initially for 3 years, with the option > of extension. > > These positions fall into the larger framework of an ERC Consolidator > grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) > recently awarded to Jonas Obleser, and will allow the joint development of > cognitive-neuroscience and psychological research projects targeting > adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: > https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral > analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the > spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the > multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper > itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the > function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken > and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in > ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power > spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, > nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = > number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum > by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = > frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the > FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the > same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience< > http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> > in Cooperation with Max Planck Society < > http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151020/eebaf460/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m > getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should > specify the electrodes. > > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor > definition so that ft_channelrepair knows the location of your channels, > which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting > the error below. > I've read the ft_fetch_sens help but I don?t understand how I should > specify > > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', > 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 59, Issue 17 > ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Wed Oct 21 19:44:28 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Wed, 21 Oct 2015 10:44:28 -0700 Subject: [FieldTrip] Interpolation and ft_channelrepair In-Reply-To: References: Message-ID: <5627CEFC.1030608@gmail.com> Hi Grazia, I'm using the following code and it works: cfgn = []; cfgn.method = 'template'; cfgn.layout = 'biosemi64.lay'; cfg = []; cfg.neighbours = ft_prepare_neighbours(cfgn, data); cfg.elec = ft_read_sens('standard_1005.elc'); cfg.missingchannel = []; cfg.badchannel = chanrepair; % these are my channels cfg.trials = [1 3 5]; % for particular trials, otherwise use 'all' data = ft_channelrepair(cfg,data); Hope this helps Vitoria On 10/21/2015 3:27 AM, Grazia Di Pisa wrote: > Hi Jörn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but > still the same error. > > Any other suggestions? > > thanks, > ~ grazia > > >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl >> wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> AuditoryCognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; >> auditorycognition.com), now at the University of L?beck, is seeking >> to hire two Postdoctoral researchers, initially for 3 years, with the >> option of extension. >> >> These positions fall into the larger framework of an ERC Consolidator >> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >> recently awarded to Jonas Obleser, and will allow the joint >> development of cognitive-neuroscience and psychological research >> projects targeting adaptive control in the auditory modality of >> middle-aged adults. >> >> Please download the full job advert here: >> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a >> spectral analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the >> spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the >> multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function >> fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the >> taper itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the >> function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is >> taken and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 >> in ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power >> spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 >> (X=signal, nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, >> nfft = number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power >> spectrum by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >> frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of >> the FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation >> methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for >> Neuroscience >> in Cooperation with Max Planck Society >> >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m >> getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17cfg_neighb.method= 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label= lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain;charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor >> definition so that ft_channelrepair knows the location of your >> channels, which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>> Sent: Wednesday, October 21, 2015 10:30 AM >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m >>> getting >>> the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should >>> specify >>> the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17cfg_neighb.method= 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label= lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>> 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 59, Issue 17 >> ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.krebber at charite.de Wed Oct 21 19:54:40 2015 From: martin.krebber at charite.de (Krebber, Martin) Date: Wed, 21 Oct 2015 17:54:40 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl>, Message-ID: Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk > 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Wed Oct 21 20:22:09 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 11:22:09 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > Hi Xiaoming, hi Arjen, > > I've been encountering the same problem. I believe Xiaoming is right when > he points out that the permutaion step shuffles data across conditions and > that this introduces a negative bias in the distribution. I found the same > thing when I correlated RT data with TFRs (absolute power). My distribution > was shifted strongly to the left and, thus, not a single negative cluster > was significant, but every positive one was. > > Xiaomings explanation made a lot of sense to me when I thought about it > graphically: Imagine correlating two data vectors, one (x) ranging between > .5 and1, the other (y) between 50 and and 100. When plotting this, one gets > a cloud of dots on the upper left corner of the diagram. When you then > switch the variable assignment of half of the data points (which is what > the permutation step seems to do), these dots will now be be shifted to the > lower right corner of the diagram. So no matter what the correlation in the > original data, chances are that (given different scaling) after permutaion, > you get a negative correlation. > > I am not 100% sure about this, so please let me know if I made a mistake. > > What I tried instead of the 'ft_statfun_correlationT' was using a custom > made statfun in which I pass the RTs via the design matrix. With this, my > results looked much better. I am not sure, but I guess this is because > there is no shuffling between the two variables in this case. > > I would really like to know, what is the right way of doing this using > just the FieldTrip functions. Is there a way to permute data within > variables? I tried cfg.resampling = 'bootstrap', but this is not a > permutation, as far as I know. > > > Thanks! > Martin > > > ------------------------------ > *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" > im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] > *Gesendet:* Dienstag, 20. Oktober 2015 08:03 > *An:* FieldTrip discussion list > *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > > Hey Xiaoming, > > It's still pretty hard, for me, to guess on basis of that matlab output > what is going on here and what you mean with 'shuffling design matrices', > and how that shuffling 'biases the cluster distribution'. As you mention > yourself, it could be due to various reasons, and you're open to > suggestions and increasing your understanding. I'd therefore suggest to try > to funnel the number of potential explanations by simulating what you're > doing (using input data for which you know how it should behave), after > you've read more about what the design matrix and monte carlo statistics > are supposed to do. Perhaps the statistics section at the bottom of this > page provides a good starting point: > http://www.fieldtriptoolbox.org/walkthrough > > Hope that helps, > Arjen > > 2015-10-19 15:56 GMT-07:00 Xiaoming Du : > >> For example, our power values ranged from 1 to 3 (after log transform); >> my behavioral data ranged from 20 to 90; >> >> by using above mentioned script, there are 14 negative clusters were >> reported in variable stat. >> >> stat = >> >> prob: [30x50 double] >> posclusters: [] >> posclusterslabelmat: [30x50 double] >> posdistribution: [1x1000 double] >> negclusters: [1x14 struct] >> negclusterslabelmat: [30x50 double] >> negdistribution: [1x1000 double] >> cirange: [30x50 double] >> mask: [30x50 logical] >> stat: [30x50 double] >> ref: [30x50 double] >> rho: [30x50 double] >> dimord: 'chan_freq' >> freq: [1x50 double] >> label: {30x1 cell} >> time: 2.5000 >> cfg: [1x1 struct] >> >> However, the p values of those clusters (i.e., stat.negclusters.prob) are >> all ones. The smallest value in stat.negdistribution is way larger than >> the largest negative cluster t-sum. This could be real. However, it is more >> likely due to the shuffle between power and behavioral group. For example, >> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 >> 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, >> their power data was labeled as behavioral data and vice versa. Because of >> the scale difference between power and behavioral data, large negative >> correlations were generated by permutation. This further biased the cluster >> distribution. >> My limited understanding is that, for correlation, each permutation >> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 >> 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >> corresponds to another subject's behavioral data. >> >> I am not good at statistics. It will be really appreciated if you have >> any suggestions or comments. >> >> Xiaoming >> >> >> >> >> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >> Hey Xiaoming, >> >> Not sure if I understand, but shouldn't the directions of the >> correlations be independent of the scaling of the two variables? Looking at >> the code of ft_statfun_correlationT it doesn't seem the conversion from >> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >> would result in a direction change either. Perhaps you could try to first >> manually calculate a correlation between signal power and behavioral power, >> and see whether anything is behaving unexpectedly? >> >> Yours, >> Arjen >> >> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >> >>> Dear FieldTrip users, >>> This is Xiaoming from University of Maryland Baltimore. My current >>> project requires to calculate behavioral-power correlation across subjects. >>> Similar topic was discussed here early this year. >>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>> According to the suggestions in above mentioned thread, I duplicate my >>> power dataset and replace the power values at each time-frequency point >>> with behavioral data. Therefore, those two datasets have same structure and >>> dimension. I used the following script to test if there are significant >>> clusters of correlations. >>> cfg = []; >>> cfg.parameter = 'powspctrm'; >>> cfg.method = 'montecarlo'; >>> cfg.statistic = 'ft_statfun_correlationT'; >>> ... >>> etc >>> ... >>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>> design(1,1:n1) = 1; >>> design(1,(n1 + 1):(n1 * 2)) = 2; >>> design(2, :) = [[1:n1 ] [1 : n1]]; >>> cfg.design = design; >>> >>> cfg.ivar = 1; >>> cfg.uvar = 2; >>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>> However, it seems when each time the design matrix is permuted, >>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>> each subject in design matrix. Although I confirmed this by uncommenting >>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>> ft_statistics_montecarlo.m which allows to display the permuted design >>> matrix in command line, please correct me if this is not the case. >>> In my mind, this kind of permutation will cause trouble when dealing >>> with correlation. For example, in my case, the behavioral data and power >>> data have different scales. The power data are much larger than behavioral >>> data in general. When assigning behavioral data into power group or vice >>> versa, it will induce huge negative correlations between power and >>> behavioral measurement. Therefore, no negative clusters will survive from >>> permutation test. >>> Please let me know if I have mis-understanding or if I did anything >>> wrong. Any suggestions will be highly appreciated! >>> Thanks. >>> Xiaoming >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From XDu at mprc.umaryland.edu Wed Oct 21 23:28:19 2015 From: XDu at mprc.umaryland.edu (Xiaoming Du) Date: Wed, 21 Oct 2015 17:28:19 -0400 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> Message-ID: <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Hi Martin, Thanks Martin to make it more clear. However, my understanding is that the problem is caused by different means of permutation for paired-sample t test and correlation. I am very curious how you solve the problem by customizing statfun. Do you mind sending me a copy of that? I will really appreciate it. Hi Arjen, I think the 'ft_statfun_correlationT' works fine. Using the code in your previous email, the correlation result (stat.rho) is same as using MATLAB function 'corr' with Spearman method. However, In your code, the design matrix for correlation is defined in the same way as for within-UO design (e.g., paired-sample t test). I think Martin's and my concern is that the permutation method for correlation and within-UO design (e.g., paired-sample t test) should be different. For example, there are 10 subjects (patients). Each of them finished a task before (A) and after (B) the treatment . Based on the different null hypothesis, the permutation methods for paired-sample t test and correlation should be different. For paired-sample t test (or within-UO design), the null hypothesis is that there is no different before or after the treatment. In other words, for each subjects, switch the results before and after treatment won't matter. This is exactly how the permutations are done when cfg.design is defined as in your code . On the other hand, the null hypothesis for correlation is that: there is no relationship between the results before and after treatment. Therefore, permutation should be done on after-treatment results among subjects while keep before-treatment results same (or permute before-treatment and keep after-treatment). In terms of permutation, correlation and paired-sample t test (within-UO design) seems treated equally in fieldtrip. Original matrix permutation for paired t test permutation for correlation before (A) after (B) before (A) after (B) before (A) after (B) subj1 A1 B1 subj1 A1 B1 subj1 A1 B2 subj2 A2 B2 subj2 B2 A2 subj2 A2 B4 subj3 A3 B3 subj3 B3 A3 subj3 A3 B3 subj4 A4 B4 subj4 A4 B4 subj4 A4 B1 subj5 A5 B5 subj5 A5 B5 subj5 A5 B10 subj6 A6 B6 subj6 B6 A6 subj6 A6 B8 subj7 A7 B7 subj7 B7 A7 subj7 A7 B9 subj8 A8 B8 subj8 A8 B8 subj8 A8 B6 subj9 A9 B9 subj9 B9 A9 subj9 A9 B5 subj10 A10 B10 subj10 A10 B10 subj10 A10 B7 As follows, I made minor changes in your previous code to show this issue. data_brain ranges from 0 to 1; data_behav ranges from 1000 to 1001; There is no relationship between data_brain and data_behav, because the values are randomly assigned to them. This is the results I got by using the code below: stat = prob: 9.9900e-04 cirange: 0.0020 mask: 1 stat: 0.2941 ref: -10.7655 rho: 0.0297 dimord: 'chan_time' label: {'1'} time: 1 cfg: [1x1 struct] stat.rho (0.0297) is the same as using 'corr' with Spearman option in matlab; However, stat.prob obtained by using permutation test is so small. The reason (I guess) are 1, two-tail test was used. 2, the rho distribution of permutation is biased to negative direction (meaning the rho after each permutation was biased to strong negative correlation. e.g., -0.8 etc ), so the real rho fell into the 5% range of rho distribution of permutations. In other words, real rho (0.0297) is smaller (or larger) than almost all rho from permutation, so that stat.prob is very small (0.000999). Please let me know if this makes sense to you or if I misunderstood anything. Thanks. Xiaoming data_brain = []; data_behav = []; for j=1:100 data_brain{j}.avg = rand; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = rand + 1000; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 1000; n1 = 100; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >>> Arjen Stolk 10/21/2015 2:22 PM >>> Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin : Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du : For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du : Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Thu Oct 22 00:33:13 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 15:33:13 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Message-ID: Thanks for clarifying, Xiaoming. It seems indeed that a systematic offset (in averages) across the two sample populations biases the randomization distribution. I'd need to sort this out, but schematically would expect it to look as follow: normal: ~1000 ~1000 ~1000 ~1000 ~1 ~1 ~1 ~1 corr = ~0 post shuffling: ~1000 ~1 ~1000 ~1000 ~1 ~1000 ~1 ~1 corr = negative, that is an anti-correlation This implies a bootstrapping approach is more correct for testing for statistical significance of a correlation (in case of a systematic offset across conditions). Yours, Arjen 2015-10-21 14:28 GMT-07:00 Xiaoming Du : > Hi Martin, > > Thanks Martin to make it more clear. However, my understanding is that the > problem is caused by different means of permutation for paired-sample t > test and correlation. I am very curious how you solve the problem by > customizing statfun. Do you mind sending me a copy of that? I will really > appreciate it. > > Hi Arjen, > > I think the 'ft_statfun_correlationT' works fine. Using the code in your > previous email, the correlation result (stat.rho) is same as using MATLAB > function 'corr' with Spearman method. However, In your code, the design > matrix for correlation is defined in the same way as for within-UO design > (e.g., paired-sample t test). I think Martin's and my concern is that the > permutation method for correlation and within-UO design (e.g., > paired-sample t test) should be different. > > For example, there are 10 subjects (patients). Each of them finished a > task before (A) and after (B) the treatment . Based on the different null > hypothesis, the permutation methods for paired-sample t test and > correlation should be different. For paired-sample t test (or within-UO > design), the null hypothesis is that there is no different before or after > the treatment. In other words, for each subjects, switch the results before > and after treatment won't matter. This is exactly how the permutations are > done when cfg.design is defined as in your code . On the other hand, the > null hypothesis for correlation is that: there is no relationship between > the results before and after treatment. Therefore, permutation should be > done on after-treatment results *among subjects* while keep > before-treatment results same (or permute before-treatment and keep > after-treatment). In terms of permutation, correlation and paired-sample t > test (within-UO design) seems treated equally in fieldtrip. > > Original matrix permutation for > paired t test permutation for correlation > > before (A) after (B) before > (A) after (B) before (A) > after (B) > subj1 A1 B1 subj1 > A1 B1 subj1 A1 B2 > subj2 A2 B2 subj2 > B2 A2 subj2 A2 B4 > subj3 A3 B3 subj3 > B3 A3 subj3 A3 B3 > subj4 A4 B4 subj4 > A4 B4 subj4 A4 B1 > subj5 A5 B5 subj5 > A5 B5 subj5 A5 B10 > subj6 A6 B6 subj6 > B6 A6 subj6 A6 B8 > subj7 A7 B7 subj7 > B7 A7 subj7 A7 B9 > subj8 A8 B8 subj8 > A8 B8 subj8 A8 B6 > subj9 A9 B9 subj9 > B9 A9 subj9 A9 B5 > subj10 A10 B10 subj10 > A10 B10 subj10 A10 B7 > > As follows, I made minor changes in your previous code to show this > issue. > data_brain ranges from 0 to 1; > data_behav ranges from 1000 to 1001; > There is no relationship between data_brain and data_behav, because the > values are randomly assigned to them. > This is the results I got by using the code below: > > stat = > > prob: 9.9900e-04 > cirange: 0.0020 > mask: 1 > stat: 0.2941 > ref: -10.7655 > rho: 0.0297 > dimord: 'chan_time' > label: {'1'} > time: 1 > cfg: [1x1 struct] > > stat.rho (0.0297) is the same as using 'corr' with Spearman option in > matlab; However, stat.prob obtained by using permutation test is so > small. The reason (I guess) are 1, two-tail test was used. 2, the rho > distribution of permutation is biased to negative direction (meaning the > rho after each permutation was biased to strong negative correlation. e.g., > -0.8 etc ), so the real rho fell into the 5% range of rho distribution of > permutations. In other words, real rho (0.0297) is smaller (or larger) than > almost all rho from permutation, so that stat.prob is very small > (0.000999). > > Please let me know if this makes sense to you or if I misunderstood > anything. > > Thanks. > > Xiaoming > > > > > > > > > > data_brain = []; > > data_behav = []; > > for j=1:100 > > data_brain{j}.avg = rand; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = rand + 1000; % add scaling difference > > end > > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 1000; > > n1 = 100; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > > > > > > > > > > > > > > >>> Arjen Stolk 10/21/2015 2:22 PM >>> > Hi Martin, > > Thanks for thinking along. I've briefly tried to replicate/simplify the > situation depicted by you using the code below. It works as I would expect, > no matter whether one variable is scaled differently. But perhaps I'm not > fully capturing the issue, and something still goes awry. This is a > possibility because ft_statfun_correlationT has only recently been > implemented for a specific case, and was never really tested within > different situations (hence it's not well-documented on the wiki). Do you > think you could use this example code to replicate the situation you are > experiencing? > > Yours, > Arjen > > % simulate simple multiple subjects timelock structures > > data_brain = []; > > data_behav = []; > > for j=1:10 > > data_brain{j}.avg = j; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference > > end > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 100; > > n1 = 10; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > assert(isequal(stat.rho, -1)); > > 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > >> Hi Xiaoming, hi Arjen, >> >> I've been encountering the same problem. I believe Xiaoming is right when >> he points out that the permutaion step shuffles data across conditions and >> that this introduces a negative bias in the distribution. I found the same >> thing when I correlated RT data with TFRs (absolute power). My distribution >> was shifted strongly to the left and, thus, not a single negative cluster >> was significant, but every positive one was. >> >> Xiaomings explanation made a lot of sense to me when I thought about it >> graphically: Imagine correlating two data vectors, one (x) ranging between >> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >> a cloud of dots on the upper left corner of the diagram. When you then >> switch the variable assignment of half of the data points (which is what >> the permutation step seems to do), these dots will now be be shifted to the >> lower right corner of the diagram. So no matter what the correlation in the >> original data, chances are that (given different scaling) after permutaion, >> you get a negative correlation. >> >> I am not 100% sure about this, so please let me know if I made a mistake. >> >> What I tried instead of the 'ft_statfun_correlationT' was using a custom >> made statfun in which I pass the RTs via the design matrix. With this, my >> results looked much better. I am not sure, but I guess this is because >> there is no shuffling between the two variables in this case. >> >> I would really like to know, what is the right way of doing this using >> just the FieldTrip functions. Is there a way to permute data within >> variables? I tried cfg.resampling = 'bootstrap', but this is not a >> permutation, as far as I know. >> >> >> Thanks! >> Martin >> >> >> ------------------------------ >> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >> *An:* FieldTrip discussion list >> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >> follow-up questions >> >> Hey Xiaoming, >> >> It's still pretty hard, for me, to guess on basis of that matlab output >> what is going on here and what you mean with 'shuffling design matrices', >> and how that shuffling 'biases the cluster distribution'. As you mention >> yourself, it could be due to various reasons, and you're open to >> suggestions and increasing your understanding. I'd therefore suggest to try >> to funnel the number of potential explanations by simulating what you're >> doing (using input data for which you know how it should behave), after >> you've read more about what the design matrix and monte carlo statistics >> are supposed to do. Perhaps the statistics section at the bottom of this >> page provides a good starting point: >> http://www.fieldtriptoolbox.org/walkthrough >> >> Hope that helps, >> Arjen >> >> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >> >>> For example, our power values ranged from 1 to 3 (after log transform); >>> my behavioral data ranged from 20 to 90; >>> by using above mentioned script, there are 14 negative clusters were >>> reported in variable stat. >>> stat = >>> prob: [30x50 double] >>> posclusters: [] >>> posclusterslabelmat: [30x50 double] >>> posdistribution: [1x1000 double] >>> negclusters: [1x14 struct] >>> negclusterslabelmat: [30x50 double] >>> negdistribution: [1x1000 double] >>> cirange: [30x50 double] >>> mask: [30x50 logical] >>> stat: [30x50 double] >>> ref: [30x50 double] >>> rho: [30x50 double] >>> dimord: 'chan_freq' >>> freq: [1x50 double] >>> label: {30x1 cell} >>> time: 2.5000 >>> cfg: [1x1 struct] >>> However, the p values of those clusters (i.e., stat.negclusters.prob) >>> are all ones. The smallest value in stat.negdistribution is way larger than >>> the largest negative cluster t-sum. This could be real. However, it is more >>> likely due to the shuffle between power and behavioral group. For example, >>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 >>> 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their >>> power data was labeled as behavioral data and vice versa. Because of the >>> scale difference between power and behavioral data, large negative >>> correlations were generated by permutation. This further biased the cluster >>> distribution. >>> My limited understanding is that, for correlation, each permutation >>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; >>> 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>> corresponds to another subject's behavioral data. >>> I am not good at statistics. It will be really appreciated if you have >>> any suggestions or comments. >>> Xiaoming >>> >>> >>> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >>> Hey Xiaoming, >>> >>> Not sure if I understand, but shouldn't the directions of the >>> correlations be independent of the scaling of the two variables? Looking at >>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>> would result in a direction change either. Perhaps you could try to first >>> manually calculate a correlation between signal power and behavioral power, >>> and see whether anything is behaving unexpectedly? >>> >>> Yours, >>> Arjen >>> >>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>> >>>> Dear FieldTrip users, >>>> This is Xiaoming from University of Maryland Baltimore. My current >>>> project requires to calculate behavioral-power correlation across subjects. >>>> Similar topic was discussed here early this year. >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>> According to the suggestions in above mentioned thread, I duplicate my >>>> power dataset and replace the power values at each time-frequency point >>>> with behavioral data. Therefore, those two datasets have same structure and >>>> dimension. I used the following script to test if there are significant >>>> clusters of correlations. >>>> cfg = []; >>>> cfg.parameter = 'powspctrm'; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'ft_statfun_correlationT'; >>>> ... >>>> etc >>>> ... >>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>> design(1,1:n1) = 1; >>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>> cfg.design = design; >>>> >>>> cfg.ivar = 1; >>>> cfg.uvar = 2; >>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>> However, it seems when each time the design matrix is permuted, >>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>> each subject in design matrix. Although I confirmed this by uncommenting >>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>> matrix in command line, please correct me if this is not the case. >>>> In my mind, this kind of permutation will cause trouble when dealing >>>> with correlation. For example, in my case, the behavioral data and power >>>> data have different scales. The power data are much larger than behavioral >>>> data in general. When assigning behavioral data into power group or vice >>>> versa, it will induce huge negative correlations between power and >>>> behavioral measurement. Therefore, no negative clusters will survive from >>>> permutation test. >>>> Please let me know if I have mis-understanding or if I did anything >>>> wrong. Any suggestions will be highly appreciated! >>>> Thanks. >>>> Xiaoming >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksenj at ohsu.edu Thu Oct 22 01:30:25 2015 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 21 Oct 2015 23:30:25 +0000 Subject: [FieldTrip] FEM head model and source model Message-ID: I am thinking of using FieldTrip for EEG source modeling, and wish to use an FEM formulation. I have found documentation on creating an FEM head model, but am unsure how to create a matching source model. Can someone please point me to documentation for this? Ideally I would want to place sources perpendicular to the local cortical surface. Also I would want to be able to create distributed sources combining several adjacent cortical elements. Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Thu Oct 22 06:01:51 2015 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Wed, 21 Oct 2015 21:01:51 -0700 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> Message-ID: Hi Xiaoming, Martin, Coming back about this issue, I have filed a bug report: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2992 In short, creating a randomization distribution using the permutation method is prone to systematic bias across conditions, as illustrated in our previous email exchanges. One workaround is to use the bootstrapping method (cfg.resampling = 'bootstrap'), or to explicitly remove the systematic bias, e.g by normalizing the data in each condition separately prior to doing statistical testing. I have added these important considerations to the documentation of ft_statfun_correlationT, built in a warning message, and created a latent function that explicitly tests for this issue (to prevent it to re-occur with future code changes). Thank you for your acuteness and contributions. Yours, Arjen 2015-10-21 15:33 GMT-07:00 Arjen Stolk : > Thanks for clarifying, Xiaoming. > > It seems indeed that a systematic offset (in averages) across the two > sample populations biases the randomization distribution. I'd need to sort > this out, but schematically would expect it to look as follow: > > normal: > ~1000 ~1000 ~1000 ~1000 > ~1 ~1 ~1 ~1 > corr = ~0 > > post shuffling: > ~1000 ~1 ~1000 ~1000 > ~1 ~1000 ~1 ~1 > corr = negative, that is an anti-correlation > > This implies a bootstrapping approach is more correct for testing for > statistical significance of a correlation (in case of a systematic offset > across conditions). > > Yours, > Arjen > > 2015-10-21 14:28 GMT-07:00 Xiaoming Du : > >> Hi Martin, >> >> Thanks Martin to make it more clear. However, my understanding is that >> the problem is caused by different means of permutation for paired-sample t >> test and correlation. I am very curious how you solve the problem by >> customizing statfun. Do you mind sending me a copy of that? I will really >> appreciate it. >> >> Hi Arjen, >> >> I think the 'ft_statfun_correlationT' works fine. Using the code in your >> previous email, the correlation result (stat.rho) is same as using MATLAB >> function 'corr' with Spearman method. However, In your code, the design >> matrix for correlation is defined in the same way as for within-UO design >> (e.g., paired-sample t test). I think Martin's and my concern is that the >> permutation method for correlation and within-UO design (e.g., >> paired-sample t test) should be different. >> >> For example, there are 10 subjects (patients). Each of them finished a >> task before (A) and after (B) the treatment . Based on the different null >> hypothesis, the permutation methods for paired-sample t test and >> correlation should be different. For paired-sample t test (or within-UO >> design), the null hypothesis is that there is no different before or after >> the treatment. In other words, for each subjects, switch the results before >> and after treatment won't matter. This is exactly how the permutations are >> done when cfg.design is defined as in your code . On the other hand, the >> null hypothesis for correlation is that: there is no relationship between >> the results before and after treatment. Therefore, permutation should be >> done on after-treatment results *among subjects* while keep >> before-treatment results same (or permute before-treatment and keep >> after-treatment). In terms of permutation, correlation and paired-sample t >> test (within-UO design) seems treated equally in fieldtrip. >> >> Original matrix permutation for >> paired t test permutation for correlation >> >> before (A) after (B) before >> (A) after (B) before (A) >> after (B) >> subj1 A1 B1 subj1 >> A1 B1 subj1 A1 B2 >> subj2 A2 B2 subj2 >> B2 A2 subj2 A2 B4 >> subj3 A3 B3 subj3 >> B3 A3 subj3 A3 B3 >> subj4 A4 B4 subj4 >> A4 B4 subj4 A4 B1 >> subj5 A5 B5 subj5 >> A5 B5 subj5 A5 B10 >> subj6 A6 B6 subj6 >> B6 A6 subj6 A6 B8 >> subj7 A7 B7 subj7 >> B7 A7 subj7 A7 B9 >> subj8 A8 B8 subj8 >> A8 B8 subj8 A8 B6 >> subj9 A9 B9 subj9 >> B9 A9 subj9 A9 B5 >> subj10 A10 B10 subj10 >> A10 B10 subj10 A10 B7 >> >> As follows, I made minor changes in your previous code to show this >> issue. >> data_brain ranges from 0 to 1; >> data_behav ranges from 1000 to 1001; >> There is no relationship between data_brain and data_behav, because the >> values are randomly assigned to them. >> This is the results I got by using the code below: >> >> stat = >> >> prob: 9.9900e-04 >> cirange: 0.0020 >> mask: 1 >> stat: 0.2941 >> ref: -10.7655 >> rho: 0.0297 >> dimord: 'chan_time' >> label: {'1'} >> time: 1 >> cfg: [1x1 struct] >> >> stat.rho (0.0297) is the same as using 'corr' with Spearman option in >> matlab; However, stat.prob obtained by using permutation test is so >> small. The reason (I guess) are 1, two-tail test was used. 2, the rho >> distribution of permutation is biased to negative direction (meaning the >> rho after each permutation was biased to strong negative correlation. e.g., >> -0.8 etc ), so the real rho fell into the 5% range of rho distribution of >> permutations. In other words, real rho (0.0297) is smaller (or larger) than >> almost all rho from permutation, so that stat.prob is very small >> (0.000999). >> >> Please let me know if this makes sense to you or if I misunderstood >> anything. >> >> Thanks. >> >> Xiaoming >> >> >> >> >> >> >> >> >> >> data_brain = []; >> >> data_behav = []; >> >> for j=1:100 >> >> data_brain{j}.avg = rand; % increasing >> >> data_brain{j}.dimord = 'chan_time'; >> >> data_brain{j}.time = 1; >> >> data_brain{j}.label = {'1'}; >> >> >> data_behav{j} = data_brain{j}; >> >> data_behav{j}.avg = rand + 1000; % add scaling difference >> >> end >> >> >> % compute statistics with correlationT >> >> cfg = []; >> >> cfg.method = 'montecarlo'; >> >> cfg.statistic = 'ft_statfun_correlationT'; >> >> cfg.numrandomization = 1000; >> >> n1 = 100; % n1 is the number of subjects >> >> design = zeros(2, n1 * 2); >> >> design(1,1:n1) = 1; >> >> design(1,(n1 + 1):(n1 * 2)) = 2; >> >> design(2, :) = [1:n1 1:n1]; >> >> cfg.design = design; >> >> >> cfg.ivar = 1; >> >> cfg.uvar = 2; >> >> stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>> Arjen Stolk 10/21/2015 2:22 PM >>> >> Hi Martin, >> >> Thanks for thinking along. I've briefly tried to replicate/simplify the >> situation depicted by you using the code below. It works as I would expect, >> no matter whether one variable is scaled differently. But perhaps I'm not >> fully capturing the issue, and something still goes awry. This is a >> possibility because ft_statfun_correlationT has only recently been >> implemented for a specific case, and was never really tested within >> different situations (hence it's not well-documented on the wiki). Do you >> think you could use this example code to replicate the situation you are >> experiencing? >> >> Yours, >> Arjen >> >> % simulate simple multiple subjects timelock structures >> >> data_brain = []; >> >> data_behav = []; >> >> for j=1:10 >> >> data_brain{j}.avg = j; % increasing >> >> data_brain{j}.dimord = 'chan_time'; >> >> data_brain{j}.time = 1; >> >> data_brain{j}.label = {'1'}; >> >> data_behav{j} = data_brain{j}; >> >> data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference >> >> end >> >> % compute statistics with correlationT >> >> cfg = []; >> >> cfg.method = 'montecarlo'; >> >> cfg.statistic = 'ft_statfun_correlationT'; >> >> cfg.numrandomization = 100; >> >> n1 = 10; % n1 is the number of subjects >> >> design = zeros(2, n1 * 2); >> >> design(1,1:n1) = 1; >> >> design(1,(n1 + 1):(n1 * 2)) = 2; >> >> design(2, :) = [1:n1 1:n1]; >> >> cfg.design = design; >> >> cfg.ivar = 1; >> >> cfg.uvar = 2; >> >> stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >> >> assert(isequal(stat.rho, -1)); >> >> 2015-10-21 10:54 GMT-07:00 Krebber, Martin : >> >>> Hi Xiaoming, hi Arjen, >>> >>> I've been encountering the same problem. I believe Xiaoming is right >>> when he points out that the permutaion step shuffles data across conditions >>> and that this introduces a negative bias in the distribution. I found the >>> same thing when I correlated RT data with TFRs (absolute power). My >>> distribution was shifted strongly to the left and, thus, not a single >>> negative cluster was significant, but every positive one was. >>> >>> Xiaomings explanation made a lot of sense to me when I thought about it >>> graphically: Imagine correlating two data vectors, one (x) ranging between >>> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >>> a cloud of dots on the upper left corner of the diagram. When you then >>> switch the variable assignment of half of the data points (which is what >>> the permutation step seems to do), these dots will now be be shifted to the >>> lower right corner of the diagram. So no matter what the correlation in the >>> original data, chances are that (given different scaling) after permutaion, >>> you get a negative correlation. >>> >>> I am not 100% sure about this, so please let me know if I made a mistake. >>> >>> What I tried instead of the 'ft_statfun_correlationT' was using a custom >>> made statfun in which I pass the RTs via the design matrix. With this, my >>> results looked much better. I am not sure, but I guess this is because >>> there is no shuffling between the two variables in this case. >>> >>> I would really like to know, what is the right way of doing this using >>> just the FieldTrip functions. Is there a way to permute data within >>> variables? I tried cfg.resampling = 'bootstrap', but this is not a >>> permutation, as far as I know. >>> >>> >>> Thanks! >>> Martin >>> >>> >>> ------------------------------ >>> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >>> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >>> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >>> *An:* FieldTrip discussion list >>> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >>> follow-up questions >>> >>> Hey Xiaoming, >>> >>> It's still pretty hard, for me, to guess on basis of that matlab output >>> what is going on here and what you mean with 'shuffling design matrices', >>> and how that shuffling 'biases the cluster distribution'. As you mention >>> yourself, it could be due to various reasons, and you're open to >>> suggestions and increasing your understanding. I'd therefore suggest to try >>> to funnel the number of potential explanations by simulating what you're >>> doing (using input data for which you know how it should behave), after >>> you've read more about what the design matrix and monte carlo statistics >>> are supposed to do. Perhaps the statistics section at the bottom of this >>> page provides a good starting point: >>> http://www.fieldtriptoolbox.org/walkthrough >>> >>> Hope that helps, >>> Arjen >>> >>> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >>> >>>> For example, our power values ranged from 1 to 3 (after log transform); >>>> my behavioral data ranged from 20 to 90; >>>> by using above mentioned script, there are 14 negative clusters were >>>> reported in variable stat. >>>> stat = >>>> prob: [30x50 double] >>>> posclusters: [] >>>> posclusterslabelmat: [30x50 double] >>>> posdistribution: [1x1000 double] >>>> negclusters: [1x14 struct] >>>> negclusterslabelmat: [30x50 double] >>>> negdistribution: [1x1000 double] >>>> cirange: [30x50 double] >>>> mask: [30x50 logical] >>>> stat: [30x50 double] >>>> ref: [30x50 double] >>>> rho: [30x50 double] >>>> dimord: 'chan_freq' >>>> freq: [1x50 double] >>>> label: {30x1 cell} >>>> time: 2.5000 >>>> cfg: [1x1 struct] >>>> However, the p values of those clusters (i.e., stat.negclusters.prob) >>>> are all ones. The smallest value in stat.negdistribution is way larger than >>>> the largest negative cluster t-sum. This could be real. However, it is more >>>> likely due to the shuffle between power and behavioral group. For example, >>>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 >>>> 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their >>>> power data was labeled as behavioral data and vice versa. Because of the >>>> scale difference between power and behavioral data, large negative >>>> correlations were generated by permutation. This further biased the cluster >>>> distribution. >>>> My limited understanding is that, for correlation, each permutation >>>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; >>>> 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>>> corresponds to another subject's behavioral data. >>>> I am not good at statistics. It will be really appreciated if you have >>>> any suggestions or comments. >>>> Xiaoming >>>> >>>> >>>> >>> Arjen Stolk 10/19/2015 6:01 PM >>> >>>> Hey Xiaoming, >>>> >>>> Not sure if I understand, but shouldn't the directions of the >>>> correlations be independent of the scaling of the two variables? Looking at >>>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>>> would result in a direction change either. Perhaps you could try to first >>>> manually calculate a correlation between signal power and behavioral power, >>>> and see whether anything is behaving unexpectedly? >>>> >>>> Yours, >>>> Arjen >>>> >>>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>>> >>>>> Dear FieldTrip users, >>>>> This is Xiaoming from University of Maryland Baltimore. My current >>>>> project requires to calculate behavioral-power correlation across subjects. >>>>> Similar topic was discussed here early this year. >>>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>>> According to the suggestions in above mentioned thread, I duplicate my >>>>> power dataset and replace the power values at each time-frequency point >>>>> with behavioral data. Therefore, those two datasets have same structure and >>>>> dimension. I used the following script to test if there are significant >>>>> clusters of correlations. >>>>> cfg = []; >>>>> cfg.parameter = 'powspctrm'; >>>>> cfg.method = 'montecarlo'; >>>>> cfg.statistic = 'ft_statfun_correlationT'; >>>>> ... >>>>> etc >>>>> ... >>>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>>> design(1,1:n1) = 1; >>>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>>> cfg.design = design; >>>>> >>>>> cfg.ivar = 1; >>>>> cfg.uvar = 2; >>>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>>> However, it seems when each time the design matrix is permuted, >>>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>>> each subject in design matrix. Although I confirmed this by uncommenting >>>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>>> matrix in command line, please correct me if this is not the case. >>>>> In my mind, this kind of permutation will cause trouble when dealing >>>>> with correlation. For example, in my case, the behavioral data and power >>>>> data have different scales. The power data are much larger than behavioral >>>>> data in general. When assigning behavioral data into power group or vice >>>>> versa, it will induce huge negative correlations between power and >>>>> behavioral measurement. Therefore, no negative clusters will survive from >>>>> permutation test. >>>>> Please let me know if I have mis-understanding or if I did anything >>>>> wrong. Any suggestions will be highly appreciated! >>>>> Thanks. >>>>> Xiaoming >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanamirahwanazlan at yahoo.com Thu Oct 22 09:47:31 2015 From: wanamirahwanazlan at yahoo.com (wan amirah Wan azlan) Date: Thu, 22 Oct 2015 00:47:31 -0700 Subject: [FieldTrip] problem in reading trigger Message-ID: <1445500051.92875.YahooMailMobile@web166106.mail.gq1.yahoo.com> Dear Fieldtrip user, I am doing realtime eeg processing via tmsi porti amplifier. My problem is my trigger not able be recognized. I am using the following command, cfg=[ ]; cfg.dataset='buffer://localhost:1972'; cfg.trialdef.eventtype='?'; cfg=ft_definetrial(cfg); 'no events were found in the datafile' is shown in matlab command window. Why does this happen? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Thu Oct 22 11:39:04 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Thu, 22 Oct 2015 11:39:04 +0200 Subject: [FieldTrip] Interpolation and ft_channelrepair (Grazia Di Pisa) In-Reply-To: References: Message-ID: <92896A04-9BF3-4C5F-A1F6-4ED92C5D8740@gmail.com> Thank you all so much for the suggestions!!!! :) After adding /cfg.elec = sens/ it finally worked. have a nice day, ~ grazia > On 21Oct, 2015, at 20:22, fieldtrip-request at science.ru.nl wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: Interpolation and ft_channelrepair (Grazia Di Pisa) > 2. Re: Interpolation and ft_channelrepair > (=?utf-8?Q?J=C3=B6rn_M._Horschig?=) > 3. Re: Interpolation and ft_channelrepair (Daria Laptinskaya) > 4. Re: Interpolation and ft_channelrepair (Vit?ria Piai) > 5. Re: calculating behavioural-power correlation -- follow-up > questions (Krebber, Martin) > 6. Re: calculating behavioural-power correlation -- follow-up > questions (Arjen Stolk) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 21 Oct 2015 12:27:40 +0200 > From: Grazia Di Pisa > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi J?rn, > > Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. > > Any other suggestions? > > thanks, > ~ grazia > > >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> Auditory Cognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. >> >> These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. >> >> Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the taper itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is taken and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of the FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for Neuroscience >> in Cooperation with Max Planck Society >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain; charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>> Sent: Wednesday, October 21, 2015 10:30 AM >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m getting >>> the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should specify >>> the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17 cfg_neighb.method = 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label = lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> 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 59, Issue 17 >> ***************************************** > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Wed, 21 Oct 2015 14:16:10 +0200 > From: "=?utf-8?Q?J=C3=B6rn_M._Horschig?=" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002301d10bfa$45d6a740$d183f5c0$@artinis.com> > Content-Type: text/plain; charset="utf-8" > > Hi Grazia, > > > > uh, jah, my bad, try cfg.elec instead ;) > > > > 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 Grazia Di Pisa > Sent: Wednesday, October 21, 2015 12:28 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > > > > Hi J?rn, > > > > Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error. > > > > Any other suggestions? > > > > thanks, > > ~ grazia > > > > > > On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: > > > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Call for new post docs in the Obleser lab | Auditory > Cognition (Jonas Obleser) > 2. Spectrum normalization (Wunderle, Thomas) > 3. Interpolation and ft_channelrepair (Grazia Di Pisa) > 4. Re: Interpolation and ft_channelrepair > (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Oct 2015 06:07:51 -0500 > From: Jonas Obleser > > To: fieldtrip at science.ru.nl , AUDITORY at LISTS.MCGILL.CA > Subject: [FieldTrip] Call for new post docs in the Obleser lab | > Auditory Cognition > Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de > > Content-Type: text/plain; charset=utf-8 > > The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension. > > These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults. > > Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 > > Note the application deadline of November 12 (postal receipt). > > http://auditorycognition.com > http://uni-luebeck.de > > > > > ------------------------------ > > Message: 2 > Date: Tue, 20 Oct 2015 14:58:25 +0000 > From: "Wunderle, Thomas" > > To: "fieldtrip at science.ru.nl " > > Subject: [FieldTrip] Spectrum normalization > Message-ID: > <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de > > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis. > This is important for me, because I need the absolute value of the spectrum for a publication. > > I was scanning through the code trying to find the normalization steps. > In particular, I don't understand the following steps: > > > 1.) The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code: > tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) > What is the rationale of dividing through this special norm of the taper itself? > > > 2.) After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by: > > dum = dum .* sqrt(2 ./ endnsample); (line 251) > > Later on, to get to the power spectrum, the abs of the spectrum is taken and squared > > powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis) > > > > This puzzles me, because scanning through the literature, the power spectrum should be given by > > (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, nfft = number of data points) > > and the PSD by > > (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate) > > > > Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD: > > sqrt(PSD) -> unit: V/sqrt(Hz) > > which is still different from > > (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = frequency resolution = Fs/nfft) > > > > The result of these equations are different from what comes out of the FieldTrip code. > > So what is the unit of the spectrum in FieldTrip? > > What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? > > Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...? > > It would help me a lot if someone could clarify these points. > > Thanks in advance, > Thomas > > > ----- > Dr. Thomas Wunderle > Ernst Str?ngmann Institute (ESI) for Neuroscience > in Cooperation with Max Planck Society > Deutschordenstrasse 46 > 60528 Frankfurt am Main, Germany > www.esi-frankfurt.de > thomas.wunderle at esi-frankfurt.de > Tel: +49 69 96769 516 > Fax: +49 69 96769 555 > > Sitz der Gesellschaft: Frankfurt am Main > Registergericht: Amtsgericht Frankfurt - HRB 84266 > Gesch?ftsf?hrer: Prof. Dr. Pascal Fries > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 10:30:07 +0200 > From: Grazia Di Pisa > > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > > Content-Type: text/plain; charset=utf-8 > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > > > ------------------------------ > > Message: 4 > Date: Wed, 21 Oct 2015 10:42:03 +0200 > From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" > > To: "'FieldTrip discussion list'" > > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com > > Content-Type: text/plain; charset="UTF-8" > > Dear Grazia, > > try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious. > > Best, > J?rn > > -- > > J?rn M. Horschig, PhD, Software Engineer > Artinis Medical Systems | +31 481 350 980 > > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl ] On Behalf Of Grazia Di Pisa > Sent: Wednesday, October 21, 2015 10:30 AM > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] Interpolation and ft_channelrepair > > Dear all, > > I?m trying to do interpolation to repair some bad channels, but I?m getting > the error below. > I've read the ft_fetch_sens help but I don?t understand how I should specify > the electrodes. > > Is there a file I should upload or am I missing something in my code? > Any help or hint is very much appreciated! > > thanks in advance, > ~ grazia > > > // > Error using ft_fetch_sens (line 183) > no electrodes or gradiometers specified. > > Error in ft_channelrepair (line 115) > sens = ft_fetch_sens(cfg, data); > > Error in new_analyse_GDP (line 42) > ft_channelrepair(cfg, data) > // > > This is my code: > > 15 cfg = []; > 16 cfg_neighb = []; > 17 cfg_neighb.method = 'triangulation'; > 18 cfg.senstype = 'EEG'; > 19 cfg_neighb.layout = 'biosemi64.lay'; > 20 neighbours = ft_prepare_neighbours(cfg_neighb); > 21 > 22 cfg.neighbours = neighbours; > 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; > 24 cfg.feedback = 'yes'; > 25 cfg.layout = 'biosemi64.lay'; > 26 lay = ft_prepare_layout(cfg); > 27 > 28 sens = data; > 29 sens.type = 'eeg'; > 30 sens.label = lay.label; > 31 sens.chanpos = lay.pos; > 32 sens.chanpos(:,3) = 0; > 33 > 34 ft_neighbourplot(cfg, data) > 35 > 36 cfg = []; > 37 cfg.method = 'nearest'; > 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'}; > 39 cfg.neighbours = neighbours; > 40 cfg.trials = 'all'; > 41 > 42 ft_channelrepair(cfg, data) > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > 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 59, Issue 17 > ***************************************** > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 21 Oct 2015 14:46:49 +0200 > From: Daria Laptinskaya > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Grazia, > > I?m using the following code and it works fine: > > cfg = []; > > cfg.method = 'average'; > > cfg.badchannel = channel; > > cfg.neighbours = neighbours; > > cfg.trials = 'all'; > > cfg.elec = sens; > > > > [interpol] = ft_channelrepair(cfg, opt1_dur); > > > > Commend out the cfg.elec leads to the same error as you get. ?sens? in my > code is the result of ft_read_sens, sens=ft_read_sens('GSN-HydroCel-257.sfp' > ). > > > > I hope, it helps! > > > > Best, > > Daria > > 2015-10-21 12:27 GMT+02:00 Grazia Di Pisa : > >> Hi J?rn, >> >> Thanks for the advice - I've just tried to add cfg.sens = sens but still >> the same error. >> >> Any other suggestions? >> >> thanks, >> ~ grazia >> >> >> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Call for new post docs in the Obleser lab | Auditory >> Cognition (Jonas Obleser) >> 2. Spectrum normalization (Wunderle, Thomas) >> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >> 4. Re: Interpolation and ft_channelrepair >> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 20 Oct 2015 06:07:51 -0500 >> From: Jonas Obleser >> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >> Auditory Cognition >> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >> Content-Type: text/plain; charset=utf-8 >> >> The research group ?Auditory Cognition? (headed by Jonas Obleser; >> auditorycognition.com), now at the University of L?beck, is seeking to >> hire two Postdoctoral researchers, initially for 3 years, with the option >> of extension. >> >> These positions fall into the larger framework of an ERC Consolidator >> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >> recently awarded to Jonas Obleser, and will allow the joint development of >> cognitive-neuroscience and psychological research projects targeting >> adaptive control in the auditory modality of middle-aged adults. >> >> Please download the full job advert here: >> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >> >> Note the application deadline of November 12 (postal receipt). >> >> http://auditorycognition.com >> http://uni-luebeck.de >> >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Tue, 20 Oct 2015 14:58:25 +0000 >> From: "Wunderle, Thomas" >> To: "fieldtrip at science.ru.nl" >> Subject: [FieldTrip] Spectrum normalization >> Message-ID: >> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Hi all, >> >> I have a question about how FieldTrip normalizes the output of a spectral >> analyses using ft_freqanalysis. >> This is important for me, because I need the absolute value of the >> spectrum for a publication. >> >> I was scanning through the code trying to find the normalization steps. >> In particular, I don't understand the following steps: >> >> >> 1.) The tapers (e.g. hanning) are normalized prior to the >> multiplication with the data by the following code: >> tap = tap./norm(tap, 'fro'); (line 195 in the function fr_specest_mtmfft) >> What is the rationale of dividing through this special norm of the taper >> itself? >> >> >> 2.) After calculating the fft, the specrum is scaled (i.e. in the >> function fr_specest_mtmfft) by: >> >> dum = dum .* sqrt(2 ./ endnsample); (line 251) >> >> Later on, to get to the power spectrum, the abs of the spectrum is taken >> and squared >> >> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in >> ft_frequanalysis) >> >> >> >> This puzzles me, because scanning through the literature, the power >> spectrum should be given by >> >> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 (X=signal, >> nfft = number of data points) >> >> and the PSD by >> >> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, nfft = >> number of data points, Fs=sampling rate) >> >> >> >> Alternatively, one can get the amplitude spectrum from the power spectrum >> by taking the square root of the PSD: >> >> sqrt(PSD) -> unit: V/sqrt(Hz) >> >> which is still different from >> >> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >> frequency resolution = Fs/nfft) >> >> >> >> The result of these equations are different from what comes out of the >> FieldTrip code. >> >> So what is the unit of the spectrum in FieldTrip? >> >> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >> >> Furthermore, is the unit for the different spectral estimation methods the >> same? That is, using mtmfft, mtmconvol, wavelet,...? >> >> It would help me a lot if someone could clarify these points. >> >> Thanks in advance, >> Thomas >> >> >> ----- >> Dr. Thomas Wunderle >> Ernst Str?ngmann Institute (ESI) for Neuroscience< >> http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> >> in Cooperation with Max Planck Society < >> http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews> >> Deutschordenstrasse 46 >> 60528 Frankfurt am Main, Germany >> www.esi-frankfurt.de >> thomas.wunderle at esi-frankfurt.de >> Tel: +49 69 96769 516 >> Fax: +49 69 96769 555 >> >> Sitz der Gesellschaft: Frankfurt am Main >> Registergericht: Amtsgericht Frankfurt - HRB 84266 >> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151020/eebaf460/attachment-0001.html >>> >> >> ------------------------------ >> >> Message: 3 >> Date: Wed, 21 Oct 2015 10:30:07 +0200 >> From: Grazia Di Pisa >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m >> getting the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify the electrodes. >> >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> >> >> ------------------------------ >> >> Message: 4 >> Date: Wed, 21 Oct 2015 10:42:03 +0200 >> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >> Content-Type: text/plain; charset="UTF-8" >> >> Dear Grazia, >> >> try adding cfg.sens = sens; before line 42. That will set the sensor >> definition so that ft_channelrepair knows the location of your channels, >> which is otherwise not obvious. >> >> Best, >> J?rn >> >> -- >> >> J?rn M. Horschig, PhD, Software Engineer >> Artinis Medical Systems | +31 481 350 980 >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >> Sent: Wednesday, October 21, 2015 10:30 AM >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] Interpolation and ft_channelrepair >> >> Dear all, >> >> I?m trying to do interpolation to repair some bad channels, but I?m getting >> the error below. >> I've read the ft_fetch_sens help but I don?t understand how I should >> specify >> >> the electrodes. >> >> Is there a file I should upload or am I missing something in my code? >> Any help or hint is very much appreciated! >> >> thanks in advance, >> ~ grazia >> >> >> // >> Error using ft_fetch_sens (line 183) >> no electrodes or gradiometers specified. >> >> Error in ft_channelrepair (line 115) >> sens = ft_fetch_sens(cfg, data); >> >> Error in new_analyse_GDP (line 42) >> ft_channelrepair(cfg, data) >> // >> >> This is my code: >> >> 15 cfg = []; >> 16 cfg_neighb = []; >> 17 cfg_neighb.method = 'triangulation'; >> 18 cfg.senstype = 'EEG'; >> 19 cfg_neighb.layout = 'biosemi64.lay'; >> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >> 21 >> 22 cfg.neighbours = neighbours; >> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9',}; >> 24 cfg.feedback = 'yes'; >> 25 cfg.layout = 'biosemi64.lay'; >> 26 lay = ft_prepare_layout(cfg); >> 27 >> 28 sens = data; >> 29 sens.type = 'eeg'; >> 30 sens.label = lay.label; >> 31 sens.chanpos = lay.pos; >> 32 sens.chanpos(:,3) = 0; >> 33 >> 34 ft_neighbourplot(cfg, data) >> 35 >> 36 cfg = []; >> 37 cfg.method = 'nearest'; >> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >> 'AF3','AF8','F7','F5','FT9'}; >> 39 cfg.neighbours = neighbours; >> 40 cfg.trials = 'all'; >> 41 >> 42 ft_channelrepair(cfg, data) >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> 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 59, Issue 17 >> ***************************************** >> >> >> >> _______________________________________________ >> 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: Wed, 21 Oct 2015 10:44:28 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Interpolation and ft_channelrepair > Message-ID: <5627CEFC.1030608 at gmail.com> > Content-Type: text/plain; charset="windows-1252"; Format="flowed" > > Hi Grazia, > > I'm using the following code and it works: > > cfgn = []; > cfgn.method = 'template'; > cfgn.layout = 'biosemi64.lay'; > > cfg = []; > cfg.neighbours = ft_prepare_neighbours(cfgn, data); > cfg.elec = ft_read_sens('standard_1005.elc'); > cfg.missingchannel = []; > cfg.badchannel = chanrepair; % these are my channels > cfg.trials = [1 3 5]; % for particular trials, otherwise use 'all' > data = ft_channelrepair(cfg,data); > > Hope this helps > Vitoria > > > > On 10/21/2015 3:27 AM, Grazia Di Pisa wrote: >> Hi J?rn, >> >> Thanks for the advice - I've just tried to add cfg.sens = sens but >> still the same error. >> >> Any other suggestions? >> >> thanks, >> ~ grazia >> >> >>> On 21Oct, 2015, at 12:00, fieldtrip-request at science.ru.nl >>> wrote: >>> >>> Send fieldtrip mailing list submissions to >>> fieldtrip at science.ru.nl >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> or, via email, send a message with subject or body 'help' to >>> fieldtrip-request at science.ru.nl >>> >>> You can reach the person managing the list at >>> fieldtrip-owner at science.ru.nl >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of fieldtrip digest..." >>> >>> >>> Today's Topics: >>> >>> 1. Call for new post docs in the Obleser lab | Auditory >>> Cognition (Jonas Obleser) >>> 2. Spectrum normalization (Wunderle, Thomas) >>> 3. Interpolation and ft_channelrepair (Grazia Di Pisa) >>> 4. Re: Interpolation and ft_channelrepair >>> (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Tue, 20 Oct 2015 06:07:51 -0500 >>> From: Jonas Obleser >>> To: fieldtrip at science.ru.nl, AUDITORY at LISTS.MCGILL.CA >>> Subject: [FieldTrip] Call for new post docs in the Obleser lab | >>> AuditoryCognition >>> Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8 at obleser.de> >>> Content-Type: text/plain; charset=utf-8 >>> >>> The research group ?Auditory Cognition? (headed by Jonas Obleser; >>> auditorycognition.com), now at the University of L?beck, is seeking >>> to hire two Postdoctoral researchers, initially for 3 years, with the >>> option of extension. >>> >>> These positions fall into the larger framework of an ERC Consolidator >>> grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) >>> recently awarded to Jonas Obleser, and will allow the joint >>> development of cognitive-neuroscience and psychological research >>> projects targeting adaptive control in the auditory modality of >>> middle-aged adults. >>> >>> Please download the full job advert here: >>> https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 >>> >>> >>> Note the application deadline of November 12 (postal receipt). >>> >>> http://auditorycognition.com >>> http://uni-luebeck.de >>> >>> >>> >>> >>> ------------------------------ >>> >>> Message: 2 >>> Date: Tue, 20 Oct 2015 14:58:25 +0000 >>> From: "Wunderle, Thomas" >>> To: "fieldtrip at science.ru.nl" >>> Subject: [FieldTrip] Spectrum normalization >>> Message-ID: >>> <27E5CAD9145EEC41BB9B34C01716A198880C3CD4 at UM-excdag-a02.um.gwdg.de> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> Hi all, >>> >>> I have a question about how FieldTrip normalizes the output of a >>> spectral analyses using ft_freqanalysis. >>> This is important for me, because I need the absolute value of the >>> spectrum for a publication. >>> >>> I was scanning through the code trying to find the normalization steps. >>> In particular, I don't understand the following steps: >>> >>> >>> 1.) The tapers (e.g. hanning) are normalized prior to the >>> multiplication with the data by the following code: >>> tap = tap./norm(tap, 'fro'); (line 195 in the function >>> fr_specest_mtmfft) >>> What is the rationale of dividing through this special norm of the >>> taper itself? >>> >>> >>> 2.) After calculating the fft, the specrum is scaled (i.e. in the >>> function fr_specest_mtmfft) by: >>> >>> dum = dum .* sqrt(2 ./ endnsample); (line 251) >>> >>> Later on, to get to the power spectrum, the abs of the spectrum is >>> taken and squared >>> >>> powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 >>> in ft_frequanalysis) >>> >>> >>> >>> This puzzles me, because scanning through the literature, the power >>> spectrum should be given by >>> >>> (2*abs(X)^2) ./ (nfft^2) -> unit: V^2 >>> (X=signal, nfft = number of data points) >>> >>> and the PSD by >>> >>> (2*abs(X)^2) ./ (nfft*Fs) -> unit: V^2/Hz (X=signal, >>> nfft = number of data points, Fs=sampling rate) >>> >>> >>> >>> Alternatively, one can get the amplitude spectrum from the power >>> spectrum by taking the square root of the PSD: >>> >>> sqrt(PSD) -> unit: V/sqrt(Hz) >>> >>> which is still different from >>> >>> (2*abs(X)) ./ (nfft*Fres) -> unit: V/Hz ? (Fres = >>> frequency resolution = Fs/nfft) >>> >>> >>> >>> The result of these equations are different from what comes out of >>> the FieldTrip code. >>> >>> So what is the unit of the spectrum in FieldTrip? >>> >>> What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ? >>> >>> Furthermore, is the unit for the different spectral estimation >>> methods the same? That is, using mtmfft, mtmconvol, wavelet,...? >>> >>> It would help me a lot if someone could clarify these points. >>> >>> Thanks in advance, >>> Thomas >>> >>> >>> ----- >>> Dr. Thomas Wunderle >>> Ernst Str?ngmann Institute (ESI) for >>> Neuroscience >>> in Cooperation with Max Planck Society >>> >>> Deutschordenstrasse 46 >>> 60528 Frankfurt am Main, Germany >>> www.esi-frankfurt.de >>> thomas.wunderle at esi-frankfurt.de >>> Tel: +49 69 96769 516 >>> Fax: +49 69 96769 555 >>> >>> Sitz der Gesellschaft: Frankfurt am Main >>> Registergericht: Amtsgericht Frankfurt - HRB 84266 >>> Gesch?ftsf?hrer: Prof. Dr. Pascal Fries >>> >>> >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: >>> >>> >>> ------------------------------ >>> >>> Message: 3 >>> Date: Wed, 21 Oct 2015 10:30:07 +0200 >>> From: Grazia Di Pisa >>> To: fieldtrip at science.ru.nl >>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>> Message-ID: >>> Content-Type: text/plain; charset=utf-8 >>> >>> Dear all, >>> >>> I?m trying to do interpolation to repair some bad channels, but I?m >>> getting the error below. >>> I've read the ft_fetch_sens help but I don?t understand how I should >>> specify the electrodes. >>> >>> Is there a file I should upload or am I missing something in my code? >>> Any help or hint is very much appreciated! >>> >>> thanks in advance, >>> ~ grazia >>> >>> >>> // >>> Error using ft_fetch_sens (line 183) >>> no electrodes or gradiometers specified. >>> >>> Error in ft_channelrepair (line 115) >>> sens = ft_fetch_sens(cfg, data); >>> >>> Error in new_analyse_GDP (line 42) >>> ft_channelrepair(cfg, data) >>> // >>> >>> This is my code: >>> >>> 15 cfg = []; >>> 16 cfg_neighb = []; >>> 17cfg_neighb.method= 'triangulation'; >>> 18 cfg.senstype = 'EEG'; >>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>> 21 >>> 22 cfg.neighbours = neighbours; >>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>> 24 cfg.feedback = 'yes'; >>> 25 cfg.layout = 'biosemi64.lay'; >>> 26 lay = ft_prepare_layout(cfg); >>> 27 >>> 28 sens = data; >>> 29 sens.type = 'eeg'; >>> 30 sens.label= lay.label; >>> 31 sens.chanpos = lay.pos; >>> 32 sens.chanpos(:,3) = 0; >>> 33 >>> 34 ft_neighbourplot(cfg, data) >>> 35 >>> 36 cfg = []; >>> 37 cfg.method = 'nearest'; >>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>> 'AF3','AF8','F7','F5','FT9'}; >>> 39 cfg.neighbours = neighbours; >>> 40 cfg.trials = 'all'; >>> 41 >>> 42 ft_channelrepair(cfg, data) >>> >>> >>> >>> >>> >>> >>> >>> ------------------------------ >>> >>> Message: 4 >>> Date: Wed, 21 Oct 2015 10:42:03 +0200 >>> From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" >>> To: "'FieldTrip discussion list'" >>> Subject: Re: [FieldTrip] Interpolation and ft_channelrepair >>> Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com> >>> Content-Type: text/plain;charset="UTF-8" >>> >>> Dear Grazia, >>> >>> try adding cfg.sens = sens; before line 42. That will set the sensor >>> definition so that ft_channelrepair knows the location of your >>> channels, which is otherwise not obvious. >>> >>> Best, >>> J?rn >>> >>> -- >>> >>> J?rn M. Horschig, PhD, Software Engineer >>> Artinis Medical Systems | +31 481 350 980 >>> >>>> -----Original Message----- >>>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- >>>> bounces at science.ru.nl] On Behalf Of Grazia Di Pisa >>>> Sent: Wednesday, October 21, 2015 10:30 AM >>>> To: fieldtrip at science.ru.nl >>>> Subject: [FieldTrip] Interpolation and ft_channelrepair >>>> >>>> Dear all, >>>> >>>> I?m trying to do interpolation to repair some bad channels, but I?m >>>> getting >>>> the error below. >>>> I've read the ft_fetch_sens help but I don?t understand how I should >>>> specify >>>> the electrodes. >>>> >>>> Is there a file I should upload or am I missing something in my code? >>>> Any help or hint is very much appreciated! >>>> >>>> thanks in advance, >>>> ~ grazia >>>> >>>> >>>> // >>>> Error using ft_fetch_sens (line 183) >>>> no electrodes or gradiometers specified. >>>> >>>> Error in ft_channelrepair (line 115) >>>> sens = ft_fetch_sens(cfg, data); >>>> >>>> Error in new_analyse_GDP (line 42) >>>> ft_channelrepair(cfg, data) >>>> // >>>> >>>> This is my code: >>>> >>>> 15 cfg = []; >>>> 16 cfg_neighb = []; >>>> 17cfg_neighb.method= 'triangulation'; >>>> 18 cfg.senstype = 'EEG'; >>>> 19 cfg_neighb.layout = 'biosemi64.lay'; >>>> 20 neighbours = ft_prepare_neighbours(cfg_neighb); >>>> 21 >>>> 22 cfg.neighbours = neighbours; >>>> 23 cfg.channel = {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; >>>> 24 cfg.feedback = 'yes'; >>>> 25 cfg.layout = 'biosemi64.lay'; >>>> 26 lay = ft_prepare_layout(cfg); >>>> 27 >>>> 28 sens = data; >>>> 29 sens.type = 'eeg'; >>>> 30 sens.label= lay.label; >>>> 31 sens.chanpos = lay.pos; >>>> 32 sens.chanpos(:,3) = 0; >>>> 33 >>>> 34 ft_neighbourplot(cfg, data) >>>> 35 >>>> 36 cfg = []; >>>> 37 cfg.method = 'nearest'; >>>> 38 cfg.badchannel = {'Fp1', 'Fp2', 'AF7', >>>> 'AF3','AF8','F7','F5','FT9'}; >>>> 39 cfg.neighbours = neighbours; >>>> 40 cfg.trials = 'all'; >>>> 41 >>>> 42 ft_channelrepair(cfg, data) >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> 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 59, Issue 17 >>> ***************************************** >> >> >> >> _______________________________________________ >> 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: 5 > Date: Wed, 21 Oct 2015 17:54:40 +0000 > From: "Krebber, Martin" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Xiaoming, hi Arjen, > > I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. > > Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. > > I am not 100% sure about this, so please let me know if I made a mistake. > > What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. > > I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. > > > Thanks! > Martin > > > ________________________________ > Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] > Gesendet: Dienstag, 20. Oktober 2015 08:03 > An: FieldTrip discussion list > Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions > > Hey Xiaoming, > > It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough > > Hope that helps, > Arjen > > 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: > For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; > > by using above mentioned script, there are 14 negative clusters were reported in variable stat. > > stat = > > prob: [30x50 double] > posclusters: [] > posclusterslabelmat: [30x50 double] > posdistribution: [1x1000 double] > negclusters: [1x14 struct] > negclusterslabelmat: [30x50 double] > negdistribution: [1x1000 double] > cirange: [30x50 double] > mask: [30x50 logical] > stat: [30x50 double] > ref: [30x50 double] > rho: [30x50 double] > dimord: 'chan_freq' > freq: [1x50 double] > label: {30x1 cell} > time: 2.5000 > cfg: [1x1 struct] > > However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. > My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. > > I am not good at statistics. It will be really appreciated if you have any suggestions or comments. > > Xiaoming > > > > >>>> Arjen Stolk > 10/19/2015 6:01 PM >>> > Hey Xiaoming, > > Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? > > Yours, > Arjen > > 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: > Dear FieldTrip users, > This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html > According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. > cfg = []; > cfg.parameter = 'powspctrm'; > cfg.method = 'montecarlo'; > cfg.statistic = 'ft_statfun_correlationT'; > ... > etc > ... > design = zeros(2, n1 * 2); % n1 is the number of subjects. > design(1,1:n1) = 1; > design(1,(n1 + 1):(n1 * 2)) = 2; > design(2, :) = [[1:n1 ] [1 : n1]]; > cfg.design = design; > > cfg.ivar = 1; > cfg.uvar = 2; > stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); > However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. > In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. > Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! > Thanks. > Xiaoming > > _______________________________________________ > 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: Wed, 21 Oct 2015 11:22:09 -0700 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] calculating behavioural-power correlation -- > follow-up questions > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Martin, > > Thanks for thinking along. I've briefly tried to replicate/simplify the > situation depicted by you using the code below. It works as I would expect, > no matter whether one variable is scaled differently. But perhaps I'm not > fully capturing the issue, and something still goes awry. This is a > possibility because ft_statfun_correlationT has only recently been > implemented for a specific case, and was never really tested within > different situations (hence it's not well-documented on the wiki). Do you > think you could use this example code to replicate the situation you are > experiencing? > > Yours, > Arjen > > % simulate simple multiple subjects timelock structures > > data_brain = []; > > data_behav = []; > > for j=1:10 > > data_brain{j}.avg = j; % increasing > > data_brain{j}.dimord = 'chan_time'; > > data_brain{j}.time = 1; > > data_brain{j}.label = {'1'}; > > > > data_behav{j} = data_brain{j}; > > data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference > > end > > > > % compute statistics with correlationT > > cfg = []; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'ft_statfun_correlationT'; > > cfg.numrandomization = 100; > > > > n1 = 10; % n1 is the number of subjects > > design = zeros(2, n1 * 2); > > design(1,1:n1) = 1; > > design(1,(n1 + 1):(n1 * 2)) = 2; > > design(2, :) = [1:n1 1:n1]; > > cfg.design = design; > > > > cfg.ivar = 1; > > cfg.uvar = 2; > > stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); > > > > assert(isequal(stat.rho, -1)); > > 2015-10-21 10:54 GMT-07:00 Krebber, Martin : > >> Hi Xiaoming, hi Arjen, >> >> I've been encountering the same problem. I believe Xiaoming is right when >> he points out that the permutaion step shuffles data across conditions and >> that this introduces a negative bias in the distribution. I found the same >> thing when I correlated RT data with TFRs (absolute power). My distribution >> was shifted strongly to the left and, thus, not a single negative cluster >> was significant, but every positive one was. >> >> Xiaomings explanation made a lot of sense to me when I thought about it >> graphically: Imagine correlating two data vectors, one (x) ranging between >> .5 and1, the other (y) between 50 and and 100. When plotting this, one gets >> a cloud of dots on the upper left corner of the diagram. When you then >> switch the variable assignment of half of the data points (which is what >> the permutation step seems to do), these dots will now be be shifted to the >> lower right corner of the diagram. So no matter what the correlation in the >> original data, chances are that (given different scaling) after permutaion, >> you get a negative correlation. >> >> I am not 100% sure about this, so please let me know if I made a mistake. >> >> What I tried instead of the 'ft_statfun_correlationT' was using a custom >> made statfun in which I pass the RTs via the design matrix. With this, my >> results looked much better. I am not sure, but I guess this is because >> there is no shuffling between the two variables in this case. >> >> I would really like to know, what is the right way of doing this using >> just the FieldTrip functions. Is there a way to permute data within >> variables? I tried cfg.resampling = 'bootstrap', but this is not a >> permutation, as far as I know. >> >> >> Thanks! >> Martin >> >> >> ------------------------------ >> *Von:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" >> im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] >> *Gesendet:* Dienstag, 20. Oktober 2015 08:03 >> *An:* FieldTrip discussion list >> *Betreff:* Re: [FieldTrip] calculating behavioural-power correlation -- >> follow-up questions >> >> Hey Xiaoming, >> >> It's still pretty hard, for me, to guess on basis of that matlab output >> what is going on here and what you mean with 'shuffling design matrices', >> and how that shuffling 'biases the cluster distribution'. As you mention >> yourself, it could be due to various reasons, and you're open to >> suggestions and increasing your understanding. I'd therefore suggest to try >> to funnel the number of potential explanations by simulating what you're >> doing (using input data for which you know how it should behave), after >> you've read more about what the design matrix and monte carlo statistics >> are supposed to do. Perhaps the statistics section at the bottom of this >> page provides a good starting point: >> http://www.fieldtriptoolbox.org/walkthrough >> >> Hope that helps, >> Arjen >> >> 2015-10-19 15:56 GMT-07:00 Xiaoming Du : >> >>> For example, our power values ranged from 1 to 3 (after log transform); >>> my behavioral data ranged from 20 to 90; >>> >>> by using above mentioned script, there are 14 negative clusters were >>> reported in variable stat. >>> >>> stat = >>> >>> prob: [30x50 double] >>> posclusters: [] >>> posclusterslabelmat: [30x50 double] >>> posdistribution: [1x1000 double] >>> negclusters: [1x14 struct] >>> negclusterslabelmat: [30x50 double] >>> negdistribution: [1x1000 double] >>> cirange: [30x50 double] >>> mask: [30x50 logical] >>> stat: [30x50 double] >>> ref: [30x50 double] >>> rho: [30x50 double] >>> dimord: 'chan_freq' >>> freq: [1x50 double] >>> label: {30x1 cell} >>> time: 2.5000 >>> cfg: [1x1 struct] >>> >>> However, the p values of those clusters (i.e., stat.negclusters.prob) are >>> all ones. The smallest value in stat.negdistribution is way larger than >>> the largest negative cluster t-sum. This could be real. However, it is more >>> likely due to the shuffle between power and behavioral group. For example, >>> design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 >>> 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, >>> their power data was labeled as behavioral data and vice versa. Because of >>> the scale difference between power and behavioral data, large negative >>> correlations were generated by permutation. This further biased the cluster >>> distribution. >>> My limited understanding is that, for correlation, each permutation >>> should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, >>> permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 >>> 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data >>> corresponds to another subject's behavioral data. >>> >>> I am not good at statistics. It will be really appreciated if you have >>> any suggestions or comments. >>> >>> Xiaoming >>> >>> >>> >>> >>>>>> Arjen Stolk 10/19/2015 6:01 PM >>> >>> Hey Xiaoming, >>> >>> Not sure if I understand, but shouldn't the directions of the >>> correlations be independent of the scaling of the two variables? Looking at >>> the code of ft_statfun_correlationT it doesn't seem the conversion from >>> correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) >>> would result in a direction change either. Perhaps you could try to first >>> manually calculate a correlation between signal power and behavioral power, >>> and see whether anything is behaving unexpectedly? >>> >>> Yours, >>> Arjen >>> >>> 2015-10-19 14:25 GMT-07:00 Xiaoming Du : >>> >>>> Dear FieldTrip users, >>>> This is Xiaoming from University of Maryland Baltimore. My current >>>> project requires to calculate behavioral-power correlation across subjects. >>>> Similar topic was discussed here early this year. >>>> http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html >>>> According to the suggestions in above mentioned thread, I duplicate my >>>> power dataset and replace the power values at each time-frequency point >>>> with behavioral data. Therefore, those two datasets have same structure and >>>> dimension. I used the following script to test if there are significant >>>> clusters of correlations. >>>> cfg = []; >>>> cfg.parameter = 'powspctrm'; >>>> cfg.method = 'montecarlo'; >>>> cfg.statistic = 'ft_statfun_correlationT'; >>>> ... >>>> etc >>>> ... >>>> design = zeros(2, n1 * 2); % n1 is the number of subjects. >>>> design(1,1:n1) = 1; >>>> design(1,(n1 + 1):(n1 * 2)) = 2; >>>> design(2, :) = [[1:n1 ] [1 : n1]]; >>>> cfg.design = design; >>>> >>>> cfg.ivar = 1; >>>> cfg.uvar = 2; >>>> stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); >>>> However, it seems when each time the design matrix is permuted, >>>> FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning >>>> cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to >>>> each subject in design matrix. Although I confirmed this by uncommenting >>>> line 313 (i.e., tmpdesign = design(:,resample(i,:))) in >>>> ft_statistics_montecarlo.m which allows to display the permuted design >>>> matrix in command line, please correct me if this is not the case. >>>> In my mind, this kind of permutation will cause trouble when dealing >>>> with correlation. For example, in my case, the behavioral data and power >>>> data have different scales. The power data are much larger than behavioral >>>> data in general. When assigning behavioral data into power group or vice >>>> versa, it will induce huge negative correlations between power and >>>> behavioral measurement. Therefore, no negative clusters will survive from >>>> permutation test. >>>> Please let me know if I have mis-understanding or if I did anything >>>> wrong. Any suggestions will be highly appreciated! >>>> Thanks. >>>> Xiaoming >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 18 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 22 11:53:16 2015 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 22 Oct 2015 09:53:16 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: Message-ID: <0C912A67-0DAD-4A2B-AD72-2191E01AF614@donders.ru.nl> Dear participants in the discussion on behavioural-power correlation, My name is Eric Maris and have contributed most of the older statfuns (but not ft_statfun_correlationT). Together with Arjen, I will try to resolve some of the issues that have been discussed. Give us some time, and we will return to you via the Discussion List. best, Eric From martin.krebber at charite.de Thu Oct 22 12:20:23 2015 From: martin.krebber at charite.de (Krebber, Martin) Date: Thu, 22 Oct 2015 10:20:23 +0000 Subject: [FieldTrip] calculating behavioural-power correlation -- follow-up questions In-Reply-To: References: <5625278A020000DC00015E64@MPRC.UMARYLAND.EDU> <0247c3e03d9e408597a3f2940e5c1cfc@EXPRD01.hosting.ru.nl> <5627CB33020000DC00015FE7@MPRC.UMARYLAND.EDU> , Message-ID: Hi guys, Thanks for getting on top of this so quickly. I'm looking forward to seeing your solution to the problem. @Xiaoming: Nice job with the example you provided! I'll send you a copy of my statfun later. Best, Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Donnerstag, 22. Oktober 2015 06:01 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hi Xiaoming, Martin, Coming back about this issue, I have filed a bug report: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2992 In short, creating a randomization distribution using the permutation method is prone to systematic bias across conditions, as illustrated in our previous email exchanges. One workaround is to use the bootstrapping method (cfg.resampling = 'bootstrap'), or to explicitly remove the systematic bias, e.g by normalizing the data in each condition separately prior to doing statistical testing. I have added these important considerations to the documentation of ft_statfun_correlationT, built in a warning message, and created a latent function that explicitly tests for this issue (to prevent it to re-occur with future code changes). Thank you for your acuteness and contributions. Yours, Arjen 2015-10-21 15:33 GMT-07:00 Arjen Stolk >: Thanks for clarifying, Xiaoming. It seems indeed that a systematic offset (in averages) across the two sample populations biases the randomization distribution. I'd need to sort this out, but schematically would expect it to look as follow: normal: ~1000 ~1000 ~1000 ~1000 ~1 ~1 ~1 ~1 corr = ~0 post shuffling: ~1000 ~1 ~1000 ~1000 ~1 ~1000 ~1 ~1 corr = negative, that is an anti-correlation This implies a bootstrapping approach is more correct for testing for statistical significance of a correlation (in case of a systematic offset across conditions). Yours, Arjen 2015-10-21 14:28 GMT-07:00 Xiaoming Du >: Hi Martin, Thanks Martin to make it more clear. However, my understanding is that the problem is caused by different means of permutation for paired-sample t test and correlation. I am very curious how you solve the problem by customizing statfun. Do you mind sending me a copy of that? I will really appreciate it. Hi Arjen, I think the 'ft_statfun_correlationT' works fine. Using the code in your previous email, the correlation result (stat.rho) is same as using MATLAB function 'corr' with Spearman method. However, In your code, the design matrix for correlation is defined in the same way as for within-UO design (e.g., paired-sample t test). I think Martin's and my concern is that the permutation method for correlation and within-UO design (e.g., paired-sample t test) should be different. For example, there are 10 subjects (patients). Each of them finished a task before (A) and after (B) the treatment . Based on the different null hypothesis, the permutation methods for paired-sample t test and correlation should be different. For paired-sample t test (or within-UO design), the null hypothesis is that there is no different before or after the treatment. In other words, for each subjects, switch the results before and after treatment won't matter. This is exactly how the permutations are done when cfg.design is defined as in your code . On the other hand, the null hypothesis for correlation is that: there is no relationship between the results before and after treatment. Therefore, permutation should be done on after-treatment results among subjects while keep before-treatment results same (or permute before-treatment and keep after-treatment). In terms of permutation, correlation and paired-sample t test (within-UO design) seems treated equally in fieldtrip. Original matrix permutation for paired t test permutation for correlation before (A) after (B) before (A) after (B) before (A) after (B) subj1 A1 B1 subj1 A1 B1 subj1 A1 B2 subj2 A2 B2 subj2 B2 A2 subj2 A2 B4 subj3 A3 B3 subj3 B3 A3 subj3 A3 B3 subj4 A4 B4 subj4 A4 B4 subj4 A4 B1 subj5 A5 B5 subj5 A5 B5 subj5 A5 B10 subj6 A6 B6 subj6 B6 A6 subj6 A6 B8 subj7 A7 B7 subj7 B7 A7 subj7 A7 B9 subj8 A8 B8 subj8 A8 B8 subj8 A8 B6 subj9 A9 B9 subj9 B9 A9 subj9 A9 B5 subj10 A10 B10 subj10 A10 B10 subj10 A10 B7 As follows, I made minor changes in your previous code to show this issue. data_brain ranges from 0 to 1; data_behav ranges from 1000 to 1001; There is no relationship between data_brain and data_behav, because the values are randomly assigned to them. This is the results I got by using the code below: stat = prob: 9.9900e-04 cirange: 0.0020 mask: 1 stat: 0.2941 ref: -10.7655 rho: 0.0297 dimord: 'chan_time' label: {'1'} time: 1 cfg: [1x1 struct] stat.rho (0.0297) is the same as using 'corr' with Spearman option in matlab; However, stat.prob obtained by using permutation test is so small. The reason (I guess) are 1, two-tail test was used. 2, the rho distribution of permutation is biased to negative direction (meaning the rho after each permutation was biased to strong negative correlation. e.g., -0.8 etc ), so the real rho fell into the 5% range of rho distribution of permutations. In other words, real rho (0.0297) is smaller (or larger) than almost all rho from permutation, so that stat.prob is very small (0.000999). Please let me know if this makes sense to you or if I misunderstood anything. Thanks. Xiaoming data_brain = []; data_behav = []; for j=1:100 data_brain{j}.avg = rand; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = rand + 1000; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 1000; n1 = 100; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); >>> Arjen Stolk > 10/21/2015 2:22 PM >>> Hi Martin, Thanks for thinking along. I've briefly tried to replicate/simplify the situation depicted by you using the code below. It works as I would expect, no matter whether one variable is scaled differently. But perhaps I'm not fully capturing the issue, and something still goes awry. This is a possibility because ft_statfun_correlationT has only recently been implemented for a specific case, and was never really tested within different situations (hence it's not well-documented on the wiki). Do you think you could use this example code to replicate the situation you are experiencing? Yours, Arjen % simulate simple multiple subjects timelock structures data_brain = []; data_behav = []; for j=1:10 data_brain{j}.avg = j; % increasing data_brain{j}.dimord = 'chan_time'; data_brain{j}.time = 1; data_brain{j}.label = {'1'}; data_behav{j} = data_brain{j}; data_behav{j}.avg = data_brain{j}.avg*-1000+50; % add scaling difference end % compute statistics with correlationT cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; cfg.numrandomization = 100; n1 = 10; % n1 is the number of subjects design = zeros(2, n1 * 2); design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [1:n1 1:n1]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_timelockstatistics(cfg, data_brain{:}, data_behav{:}); assert(isequal(stat.rho, -1)); 2015-10-21 10:54 GMT-07:00 Krebber, Martin >: Hi Xiaoming, hi Arjen, I've been encountering the same problem. I believe Xiaoming is right when he points out that the permutaion step shuffles data across conditions and that this introduces a negative bias in the distribution. I found the same thing when I correlated RT data with TFRs (absolute power). My distribution was shifted strongly to the left and, thus, not a single negative cluster was significant, but every positive one was. Xiaomings explanation made a lot of sense to me when I thought about it graphically: Imagine correlating two data vectors, one (x) ranging between .5 and1, the other (y) between 50 and and 100. When plotting this, one gets a cloud of dots on the upper left corner of the diagram. When you then switch the variable assignment of half of the data points (which is what the permutation step seems to do), these dots will now be be shifted to the lower right corner of the diagram. So no matter what the correlation in the original data, chances are that (given different scaling) after permutaion, you get a negative correlation. I am not 100% sure about this, so please let me know if I made a mistake. What I tried instead of the 'ft_statfun_correlationT' was using a custom made statfun in which I pass the RTs via the design matrix. With this, my results looked much better. I am not sure, but I guess this is because there is no shuffling between the two variables in this case. I would really like to know, what is the right way of doing this using just the FieldTrip functions. Is there a way to permute data within variables? I tried cfg.resampling = 'bootstrap', but this is not a permutation, as far as I know. Thanks! Martin ________________________________ Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Arjen Stolk [a.stolk8 at gmail.com] Gesendet: Dienstag, 20. Oktober 2015 08:03 An: FieldTrip discussion list Betreff: Re: [FieldTrip] calculating behavioural-power correlation -- follow-up questions Hey Xiaoming, It's still pretty hard, for me, to guess on basis of that matlab output what is going on here and what you mean with 'shuffling design matrices', and how that shuffling 'biases the cluster distribution'. As you mention yourself, it could be due to various reasons, and you're open to suggestions and increasing your understanding. I'd therefore suggest to try to funnel the number of potential explanations by simulating what you're doing (using input data for which you know how it should behave), after you've read more about what the design matrix and monte carlo statistics are supposed to do. Perhaps the statistics section at the bottom of this page provides a good starting point: http://www.fieldtriptoolbox.org/walkthrough Hope that helps, Arjen 2015-10-19 15:56 GMT-07:00 Xiaoming Du >: For example, our power values ranged from 1 to 3 (after log transform); my behavioral data ranged from 20 to 90; by using above mentioned script, there are 14 negative clusters were reported in variable stat. stat = prob: [30x50 double] posclusters: [] posclusterslabelmat: [30x50 double] posdistribution: [1x1000 double] negclusters: [1x14 struct] negclusterslabelmat: [30x50 double] negdistribution: [1x1000 double] cirange: [30x50 double] mask: [30x50 logical] stat: [30x50 double] ref: [30x50 double] rho: [30x50 double] dimord: 'chan_freq' freq: [1x50 double] label: {30x1 cell} time: 2.5000 cfg: [1x1 struct] However, the p values of those clusters (i.e., stat.negclusters.prob) are all ones. The smallest value in stat.negdistribution is way larger than the largest negative cluster t-sum. This could be real. However, it is more likely due to the shuffle between power and behavioral group. For example, design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] was shuffled to [1 2 2 1 2 2 1 1; 1 2 3 4 1 2 3 4]. After each permutation, for some subjects, their power data was labeled as behavioral data and vice versa. Because of the scale difference between power and behavioral data, large negative correlations were generated by permutation. This further biased the cluster distribution. My limited understanding is that, for correlation, each permutation should fix cfg.ivar and only shuffle half of the cfg.uvar. For example, permute design matrix [1 1 1 1 2 2 2 2; 1 2 3 4 1 2 3 4] to [1 1 1 1 2 2 2; 1 2 3 4 4 2 3 1]. THerefore, after permutation, one subject's power data corresponds to another subject's behavioral data. I am not good at statistics. It will be really appreciated if you have any suggestions or comments. Xiaoming >>> Arjen Stolk > 10/19/2015 6:01 PM >>> Hey Xiaoming, Not sure if I understand, but shouldn't the directions of the correlations be independent of the scaling of the two variables? Looking at the code of ft_statfun_correlationT it doesn't seem the conversion from correlation to T value (tstat = rho*(sqrt(max(nunits)-2))/sqrt((1-rho^2))) would result in a direction change either. Perhaps you could try to first manually calculate a correlation between signal power and behavioral power, and see whether anything is behaving unexpectedly? Yours, Arjen 2015-10-19 14:25 GMT-07:00 Xiaoming Du >: Dear FieldTrip users, This is Xiaoming from University of Maryland Baltimore. My current project requires to calculate behavioral-power correlation across subjects. Similar topic was discussed here early this year. http://mailman.science.ru.nl/pipermail/fieldtrip/2015-February/008953.html According to the suggestions in above mentioned thread, I duplicate my power dataset and replace the power values at each time-frequency point with behavioral data. Therefore, those two datasets have same structure and dimension. I used the following script to test if there are significant clusters of correlations. cfg = []; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'ft_statfun_correlationT'; ... etc ... design = zeros(2, n1 * 2); % n1 is the number of subjects. design(1,1:n1) = 1; design(1,(n1 + 1):(n1 * 2)) = 2; design(2, :) = [[1:n1 ] [1 : n1]]; cfg.design = design; cfg.ivar = 1; cfg.uvar = 2; stat = ft_freqstatistics(cfg, dataBeh{:}, dataDX1{:}); However, it seems when each time the design matrix is permuted, FieldTrip is using the same method as for 'ft_statfun_depsamplesT', meaning cfg.uvar remains the same while cfg.ivar (1 or 2) is randomly assigned to each subject in design matrix. Although I confirmed this by uncommenting line 313 (i.e., tmpdesign = design(:,resample(i,:))) in ft_statistics_montecarlo.m which allows to display the permuted design matrix in command line, please correct me if this is not the case. In my mind, this kind of permutation will cause trouble when dealing with correlation. For example, in my case, the behavioral data and power data have different scales. The power data are much larger than behavioral data in general. When assigning behavioral data into power group or vice versa, it will induce huge negative correlations between power and behavioral measurement. Therefore, no negative clusters will survive from permutation test. Please let me know if I have mis-understanding or if I did anything wrong. Any suggestions will be highly appreciated! Thanks. Xiaoming _______________________________________________ fieldtrip 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 Thu Oct 22 16:51:04 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Thu, 22 Oct 2015 16:51:04 +0200 Subject: [FieldTrip] EEG electrode coordinate system transformation Message-ID: Dear all, we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_layout.jpg Type: image/jpeg Size: 34769 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: inverted_localite_layout.jpg Type: image/jpeg Size: 34337 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: localite_layout.jpg Type: image/jpeg Size: 33727 bytes Desc: not available URL: From paolo.belardinelli at gmail.com Thu Oct 22 16:55:28 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Thu, 22 Oct 2015 14:55:28 +0000 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: References: Message-ID: Dear all, we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_layout.jpg Type: image/jpeg Size: 34769 bytes Desc: standard_layout.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: inverted_localite_layout.jpg Type: image/jpeg Size: 34337 bytes Desc: inverted_localite_layout.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: localite_layout.jpg Type: image/jpeg Size: 33727 bytes Desc: localite_layout.jpg URL: From r.oostenveld at donders.ru.nl Thu Oct 22 21:47:51 2015 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 22 Oct 2015 21:47:51 +0200 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: References: Message-ID: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Hi Paolo, You may want to use ft_electroderealign immediately following the reading in. The electrode realign function allows you to rotate and translate (i.e. shift) the electrodes. Getting the electrodes properly aligned with the axes of the coordinate system will make it easier to make the layout with ft_prepare_layout. I have just made a small change to ft_electroderealign that makes it possible to use the function with only electrodes (and no MRI or head shape). You should get the latest fieldtrip version (later this evening on the FTP) or download https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m You can then do cfg = []; cfg.elec = ft_read_sens(‘your localite file’) cfg.method = ‘interactive’; elec_realigned = ft_electroderealign(cfg) cfg = []; cfg.elec = elec_realigned; layout = ft_prepare_layout(cfg); best regards, Robert On 22 Oct 2015, at 16:55, Paolo Belardinelli wrote: > Dear all, > > we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. > The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. > We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). > Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). > Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? > > 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 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 Oct 23 11:34:15 2015 From: paolo.belardinelli at gmail.com (Paolo Belardinelli) Date: Fri, 23 Oct 2015 11:34:15 +0200 Subject: [FieldTrip] Fwd: EEG electrode coordinate system transformation In-Reply-To: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> References: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Message-ID: Dear Robert, thank you very much for your answer and support. We downloaded the ft_electroderealign from the github link you sent us. We ran the code lines that you inserted in your previous email. In the resulting interactive topoplot, we were able to rotate and realign the electrode configuration properly. However, for some reason, after pushing the 'apply' button, we are still not able to save the modified configuration and manually close the interactive window. As a consequence, when visualizing the new layout, we are still plotting the old configuration. Are we missing a step in the interactive GUI or is the subfunction cb_close not working properly? Best wishes, Paolo On Thu, Oct 22, 2015 at 9:47 PM, Robert Oostenveld < r.oostenveld at donders.ru.nl> wrote: > Hi Paolo, > > You may want to use ft_electroderealign immediately following the reading > in. The electrode realign function allows you to rotate and translate (i.e. > shift) the electrodes. Getting the electrodes properly aligned with the > axes of the coordinate system will make it easier to make the layout with > ft_prepare_layout. > > I have just made a small change to ft_electroderealign that makes it > possible to use the function with only electrodes (and no MRI or head > shape). You should get the latest fieldtrip version (later this evening on > the FTP) or download > https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m > > You can then do > > cfg = []; > cfg.elec = ft_read_sens(‘your localite file’) > cfg.method = ‘interactive’; > elec_realigned = ft_electroderealign(cfg) > > cfg = []; > cfg.elec = elec_realigned; > layout = ft_prepare_layout(cfg); > > best regards, > Robert > > > > > On 22 Oct 2015, at 16:55, Paolo Belardinelli > wrote: > > Dear all, > > we are recording EEG electrode positions using the LOCALITE TMS navigator > acquisition software. We dispose over MRI data in DICOM format. > The electrode positions are stored in the (LPS) coordinate system. Unity > measures are mm. > We load the electrode positions in Fieldtrip by means of ft_read_sens. We > use the elec structure to prepare the layout with ft_prepare_layout. > Attached are the obtained layout (localite_layout) and the layout obtained > using standard electrode positions (standard_layout). > Appearantly, besides an inversion of both X and Y axes, we have to deal > with a Z offset we don't know how to exactly calculate ( a simple inversion > of axes does not provide correct results, see attached > inverted_localite_layout). > Is there a way to address this issue in Fieldtrip or with some > mathematical manipulation? > > 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 list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > 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 r.oostenveld at donders.ru.nl Fri Oct 23 14:52:36 2015 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Fri, 23 Oct 2015 14:52:36 +0200 Subject: [FieldTrip] EEG electrode coordinate system transformation In-Reply-To: References: <1433C1FB-A762-4A2A-B805-FE1122975ECF@donders.ru.nl> Message-ID: <4BC7F690-80F5-40FA-8152-BC3968E39BA3@donders.ru.nl> Hi Paolo, After pressing apply and closing the figure from electroderealign, the function returns the updated electrode structure. You are referring to cb_close, which is a subfunction that you would not see under normal situations. So I wonder whether you are running into an error (and that the function name is printed on screen). For me it works fine, both in 2014b and 2015b. But if you have an error in cb_close, the figure would not close properly and the updated electrode structure would not be returned. If you indeed have an error, please report it on http://bugzilla.fieldtriptoolbox.org/ and attach a small mat file with the elec structure in it. You should also report the operating system and the matlab version. best regards, Robert PS I will be traveling the next few days, so probably I won’t be able to respond to follow up emails for some time. On 23 Oct 2015, at 11:34, Paolo Belardinelli wrote: > Dear Robert, > thank you very much for your answer and support. > We downloaded the ft_electroderealign from the github link you sent us. > We ran the code lines that you inserted in your previous email. > In the resulting interactive topoplot, we were able to rotate and realign the electrode configuration properly. > However, for some reason, after pushing the 'apply' button, we are still not able to save the modified configuration and manually close the interactive window. > As a consequence, when visualizing the new layout, we are still plotting the old configuration. > Are we missing a step in the interactive GUI or is the subfunction cb_close not working properly? > > Best wishes, > > Paolo > > > > On Thu, Oct 22, 2015 at 9:47 PM, Robert Oostenveld wrote: > Hi Paolo, > > You may want to use ft_electroderealign immediately following the reading in. The electrode realign function allows you to rotate and translate (i.e. shift) the electrodes. Getting the electrodes properly aligned with the axes of the coordinate system will make it easier to make the layout with ft_prepare_layout. > > I have just made a small change to ft_electroderealign that makes it possible to use the function with only electrodes (and no MRI or head shape). You should get the latest fieldtrip version (later this evening on the FTP) or download https://github.com/fieldtrip/fieldtrip/blob/master/ft_electroderealign.m > > You can then do > > cfg = []; > cfg.elec = ft_read_sens(‘your localite file’) > cfg.method = ‘interactive’; > elec_realigned = ft_electroderealign(cfg) > > cfg = []; > cfg.elec = elec_realigned; > layout = ft_prepare_layout(cfg); > > best regards, > Robert > > > > > On 22 Oct 2015, at 16:55, Paolo Belardinelli wrote: > >> Dear all, >> >> we are recording EEG electrode positions using the LOCALITE TMS navigator acquisition software. We dispose over MRI data in DICOM format. >> The electrode positions are stored in the (LPS) coordinate system. Unity measures are mm. >> We load the electrode positions in Fieldtrip by means of ft_read_sens. We use the elec structure to prepare the layout with ft_prepare_layout. Attached are the obtained layout (localite_layout) and the layout obtained using standard electrode positions (standard_layout). >> Appearantly, besides an inversion of both X and Y axes, we have to deal with a Z offset we don't know how to exactly calculate ( a simple inversion of axes does not provide correct results, see attached inverted_localite_layout). >> Is there a way to address this issue in Fieldtrip or with some mathematical manipulation? >> >> 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 list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > 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 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From helen.wieffering at gmail.com Fri Oct 23 23:53:48 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Fri, 23 Oct 2015 17:53:48 -0400 Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis In-Reply-To: References: Message-ID: Hi Per, Thanks for your suggestion, and I'm sorry for my (much) delayed reply. I've read the paper you mentioned - it seems this could be promising for my work, too. I hadn't considered the non-parametric approach. Could you give me more detail on the pre-processing steps you took and the parameters you're using with the fieldtrip connectivity functions? I'd love to look at the scripts you're using, too, if at all possible. Thanks again. Helen Wieffering Bowdoin College On Wed, Oct 7, 2015 at 4:55 PM, Per Arnold Lysne wrote: > Hi Helen, > > > I am having good luck with ft_connectivity_analysis in MEG using the > nonparametric Granger approach of Dhamala, Rangarajan & Ding, 2008, > Neuroimage and Physical Review letters. > > > Thanks, > > > Per Lysne > > University of New Mexico > > lysne at unm.edu > > > -----Original Message----- > From: Helen Wieffering > Sent: Oct 7, 2015 8:59 AM > To: FieldTrip discussion list > Subject: [FieldTrip] Granger Causality with ft_connectivity_analysis > > Dear FieldTrip users, > > I'm writing to see if any one out there has had success with computing > Granger causality measures in FieldTrip. We have been working toward making > this analysis possible with our EEG data and have now reached the final > stages. > > However, we find that ft_connectivity_analysis (and > ft_connectivity_granger for that matter) offers little guidance on how to > achieve a good mvar model fit. For example, the function asks the user to > specify the model order without offering tests for whiteness, stationarity, > or consistency. It seems that Fieldtrip calls on the BSMART toolbox to > perform these operations, which further confuses me given that BSMART > itself offers these model validation tests. Yet they don't seem to ever be > called upon by FieldTrip. > > We've considered using the BSMART toolbox separately from FieldTrip, yet > the toolbox website is rather outdated and the functions are only > compatible through 2008 Matlab - seems like a headache. But without tools > for validating the mvar model, we can't be confident of any GC results > achieved through FieldTrip. > > Are there perhaps further connectivity tools in FieldTrip that I've > overlooked? Or is it worth looking into other toolboxes? We've also > considered SIFT and the MVGC toolbox, but would love to keep working with > FieldTrip if possible. > > If anyone can offer advice, or connect me with someone knowledgeable in > this area, I'd love to know. > > Thanks very much, > > Helen Wieffering > Bowdoin College > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishwaryaselvaraj1708 at gmail.com Sun Oct 25 08:10:30 2015 From: aishwaryaselvaraj1708 at gmail.com (aishwarya selvaraj) Date: Sun, 25 Oct 2015 12:40:30 +0530 Subject: [FieldTrip] field trip Message-ID: Hi , I am a student who is working on emotiv epoc headset for my project . i just downloaded field trip and added to matlab directory successfully . And i was going through the manual ,but i found it difficult to understand anything . Basically i want to start using emotiv with matlab using field trip toolbox Could you help with a start PS:i would want to have a live streaming from the headset into matlab with field trip Waiting for your reply :) Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Sun Oct 25 13:04:26 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Sun, 25 Oct 2015 12:04:26 +0000 Subject: [FieldTrip] field trip Message-ID: It sounds like you want to do real-time analysis; does this link help? http://www.fieldtriptoolbox.org/getting_started/realtime You can also read the general tutorials information: http://www.fieldtriptoolbox.org/tutorial/introduction http://www.fieldtriptoolbox.org/walkthrough http://www.fieldtriptoolbox.org/tutorial Beyond that, it's going to be hard for anyone to give you more detailed help unless you can explain more specifically what you are looking for, what you have read on the site so far, and what about it is lacking. 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: Sun, 25 Oct 2015 12:40:30 +0530 > From: aishwarya selvaraj > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] field trip > Message-ID: > < > CACWTKSr6E2P+58xw4z5YbK_u6KV-230oAsDxgjFMjpw8VeS4Yg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi , > I am a student who is working on emotiv epoc headset for my project . > i just downloaded field trip and added to matlab directory successfully . > And i was going through the manual ,but i found it difficult to understand > anything . > Basically i want to start using emotiv with matlab using field trip toolbox > Could you help with a start > PS:i would want to have a live streaming from the headset into matlab with > field trip > > Waiting for your reply :) > Regards > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151025/d5a10445/attachment-0001.html > > > > ------------------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.caballero at bcbl.eu Mon Oct 26 20:50:17 2015 From: c.caballero at bcbl.eu (Cesar Caballero) Date: Mon, 26 Oct 2015 20:50:17 +0100 (CET) Subject: [FieldTrip] error when creating head model in tutorial Message-ID: <1228077923.817774.1445889017673.JavaMail.zimbra@bcbl.eu> Dear all, I'm doing the tutorial to create the head model for EEG with my own nifti dataset. http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg When I try to create the head model, I have the following error: >> cfg = []; >> cfg.method = 'dipoli'; >> vol = ft_prepare_headmodel(cfg, bnd); Illegal right hand side in assignment. Too many elements. Error in ft_datatype_source>fixpos (line 337) source.pos = source.pnt; Error in ft_datatype_source (line 110) source = fixpos(source); Error in ft_checkdata (line 233) data = ft_datatype_source(data); Error in ft_prepare_headmodel (line 193) data = ft_checkdata(data, 'hasunit', 'yes'); I'd be pleased if anyone could point me out to the reason of the error. Thanks in advance for your time. Best wishes, Cesar ---------------------------------------------------------------------- Cesar Caballero MRI engineer www.bcbl.eu Twitter: @caballerogaudes www.researchgate.net/profile/Cesar_Caballero2 Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer From mishra408 at gmail.com Tue Oct 27 09:32:49 2015 From: mishra408 at gmail.com (Ashutosh Mishra) Date: Tue, 27 Oct 2015 14:02:49 +0530 Subject: [FieldTrip] Dipole lies on the boundary of volume model Message-ID: Hi, While computing sources, I get the "warning:dipole lies on boundary of volume model ". I noticed that lead field matrix for those dipoles matrix with NaN values, which further cause a problem in computing sources. 1. Can we neglect those dipoles? 2. If not then how could we fix this? Thanks Ashutosh -- Ashutosh Mishra -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.vanEs at donders.ru.nl Tue Oct 27 15:29:19 2015 From: M.vanEs at donders.ru.nl (Es, M.W.J. van (Mats)) Date: Tue, 27 Oct 2015 14:29:19 +0000 Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Oct 27 15:44:56 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 27 Oct 2015 14:44:56 +0000 Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis In-Reply-To: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> References: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7@exprd01.hosting.ru.nl> Message-ID: Hi Mats, Based on your description I suspect an issue with floating point numerical round off. I would assume that the length of your trials is fixed and the time axis supposed to be equal across trials? Could you try and do data.time(1:end) = data.time(1); and report back whether the problem persists (or vanishes)? Best, Jan-Mathijs On Oct 27, 2015, at 3:29 PM, Es, M.W.J. van (Mats) > wrote: Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.vanlier at bsse.ethz.ch Tue Oct 27 16:28:44 2015 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Tue, 27 Oct 2015 15:28:44 +0000 Subject: [FieldTrip] comodugrams (power-power correlation) Message-ID: Hi FieldTrip, I am trying to get the comodugrams of each channel pair to look for power-power correlations across frequencies. It would be great to multiplot them (depending on refchannel) with freqs on x and y, and corrcoefs on z. I can't seem to get the right output from connectivityanalysis. Is there a clever way of doing this within fieldtrip? Will multiplotTFR be able to handle this? Need to trick it into thinking one freq dim is a time dim I guess. cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.vanEs at donders.ru.nl Wed Oct 28 13:13:17 2015 From: M.vanEs at donders.ru.nl (Es, M.W.J. van (Mats)) Date: Wed, 28 Oct 2015 12:13:17 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 59, Issue 27 In-Reply-To: References: Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AF8@exprd01.hosting.ru.nl> Hi Jan-Mathijs, the length of trials is indeed fixed and the time axis was the same for all trials, so your option did not work. I did find the problem however: the time-window I tried to select was inconsistent with the time axis of the trials. I shifted the time-axis with 1/(2*Fs) and now the axes are equal again. Thank you for your help. Best, Mats ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of fieldtrip-request at science.ru.nl [fieldtrip-request at science.ru.nl] Sent: Wednesday, October 28, 2015 12:00 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 59, Issue 27 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. Problem matrix dim in ft_timelockanalysis (Es, M.W.J. van (Mats)) 2. Re: Problem matrix dim in ft_timelockanalysis (Schoffelen, J.M. (Jan Mathijs)) 3. comodugrams (power-power correlation) (van Lier Ben) ---------------------------------------------------------------------- Message: 1 Date: Tue, 27 Oct 2015 14:29:19 +0000 From: "Es, M.W.J. van (Mats)" To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF277F1AD7 at exprd01.hosting.ru.nl> Content-Type: text/plain; charset="iso-8859-1" Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 27 Oct 2015 14:44:56 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Problem matrix dim in ft_timelockanalysis Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi Mats, Based on your description I suspect an issue with floating point numerical round off. I would assume that the length of your trials is fixed and the time axis supposed to be equal across trials? Could you try and do data.time(1:end) = data.time(1); and report back whether the problem persists (or vanishes)? Best, Jan-Mathijs On Oct 27, 2015, at 3:29 PM, Es, M.W.J. van (Mats) > wrote: Hi FieldTrippers, I want to apply a support vector machine (SVM) on small timewindows of my data, which means I loop ft_timelockanalysis and ft_timelockstatistics over time. However, for some timepoint I get the following error: Index exceeds matrix dimensions. Error in ft_timelockanalysis (line 278) s (:,windowsel) = s (:,windowsel) + dat; % compute the sum I tried to look into the error, and I saw that for some timewindows 'windowsel' and 'dat' are a 1x4 vector, whereas 's' is a 1x3 vector. I couldn't find why this mismatch occurs so any help is appreciated. I also tried older versions of this function and I got the same error. I am using the latest fieldtrip on matlab2015a on the cluster. Best, Mats van Es _______________________________________________ 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: 3 Date: Tue, 27 Oct 2015 15:28:44 +0000 From: "van Lier Ben" To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] comodugrams (power-power correlation) Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi FieldTrip, I am trying to get the comodugrams of each channel pair to look for power-power correlations across frequencies. It would be great to multiplot them (depending on refchannel) with freqs on x and y, and corrcoefs on z. I can't seem to get the right output from connectivityanalysis. Is there a clever way of doing this within fieldtrip? Will multiplotTFR be able to handle this? Need to trick it into thinking one freq dim is a time dim I guess. cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 59, Issue 27 ***************************************** From daniel.haehnke at tum.de Wed Oct 28 15:41:03 2015 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Wed, 28 Oct 2015 14:41:03 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation Message-ID: Dear fellow Fieldtrip users, I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Thanks in advance for your ideas! All the 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 helen.wieffering at gmail.com Wed Oct 28 23:37:45 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 28 Oct 2015 18:37:45 -0400 Subject: [FieldTrip] Changing dimord of Cross Spectral Density matrix Message-ID: Dear Fieldtrip Users, I am trying to use the function ft_connectivitiy_csd2transfer in order to compute non-parametric Granger Causality measures. In order to do so, I have my frequency analysis data in the following form: freq = label: {129x1 cell} dimord: 'chan_freq_time' freq: [4 4.5000 5 5.5000 6] time: [1x41 double] powspctrm: [129x5x41 double] labelcmb: {8256x2 cell} crsspctrm: [8256x5x41 double] cfg: [1x1 struct] In my data, the crsspctrm matrix has a dimord of chan_freq_time -- however, the function ft_connectivity_csd2transfer requires a dimord of chan_chan_freq(_time). Does anyone have insight on how to change the dimord of my data? I understand that Fieldtrip's ft_freqanalysis function treats (a, b) and (b, a) cross spectra as identical and therefore omits half of all possible combinations. Ideally, though, I'd like for my crsspctrm matrix to contain all possible combinations between channels, including the auto-spectra. Thanks for your help! Helen Wieffering Bowdoin College -------------- next part -------------- An HTML attachment was scrubbed... URL: From helen.wieffering at gmail.com Thu Oct 29 00:30:05 2015 From: helen.wieffering at gmail.com (Helen Wieffering) Date: Wed, 28 Oct 2015 19:30:05 -0400 Subject: [FieldTrip] Changing dimord of Cross Spectral Density matrix In-Reply-To: References: Message-ID: Hello again, I've just realized the question in my previous e-mail is irrelevant when I proceed with ft_connectivityanalysis instead, using 'granger' as the method. I wasn't aware that this function could also perform nonparametric granger methods. Still, if anyone has insight on this or would like to connect about approaches, I'd love to hear. Best, Helen On Wed, Oct 28, 2015 at 6:37 PM, Helen Wieffering < helen.wieffering at gmail.com> wrote: > Dear Fieldtrip Users, > > I am trying to use the function ft_connectivitiy_csd2transfer in order to > compute non-parametric Granger Causality measures. > > In order to do so, I have my frequency analysis data in the following > form: > freq = > > label: {129x1 cell} > dimord: 'chan_freq_time' > freq: [4 4.5000 5 5.5000 6] > time: [1x41 double] > powspctrm: [129x5x41 double] > labelcmb: {8256x2 cell} > crsspctrm: [8256x5x41 double] > cfg: [1x1 struct] > > In my data, the crsspctrm matrix has a dimord of chan_freq_time -- > however, the function ft_connectivity_csd2transfer requires a dimord of > chan_chan_freq(_time). > > Does anyone have insight on how to change the dimord of my data? > > I understand that Fieldtrip's ft_freqanalysis function treats (a, b) and > (b, a) cross spectra as identical and therefore omits half of all possible > combinations. Ideally, though, I'd like for my crsspctrm matrix to contain > all possible combinations between channels, including the auto-spectra. > > Thanks for your help! > > Helen Wieffering > Bowdoin College > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Thu Oct 29 04:44:26 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Wed, 28 Oct 2015 20:44:26 -0700 Subject: [FieldTrip] many ICA components looking the same Message-ID: <5631961A.1050507@gmail.com> Hi everyone, I'm running ICA (cfg.method = 'runica') on CTF data with 274 sensors. I was restricting my decomposition to 80 components at first, and it worked well for all previous patients. Somehow, for this particular patient, many of the components have similar topography (I'm only showing till 42 below but the similarity continues for more components). Has anyone ever seen this before? If I look at the time course of these components, not all of them are clear eye-movements, but according to the topography, you'd think they are. Any thoughts, like either changing the method or rejecting only those components whose time courses clearly indicate eye movements and keep other components despite their topographies? Thanks, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: jcbdeahi.png Type: image/png Size: 164624 bytes Desc: not available URL: From stephen.politzer-ahles at ling-phil.ox.ac.uk Thu Oct 29 07:31:19 2015 From: stephen.politzer-ahles at ling-phil.ox.ac.uk (Stephen Politzer-Ahles) Date: Thu, 29 Oct 2015 06:31:19 +0000 Subject: [FieldTrip] many ICA components looking the same Message-ID: Hello Vitoria, I'm not sure, but one of my guesses would be head movement. That is to say, if the participant moves her head an inch (for example) then the same type of activity is going to start appearing on different sensors, and if that movement isn't corrected for then you can indeed start seeing what looks like many copies of the same component. (If you've done EEG, this is the same thing that happens when, for example, you bring the same participant back for multiple sessions on separate days and concatenate the datasets together, but didn't put the cap on on exactly the same place each time.) Do you have marker measurements you can use to at least check how much the head was moving, and perhaps to correct for movements over the course of the session? Best, Steve --- Stephen Politzer-Ahles University of Oxford Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology http://users.ox.ac.uk/~cpgl0080/ > Message: 5 > Date: Wed, 28 Oct 2015 20:44:26 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: [FieldTrip] many ICA components looking the same > Message-ID: <5631961A.1050507 at gmail.com> > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi everyone, > > I'm running ICA (cfg.method = 'runica') on CTF data with 274 sensors. I > was restricting my decomposition to 80 components at first, and it > worked well for all previous patients. > Somehow, for this particular patient, many of the components have > similar topography (I'm only showing till 42 below but the similarity > continues for more components). Has anyone ever seen this before? > If I look at the time course of these components, not all of them are > clear eye-movements, but according to the topography, you'd think they are. > Any thoughts, like either changing the method or rejecting only those > components whose time courses clearly indicate eye movements and keep > other components despite their topographies? > > Thanks, > Vitoria > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151028/bd0a6b81/attachment.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: jcbdeahi.png > Type: image/png > Size: 164624 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151028/bd0a6b81/attachment.png > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 28 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 29 07:49:08 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 29 Oct 2015 06:49:08 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: References: Message-ID: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Hi Daniel > I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. Has anyone said to you it would not be challenging ;o)? > While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data. This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with a leave-one-out approach. > 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? Yes. > 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can be prevented to start from the right format of the data to begin with (as per ft_freqanalysis). > I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Please do. Best, Jan-Mathijs > > Thanks in advance for your ideas! > > All the 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 alik.widge at gmail.com Thu Oct 29 10:42:01 2015 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 29 Oct 2015 05:42:01 -0400 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> References: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Message-ID: You may also find this informative: http://www.sciencedirect.com/science/article/pii/S1053811915003316 Disclaimer: I have not personally tried this yet, although it's on our list for a near future. Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Hi Daniel > > > I am currently computing the Granger causality between LFP signals from > different brain regions. As it turns out, this is a more challenging > endeavour than I had previously thought. > > Has anyone said to you it would not be challenging ;o)? > > > While testing parametric and non-parametric approaches to computing > Granger causality, I came across some behaviour which seems odd to me. I > hope someone can shed light on these issues: > > > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> > ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR > data that contains a trial dimension. The first error is actually that it > can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis > with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ > field. However, if I manually copy the ‘label’ field from the original data > to the MVAR data, ft_freqanalysis stops at some point where it uses an > array that lacks one dimension. > > OK, this could (or could not) be a general issue with the code. The part > of FieldTrip that deals with AR-modelling is quite old, and it could be > that more recent changes in other parts of the code (e.g. concerning with > data bookkeeping) destroyed some of the functionality. None of the > developers are actively using AR-models in their daily research nowadays, > so it could be that this code is a bit stale. This being said, in general I > don’t think it is a good idea to fit an AR-model to a single trial worth of > data. This would probably lead to not so meaningful estimates. It would be > more meaningful to use a jackknife approach, where a variance across trials > (or some measure that quantifies the extent to which a single trial differs > from the rest) can be obtained with a leave-one-out approach. > > > 2. Using the non-parametric approach (ft_freqanalysis -> > ft_connectivityanalysis) I stumbled across the problem that the > implementation of Wilson’s algorithm that computes the factorisation of the > spectral density matrix doesn’t allow non-integer frequencies nor non-equal > distances between frequencies. Is this an inherent limitation of this > algorithm? > > Yes. > > > 3. Again for the non-parametric approach: If I use trial-resolved FREQ > data for ft_connectivityanalysis, the trial dimension is lost at line 389 > if I use data contain a ‘fourierspctrm’ field. If I use data containing a > ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at > line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not > resolved by using FREQ data which has both a ‘powspctrm’ as well as a > ‘crsspctrm’ field. > > The input into ft_connectivityanalysis should be a frequency domain data > structure containing either a ‘fourierspctrm’ (obtained with > cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with > cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I > would expect it to crash, if it doesn’t we should consider making the error > handling more strict. Also, for Wilson’s algorithm, the estimate of the > cross-spectral density needs to be somewhat robust, and a single trial > estimate in my opinion does not really make sense. The step at which the > fourierspctrm representation is converted into the cross-spectrum ‘knows’ > this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata > can in deed be notoriously slow in some cases, which can be prevented to > start from the right format of the data to begin with (as per > ft_freqanalysis). > > > I’m not really sure whether I need trial-resolved Granger-causality, but > in theory this should be possible. Of course, I could work around this > issue by just using 1-trial FREQ data for ft_connectivityanalysis. > > Please do. > > > Best, > Jan-Mathijs > > > > > > > Thanks in advance for your ideas! > > > > All the 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 peyton.finley at my.wheaton.edu Thu Oct 29 16:19:40 2015 From: peyton.finley at my.wheaton.edu (Peyton Finley) Date: Thu, 29 Oct 2015 10:19:40 -0500 Subject: [FieldTrip] Fast Fourier Transform Using EEGLab Message-ID: Hello, My name is Peyton Finley and I am an undergraduate research student at Wheaton College in Wheaton, Illinois. I am emailing you regarding how to conduct a Fast Fourier Transform using FieldTrip. Specifically, I am trying to use the function ft_freqstatistics.m to gather statistics for the FFT. The function requires what is noted as a "design matrix". This is the description: Nxnumobservations: design matrix (for examples/advice, please see the Fieldtrip wiki, especially cluster-permutation tutorial and the 'walkthrough' design-matrix section) I checked the FieldTrip wiki site, but I was unable to find anything on this design matrix. What is the design matrix and how do I construct it? Also, is this the correct way of performing a FFT on EEG data? Is there an alternate method? Before arriving at this point, I have performed the following steps. cfg = []; ft_defaults; cfg.dataset = dataset; preprocdata=ft_preprocessing(cfg); data=struct2single(preprocdata); %% Define cfg for ft_frequanalysis.m and run. cfg = []; cfg.output='fourier'; cfg.method='mtmfft'; cfg.outputfile=outputFileName; cfg.foilim=[0 55]; cfg.tapsmofrq='2'; [freq]=ft_freqanalysis(cfg,data); %% Define cfg for ft_freqstatistics.m and run. cfg = []; cfg.method='analytic'; [stat]=ft_freqstatistics(cfg, freq); Sincerely, Peyton Finley -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Thu Oct 29 16:49:57 2015 From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=) Date: Thu, 29 Oct 2015 16:49:57 +0100 Subject: [FieldTrip] Fast Fourier Transform Using EEGLab In-Reply-To: References: Message-ID: <00aa01d11261$767e4750$637ad5f0$@artinis.com> Dear Peyton, You might want to check this out: http://www.fieldtriptoolbox.org/walkthrough#input_output_structure_of_ft_freqstatistics And the tutorials on statistic, e.g. http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq However, note that doing an FFT has nothing to do with ft_freqstatistics. You need ft_freqanalysis for that and did that just fine with the code you shared (and, as with everything in life, there is not *the* correct way to do anything, but the way you did it should be fine). 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 Peyton Finley Sent: Thursday, October 29, 2015 16:20 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Fast Fourier Transform Using EEGLab Hello, My name is Peyton Finley and I am an undergraduate research student at Wheaton College in Wheaton, Illinois. I am emailing you regarding how to conduct a Fast Fourier Transform using FieldTrip. Specifically, I am trying to use the function ft_freqstatistics.m to gather statistics for the FFT. The function requires what is noted as a "design matrix". This is the description: Nxnumobservations: design matrix (for examples/advice, please see the Fieldtrip wiki, especially cluster-permutation tutorial and the 'walkthrough' design-matrix section) I checked the FieldTrip wiki site, but I was unable to find anything on this design matrix. What is the design matrix and how do I construct it? Also, is this the correct way of performing a FFT on EEG data? Is there an alternate method? Before arriving at this point, I have performed the following steps. cfg = []; ft_defaults; cfg.dataset = dataset; preprocdata=ft_preprocessing(cfg); data=struct2single(preprocdata); %% Define cfg for ft_frequanalysis.m and run. cfg = []; cfg.output='fourier'; cfg.method='mtmfft'; cfg.outputfile=outputFileName; cfg.foilim=[0 55]; cfg.tapsmofrq='2'; [freq]=ft_freqanalysis(cfg,data); %% Define cfg for ft_freqstatistics.m and run. cfg = []; cfg.method='analytic'; [stat]=ft_freqstatistics(cfg, freq); Sincerely, Peyton Finley -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.haehnke at tum.de Thu Oct 29 18:25:31 2015 From: daniel.haehnke at tum.de (=?utf-8?B?SMOkaG5rZSwgRGFuaWVs?=) Date: Thu, 29 Oct 2015 17:25:31 +0000 Subject: [FieldTrip] Granger causality - parametric and non-parametric calculation In-Reply-To: References: <32A3AB91-9F56-4AE8-BF5F-8E825EE818FE@fcdonders.ru.nl> Message-ID: Thank you Jan-Mathijs for your opinion and suggestions! Thanks, Alik for the paper, this looks interesting. Now that I applied non-parametrically calculated Granger-causality for my data, I have to follow-up questions: 1. During the computation of spectral factorisation, the implementation of Wilson’s algorithm complains that “when performing non-parametric spectral factorisation the frequency axis should ideally be zero-padded”. I guess this means that the frequency axis should start at 0. However, as far as I can see that’s not possible using ft_freqanalysis. The code then goes on and performs the zero-padding. I don’t really understand why exactly it does the padding the way it does: it seems to add other frequencies as well, so that the frequency axis the algorithm is actually working with starts with 0 and is followed by some frequencies that are even higher than the first frequency from the original axis, before the original axis is starts. So my questions are: Should I be concerned about this warning? Why is the zero-padding of the frequency axis so weird? 2. I found that when I apply the GC computation to my data there seems to be some kind of edge artefact at the highest frequencies when I average across combinations that represent the same anatomical direction (see attached plot). Why do I get this effect and is it related to my first question? Best, Daniel[cid:6282C030-CD90-405E-BCED-AD7F0DDA754A] On 29 Oct 2015, at 10:42, Alik Widge > wrote: You may also find this informative: http://www.sciencedirect.com/science/article/pii/S1053811915003316 Disclaimer: I have not personally tried this yet, although it's on our list for a near future. Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 29, 2015 at 2:49 AM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Daniel > I am currently computing the Granger causality between LFP signals from different brain regions. As it turns out, this is a more challenging endeavour than I had previously thought. Has anyone said to you it would not be challenging ;o)? > While testing parametric and non-parametric approaches to computing Granger causality, I came across some behaviour which seems odd to me. I hope someone can shed light on these issues: > > 1. Using the parametric approach (ft_mvaranalysis -> ft_freqanalysis -> ft_connectivityanalysis) I found that ft_freqanalysis can’t deal with MVAR data that contains a trial dimension. The first error is actually that it can’t find the field ‘label’, and this is true: if you run ft_mvaranalysis with cfg.keeptrials = ‘yes’, the resulting structure lacks the ‘label’ field. However, if I manually copy the ‘label’ field from the original data to the MVAR data, ft_freqanalysis stops at some point where it uses an array that lacks one dimension. OK, this could (or could not) be a general issue with the code. The part of FieldTrip that deals with AR-modelling is quite old, and it could be that more recent changes in other parts of the code (e.g. concerning with data bookkeeping) destroyed some of the functionality. None of the developers are actively using AR-models in their daily research nowadays, so it could be that this code is a bit stale. This being said, in general I don’t think it is a good idea to fit an AR-model to a single trial worth of data. This would probably lead to not so meaningful estimates. It would be more meaningful to use a jackknife approach, where a variance across trials (or some measure that quantifies the extent to which a single trial differs from the rest) can be obtained with a leave-one-out approach. > 2. Using the non-parametric approach (ft_freqanalysis -> ft_connectivityanalysis) I stumbled across the problem that the implementation of Wilson’s algorithm that computes the factorisation of the spectral density matrix doesn’t allow non-integer frequencies nor non-equal distances between frequencies. Is this an inherent limitation of this algorithm? Yes. > 3. Again for the non-parametric approach: If I use trial-resolved FREQ data for ft_connectivityanalysis, the trial dimension is lost at line 389 if I use data contain a ‘fourierspctrm’ field. If I use data containing a ‘powspctrm’ field, it takes literally hours at line 392 to ‘fix’ the CSD at line 585 in ft_checkdata (which uses ‘fixcsd’) for every trial. This is not resolved by using FREQ data which has both a ‘powspctrm’ as well as a ‘crsspctrm’ field. The input into ft_connectivityanalysis should be a frequency domain data structure containing either a ‘fourierspctrm’ (obtained with cfg.output=‘fourier’), or a crsspctrm/powspctrm (obtained with cfg.output=‘powandcsd’). Specifying cfg.output=‘pow’ does not make sense. I would expect it to crash, if it doesn’t we should consider making the error handling more strict. Also, for Wilson’s algorithm, the estimate of the cross-spectral density needs to be somewhat robust, and a single trial estimate in my opinion does not really make sense. The step at which the fourierspctrm representation is converted into the cross-spectrum ‘knows’ this, and kicks out the trial dimension. The ‘fixcsd’ step in ft_checkdata can in deed be notoriously slow in some cases, which can be prevented to start from the right format of the data to begin with (as per ft_freqanalysis). > I’m not really sure whether I need trial-resolved Granger-causality, but in theory this should be possible. Of course, I could work around this issue by just using 1-trial FREQ data for ft_connectivityanalysis. Please do. Best, Jan-Mathijs > > Thanks in advance for your ideas! > > All the 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: granger.PNG Type: image/png Size: 82768 bytes Desc: granger.PNG URL: From v.piai.research at gmail.com Thu Oct 29 19:01:32 2015 From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=) Date: Thu, 29 Oct 2015 11:01:32 -0700 Subject: [FieldTrip] many ICA components looking the same In-Reply-To: References: Message-ID: <56325EFC.2050802@gmail.com> hi Steve, Thanks, sounds like a very reasonable explanation. I'm wondering whether I could use Arjen's correction for head movement prior to ICA decomposition, but I can imagine there would be problems with doing the regression first... I'll ask Arjen what he thinks and post it here - if he doesn't see this before I see him again - but I'd be curious to hear what you think as well. Thanks a lot! Vitoria On 10/28/2015 11:31 PM, Stephen Politzer-Ahles wrote: > Hello Vitoria, > > I'm not sure, but one of my guesses would be head movement. That is to > say, if the participant moves her head an inch (for example) then the > same type of activity is going to start appearing on different > sensors, and if that movement isn't corrected for then you can indeed > start seeing what looks like many copies of the same component. (If > you've done EEG, this is the same thing that happens when, for > example, you bring the same participant back for multiple sessions on > separate days and concatenate the datasets together, but didn't put > the cap on on exactly the same place each time.) Do you have marker > measurements you can use to at least check how much the head was > moving, and perhaps to correct for movements over the course of the > session? > > Best, > Steve > > > > --- > Stephen Politzer-Ahles > University of Oxford > Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology > http://users.ox.ac.uk/~cpgl0080/ > > Message: 5 > Date: Wed, 28 Oct 2015 20:44:26 -0700 > From: Vit?ria Piai > > To: FieldTrip discussion list > > Subject: [FieldTrip] many ICA components looking the same > Message-ID: <5631961A.1050507 at gmail.com > > > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hi everyone, > > I'm running ICA (cfg.method = 'runica') on CTF data with 274 > sensors. I > was restricting my decomposition to 80 components at first, and it > worked well for all previous patients. > Somehow, for this particular patient, many of the components have > similar topography (I'm only showing till 42 below but the similarity > continues for more components). Has anyone ever seen this before? > If I look at the time course of these components, not all of them are > clear eye-movements, but according to the topography, you'd think > they are. > Any thoughts, like either changing the method or rejecting only those > components whose time courses clearly indicate eye movements and keep > other components despite their topographies? > > Thanks, > Vitoria > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: jcbdeahi.png > Type: image/png > Size: 164624 bytes > Desc: not available > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 59, Issue 28 > ***************************************** > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Fri Oct 30 18:28:59 2015 From: v.piai.research at gmail.com (Vitoria Piai) Date: Fri, 30 Oct 2015 10:28:59 -0700 Subject: [FieldTrip] many ICA components looking the same In-Reply-To: <56325EFC.2050802@gmail.com> References: <56325EFC.2050802@gmail.com> Message-ID: <5633A8DB.9010103@gmail.com> Hi all, Just adding this info for the sake of completeness. Thanks, Arjen, for clarifying it! As I suspected, it's *really* not a good idea to use ft_regressconfound before ICA. In fact, this function should be used only at the very latest stages of your analysis, either just before doing stats, or by incorporating the approach in the stats itself. Vitória On 10/29/2015 11:01 AM, Vitória Piai wrote: > hi Steve, > > Thanks, sounds like a very reasonable explanation. > I'm wondering whether I could use Arjen's correction for head movement > prior to ICA decomposition, but I can imagine there would be problems > with doing the regression first... I'll ask Arjen what he thinks and > post it here - if he doesn't see this before I see him again - but I'd > be curious to hear what you think as well. > > Thanks a lot! > Vitoria > > On 10/28/2015 11:31 PM, Stephen Politzer-Ahles wrote: >> Hello Vitoria, >> >> I'm not sure, but one of my guesses would be head movement. That is >> to say, if the participant moves her head an inch (for example) then >> the same type of activity is going to start appearing on different >> sensors, and if that movement isn't corrected for then you can indeed >> start seeing what looks like many copies of the same component. (If >> you've done EEG, this is the same thing that happens when, for >> example, you bring the same participant back for multiple sessions on >> separate days and concatenate the datasets together, but didn't put >> the cap on on exactly the same place each time.) Do you have marker >> measurements you can use to at least check how much the head was >> moving, and perhaps to correct for movements over the course of the >> session? >> >> Best, >> Steve >> >> >> >> --- >> Stephen Politzer-Ahles >> University of Oxford >> Language and Brain Lab, Faculty of Linguistics, Phonetics & Philology >> http://users.ox.ac.uk/~cpgl0080/ >> >> Message: 5 >> Date: Wed, 28 Oct 2015 20:44:26 -0700 >> From: Vit?ria Piai > > >> To: FieldTrip discussion list >> Subject: [FieldTrip] many ICA components looking the same >> Message-ID: <5631961A.1050507 at gmail.com >> > >> Content-Type: text/plain; charset="utf-8"; Format="flowed" >> >> Hi everyone, >> >> I'm running ICA (cfg.method = 'runica') on CTF data with 274 >> sensors. I >> was restricting my decomposition to 80 components at first, and it >> worked well for all previous patients. >> Somehow, for this particular patient, many of the components have >> similar topography (I'm only showing till 42 below but the similarity >> continues for more components). Has anyone ever seen this before? >> If I look at the time course of these components, not all of them are >> clear eye-movements, but according to the topography, you'd think >> they are. >> Any thoughts, like either changing the method or rejecting only those >> components whose time courses clearly indicate eye movements and keep >> other components despite their topographies? >> >> Thanks, >> Vitoria >> >> >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> -------------- next part -------------- >> A non-text attachment was scrubbed... >> Name: jcbdeahi.png >> Type: image/png >> Size: 164624 bytes >> Desc: not available >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 59, Issue 28 >> ***************************************** >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.dipisa at gmail.com Fri Oct 30 18:49:31 2015 From: g.dipisa at gmail.com (Grazia Di Pisa) Date: Fri, 30 Oct 2015 18:49:31 +0100 Subject: [FieldTrip] ft_redefinetrial and response correctness Message-ID: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> Hi all, I have a question about ft_redefinetrial. So, I have two conditions S 11 and S 31, respectively ‘in-synch’ and ’not-in-synch’ and participants were instructed to press 1 or 2 in the keyboard to report their answer, S 1 for ‘not-in-synch’ and S 2 for ‘in-synch’. What I need to do is TFR analysis only for the trials where participants answered correctly, that is S 11 & S 2 and S 31 & S 1 (below an extract from a .vmrk file showing a correct match). Mk3=Stimulus,S 11,33182,1,0 Mk4=Stimulus,S 12,33782,1,0 Mk5=Stimulus,S 13,33902,1,0 Mk6=Stimulus,S 14,34582,1,0 Mk7=Stimulus,S 2,37915,1,0 Mk8=Stimulus,S 31,40352,1,0 Mk9=Stimulus,S 63,40952,1,0 Mk10=Stimulus,S 32,40953,1,0 Mk11=Stimulus,S 33,41112,1,0 Mk12=Stimulus,S 35,41792,1,0 Mk13=Stimulus,S 34,41793,1,0 Mk14=Stimulus,S 35,44634,1,0 Mk15=Stimulus,S 1,44635,1,0 From the tutorials, I’ve understood that I should have done this in my trialfun when I defined my trials during the pre-processing step, but today we realised that some subjects perceived as out-of-synch the condition in-synch and viceversa. So, I was wondering how could I do this now - could I do this using the ft_redefinetrial or worst-case-scenario should I do the pre-processing all over again? I wrote the code below before starting the TRF analysis but it’s not correct since it’s not working: %Redefine trials cfg = []; cfg.trials = 'all'; cfg.trialdef.eventtype = 'Stimulus'; % we are interested in Stimulus markers cfg.trialdef.eventvalue = { 'S 11' 'S 31' }; cfg.trialdef.eventcorrect = [ 'S 2' 'S 1' ]; % correct response Stimulus S 2 for S 11 and S 1 for S 31 cfg.toilim = [-1.8 2.0]; data = ft_redefinetrial(cfg, data); Any suggestions/help is more than welcome! thanks in advance, ~ grazia -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sat Oct 31 01:16:58 2015 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 30 Oct 2015 20:16:58 -0400 Subject: [FieldTrip] ft_redefinetrial and response correctness In-Reply-To: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> References: <19FFE871-7B50-4336-975B-4FC4A94ACA3C@gmail.com> Message-ID: Hi Grazia, In the past I ran into difficulty with my trial function when my triggers were strings. can you remove the ’S’ and change your triggers to numeric values? If not, perhaps I can try if you give me a snippet of data (although I am unfamiliar with .vmk), my old trial functions did what you need. Alternatively, break down this process by using ft_read_event ( http://www.fieldtriptoolbox.org/reference/ft_read_event ) and ft_read_header (http://www.fieldtriptoolbox.org/reference/ft_read_header ). Best, Raquel > On Oct 30, 2015, at 1:49 PM, Grazia Di Pisa wrote: > > Hi all, > > I have a question about ft_redefinetrial. So, I have two conditions S 11 and S 31, respectively ‘in-synch’ and ’not-in-synch’ and participants were instructed to press 1 or 2 in the keyboard to report their answer, S 1 for ‘not-in-synch’ and S 2 for ‘in-synch’. > > What I need to do is TFR analysis only for the trials where participants answered correctly, that is S 11 & S 2 and S 31 & S 1 (below an extract from a .vmrk file showing a correct match). > > Mk3=Stimulus,S 11,33182,1,0 > Mk4=Stimulus,S 12,33782,1,0 > Mk5=Stimulus,S 13,33902,1,0 > Mk6=Stimulus,S 14,34582,1,0 > Mk7=Stimulus,S 2,37915,1,0 > > Mk8=Stimulus,S 31,40352,1,0 > Mk9=Stimulus,S 63,40952,1,0 > Mk10=Stimulus,S 32,40953,1,0 > Mk11=Stimulus,S 33,41112,1,0 > Mk12=Stimulus,S 35,41792,1,0 > Mk13=Stimulus,S 34,41793,1,0 > Mk14=Stimulus,S 35,44634,1,0 > Mk15=Stimulus,S 1,44635,1,0 > > From the tutorials, I’ve understood that I should have done this in my trialfun when I defined my trials during the pre-processing step, but today we realised that some subjects perceived as out-of-synch the condition in-synch and viceversa. > > So, I was wondering how could I do this now - could I do this using the ft_redefinetrial or worst-case-scenario should I do the pre-processing all over again? > > I wrote the code below before starting the TRF analysis but it’s not correct since it’s not working: > > %Redefine trials > cfg = []; > cfg.trials = 'all'; > cfg.trialdef.eventtype = 'Stimulus'; % we are interested in Stimulus markers > cfg.trialdef.eventvalue = { 'S 11' 'S 31' }; > cfg.trialdef.eventcorrect = [ 'S 2' 'S 1' ]; % correct response Stimulus S 2 for S 11 and S 1 for S 31 > cfg.toilim = [-1.8 2.0]; > > data = ft_redefinetrial(cfg, data); > > > Any suggestions/help is more than welcome! > > thanks in advance, > ~ grazia > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Sat Oct 31 01:31:55 2015 From: bick35 at gmail.com (steph) Date: Fri, 30 Oct 2015 17:31:55 -0700 Subject: [FieldTrip] ft_connectivity_laggedcoherence error Message-ID: Hello fieldtrip experts, I tried ft_connectivity_laggedcoherence and ran in this error: Error in ft_connectivity_laggedcoherence (line 228) laggedcrossproduct = fcs1(chancmbind(:,1),tcounter).*conj(fcs2(chancmbind(:,2),tcounter)); This is the code starting at line 224: fcs1(:,colswithnans) = []; fcs2(:,colswithnans) = []; % sum laggedcrossproducts and power over all timepoints for tcounter=1:length(t1) laggedcrossproduct = fcs1(chancmbind(:,1),tcounter).*conj(fcs2(chancmbind(:,2),tcounter)); laggedcps(:,lagindx,trialindx) = laggedcps(:,lagindx,trialindx)+ laggedcrossproduct; power(:,lagindx,1,trialindx) = power(:,lagindx,1,trialindx)+ abs(fcs1(chancmbind(:,1),tcounter)).^2; power(:,lagindx,2,trialindx) = power(:,lagindx,2,trialindx)+ abs(fcs2(chancmbind(:,2),tcounter)).^2; hasdata(trialindx,lagindx) = true; nsmplslaggedcps(lagindx,trialindx) = nsmplslaggedcps(lagindx,trialindx)+1; end; I thing my error appeared because I had some columns with NAN’s which were removed (fcs1(:,colswithnans) = []; fcs2(:,colswithnans) = []; ). Then the second dimension of the matrix fcs1 did not match length(t1). The code runs without error when replacing: % for tcounter=1:length(t1) for tcounter=1:size(fcs1,2) Would the output still be correct? Thank you! Stephan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Sat Oct 31 13:56:02 2015 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sat, 31 Oct 2015 12:56:02 +0000 Subject: [FieldTrip] ft_connectivity_laggedcoherence error In-Reply-To: References: Message-ID: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> Hi Stephan, This code has recently been added as a placeholder function. The code is not functional at the moment. You could keep yourself informed, by signing up on the CC list of this bug: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2951 Of course you are free to contribute to the code. Best wishes Jan-Mathijs Jan-Mathijs Schoffelen, MD PhD, Senior researcher Donders Centre for Cognitive Neuroimaging E-mail: j.schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.fieldtriptoolbox.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bick35 at gmail.com Sat Oct 31 18:52:31 2015 From: bick35 at gmail.com (Steph Bickel) Date: Sat, 31 Oct 2015 10:52:31 -0700 Subject: [FieldTrip] ft_connectivity_laggedcoherence error In-Reply-To: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> References: <4749CB9D-ADE1-4602-A441-0C690C440157@fcdonders.ru.nl> Message-ID: <3A847F3B-D850-41A2-9D6A-8BB19FDF386C@gmail.com> Hi Jan-Mathijs, thank you for your response! That’s good to know. I will sign up and if I can contribute at all I will. Happy halloween, Stephan > On Oct 31, 2015, at 5:56 AM, Schoffelen, J.M. (Jan Mathijs) wrote: > > Hi Stephan, > > This code has recently been added as a placeholder function. The code is not functional at the moment. You could keep yourself informed, by signing up on the CC list of this bug: > http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2951 > Of course you are free to contribute to the code. > > Best wishes > Jan-Mathijs > > > Jan-Mathijs Schoffelen, MD PhD, Senior researcher > > Donders Centre for Cognitive Neuroimaging > > E-mail: j.schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.fieldtriptoolbox.org > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From guevara.erra at gmail.com Sat Oct 31 22:25:02 2015 From: guevara.erra at gmail.com (GUEVARA ERRA RAMON MARIANO) Date: Sat, 31 Oct 2015 22:25:02 +0100 Subject: [FieldTrip] Call for participation Neural Synchronization Frontiers Topic Message-ID: Dear potential authors on the fieldtrip mailing list, This is a call for participation at a special issue (Frontiers Topic) on neural synchronization, that we are currently editing: 'Large-scale neural synchronization and coordinated dynamics: a foundational approach' Web site: http://journal.frontiersin.org/researchtopic/4079/large-scale-neural-synchronization-and-coordinated-dynamics-a-foundational-approach Description: A fundamental question in neuroscience is how segregation and integration of information takes place by the temporal coordination of differentiated, specialized brain areas. Neural synchronization is often invoked as a mechanism of coordinated activity, and in the last ten years there has been a great effort to understand its significance, to clarify its physiological and computational roles and its relationship with brain rhythms and abnormal brain functioning (as in epilepsy or Parkinson’s disease). But in a broader sense, synchronization is an old concept, arising from the studies of oscillators in non-linear dynamics. It is indeed a widespread phenomenon, reflecting the coupling between self-oscillating units. However, the association between coupling and coordinated activity is not completely understood in the context of brain dynamics, most critically when this relationship is extended to large networks of interacting neurons. What do we mean when we use the term ‘synchronization’ in neuroscience? How can we measure physical coupling when real experiments can only tell us about temporal statistical correlation? Can we freely use concepts from oscillation theory to describe brain dynamics? In this Research Topic we welcome contributions from different backgrounds and perspectives to promote a deeper understanding of the relationship between neural synchronization and physical coupling between neuronal networks, and its implications for functional connectivity in the normal and the pathological brain. This topic will include, among others, contributions with the following themes: 1) Foundations of large-scale neural synchronization, based on physical theories of oscillation. 2) The computational role and metabolic cost of neural synchronization, and its relation to brain rhythms. 3) Behavioral and cognitive consequences of oscillatory activity in the human brain. 4) Synthesis and state-of-the-art on measuring neural synchronization in experimental settings. 5) Recent methods for the reconstruction of connectivity in oscillatory networks. 6) Applications of the concept of neural coupling and oscillatory activity in a medical setting, such as monitoring and control of neural synchronization in brain pathologies affecting coordination dynamics. Looking forward to have your contributions. Those interested please write to Ramon Guevara (guevara.erra at gmail.com ) Best wishes, Ramon Guevara Erra University Paris Descartes, Paris, France Jose Luis Perez Velazquez Hospital for Sick Children and University of Toronto, Toronto, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: