From russgport at gmail.com Sat Oct 1 18:34:52 2016 From: russgport at gmail.com (russ port) Date: Sat, 1 Oct 2016 12:34:52 -0400 Subject: [FieldTrip] Failure of LCMV beamformer for Neuromag VectorView planar gradiometers Message-ID: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> Dear Fieldtrippers/Fieldtrippians I was hoping someone could help me with an issue I have come across during my analyses of a preliminary study. In brief, for the study a person was scanned on a CTF 275 channel biomagnetometer and then directly after on a 306 channel Elekta Neuromag VectorView platform. During the scans, the subject listened to a 40Hz amplitude modulated 500Hz tone (to generate a 40Hz Auditory Steady-state Response [ASSR]). In order to get the Elekta-derived data into a workable format, the Elekta-derived was MaxFilter’d for SSS (not tsss). After this, to analyze the datasets in an analogous manner, all datasets (both CTF- and Elekta-derived datasets [planar gradiometers and magnetometers analyzed separately]) were artifact cleaned (artifact rejection for jump/muscle artifact, ICA rejection of EOG/ECG components - OF NOTE FOR ELEKTA DATA THE ICA OUTPUT WAS LIMITED TO THE RANK OF THE DATA [BECAUSE OF SSS NOTED ABOVE]). Then the data was averaged, and a LCMV beamformer (ipsi-lateral channels only) targeted at the subject’s right or left hemisphere Helsch’s Gyrus was used to generate a ASSR time course. Attached (within the powerpoint slide deck) are figures showing the results . For each figure, the left column shows data that is just read with with no artifact correction (incase the ICA routines were improperly deforming the data), and the right column show the results of the methodology described above. The first and second row is the time-locked data from all sensors, both broad band (1st row - and also what is passed to the LCMV beamformer), and band-passed for gamma-band activity (30-58Hz). The third and forth rows are similar, though show the virtual electrodes time course (orientated to the ASSR). Hopefully you would agree that the CTF and Elekta magnetometer virtual electrode time course/results seem very appropriate. On the other hand, the Elekta planar gradiometer time course seem “lack-luster” to say the best. I did try to look into this, and found that during the beamforming, both CTF and Elekta magnetometers are rank sufficient (rank= number of channels for that hemisphere). The planar gradiometers on the other hand are rank deficient, which based on my understanding of the steps of an LCMV beamformer may be quite problematic. Has anyone else experienced this before and/or have suggestions how to circumvent this issue of poor planar gradiometer results from a LCMV beamformer? Best, Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip_LCMV_results.pptx Type: application/vnd.openxmlformats-officedocument.presentationml.presentation Size: 224785 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From rleese12 at berkeley.edu Sat Oct 1 21:42:57 2016 From: rleese12 at berkeley.edu (Nakyung Lee) Date: Sat, 1 Oct 2016 12:42:57 -0700 Subject: [FieldTrip] (no subject) Message-ID: Dear Fieldtrip community, I've been working on recreating one of the works of my predecessor with Fieldtrip. However, there's a discrepancy between high gamma signals that was filtered using Fieldtrip and high gamma signals that was filtered using other MATLAB functions. More specifically, it seems like there's always some lag between those two data and I've not been able to remove the lag entirely even with 'xcorr'. This is my Fieldtrip code (I used 'fir' here but I got the same problem with other filter types): cfg = []; cfg.continuous = 'yes'; cfg.bpfilter = 'yes'; cfg.bpfreq = [freq_low, freq_high]; cfg.bpfilttype = 'fir'; cfg.hilbert = 'yes'; cfg.N = N; signal_HG_fieldtrip = ft_preprocessing(cfg, signal); And this is the MATLAB code: h = fdesign.bandpass('N,Fst1,Fst2,Ast', N, freq_low/(srate/2), freq_high/(srate/2),60); BP = design(h); bp = filter(BP,signal); signal_HG_matlab = abs(hilbert(bp)); And those codes result in these: ​ ​ I've been looking at this for weeks now without coming up with a solution. Is anybody who had a similar problem and managed to fix it? Thank you in advance. Best, Rachel Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: scatter.jpg Type: image/jpeg Size: 43222 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot.jpg Type: image/jpeg Size: 14343 bytes Desc: not available URL: From rleese12 at berkeley.edu Sat Oct 1 21:44:30 2016 From: rleese12 at berkeley.edu (Nakyung Lee) Date: Sat, 1 Oct 2016 12:44:30 -0700 Subject: [FieldTrip] Discrepancies after filtering Message-ID: Dear Fieldtrip community, First, I apologize for duplicate emails. I forgot to add a title. I've been working on recreating one of the works of my predecessor with Fieldtrip. However, there's a discrepancy between high gamma signals that was filtered using Fieldtrip and high gamma signals that was filtered using other MATLAB functions. More specifically, it seems like there's always some lag between those two data and I've not been able to remove the lag entirely even with 'xcorr'. This is my Fieldtrip code (I used 'fir' here but I got the same problem with other filter types): cfg = []; cfg.continuous = 'yes'; cfg.bpfilter = 'yes'; cfg.bpfreq = [freq_low, freq_high]; cfg.bpfilttype = 'fir'; cfg.hilbert = 'yes'; cfg.N = N; signal_HG_fieldtrip = ft_preprocessing(cfg, signal); And this is the MATLAB code: h = fdesign.bandpass('N,Fst1,Fst2,Ast', N, freq_low/(srate/2), freq_high/(srate/2),60); BP = design(h); bp = filter(BP,signal); signal_HG_matlab = abs(hilbert(bp)); And those codes result in these: ​ ​ I've been looking at this for weeks now without coming up with a solution. Is anybody who had a similar problem and managed to fix it? Thank you in advance. Best, Rachel Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot.jpg Type: image/jpeg Size: 14343 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: scatter.jpg Type: image/jpeg Size: 43222 bytes Desc: not available URL: From pooneh.baniasad at gmail.com Sun Oct 2 12:22:55 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Sun, 2 Oct 2016 13:52:55 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix Message-ID: Dear FieldTrip community I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. Since I used the template electrode 'standard_1020.elc', m = 97 according to: chanpos: [97x3 double] chantype: {97x1 cell} chanunit: {97x1 cell} elecpos: [97x3 double] label: {97x1 cell} type: 'eeg1010' unit: 'mm' while the dimension of lead-field matrix is: 2000x122880 I use this function for calculating lead-field matrix: LF = ft_compute_leadfield(DipPos, elec, VolBEM); ​I do not understand why the number of raws are different​! ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ ​I will be so thankful if anyone can help me.​ -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: From mklados at gmail.com Sun Oct 2 20:55:10 2016 From: mklados at gmail.com (Manousos Klados) Date: Sun, 2 Oct 2016 11:55:10 -0700 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) Message-ID: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Mon Oct 3 02:27:05 2016 From: alik.widge at gmail.com (Alik Widge) Date: Sun, 2 Oct 2016 20:27:05 -0400 Subject: [FieldTrip] Postdoctoral opportunity: Human electrophysiology, Harvard/Mass General Message-ID: Fellow FieldTrippers, Our laboratory is hiring! Please see announcement below. We're a mixed-software shop, but I trained in MATLAB and still use FieldTrip, so that skillset is obviously welcome. Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 *Postdoctoral Research Fellowship in Human Invasive Neuroscience and Neural Engineering at MGH/Harvard Medical School * The Translational NeuroEngineering Laboratory (Alik Widge, MD, PhD) in the Division of Neurotherapeutics at Massachusetts General Hospital is seeking applicants for a multi-year, Federally funded postdoctoral fellowship in the areas of invasive human neuroscience and brain stimulation. The fellow will be responsible for collection and analysis of electrophysiologic recordings from patients who are undergoing or have recently undergone neurosurgical procedures. Modalities we currently use include EEG, MEG, intracranial LFP recording (stereo-EEG, ECOG), long-term recordings through implanted devices, and intraoperative single-unit/LFP mapping. Many of these experiments involve psychophysical tasks and/or electrical stimulation in the awake, behaving human. The overall goal is to better understand how brain networks give rise to and regulate emotional experiences, how those networks malfunction in severe psychiatric illness, and how that might lead to neurostimulation treatments for mental illness. The fellow will gain experience in working with rare clinical populations and a unique set of multi-resolution investigations of the human mind. There will be extensive opportunities to learn electrophysiologic techniques, novel statistical approaches, the fundamentals of human brain intervention, and the art of translational neuroscience. Much of the work is related to projects under the United States BRAIN Initiative, and there will be frequent interactions with other BRAIN projects. If desired, the fellow will also have opportunities to be exposed to neurosurgical and other clinical aspects of his/her research. The successful candidate will have a rich dataset and toolbox of skills to launch an independent research program in human cognition or medical device research. Successful applicants should have a PhD, or another doctoral degree with substantial research experience in a relevant discipline. This may include (and is not limited to) engineering, mathematics, psychology, neuroscience, computer science, or physics. For engineering and computer science specifically, we will consider candidates with a terminal masters' degree. Candidates should describe in their cover letter how their specific academic background is relevant to this position. Candidates should have one or more of: • Prior experience in electrophysiologic recordings and analysis in human or animals • Prior work in human cognitive neuroscience and/or a demonstrated understanding of psychophysical task design/executions • Prior conduct of neurostimulation experiments, with an understanding of the strengths and limitations of various designs • Past work in medical device design or research with neurological devices • Strong programming skills, particularly in MATLAB or Python • The psychology and neurobiology of mental illness • Grounding or formal training in signal processing for time-series data in the time and frequency domains We expect to be able to train a successful candidate in several of these areas according to his/her ability and interests. We would particularly welcome applicants with prior experience in neural engineering, brain-computer interfaces, or network/systems-level neuroscience. Please send a cover letter, a CV, and the names of 2-3 references to Dr. Widge at awidge at partners.org . A good cover letter will explain why your skills and interests overlap with our laboratory's goals, what you hope to gain from working with us, and what you think you might uniquely bring to our team. MGH is an equal-opportunity employer and welcomes applicants from any ethnicity, gender, nationality, or background. For this position in particular, visa sponsorship is available for qualified non-citizens, but the need for such sponsorship should be disclosed early in the interview process. -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 10:19:48 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 10:19:48 +0200 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: Dear Susmita, I used your code and could reproduce the same results. The step that goes wrong here is the segmentation step. cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri = ft_volumesegment(cfg, mri_aligned); seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','indexed'); cfg = []; cfg.funparameter = 'seg'; cfg.funcolormap = lines(6); % distinct color per tissue cfg.location = 'center'; cfg.atlas = seg_i; % the segmentation can also be used as atlas ft_sourceplot(cfg, seg_i); I segmented additionally to the scalp the brain and the skull tissues as well so that you can clearly see whats going on. You should tweak the cfg for the ft_volumesegment to improve your pipeline. Best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 30 Sep 2016, at 19:16, Susmita Sen wrote: > > I am Susmita Sen, MS research scholar in the dept of Electronics and Electrical Communication Engineering, IIT Kharagpur. > I am currently working on MEG data recorded by yokogawa system. I want to perform source reconstruction on the data. However, I do not have the MRI data along with that. so, I have planned to use the standard MRI provided by fieldtrip (downloaded from https://github.com/fieldtrip/fieldtrip/blob/master/template/headmodel/standard_mri.mat ). > > For preparing the head model I have followed the steps provided in the fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg ). > > %% align the coordinate system > load('standard_mri.mat'); % load mri data > disp(mri) > > cfg = []; > cfg.method = 'interactive'; > cfg.coordsys = 'yokogawa'; > cfg.snapshot = 'yes'; > [mri_aligned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > %% create headmodel > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > load grad % load gradiometer info > vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm > > figure; > ft_plot_sens(grad, 'style', '*b'); > hold on > ft_plot_vol(vol); > > while aligning the coordinate system I have chosen fiducial points (naison, LPA and RPA) using the instruction given by http://neuroimage.usc.edu/brainstorm/CoordinateSystems . > > I am attaching the figures that display the shape of the 'vol' along with the position of the sensors (from different viewing angle). However, I doubt the headmodel is corrected prepared (It dosen't look alike the figure given in the tutorial). It seems I have made some mistakes, but I am not able to detect it. I would be very thankful if you can help me in this regard. > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 10:23:46 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 10:23:46 +0200 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: Dear pooh, Could you provide more information how you constructed your BEM-model? best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 02 Oct 2016, at 12:22, pooneh baniasad wrote: > > Dear FieldTrip community > > I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. > > First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. > Since I used the template electrode 'standard_1020.elc', m = 97 according to: > > chanpos: [97x3 double] > chantype: {97x1 cell} > chanunit: {97x1 cell} > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > while the dimension of lead-field matrix is: 2000x122880 > I use this function for calculating lead-field matrix: > > LF = ft_compute_leadfield(DipPos, elec, VolBEM); > > ​I do not understand why the number of raws are different​! > > ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ > > ​I will be so thankful if anyone can help me.​ > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From pooneh.baniasad at gmail.com Mon Oct 3 13:01:37 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Mon, 3 Oct 2016 14:31:37 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: Dear Simon, I've followed this tutorial: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct the headmodel ('VolBEM') I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for 'DipPos'. Is it clear or should I explain more? 🙂 On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle wrote: > Dear pooh, > > Could you provide more information how you constructed your BEM-model? > > best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 02 Oct 2016, at 12:22, pooneh baniasad > wrote: > > Dear FieldTrip community > > I'm using the forward model to simulating EEG signal although it seems the > dimension of the lead-field matrix is not correct. Here is a review of the > procedure. > > First I constructed a BEM headmodel for EEG source analysis ​and then by > loading the template cortex, I put the dipoles with specific current source > on that. I expect the dimension of the lead-field matrix will be m*n which > m=electrode's number and n=3*dipole's number but 'm' is different. > Since I used the template electrode 'standard_1020.elc', m = 97 according > to: > > chanpos: [97x3 double] > chantype: {97x1 cell} > chanunit: {97x1 cell} > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > while the dimension of lead-field matrix is: 2000x122880 > > I use this function for calculating lead-field matrix: > > LF = ft_compute_leadfield(DipPos, elec, VolBEM); > ​I do not understand why the number of raws are different​! > > ​On the other hand I guess that there is a similarity between the number > of raws in the volume head model and LF matrix due to the dimension of > headmodel matrix is: 2000x8000 double .​ > > ​I will be so thankful if anyone can help me.​ > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 3 14:59:59 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 3 Oct 2016 18:29:59 +0530 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for your response. I am sorry to bother you once again with my doubt. The headmodel that I have constructed, has a flat surface at the bottom. I would like to ask you to explain why that is happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look like this. I am attaching a file comparing these two headmodels. I have circled some part of the figure which actually raises the question of whether I am doing it correctly or not. Is there anything wrong in choosing the fiducial points? Thank you in anticipation. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle wrote: > Dear Susmita, > > I used your code and could reproduce the same results. The step that goes > wrong here is the segmentation step. > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > > seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','i > ndexed'); > > > cfg = []; > cfg.funparameter = 'seg'; > cfg.funcolormap = lines(6); % distinct color per tissue > cfg.location = 'center'; > cfg.atlas = seg_i; % the segmentation can also be used as atlas > ft_sourceplot(cfg, seg_i); > > > I segmented additionally to the scalp the brain and the skull tissues as > well so that you can clearly see whats going on. > > You should tweak the cfg for the ft_volumesegment to improve your pipeline. > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 30 Sep 2016, at 19:16, Susmita Sen wrote: > > I am Susmita Sen, MS research scholar in the dept of Electronics and > Electrical Communication Engineering, IIT Kharagpur. > I am currently working on MEG data recorded by yokogawa system. I > want to perform source reconstruction on the data. However, I do not have > the MRI data along with that. so, I have planned to use the standard MRI > provided by fieldtrip (downloaded from https://github.com/fieldt > rip/fieldtrip/blob/master/template/headmodel/standard_mri.mat). > > For preparing the head model I have followed the steps provided in the > fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg > ). > > %% align the coordinate system > load('standard_mri.mat'); % load mri data > disp(mri) > > cfg = []; > cfg.method = 'interactive'; > cfg.coordsys = 'yokogawa'; > cfg.snapshot = 'yes'; > [mri_aligned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > %% create headmodel > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > load grad % load gradiometer info > vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm > > figure; > ft_plot_sens(grad, 'style', '*b'); > hold on > ft_plot_vol(vol); > > while aligning the coordinate system I have chosen fiducial points > (naison, LPA and RPA) using the instruction given by > http://neuroimage.usc.edu/brainstorm/CoordinateSystems. > > I am attaching the figures that display the shape of the 'vol' along with > the position of the sensors (from different viewing angle). However, I > doubt the headmodel is corrected prepared (It dosen't look alike the figure > given in the tutorial). It seems I have made some mistakes, but I am not > able to detect it. I would be very thankful if you can help me in this > regard. > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > ______________________________ > _________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodels.png Type: image/png Size: 231910 bytes Desc: not available URL: From s.homolle at donders.ru.nl Mon Oct 3 15:18:53 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 15:18:53 +0200 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> Dear Susmita, I think first all http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is a nice place to go to understand the different coordinate systems. I’m not to well aware about the Yokogawa coordinate system, but my first expectation would be that this coordinate systems is shifted lower than the CTF. After aligning with the different coordinate systems you should look at mri_aligned.coordsys Best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 03 Oct 2016, at 14:59, Susmita Sen wrote: > > Dear Simon, > > Thank you very much for your response. I am sorry to bother you once again with my doubt. The headmodel that I have constructed, has a flat surface at the bottom. I would like to ask you to explain why that is happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look like this. I am attaching a file comparing these two headmodels. I have circled some part of the figure which actually raises the question of whether I am doing it correctly or not. Is there anything wrong in choosing the fiducial points? Thank you in anticipation. > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > > On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle > wrote: > Dear Susmita, > > I used your code and could reproduce the same results. The step that goes wrong here is the segmentation step. > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','indexed'); > > cfg = []; > cfg.funparameter = 'seg'; > cfg.funcolormap = lines(6); % distinct color per tissue > cfg.location = 'center'; > cfg.atlas = seg_i; % the segmentation can also be used as atlas > ft_sourceplot(cfg, seg_i); > > > I segmented additionally to the scalp the brain and the skull tissues as well so that you can clearly see whats going on. > > You should tweak the cfg for the ft_volumesegment to improve your pipeline. > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > >> On 30 Sep 2016, at 19:16, Susmita Sen > wrote: >> >> I am Susmita Sen, MS research scholar in the dept of Electronics and Electrical Communication Engineering, IIT Kharagpur. >> I am currently working on MEG data recorded by yokogawa system. I want to perform source reconstruction on the data. However, I do not have the MRI data along with that. so, I have planned to use the standard MRI provided by fieldtrip (downloaded from https://github.com/fieldtrip/fieldtrip/blob/master/template/headmodel/standard_mri.mat ). >> >> For preparing the head model I have followed the steps provided in the fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg ). >> >> %% align the coordinate system >> load('standard_mri.mat'); % load mri data >> disp(mri) >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.coordsys = 'yokogawa'; >> cfg.snapshot = 'yes'; >> [mri_aligned] = ft_volumerealign(cfg,mri); >> >> %% SEGMENTATION >> cfg = []; >> cfg.output = 'brain'; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> %% create headmodel >> cfg = []; >> cfg.method='singleshell'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> %% visualize >> load grad % load gradiometer info >> vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm >> >> figure; >> ft_plot_sens(grad, 'style', '*b'); >> hold on >> ft_plot_vol(vol); >> >> while aligning the coordinate system I have chosen fiducial points (naison, LPA and RPA) using the instruction given by http://neuroimage.usc.edu/brainstorm/CoordinateSystems . >> >> I am attaching the figures that display the shape of the 'vol' along with the position of the sensors (from different viewing angle). However, I doubt the headmodel is corrected prepared (It dosen't look alike the figure given in the tutorial). It seems I have made some mistakes, but I am not able to detect it. I would be very thankful if you can help me in this regard. >> >> >> >> Thanks and Regards, >> Susmita Sen >> Research Scholar >> Audio and Bio Signal Processing Lab. >> E & ECE Dept. >> IIT Kharagpur >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 15:27:09 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 15:27:09 +0200 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> Dear Pooneh, http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem I relate to this part: When the forward solution is computed, the lead field matrix (= channels X source points matrix) is calculated for each grid point taking into account the head model and the channel positions. So I assume your mesh consists of 2000 grid points? Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 03 Oct 2016, at 13:01, pooneh baniasad wrote: > > Dear Simon, > > I've followed this tutorial: > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct the headmodel ('VolBEM') > I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for 'DipPos'. > Is it clear or should I explain more? 🙂 > > On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle > wrote: > Dear pooh, > > Could you provide more information how you constructed your BEM-model? > > best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > >> On 02 Oct 2016, at 12:22, pooneh baniasad > wrote: >> >> Dear FieldTrip community >> >> I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. >> >> First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. >> Since I used the template electrode 'standard_1020.elc', m = 97 according to: >> >> chanpos: [97x3 double] >> chantype: {97x1 cell} >> chanunit: {97x1 cell} >> elecpos: [97x3 double] >> label: {97x1 cell} >> type: 'eeg1010' >> unit: 'mm' >> >> while the dimension of lead-field matrix is: 2000x122880 >> I use this function for calculating lead-field matrix: >> >> LF = ft_compute_leadfield(DipPos, elec, VolBEM); >> >> ​I do not understand why the number of raws are different​! >> >> ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ >> >> ​I will be so thankful if anyone can help me.​ >> >> -- >> Bests >> >> Pouneh Baniasad >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 3 15:40:12 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 3 Oct 2016 19:10:12 +0530 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> References: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> Message-ID: Dear Simon, Thanks a lot for your suggestion. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Mon, Oct 3, 2016 at 6:48 PM, Simon Homolle wrote: > Dear Susmita, > > I think first all > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined > is a nice place to go to understand the different coordinate systems. > > I’m not to well aware about the Yokogawa coordinate system, but my first > expectation would be that this coordinate systems is shifted lower than the > CTF. After aligning with the different coordinate systems you should look > at mri_aligned.coordsys > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 03 Oct 2016, at 14:59, Susmita Sen wrote: > > Dear Simon, > > Thank you very much for your response. I am sorry to bother you once > again with my doubt. The headmodel that I have constructed, has a flat > surface at the bottom. I would like to ask you to explain why that is > happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look > like this. I am attaching a file comparing these two headmodels. I have > circled some part of the figure which actually raises the question of > whether I am doing it correctly or not. Is there anything wrong in choosing > the fiducial points? Thank you in anticipation. > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > > On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle > wrote: > >> Dear Susmita, >> >> I used your code and could reproduce the same results. The step that goes >> wrong here is the segmentation step. >> >> cfg = []; >> cfg.output = {'brain','skull','scalp'}; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','i >> ndexed'); >> >> cfg = []; >> cfg.funparameter = 'seg'; >> cfg.funcolormap = lines(6); % distinct color per tissue >> cfg.location = 'center'; >> cfg.atlas = seg_i; % the segmentation can also be used as >> atlas >> ft_sourceplot(cfg, seg_i); >> >> >> I segmented additionally to the scalp the brain and the skull tissues as >> well so that you can clearly see whats going on. >> >> You should tweak the cfg for the ft_volumesegment to improve your >> pipeline. >> >> Best regards, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 30 Sep 2016, at 19:16, Susmita Sen wrote: >> >> I am Susmita Sen, MS research scholar in the dept of Electronics and >> Electrical Communication Engineering, IIT Kharagpur. >> I am currently working on MEG data recorded by yokogawa system. I >> want to perform source reconstruction on the data. However, I do not have >> the MRI data along with that. so, I have planned to use the standard MRI >> provided by fieldtrip (downloaded from https://github.com/fieldt >> rip/fieldtrip/blob/master/template/headmodel/standard_mri.mat). >> >> For preparing the head model I have followed the steps provided in the >> fieldtrip tutorial (http://www.fieldtriptoolbox.o >> rg/tutorial/headmodel_meg). >> >> %% align the coordinate system >> load('standard_mri.mat'); % load mri data >> disp(mri) >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.coordsys = 'yokogawa'; >> cfg.snapshot = 'yes'; >> [mri_aligned] = ft_volumerealign(cfg,mri); >> >> %% SEGMENTATION >> cfg = []; >> cfg.output = 'brain'; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> %% create headmodel >> cfg = []; >> cfg.method='singleshell'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> %% visualize >> load grad % load gradiometer info >> vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm >> >> figure; >> ft_plot_sens(grad, 'style', '*b'); >> hold on >> ft_plot_vol(vol); >> >> while aligning the coordinate system I have chosen fiducial points >> (naison, LPA and RPA) using the instruction given by >> http://neuroimage.usc.edu/brainstorm/CoordinateSystems. >> >> I am attaching the figures that display the shape of the 'vol' along with >> the position of the sensors (from different viewing angle). However, I >> doubt the headmodel is corrected prepared (It dosen't look alike the figure >> given in the tutorial). It seems I have made some mistakes, but I am not >> able to detect it. I would be very thankful if you can help me in this >> regard. >> >> >> >> Thanks and Regards, >> Susmita Sen >> Research Scholar >> Audio and Bio Signal Processing Lab. >> E & ECE Dept. >> IIT Kharagpur >> ______________________________ >> _________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From singht at musc.edu Mon Oct 3 17:34:18 2016 From: singht at musc.edu (Singh, Tarkeshwar) Date: Mon, 3 Oct 2016 15:34:18 +0000 Subject: [FieldTrip] ft_timelockanalysis outputs average data with different trial lengths Message-ID: Dear All, I am new to Fieldtrip and am trying to compare ERPs between two conditions using the following lines of code. ‘data_iccleaned’ is the processed data structure. The code below is in red and my message in black. cfg=[]; cfg.keeptrials = 'yes'; cfg.vartrllength=1; cfg.trials = find(data_iccleaned.trialinfo(:,1) == 1); erp_pictures = ft_timelockanalysis(cfg, data_iccleaned); cfg=[]; cfg.keeptrials = 'yes'; cfg.vartrllength=1; cfg.trials = find(data_iccleaned.trialinfo(:,1) == 2); erp_abstract = ft_timelockanalysis(cfg, data_iccleaned); %Baseline Correction cfg=[]; cfg.baseline = [twin(1) 0]; erp_pictures_TL = ft_timelockbaseline(cfg, erp_pictures); erp_abstract_TL = ft_timelockbaseline(cfg, erp_abstract); cfgp=[]; cfgp.interactive = 'yes'; cfgp.layout = 'easycapM11.mat'; cfgp.box='yes'; cfgp.showoutline = 'yes'; ft_multiplotER(cfgp, erp_pictures_TL,erp_abstract_TL. When I run the last line of code, I get the following error: [cid:image001.png at 01D21D6A.13970950] I believe the problem is that erp_abstract.time and erp_picture.time are of different lengths (please see the picture below). We have sampled the data at 1000 Hz and each trial is approx. 8 seconds long (trial lengths vary from 7989 to 8012 points). To circumvent the problem, I tried an additional constraint on the accepted trials (accept only those that are exactly 8000 points) but that did not solve the problem. What am I doing wrong? [cid:image002.png at 01D21D6A.13970950] -- Tarkeshwar Singh Postdoctoral Scholar Department of Health Sciences and Research Medical University of South Carolina 77 President Street, Room C305 Charleston, SC 29425 singht at musc.edu ------------------------------------------------------------------------- This message was secured via TLS by MUSC. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 22130 bytes Desc: image001.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 77227 bytes Desc: image002.png URL: From SXM1085 at student.bham.ac.uk Mon Oct 3 18:40:04 2016 From: SXM1085 at student.bham.ac.uk (Sebastian Michelmann) Date: Mon, 3 Oct 2016 16:40:04 +0000 Subject: [FieldTrip] neuralynx problem with repeated timestamps Message-ID: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> Dear Fieldtrippers, when reading Neuralynx ncs data I run into the following problem: %----------------------------------------------------------------------------------% cfg = []; cfg.dataset = [dataset_directory filesep electrode '.ncs']; data_nse = ft_preprocessing(cfg); >> Index exceeds matrix dimensions. Error in ft_read_data (line 1013) dat = ncs.dat(begsample:endsample); Error in ft_preprocessing (line 576) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); %----------------------------------------------------------------------------------% The problem seems to be due to repeated timestamps in the data, that are corrected in @read_neuralynx_ncs line: 230 [A,I] = unique(val); % consider only the unique values indx = indx(I); This causes the information about the number of samples in the header and the actual samples to be different. My question is now: How do I deal with this? Especially since I am not entirely sure why fieldtrip handles this dataformat the way it does (e.g. sorting the timestamps at each sampling point) So, can I just comment this out and accept the multiple sampling of some Timestamps? Or should I rather correct the information about the number of samples? Should I even interpolate plausible Timestamps? Any help is highly appreciated! All the best, Sebastian -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Mon Oct 3 18:51:40 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Mon, 03 Oct 2016 17:51:40 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> References: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> Message-ID: <8865e168a6639693d5d9e5106563e21c@cam.ac.uk> Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? Many thanks From lindseyrtate at ou.edu Mon Oct 3 23:23:02 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Mon, 3 Oct 2016 21:23:02 +0000 Subject: [FieldTrip] REPOST: Beamforming, "Inf" during source estimation by subject In-Reply-To: References: , Message-ID: Tate, Lindsey R. has shared a?OneDrive for Business?file with you. To view it, click the link below. [https://r1.res.office365.com/owa/prem/images/dc-generic_20.png] dataFIC4.mat Tate, Lindsey R. has shared a?OneDrive for Business?file with you. To view it, click the link below. [https://r1.res.office365.com/owa/prem/images/dc-generic_20.png] dataFIC4.mat Hello Fieldtrip Community, On Tuesday 6/28, I sent out the original message forwarded below. I received some response but have been unable to resolve my problem. [Attempted to allow lambda to be estimated/not specified, but this didn't eliminate the "Inf" in the pow matrices.] I've been working on beamforming the MEG data collected from 16 subjects during a saccade task. There are 4 conditions, with a maximum of 30 trials each per subject (some trials eliminated due to loss of focus). This is my first time beamforming so I've been heavily relying on the tutorial. I'm having what appears to be two issues: 1) Number of trials per subject may be too low. When I collapse across all subjects or even collapse across two random subjects so as to artificially increase the number of trials per "artificial subject," real numbers are produced by ft_sourceinterpolate in the pow matrix. When I run each subject individually, the pow matrix from ft_sourceinterpolate "Inf" where numbers were for the other runs. Is there a way to resolve this issue, such as a default setting to override? Or do I have too few trials per condition? 2) The pow matrix from ft_sourceinterpolate produces primarily "NaN," with about 90% of the rows being "NaN." This seems problematic. Also, it seems like it may be causing problems with ft_sourcestatistics as the stat.prob and stat.mask matrices always come back empty, even when ft_sourceinterpolate produces pow matrices with real numbers divided by "artificial subjects." Could this prevalence of "NaN" be an indication that the beamforming isn't happening correctly? Could the prevalence be causing the ft_sourcestatistics to produce blank stat.prob and stat.mask matrices? Code and raw dataset attached. Thank you for any assistance or guidance you may offer! Lindsey University of Oklahoma ________________________________ From: Tate, Lindsey R. Sent: Tuesday, June 28, 2016 3:05 AM To: fieldtrip at science.ru.nl Subject: Beamforming, "Inf" during source estimation by subject Hello Fieldtrip Community, I've been working on beamforming the MEG data collected from 16 subjects during a saccade task. This is my first time beamforming so I've been heavily relying on the tutorial. When I collapse trials across subjects and do beamforming, I can get the ft_sourceplot commands to produce something that makes some sense. However, I need to be able to have the data separated by subject for ft_sourcestatistics. I've created structures that should work for this purpose and that look correct. However, the ".pow" from the Neural Activity Index calculation step ends up mostly "NaN" and partly "Inf" when I run the beamforming divided by subject. Is this related to the number of trials per subject somehow (e.g., do I have too few? is there some kind of setting I need to change?)? Why is the ".pow" coming back "Inf" instead of a real number? Does anyone have suggestions for fixing this problem so that I don't get "Inf" anymore? My code and raw data structure are attached. Thank you, Lindsey Tate University of Oklahoma -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BF_trial4.m URL: From lindseyrtate at ou.edu Mon Oct 3 23:23:06 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Mon, 3 Oct 2016 21:23:06 +0000 Subject: [FieldTrip] Tate, Lindsey R. wants to share the file dataFIC4.mat with you Message-ID: To view dataFIC4.mat, sign in or create an account. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at donders.ru.nl Tue Oct 4 04:29:42 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 4 Oct 2016 11:29:42 +0900 Subject: [FieldTrip] Fwd: Job posting: PhD position at MPI-CBS Germany References: <943142109.19332.1475485117729.JavaMail.zimbra@cbs.mpg.de> Message-ID: <95458A7B-907C-4102-B962-326C7434B44B@donders.ru.nl> On behalf of Claudia Männel, please see the attachment for a job opening for a highly motivated and qualified PhD student. -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Maennel_DFGNov2016.pdf Type: application/pdf Size: 85151 bytes Desc: not available URL: -------------- next part -------------- From robert.oostenveld at donders.ru.nl Tue Oct 4 04:30:25 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 4 Oct 2016 11:30:25 +0900 Subject: [FieldTrip] Fwd: Job posting: PhD position at MPI-CBS Germany References: <943142109.19332.1475485117729.JavaMail.zimbra@cbs.mpg.de> Message-ID: <2BFD51EB-660D-4FFF-92C7-1E5767673587@donders.ru.nl> On behalf of Claudia Männel, please see the attachment for a job opening for a highly motivated and qualified PhD student. -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Maennel_DFGNov2016.pdf Type: application/pdf Size: 85151 bytes Desc: not available URL: -------------- next part -------------- From ph442 at cam.ac.uk Tue Oct 4 10:45:47 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 09:45:47 +0100 Subject: [FieldTrip] =?utf-8?q?Fwd=3A_plotting_freesurfer_mesh_on_the_mri?= =?utf-8?b?X2FsaWduZWQu?= Message-ID: Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? Many thanks -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From ph442 at cam.ac.uk Tue Oct 4 16:41:27 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 15:41:27 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= Message-ID: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? The reason that I ask is that I would like to plot my solution on the MRI image. Unfortunately I do not use dipoles. In EEG, I model the irrotational component of the current as a scalar function and therefore I am doing function estimation. IF you use dipoles, it is straightforward because you follow one of the tutorials. But if you do not use dipoles and model the current as the gradient of the irrotational component of the current in EEG then one can get lost. Any help would be appreciated. Many thanks -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From jan.schoffelen at donders.ru.nl Tue Oct 4 17:29:49 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 4 Oct 2016 15:29:49 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> Message-ID: <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> Hi Parham, It is possible, but certainly not pain free, nor straightforward. I think this is not really a fieldtrip question, but more a general matlab related issue. It should be possible to plot a slice through an MRI volume as a MATLAB patch, where the coordinates of the voxels are expressed in some coordinate system. Then, it is possible to generate and intersection of the freesurfer mesh through the plane of visualization. Best, Jan-Mathijs > On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: > > Dear Fieldtrippers > Is there a straightforward pain free method ( I appreciate if you can give me the command) > to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? > The reason that I ask is that I would like to plot my solution on the MRI image. > Unfortunately I do not use dipoles. In EEG, I model the irrotational component of the current as a scalar function and therefore I am doing function estimation. > IF you use dipoles, it is straightforward because you follow one of the tutorials. > But if you do not use dipoles and model the current as the gradient of the irrotational component of the current in EEG then one can get lost. > Any help would be appreciated. > Many thanks > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ph442 at cam.ac.uk Tue Oct 4 17:59:06 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 16:59:06 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> Message-ID: <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Hi Jan Thank you, my functional data are the function values of some function (irrotational component of the current). From my limited experience of Fieldtrip, your explanation feels (to myself) a bit cryptic at the moment. You see if my inversion strategy was one of the classical ones such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta then the available fieldtrip tutorials are great in showing how to plot functional values on the top of anatomical values. But, since, I work on inversion methods, then I need a hacking strategy to be able to plot functional values of "some function"(estimated) on top of anatomical data MRI. I would appreciate if you would kindly let me know, if there is hack to it such that ft_sourceplot can accept the input. best regards parham On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > It is possible, but certainly not pain free, nor straightforward. > I think this is not really a fieldtrip question, but more a general > matlab related issue. > > It should be possible to plot a slice through an MRI volume as a > MATLAB patch, where the coordinates of the voxels are expressed in > some coordinate system. Then, it is possible to generate and > intersection of the freesurfer mesh through the plane of > visualization. > > Best, > Jan-Mathijs > > > >> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >> >> Dear Fieldtrippers >> Is there a straightforward pain free method ( I appreciate if you can >> give me the command) >> to plot arbitrary points such as the vertices of the freesurfer output >> (mesh) onto the MRI image? >> The reason that I ask is that I would like to plot my solution on the >> MRI image. >> Unfortunately I do not use dipoles. In EEG, I model the irrotational >> component of the current as a scalar function and therefore I am doing >> function estimation. >> IF you use dipoles, it is straightforward because you follow one of >> the tutorials. >> But if you do not use dipoles and model the current as the gradient >> of the irrotational component of the current in EEG then one can get >> lost. >> Any help would be appreciated. >> Many thanks >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From Darren.Price at mrc-cbu.cam.ac.uk Tue Oct 4 18:45:07 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Tue, 4 Oct 2016 16:45:07 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi Parham For a non-linear interpolation onto a regular grid, spm_mesh_to_grid might be ideal (from the spm package of course). I don't have a working example to hand, but I may be able to dig one out if you can't get it working. Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL:  darren.price at mrc-cbu.cam.ac.uk URL:    http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL     +44 (0)1223 355 294 x202 FAX     +44 (0)1223 359 062 MOB     +44 (0)7717822431 ------------------------------------------------------- -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham hashemzadeh Sent: 04 October 2016 16:59 To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Hi Jan Thank you, my functional data are the function values of some function (irrotational component of the current). From my limited experience of Fieldtrip, your explanation feels (to myself) a bit cryptic at the moment. You see if my inversion strategy was one of the classical ones such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta then the available fieldtrip tutorials are great in showing how to plot functional values on the top of anatomical values. But, since, I work on inversion methods, then I need a hacking strategy to be able to plot functional values of "some function"(estimated) on top of anatomical data MRI. I would appreciate if you would kindly let me know, if there is hack to it such that ft_sourceplot can accept the input. best regards parham On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > It is possible, but certainly not pain free, nor straightforward. > I think this is not really a fieldtrip question, but more a general > matlab related issue. > > It should be possible to plot a slice through an MRI volume as a > MATLAB patch, where the coordinates of the voxels are expressed in > some coordinate system. Then, it is possible to generate and > intersection of the freesurfer mesh through the plane of > visualization. > > Best, > Jan-Mathijs > > > >> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >> >> Dear Fieldtrippers >> Is there a straightforward pain free method ( I appreciate if you can >> give me the command) >> to plot arbitrary points such as the vertices of the freesurfer output >> (mesh) onto the MRI image? >> The reason that I ask is that I would like to plot my solution on the >> MRI image. >> Unfortunately I do not use dipoles. In EEG, I model the irrotational >> component of the current as a scalar function and therefore I am doing >> function estimation. >> IF you use dipoles, it is straightforward because you follow one of >> the tutorials. >> But if you do not use dipoles and model the current as the gradient >> of the irrotational component of the current in EEG then one can get >> lost. >> Any help would be appreciated. >> Many thanks >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ph442 at cam.ac.uk Tue Oct 4 19:08:29 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 18:08:29 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL:  darren.price at mrc-cbu.cam.ac.uk > URL:    http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL     +44 (0)1223 355 294 x202 > FAX     +44 (0)1223 359 062 > MOB     +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From a.donda at hotmail.com Wed Oct 5 00:47:27 2016 From: a.donda at hotmail.com (A. Donda) Date: Tue, 4 Oct 2016 22:47:27 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> , Message-ID: Hi Parham, if you wanna plot it in FieldTrip, these commands worked well for me, but in my case (MEG data) I had to make sure first that these data were on the same coordinate system (co-registration of MRI and MEG sensor-data). If you do not have this issue, then you can simply plot an MRI and a mesh obtained from freesurfer the following way (make sure that both MRI and the mesh are in the same units, e.g. cm or mm): ft_determine_coordsys(mricor_cm, 'interactive', 'no') hold on ft_plot_mesh(sourcespace); Alternatively, if you want to plot the vertices of the mesh as dots, you can use ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); sourcespace has the following structure (in case this is helpful for you): pnt: [8196x3 double] tri: [16384x3 double] area: [16384x1 double] orig: [1x1 struct] unit: 'm' I obtained sourcespace by loading the boundary element model (bem) surface, created with the watershed algorthim of Freesurfer: sourcespace = ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], 'format', 'mne_source'); %in meters Note that I had to transform the sourcespace dataset to the right coordinate system and units. Finally I plotted the mri and mesh in cm To convert units in Fieldtrip, as you know, use X_cm = ft_convert_units(X,'cm'); I hope this is helpful. Best A.Donda ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of parham hashemzadeh Sent: Tuesday, October 4, 2016 6:08 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL: darren.price at mrc-cbu.cam.ac.uk > URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL +44 (0)1223 355 294 x202 > FAX +44 (0)1223 359 062 > MOB +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 5 03:15:07 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 5 Oct 2016 01:15:07 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi Parham, Sorry for sounding cryptic earlier, I was just reciprocating the crypticity of the question. I think that the suggestion made in the previous e-mail is an excellent one. With the addition that, rather than using ft_determine_coordsys, you could use ft_plot_ortho to visualize an arbitrary cross-cut through your volumetric image. Note however, that the MR and the sourcespace should be in the same coordinate system for this to work. Best, Jan-Mathijs On 05 Oct 2016, at 00:47, A. Donda > wrote: Hi Parham, if you wanna plot it in FieldTrip, these commands worked well for me, but in my case (MEG data) I had to make sure first that these data were on the same coordinate system (co-registration of MRI and MEG sensor-data). If you do not have this issue, then you can simply plot an MRI and a mesh obtained from freesurfer the following way (make sure that both MRI and the mesh are in the same units, e.g. cm or mm): ft_determine_coordsys(mricor_cm, 'interactive', 'no') hold on ft_plot_mesh(sourcespace); Alternatively, if you want to plot the vertices of the mesh as dots, you can use ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); sourcespace has the following structure (in case this is helpful for you): pnt: [8196x3 double] tri: [16384x3 double] area: [16384x1 double] orig: [1x1 struct] unit: 'm' I obtained sourcespace by loading the boundary element model (bem) surface, created with the watershed algorthim of Freesurfer: sourcespace = ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], 'format', 'mne_source'); %in meters Note that I had to transform the sourcespace dataset to the right coordinate system and units. Finally I plotted the mri and mesh in cm To convert units in Fieldtrip, as you know, use X_cm = ft_convert_units(X,'cm'); I hope this is helpful. Best A.Donda ________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of parham hashemzadeh > Sent: Tuesday, October 4, 2016 6:08 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL: darren.price at mrc-cbu.cam.ac.uk > URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL +44 (0)1223 355 294 x202 > FAX +44 (0)1223 359 062 > MOB +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh > wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From son.ta.dinh at tum.de Wed Oct 5 06:54:31 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Wed, 5 Oct 2016 04:54:31 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Message-ID: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let's say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 5 07:57:01 2016 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 5 Oct 2016 16:57:01 +1100 Subject: [FieldTrip] Plotting confidence intervals in multiplotER In-Reply-To: References: Message-ID: Dear Kousik, Thank you very much for your help. I am not sure how to change the "dat_sem" as you suggested. My grand averaged file has the fields as follows GrandAvg_Target1 = avg: [132x601 double] var: [132x601 double] dof: [132x601 double] time: [1x601 double] label: {132x1 cell} dimord: 'chan_time' cfg: [1x1 struct] I am a beginner in MATLAB and any help would be greatly appreciated. Thanks, Arti On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy wrote: > Hey Arti, > > This is not such a trivial thing to solve. Here's a recipe I used. You > need to find and edit two scripts. If this spurns any more interest, I'll > initiate a 'bug' and try to send in a pull request. This is a dirty fix and > in all probability will be considered blasphemy. ;) > > 1. Find in ft_multiplotER > > : > ft_plot_vector(xval, yval, 'width', width(m), 'height', height(m), 'hpos', > layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', [ymin ymax], 'color > ', color, 'style', cfg.linestyle{i}, 'linewidth', cfg.linewidth, 'axis', > cfg.axes, 'highlight', mask, 'highlightstyle', cfg.maskstyle, 'label', > label, 'box', cfg.box, 'fontsize', cfg.fontsize); > This basically calls a plotting function which in turn does the plotting > for you. You need to send in the extra 'sem' or a 'ci' variable. > Change this to: > ft_plot_vector(xval, yval, 'ysem', ysem, 'width', width(m), 'height', > height(m), 'hpos', layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', > [ymin ymax], 'color', color, 'style', cfg.linestyle{i}, 'linewidth', > cfg.linewidth, 'axis', cfg.axes, 'highlight', mask, 'highlightstyle', > cfg.maskstyle, 'label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); > > 2. Find in ft_plot_vector > > : > You need to first get the sem parameter from your data and setup so FT can > see your sem or CI info. Follow the code here > . > Search for "data_sem" and fix those lines. > Then: > h = plot(hdat, vdat, style, 'LineWidth', linewidth, 'Color', color, ' > markersize', markersize, 'markerfacecolor', markerfacecolor); > Change this to: > [h hp ]= boundedline(hdat, vdat, vdat_sem); > > Boundedline > is > a submission in the MATLAB file exchange. You can use any other thing. > > > Good luck trying! :) > > > -- > Regards, > Kousik Sarathy, S > > > On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek > wrote: > >> Dear fieldtrip community, >> >> I was wondering whether there is a way to plot the confidence intervals >> in the ERP plot? I see that this question was asked multiple times in the >> discussion list before, but I could not find an answer to this. >> >> Thanks, >> Arti >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Wed Oct 5 10:08:53 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Wed, 05 Oct 2016 09:08:53 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: <39b0115d2f09176a1ffada64668e300e@cam.ac.uk> Hi Jan and A.Donda Thank you both very much for your input. I will try what you suggested. Many thanks best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From susmitasen.ece at gmail.com Wed Oct 5 12:41:06 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 5 Oct 2016 16:11:06 +0530 Subject: [FieldTrip] Standard mri dimension and fiducial point Message-ID: Dear FieldTrip community I am using standard mri providded by fieldTrip. The dimension of it is 181 x 217 x 181 [image: Inline image 1] The fiducial points are [image: Inline image 2] It is quite confusing since the coordinate of lpa exceeds the dimension. I would be very thankful if you can help me in this regard. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 6452 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From matt.gerhold at gmail.com Wed Oct 5 13:31:40 2016 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 5 Oct 2016 13:31:40 +0200 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son wrote: > Dear Fieldtrippers, > > > > the general problem we are facing is one of statistics. In particular, we > are trying to test the robustness of a graph measure when reducing the > amount of nodes it is computed with. In our case, we use the EEG electrodes > as nodes. > > > > We are trying to find out whether a graph measure differs significantly > from zero over a group of subjects. The exact calculation of the measure is > rather complicated to explain, suffice it to say that every subject has > exactly one scalar value in the end. Computation of this measure using 64 > electrodes is straightforward and we can easily calculate a p-value and/or > a confidence interval. > > When we calculate based on only 32 electrodes however, we draw 32 > electrodes randomly. Therefore, we need to repeat this computation many > times (let’s say 1000 times). So we then get [1000 x number of subjects] > values, or 1000 p-values/confidence intervals. > > How do we statistically test whether the measure is robustly different > from 0? Is it too naive to simply assume that if the confidence interval > does not contain 0 in at least 950 of the 1000 computations then it is > robustly different from 0? > > > > Any help would be greatly appreciated! > > > > Best regards, > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Wed Oct 5 15:55:26 2016 From: sarathykousik at gmail.com (kousik sarathy) Date: Wed, 5 Oct 2016 15:55:26 +0200 Subject: [FieldTrip] Plotting confidence intervals in multiplotER In-Reply-To: References: Message-ID: Hi Arti, The best I can suggest is a two step process. ft_timelockgrandaverage you should see a keepindividual option. You can collate your subject x chan x time as a single 3-D dataset. Then you can manually make your own fields of mean and sem. -- Regards, Kousik Sarathy, S On Wed, Oct 5, 2016 at 7:57 AM, Arti Abhishek wrote: > Dear Kousik, > > Thank you very much for your help. I am not sure how to change the > "dat_sem" as you suggested. My grand averaged file has the fields as follows > > GrandAvg_Target1 = > > avg: [132x601 double] > var: [132x601 double] > dof: [132x601 double] > time: [1x601 double] > label: {132x1 cell} > dimord: 'chan_time' > cfg: [1x1 struct] > > I am a beginner in MATLAB and any help would be greatly appreciated. > > Thanks, > Arti > > On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy > wrote: > >> Hey Arti, >> >> This is not such a trivial thing to solve. Here's a recipe I used. You >> need to find and edit two scripts. If this spurns any more interest, I'll >> initiate a 'bug' and try to send in a pull request. This is a dirty fix and >> in all probability will be considered blasphemy. ;) >> >> 1. Find in ft_multiplotER >> >> : >> ft_plot_vector(xval, yval, 'width', width(m), 'height', height(m), 'hpos', >> layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', [ymin ymax], ' >> color', color, 'style', cfg.linestyle{i}, 'linewidth', cfg.linewidth, ' >> axis', cfg.axes, 'highlight', mask, 'highlightstyle', cfg.maskstyle, ' >> label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); >> This basically calls a plotting function which in turn does the plotting >> for you. You need to send in the extra 'sem' or a 'ci' variable. >> Change this to: >> ft_plot_vector(xval, yval, 'ysem', ysem, 'width', width(m), 'height', >> height(m), 'hpos', layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', >> [ymin ymax], 'color', color, 'style', cfg.linestyle{i}, 'linewidth', >> cfg.linewidth, 'axis', cfg.axes, 'highlight', mask, 'highlightstyle', >> cfg.maskstyle, 'label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); >> >> 2. Find in ft_plot_vector >> >> : >> You need to first get the sem parameter from your data and setup so FT >> can see your sem or CI info. Follow the code here >> . >> Search for "data_sem" and fix those lines. >> Then: >> h = plot(hdat, vdat, style, 'LineWidth', linewidth, 'Color', color, ' >> markersize', markersize, 'markerfacecolor', markerfacecolor); >> Change this to: >> [h hp ]= boundedline(hdat, vdat, vdat_sem); >> >> Boundedline >> is >> a submission in the MATLAB file exchange. You can use any other thing. >> >> >> Good luck trying! :) >> >> >> -- >> Regards, >> Kousik Sarathy, S >> >> >> On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek >> wrote: >> >>> Dear fieldtrip community, >>> >>> I was wondering whether there is a way to plot the confidence intervals >>> in the ERP plot? I see that this question was asked multiple times in the >>> discussion list before, but I could not find an answer to this. >>> >>> Thanks, >>> Arti >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From belahian at memphis.edu Wed Oct 5 15:59:41 2016 From: belahian at memphis.edu (Bahareh Elahian (belahian)) Date: Wed, 5 Oct 2016 13:59:41 +0000 Subject: [FieldTrip] fieldtrip structure Message-ID: Hi All, I have a ".mat" file which contains: <8x10350000 double> and sampling rate. How should I import this data to field trip? By using [data] = ft_preprocessing( cfg); I am getting an error that the data should be in the format of raw or raw + comp. Any idea? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From belahian at memphis.edu Wed Oct 5 16:10:00 2016 From: belahian at memphis.edu (Bahareh Elahian (belahian)) Date: Wed, 5 Oct 2016 14:10:00 +0000 Subject: [FieldTrip] fieldtrip structure In-Reply-To: References: Message-ID: Sorry for the duplicated email. My mailbox sent it automatically. Please discard this email. Thanks! Bahar ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Bahareh Elahian (belahian) Sent: Wednesday, October 5, 2016 8:59:41 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] fieldtrip structure Hi All, I have a ".mat" file which contains: <8x10350000 double> and sampling rate. How should I import this data to field trip? By using [data] = ft_preprocessing( cfg); I am getting an error that the data should be in the format of raw or raw + comp. Any idea? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Wed Oct 5 17:21:19 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Wed, 5 Oct 2016 11:21:19 -0400 Subject: [FieldTrip] Neighbors for Elekta Neuromag 306 gradiometers separately? In-Reply-To: References: Message-ID: Dear all, I have the same question. Do we need to separate the two gradiometer sensors at one position when defining the neighbours for interpolating bad sensors? Thanks! Lin On Thu, Sep 17, 2015 at 3:43 AM, Darinka Trübutschek wrote: > Dear Fieldtrip community, > > I am new to MEG/fieldtrip and have a question regarding the neighbor > structure necessary for computing cluster-based statistics. I am currently > analyzing data from a Neuromag 306 system (with 102 Mags and 204 Grads) and > would like to look separately at Mags, Grad1, and Grad2. > I assume that this means that I also need to compute the neighbors > separately for the different channel types. > > My question therefore concerns fieldtrip's standard neighbor templates for > Neuromag. Is there a specific reason (theoretical or methodological), why > there are no separate templates for Grad1 and 2? All that I could find are > separate templates for Mag (neuromag306mag_neighb.mat), the combined planar > gradients (neuromag306cmb_neighb.mat), and the neuromag306planar_neighb.mat > template, which, if I understand correctly, does not combine the Grads, but > still lists sensors of one type as neighbors of sensors of another type > (e.g., for sensor 0713 - a gradiometer measuring the derivative along the > longitudinal component, the neighbors listed include 0432, 0723, but also > sensors that, if I interpret it correctly, should measure the derivative > along the latitudinal component, such as 0433, 0712, etc.) Is there a > specific reason, why sometimes, for a given sensor position, both Grad1 and > Grad2 are included in the neighbors (e.g., 0432 and 0433), but sometimes > only one of the two (e.g., 0742)? > > Many thanks in advance for your help! > > Best, > Darinka > -- > Darinka Trübutschek (PhD Candidate) > > Inserm-CEA Cognitive Neuroimaging Unit > CEA/SAC/DSV/DRM/Neurospin > Bât 145, Point Courier 156 > F-91191 Gif-sur-Yvette > > website: https://sites.google.com/site/dtruebutschek/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mklados at gmail.com Wed Oct 5 20:55:05 2016 From: mklados at gmail.com (Manousos Klados) Date: Wed, 5 Oct 2016 14:55:05 -0400 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) Message-ID: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Wed Oct 5 21:36:02 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Wed, 5 Oct 2016 21:36:02 +0200 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) In-Reply-To: References: Message-ID: Dear Dr Klados, thank you for sharing this event. I'm interested and I would like to ask you if video material will be sent to all the e-participants. I'm in the EEST time zone, but I'll be busy working at the time of the talks. Thank you in advance. Best Regards, Federica Mauro, Ph.D. Psychology Department - Sapienza University of Rome (Italy) Il 5 ott 2016 9:26 PM, "Manousos Klados" ha scritto: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 5 22:24:16 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 5 Oct 2016 20:24:16 +0000 Subject: [FieldTrip] fiff_read_tag error Message-ID: I have some old Neuromag MEG/EEG data files that I’m trying to read. One file is giving me a runtime error (the others appears ok): Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle 306 MEG channel locations transformed Reading sleep_DC_s3_13_raw.fif ... Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle Opening raw data file sleep_DC_s3_13_raw.fif... Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle Range : 28800 ... 518399 = 47.753 ... 859.547 secs Ready. Reading 28800 ... 518399 = 47.753 ... 859.547 secs...Error using fiff_read_tag (line 232) Cannot handle other than dense or sparse matrices yet Error in fiff_read_raw_segment (line 152) tag = fiff_read_tag(fid,this.ent.pos); Error in ft_read_data (line 1105) dat = fiff_read_raw_segment(hdr.orig.raw,begsample+hdr.orig.raw.first_samp-1,endsample+hdr.orig.raw.first_samp-1,chanindx); Any suggestions on how to debug/fix/read this file? All help is appreciated as I’m just starting with FieldTrip. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel." --- Maya Angelou ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 5 23:06:18 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 5 Oct 2016 21:06:18 +0000 Subject: [FieldTrip] error with ft_appenddata Message-ID: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From rhancock at email.arizona.edu Thu Oct 6 01:05:46 2016 From: rhancock at email.arizona.edu (Roeland Hancock) Date: Wed, 5 Oct 2016 16:05:46 -0700 Subject: [FieldTrip] Postdoctoral Position at UCSF in California, USA on cognitive neuroscience of language processing Message-ID: The Hoeft Lab (http://brainLENS.org PI: Fumiko Hoeft MD PhD) at the UCSF Dept of Psychiatry and Weill Institute for Neurosciences is looking for an exceptional postdoc in the field of neurolinguistics, with advanced neuroimaging, computational, programming and organizational skills. Training in genetics is a plus. The primary project that the postdoc will be responsible for is the examination of intergenerational neuroimaging using a ‘natural’ cross-fostering design that allows dissociation of genetic, prenatal and postnatal environment on brain networks that are transmitted across generations. Related articles from our lab can be found here - Yamagata et al. J Neurosci 2016 (http://goo.gl/vMK8iy), Ho et al. Trends in Neurosci 2016 (http://goo.gl/SyXLcK), and Scientific American (http://goo.gl/YTiH6D). There are many opportunities to be involved in other projects on the neuroscience of language and literacy. The position can begin immediately. Please email info at brainlens.org with a cover letter and your CV. Please add “[Postdoc job]” and your full name in the Subject of the email. Qualified candidates will be asked to have 3 letters of reference forwarded. Roeland Hancock -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 6 02:21:02 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 6 Oct 2016 00:21:02 +0000 Subject: [FieldTrip] error with ft_appenddata In-Reply-To: References: Message-ID: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won’t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif’; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Thu Oct 6 11:24:11 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Thu, 06 Oct 2016 10:24:11 +0100 Subject: [FieldTrip] =?utf-8?q?Official_Fieldtrip_Courses/Meetings_in_Euro?= =?utf-8?q?pe_this_year=3F?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear Fieldtrippers I was wondering if there are any official Fieldtrip courses/Meetings in Europe this year or early next year? best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From dlozanosoldevilla at gmail.com Thu Oct 6 11:47:29 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Thu, 6 Oct 2016 11:47:29 +0200 Subject: [FieldTrip] Official Fieldtrip Courses/Meetings in Europe this year? In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi, Take a look here: http://www.fieldtriptoolbox.org/workshop There's one in Tuebingen and another in Marseille. Ask the organizers to see if there're available seats best, Diego On 6 October 2016 at 11:24, parham hashemzadeh wrote: > Dear Fieldtrippers > I was wondering if there are any official Fieldtrip courses/Meetings in > Europe this year or early next year? > best regards parham > > On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > >> Hi Parham, >> >> Sorry for sounding cryptic earlier, I was just reciprocating the >> crypticity of the question. >> I think that the suggestion made in the previous e-mail is an >> excellent one. >> With the addition that, rather than using ft_determine_coordsys, you >> could use ft_plot_ortho to visualize an arbitrary cross-cut through >> your volumetric image. >> Note however, that the MR and the sourcespace should be in the same >> coordinate system for this to work. >> >> Best, >> Jan-Mathijs >> >> On 05 Oct 2016, at 00:47, A. Donda wrote: >>> >>> Hi Parham, >>> >>> if you wanna plot it in FieldTrip, these commands worked well for >>> me, but in my case (MEG data) I had to make sure first that these >>> data were on the same coordinate system (co-registration of MRI and >>> MEG sensor-data). If you do not have this issue, then you can simply >>> plot an MRI and a mesh obtained from freesurfer the following way >>> (make sure that both MRI and the mesh are in the same units, e.g. cm >>> or mm): >>> >>> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >>> >>> hold on >>> >>> ft_plot_mesh(sourcespace); >>> >>> Alternatively, if you want to plot the vertices of the mesh as dots, >>> you can use >>> >>> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >>> >>> sourcespace has the following structure (in case this is helpful for >>> you): >>> >>> pnt: [8196x3 double] >>> tri: [16384x3 double] >>> area: [16384x1 double] >>> orig: [1x1 struct] >>> unit: 'm' >>> >>> I obtained sourcespace by loading the boundary element model (bem) >>> surface, created with the watershed algorthim of Freesurfer: >>> >>> sourcespace = >>> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >>> 'format', 'mne_source'); %in meters >>> >>> Note that I had to transform the sourcespace dataset to the right >>> coordinate system and units. >>> >>> Finally I plotted the mri and mesh in cm >>> >>> To convert units in Fieldtrip, as you know, use X_cm = >>> ft_convert_units(X,'cm'); >>> >>> I hope this is helpful. >>> >>> Best >>> >>> A.Donda >>> >>> ------------------------- >>> >>> FROM: fieldtrip-bounces at science.ru.nl >>> on behalf of parham hashemzadeh >>> >>> SENT: Tuesday, October 4, 2016 6:08 PM >>> TO: FieldTrip discussion list >>> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >>> mri_aligned. >>> >>> Dear Darren >>> Thank you very much, and I will try to give it a go. >>> In the event that I can not. You are a life saver if you can help >>> me >>> out. Everything is in place except this incredibly important item. >>> I >>> have noticed that you are in Cambridge, maybe we can meet at some >>> point. >>> I am close by at the mathematics department. >>> Many many thanks >>> best regards parham >>> >>> On 2016-10-04 17:45, Darren Price wrote: >>> >>>> Hi Parham >>>> >>>> For a non-linear interpolation onto a regular grid, >>>> >>> spm_mesh_to_grid >>> >>>> might be ideal (from the spm package of course). I don't have a >>>> working example to hand, but I may be able to dig one out if you >>>> >>> can't >>> >>>> get it working. >>>> >>>> Darren >>>> >>>> >>>> ------------------------------------------------------- >>>> Dr. Darren Price >>>> Investigator Scientist and Cam-CAN Data Manager >>>> MRC Cognition & Brain Sciences Unit >>>> 15 Chaucer Road >>>> Cambridge, CB2 7EF >>>> England >>>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>>> TEL +44 (0)1223 355 294 x202 >>>> FAX +44 (0)1223 359 062 >>>> MOB +44 (0)7717822431 >>>> ------------------------------------------------------- >>>> >>>> >>>> -----Original Message----- >>>> From: fieldtrip-bounces at science.ru.nl >>>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>>> hashemzadeh >>>> Sent: 04 October 2016 16:59 >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >>>> >>> mri_aligned. >>> >>>> >>>> Hi Jan >>>> Thank you, my functional data are the function values of some >>>> function (irrotational component of the current). From my limited >>>> experience of Fieldtrip, your explanation feels (to myself) a bit >>>> cryptic at the moment. >>>> >>>> You see if my inversion strategy was one of the classical ones >>>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >>>> >>> eloreta >>> >>>> then the available fieldtrip tutorials are great in showing >>>> how to plot functional values on the top of anatomical values. >>>> But, since, I work on inversion methods, then I need a hacking >>>> strategy to be able to plot functional values of "some >>>> function"(estimated) on top of anatomical data MRI. >>>> >>>> I would appreciate if you would kindly let me know, if there is >>>> >>> hack >>> >>>> to it such that >>>> ft_sourceplot can accept the input. >>>> best regards parham >>>> >>>> >>>> >>>> >>>> >>>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> >>>>> Hi Parham, >>>>> >>>>> It is possible, but certainly not pain free, nor >>>>> >>>> straightforward. >>> >>>> I think this is not really a fieldtrip question, but more a >>>>> >>>> general >>> >>>> matlab related issue. >>>>> >>>>> It should be possible to plot a slice through an MRI volume as a >>>>> MATLAB patch, where the coordinates of the voxels are expressed >>>>> >>>> in >>> >>>> some coordinate system. Then, it is possible to generate and >>>>> intersection of the freesurfer mesh through the plane of >>>>> visualization. >>>>> >>>>> Best, >>>>> Jan-Mathijs >>>>> >>>>> >>>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >>>>>> >>>>> wrote: >>> >>>> >>>>>> Dear Fieldtrippers >>>>>> Is there a straightforward pain free method ( I appreciate if >>>>>> >>>>> you can >>> >>>> give me the command) >>>>>> to plot arbitrary points such as the vertices of the freesurfer >>>>>> >>>>> >>> output >>>>>> (mesh) onto the MRI image? >>>>>> The reason that I ask is that I would like to plot my solution >>>>>> >>>>> on the >>> >>>> MRI image. >>>>>> Unfortunately I do not use dipoles. In EEG, I model the >>>>>> >>>>> irrotational >>> >>>> component of the current as a scalar function and therefore I >>>>>> >>>>> am >>> >>>> doing >>>>>> function estimation. >>>>>> IF you use dipoles, it is straightforward because you follow >>>>>> >>>>> one of >>> >>>> the tutorials. >>>>>> But if you do not use dipoles and model the current as the >>>>>> >>>>> gradient >>> >>>> of the irrotational component of the current in EEG then one >>>>>> >>>>> can get >>> >>>> lost. >>>>>> Any help would be appreciated. >>>>>> Many thanks >>>>>> >>>>>> -- >>>>>> best regards >>>>>> Parham Hashemzadeh >>>>>> Research Associate >>>>>> Department of Applied Mathematics and Theoretical Physics >>>>>> University of Cambridge, UK. >>>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>>> >>>> >>>> -- >>>> best regards >>>> Parham Hashemzadeh >>>> Research Associate >>>> Department of Applied Mathematics and Theoretical Physics >>>> University of Cambridge, UK. >>>> email: hashemzadeh at damtp.cam.ac.uk >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >> >> >> >> Links: >> ------ >> [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price >> [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Thu Oct 6 15:35:01 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Thu, 6 Oct 2016 09:35:01 -0400 Subject: [FieldTrip] ICA components for gradiometer sensors Message-ID: Dear all, I applied ICA ('runica' method) to 202 gradiometer sensors (collected with neuromag system) after removing two bad channels and some trials that contained obvious artifacts. I could identify the EOG and ECG components, but the topographic distributions of the components look quite weird to me (i.e., the strips). I attached a screenshot of some components in the email. Could you help me to see whether there is anything wrong with the ICA analysis? Thanks a lot! Best, Lin [image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ICA_GRAD.png Type: image/png Size: 574403 bytes Desc: not available URL: From elizabeth.1.shephard at kcl.ac.uk Thu Oct 6 16:03:01 2016 From: elizabeth.1.shephard at kcl.ac.uk (Shephard, Elizabeth) Date: Thu, 6 Oct 2016 14:03:01 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis Message-ID: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King's College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 6 16:35:39 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 6 Oct 2016 14:35:39 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis In-Reply-To: References: Message-ID: <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> Dear Lizzie, You haven’t done anything wrong, and the output is exactly as expected. You almost solved it yourself, since indeed you would want to need the option cfg.avgoverfreq = ‘yes’, but this should be invoked in another function: cfg = []; cfg.avgoverfreq = ‘yes’; FFThann = ft_freqanalysis(cfg, FFThann); Best wishes, Jan-Mathijs On 06 Oct 2016, at 16:03, Shephard, Elizabeth > wrote: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.1.shephard at kcl.ac.uk Thu Oct 6 16:51:45 2016 From: elizabeth.1.shephard at kcl.ac.uk (Shephard, Elizabeth) Date: Thu, 6 Oct 2016 14:51:45 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis In-Reply-To: <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> References: , <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> Message-ID: Dear Jan-Mathijs Brilliant, thanks for getting back to me. I have it working now with the second step :) Many thanks Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Schoffelen, J.M. (Jan Mathijs) Sent: 06 October 2016 15:35:39 To: FieldTrip discussion list Subject: Re: [FieldTrip] Outputting average power with ft_freqanalysis Dear Lizzie, You haven’t done anything wrong, and the output is exactly as expected. You almost solved it yourself, since indeed you would want to need the option cfg.avgoverfreq = ‘yes’, but this should be invoked in another function: cfg = []; cfg.avgoverfreq = ‘yes’; FFThann = ft_freqanalysis(cfg, FFThann); Best wishes, Jan-Mathijs On 06 Oct 2016, at 16:03, Shephard, Elizabeth > wrote: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Fri Oct 7 03:08:15 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Fri, 07 Oct 2016 01:08:15 +0000 Subject: [FieldTrip] inverse problem for HCP Message-ID: Hi all, I am trying to compute the inverse source localization with beamforming in HCP, then the volume segment of provided MRI is one of the first steps, but as the ordsys of the MRI is not available this segmentation is not possible, I would to know what is solution? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Oct 7 21:40:56 2016 From: russgport at gmail.com (russ port) Date: Fri, 7 Oct 2016 15:40:56 -0400 Subject: [FieldTrip] Failure of LCMV beamformer for Neuromag VectorView planar gradiometers In-Reply-To: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> References: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> Message-ID: <0C79E9BD-15C3-40EF-820C-7B676A9D1D7D@gmail.com> Hi, I realize that my previous email was far too long. In short: I'm having some trouble localizing some auditory steady state elekta data using LCMV beamformer in fieldtrip. I'm localizing the magnetometers and gradiometers separately and while the magnetometers are giving good results the gradiometers are not (see attached ppt). I suspect that this is due to the gradiometer data matrix being rank difficient due to running maxFilter. Does anyone have any suggestions on how to run LCMV beamforming on SSS’d elekta gradiometer data? Thanks​ Russ > On Oct 1, 2016, at 12:34 PM, russ port wrote: > > Dear Fieldtrippers/Fieldtrippians > > I was hoping someone could help me with an issue I have come across during my analyses of a preliminary study. In brief, for the study a person was scanned on a CTF 275 channel biomagnetometer and then directly after on a 306 channel Elekta Neuromag VectorView platform. During the scans, the subject listened to a 40Hz amplitude modulated 500Hz tone (to generate a 40Hz Auditory Steady-state Response [ASSR]). In order to get the Elekta-derived data into a workable format, the Elekta-derived was MaxFilter’d for SSS (not tsss). After this, to analyze the datasets in an analogous manner, all datasets (both CTF- and Elekta-derived datasets [planar gradiometers and magnetometers analyzed separately]) were artifact cleaned (artifact rejection for jump/muscle artifact, ICA rejection of EOG/ECG components - OF NOTE FOR ELEKTA DATA THE ICA OUTPUT WAS LIMITED TO THE RANK OF THE DATA [BECAUSE OF SSS NOTED ABOVE]). Then the data was averaged, and a LCMV beamformer (ipsi-lateral channels only) targeted at the subject’s right or left hemisphere Helsch’s Gyrus was used to generate a ASSR time course. Attached (within the powerpoint slide deck) are figures showing the results . For each figure, the left column shows data that is just read with with no artifact correction (incase the ICA routines were improperly deforming the data), and the right column show the results of the methodology described above. The first and second row is the time-locked data from all sensors, both broad band (1st row - and also what is passed to the LCMV beamformer), and band-passed for gamma-band activity (30-58Hz). The third and forth rows are similar, though show the virtual electrodes time course (orientated to the ASSR). Hopefully you would agree that the CTF and Elekta magnetometer virtual electrode time course/results seem very appropriate. On the other hand, the Elekta planar gradiometer time course seem “lack-luster” to say the best. I did try to look into this, and found that during the beamforming, both CTF and Elekta magnetometers are rank sufficient (rank= number of channels for that hemisphere). The planar gradiometers on the other hand are rank deficient, which based on my understanding of the steps of an LCMV beamformer may be quite problematic. Has anyone else experienced this before and/or have suggestions how to circumvent this issue of poor planar gradiometer results from a LCMV beamformer? > > Best, > Russ Port > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pooneh.baniasad at gmail.com Mon Oct 10 13:55:02 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Mon, 10 Oct 2016 15:25:02 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> References: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> Message-ID: Dear Simon Thanks a lot for your attention and sorry for the late response. I've actually found which part of the code makes a problem. I used the ft_prepare_vol_sens's function in a wrong way. Now I have another problem. I change the coordination system from 'ctf' to 'spm' by using this code: cfg = []; [mri] = ft_volumenormalise(cfg, mri); When I segmented 'scalp' separately and prepared mesh from it, the figure was well (1.fig). On the other hand when I changed the segmentation into {'brain', 'skull', 'scalp'}, the scalp can not be computed properly (2.fig). On Mon, Oct 3, 2016 at 4:57 PM, Simon Homolle wrote: > Dear Pooneh, > > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem > > I relate to this part: > > > When the forward solution is computed, the lead field matrix (= channels > X source points matrix) is calculated *for each grid point* taking into > account the head model and the channel positions. > > > So I assume your mesh consists of 2000 grid points? > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 03 Oct 2016, at 13:01, pooneh baniasad > wrote: > > Dear Simon, > > I've followed this tutorial: > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct > the headmodel ('VolBEM') > I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for > 'DipPos'. > Is it clear or should I explain more? 🙂 > > On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle > wrote: > >> Dear pooh, >> >> Could you provide more information how you constructed your BEM-model? >> >> best regards, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 02 Oct 2016, at 12:22, pooneh baniasad >> wrote: >> >> Dear FieldTrip community >> >> I'm using the forward model to simulating EEG signal although it seems >> the dimension of the lead-field matrix is not correct. Here is a review of >> the procedure. >> >> First I constructed a BEM headmodel for EEG source analysis ​and then by >> loading the template cortex, I put the dipoles with specific current source >> on that. I expect the dimension of the lead-field matrix will be m*n which >> m=electrode's number and n=3*dipole's number but 'm' is different. >> Since I used the template electrode 'standard_1020.elc', m = 97 according >> to: >> >> chanpos: [97x3 double] >> chantype: {97x1 cell} >> chanunit: {97x1 cell} >> elecpos: [97x3 double] >> label: {97x1 cell} >> type: 'eeg1010' >> unit: 'mm' >> >> while the dimension of lead-field matrix is: 2000x122880 >> >> I use this function for calculating lead-field matrix: >> >> LF = ft_compute_leadfield(DipPos, elec, VolBEM); >> ​I do not understand why the number of raws are different​! >> >> ​On the other hand I guess that there is a similarity between the number >> of raws in the volume head model and LF matrix due to the dimension of >> headmodel matrix is: 2000x8000 double .​ >> >> ​I will be so thankful if anyone can help me.​ >> >> -- >> Bests >> >> Pouneh Baniasad >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.jpg Type: image/jpeg Size: 96708 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.jpg Type: image/jpeg Size: 84068 bytes Desc: not available URL: From alexander.whillier at med.uni-goettingen.de Mon Oct 10 19:39:03 2016 From: alexander.whillier at med.uni-goettingen.de (Whillier, Alexander) Date: Mon, 10 Oct 2016 17:39:03 +0000 Subject: [FieldTrip] Help importing and reading data Message-ID: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> Dear Fieldtrip, I have inherited a dataset of EMG and EEG data that was gathered using two different programs. One of my colleagues has taught me the basics of fieldtrip and I only a beginner at Matlab at the moment. I am trying to analyse both data sets using fieldtrip. The first dataset (which works) is .cnt data gathered using EEG Probe. The second dataset (which fieldtrip currently fails to recognise) is .cfs data gathered using Signal. I am able to export the data as .mat files, to read them in Matlab using Fieldtrip. However, in spite of my best efforts to create a header file and header format that the preprocessing code will accept, I am unable to proceed. I get constant errors: Error using ft_read_header (line 2158) unsupported header format (matlab) Error in ft_preprocessing (line 394) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Even though my cfg.hdr section has all of these values, I cannot find a way to get it to run the preprocessing code. Can you help? Kind regards, Alexander Whillier -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.sciences at gmail.com Mon Oct 10 19:58:23 2016 From: peter.sciences at gmail.com (Peter Soros) Date: Mon, 10 Oct 2016 19:58:23 +0200 Subject: [FieldTrip] PhD position in psychiatric neuroimaging (Oldenburg, Germany) Message-ID: Dear All, The University Clinic of Psychiatry and Psychotherapy, University of Oldenburg, Germany (Director: Prof. Dr. Alexandra Philipsen) offers a PhD position (65 % of full time TV-L 13, 3 years) in multimodal psychiatric neuroimaging. The successful PhD student will investigate the neural correlates of attention deficit hyperactivity disorder (ADHD) and borderline personality disorder, using the state-of-the-art infrastructure of the University Clinic and the newly founded Neuroimaging Center, including a Siemens Prisma MRI at 3 Tesla with 64-channel head coil, a 306-channel Elekta Neuromag Triux magnetoencephalography system, EEG and TMS. This position is embedded in an excellent interdisciplinary scientific environment with a strong focus on neurosensory, neurocognitive and psychiatric research. The University Clinic of Psychiatry and Psychotherapy is part of the rapidly growing European Medical School, founded by the Universities of Oldenburg, Germany, and Groningen, The Netherlands. Applicants are expected to hold a master's degree in the field of psychology, neuroscience, physics or a related discipline, or a medical degree. Prior experience with the analysis of MRI, EEG or MEG data is highly desirable. Computer programming and statistical skills are an asset. Oldenburg is an attractive and safe city with a population of 160.000 in Germany's northwest with excellent quality of life. It is close to Bremen, Hamburg and Groningen, and approximately 1 h from the North Sea. The University of Oldenburg is an equal opportunity employer aiming to increase the proportion of female academic members. Therefore, we especially encourage women to apply. Applicants with disabilities will be given preference if equally qualified. Applications should include a cover letter, CV, copy of the master's thesis or other written work, university grades and the contact details of two academic references and should be sent to Prof. Dr. Alexandra Philipsen, Director of the University Clinic of Psychiatry and Psychotherapy, University of Oldenburg, Germany via e-mail (alexandra.philipsen at uni-oldenburg.de ). For additional information, please contact Dr. Peter Soros (phone +49.441.9615.1503; peter.soeroes at uni-oldenburg.de ) Deadline for application: October 31, 2016 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Holding at nottingham.ac.uk Tue Oct 11 18:26:11 2016 From: Martin.Holding at nottingham.ac.uk (Martin Holding) Date: Tue, 11 Oct 2016 16:26:11 +0000 Subject: [FieldTrip] Cluster Based Permutation Stats on Source Spaced Frequency Data Message-ID: <218876b60d2a47b99ad1d80347ff8e8c@frigg-vm0.nus.ihr.mrc.ac.uk> Hello Fieldtrip, This is my first posting so I'll introduce myself. My name is Martin and I'm a PhD student at the Institute of Hearing Research in Nottingham, primarily interested in auditory oscillations associated with tinnitus using EEG and MEG. This problem is from a project I did a while back but I'm just wrapping up now. I'm having a problem with running some cluster based permutation statistics on some frequency and timelocked MEG data I have. The first thing to mention is that the code runs fine. Fieldtrip is happy to run the tests, the problem is that I am getting no significant clusters out of it. This is in spite of some rather large t-values that might suggest otherwise. I suspect this is due to the fact that the frequency and timelocked data I am passing to the relevant stats functions (ft_freqstatistics and ft_timelockstatistics respectively) is analysed in source space, not sensor space. Unfortunately, due to data artefacts it isn't possible for me to do these analyses in sensor space. As such, I think that fieldtrip is telling me I have no clusters because it defines clusters based on neighbouring channels/sensors supplied by a layout template which it no longer has access too because I'm in source space on an MNI grid system. I have 2 questions then: 1. Is this a sensible conclusion for why I'm getting no significant clusters? 2. And if so, is there a way I can make the fieldtrip statistics functions recognise MNI grids and calculate the neighbours on grid points rather than sensors? Many thanks, Martin ============================================================== Martin Holding PhD Student MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115 74) 86938 Email: martin.holding at nottingham.ac.uk ============================================================== Martin Holding PhD Student MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115 74) 86938 Email: martin.holding at nottingham.ac.uk This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 12 09:48:31 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 12 Oct 2016 07:48:31 +0000 Subject: [FieldTrip] Help importing and reading data In-Reply-To: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> References: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> Message-ID: Hi Alexander, If you have managed to convert the data into a mat-file, in general it is not needed to go through ft_preprocessing to get the data loaded into memory. In general, providing cfg.datafile = ‘somefilename.mat’ will not work. I’d recommend to look here: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat, and in particular at the ‘circumvent the fieldtrip reading functions’ section. The idea is to create a fieldtrip-style data structure that can serve as an input argument to downstream processing functions. Good luck, Jan-Mathijs On 10 Oct 2016, at 19:39, Whillier, Alexander > wrote: Dear Fieldtrip, I have inherited a dataset of EMG and EEG data that was gathered using two different programs. One of my colleagues has taught me the basics of fieldtrip and I only a beginner at Matlab at the moment. I am trying to analyse both data sets using fieldtrip. The first dataset (which works) is .cnt data gathered using EEG Probe. The second dataset (which fieldtrip currently fails to recognise) is .cfs data gathered using Signal. I am able to export the data as .mat files, to read them in Matlab using Fieldtrip. However, in spite of my best efforts to create a header file and header format that the preprocessing code will accept, I am unable to proceed. I get constant errors: Error using ft_read_header (line 2158) unsupported header format (matlab) Error in ft_preprocessing (line 394) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Even though my cfg.hdr section has all of these values, I cannot find a way to get it to run the preprocessing code. Can you help? Kind regards, Alexander Whillier _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Oct 12 11:51:34 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 12 Oct 2016 11:51:34 +0200 Subject: [FieldTrip] Post-doctoral position in Cognitive Neuroscience, Charite Berlin Message-ID: The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a Post-doctoral position. A Grant by the German Research Foundation (DFG) will fund the position for a 30-months period. The main objective of the project is to examine multisensory processing in patients with schizophrenia. Recent studies have suggested multisensory processing deficits in patients with schizophrenia, but the neurophysiologic mechanisms underlying these deficits are not well understood. This project comprises of electroencephalography studies using multisensory paradigms for which effects in neural oscillations have been previously established in healthy individuals. Multisensory processing, as reflected in local power, dynamic network patterns, and functional connectivity will be examined in schizophrenia patients and healthy control participants. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Experience in human EEG/MEG studies, Matlab programming skills, as well as German language skills for interacting with patients are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades), as well as information on the earliest possible date to start the position until October 21, 2016, electronically to: Daniel Senkowski, Department of Psychiatry and Psychotherapy, Charité, University Medicine Berlin, 10115 Berlin, Germany, Phone: +49-30-2311-2738, Fax: +49-30-2311-2209, daniel.senkowski at charite.de. Regards, Daniel Senkowski -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From ph442 at cam.ac.uk Wed Oct 12 12:33:36 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Wed, 12 Oct 2016 11:33:36 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear All I tried your recommendations and I was unsuccessful. The platform is hardwired for dipole analysis. Any other suggestions, would be appreciated. best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From sander at mpib-berlin.mpg.de Wed Oct 12 14:46:56 2016 From: sander at mpib-berlin.mpg.de (Sander, Myriam) Date: Wed, 12 Oct 2016 12:46:56 +0000 Subject: [FieldTrip] Post-doctoral position at MPI for Human Development, Berlin Message-ID: Dear Colleagues, We have an open post-doc position for which we are still searching the ideal candidate – a person with a strong background in memory research and experience with advanced statistical analysis (machine-learning techniques like SVM, RSA…). In collaboration with Nikolai Axmacher (Ruhr Universität Bochum), we plan a project on age-differences in memory reactivation that will be conducted at the Center for Lifespan Research of the Max Planck Institut for Human Development in Berlin in the context of the MINERVA research group headed by Dr. Myriam Sander (https://www.mpib-berlin.mpg.de/en/research/lifespan-psychology/projects/cognitive-and-neuronal-dynamics-of-memory) Research of the MINERVA research group (PI: Dr. Myriam Sander) focuses on age-differences in memory representations. We aim to track memory representations across their life-cycles in terms of specific distributed patterns of neural activity. We investigate whether aging changes the quality of the representational patterns and thereby affects memory performance. We want to understand how aging affects the distinctiveness and similarity of memory representations during memory formation, replay, and retrieval. Research of the MINERVA group uses mainly electroencephalography (EEG) with a focus on oscillatory measures to uncover lifespan differences in mechanisms underlying memory performance (see e.g. Sander, et al., Neurosci. Biobehav. Rev., 2012). We also have access to a 3T scanner, TMS and eye tracker. Our research group is located at the Max Planck Institute for Human Development (MPIB) in Berlin with an international working atmosphere. The official deadline for applications has passed already, but we decided to wait for the ideal candidate for this project – so if you know her or him, please let her/him know and encourage her/him to apply! Thanks for spreading the word! With best regards from Berlin, Myriam Sander -- Dr. Myriam C. Sander Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94 14195 Berlin +49 (0)30 82 406 414 sander at mpib-berlin.mpg.de www.mpib-berlin.mpg.de/en/staff/myriam-c-sander -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PostDoc MPIB.pdf Type: application/pdf Size: 56405 bytes Desc: PostDoc MPIB.pdf URL: From son.ta.dinh at tum.de Wed Oct 12 17:06:08 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Wed, 12 Oct 2016 15:06:08 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Wed Oct 12 18:00:59 2016 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 12 Oct 2016 18:00:59 +0200 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son, Without directly referring to the Achard paper: In one sentence, how do you define the hub disruption index in terms of human brain function? In one sentence, how does the single value represent the definition you have provided in the previous sentence? If you have the right answers to these two simple questions, then the manner in which the null is defined computationally should be intuitive to you. Regards, Matthew On Wed, Oct 12, 2016 at 5:06 PM, Ta Dinh, Son wrote: > Hey Matthew, > > > > Thanks for the answer, but the question is exactly how to actually build a > representative null distribution. As the calculation using all (64) > electrodes is deterministic, it can’t really be used to create a > distribution, it would just be a vector of 1000 x 1 exact same value. > > The graph measure is called hub disruption index and was introduced here: > Achard, S., et al. (2012). "Hubs of brain functional networks are radically > reorganized in comatose patients." PNAS. > > To put it in a nutshell, it compares a subject against a group of > controls, thereby giving a single value for every subject (in comparison to > the control group). > > > > I hope this has cleared up the context a bit. > > > > Best > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > *Von:* Nickel, Moritz > *Gesendet:* Mittwoch, 12. Oktober 2016 16:37 > *An:* Ta Dinh, Son > *Betreff:* Fwd: [FieldTrip] Statistical test of robustness of a graph > measure based on reduced amount of nodes > > > > > > ---------- Forwarded message ---------- > From: *Matt Gerhold* > Date: 2016-10-05 13:31 GMT+02:00 > Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure > based on reduced amount of nodes > To: FieldTrip discussion list > > Hi Son, > > What you are explaining sounds like resampling to build a distribution > under the null hypothesis. You would need to make sure that your random > draws are representative in some way of an instance where the test > statistic (graph theoretic measure) is truly zero, i.e. representative of > the null hypothesis. There is no info on your measure, so one can't comment > any further on how one would achieve this. > > Once you have the bootstrapped distribution you compute the proportion of > values above the test statistic and those below the test statistic--the > test statistic is the measure you got from the actual sample, not the > bootstrapped distribution. > > Then it depends whether you use a two-tail or one-tail test and the > direction of the hypothesized effect: for a one-tail test you could > potentially take the proportion of the distribution above equal to the test > statistic, that would be your p-value. For two tailed-tests take the min > value of the two-proportions as your p-value and remember to divide alpha > by 2 to test for significance. > > That, in a nutshell, is a simple approach; however, there are other ways > to go about this. > > Matthew > > > > On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son wrote: > > Dear Fieldtrippers, > > > > the general problem we are facing is one of statistics. In particular, we > are trying to test the robustness of a graph measure when reducing the > amount of nodes it is computed with. In our case, we use the EEG electrodes > as nodes. > > > > We are trying to find out whether a graph measure differs significantly > from zero over a group of subjects. The exact calculation of the measure is > rather complicated to explain, suffice it to say that every subject has > exactly one scalar value in the end. Computation of this measure using 64 > electrodes is straightforward and we can easily calculate a p-value and/or > a confidence interval. > > When we calculate based on only 32 electrodes however, we draw 32 > electrodes randomly. Therefore, we need to repeat this computation many > times (let’s say 1000 times). So we then get [1000 x number of subjects] > values, or 1000 p-values/confidence intervals. > > How do we statistically test whether the measure is robustly different > from 0? Is it too naive to simply assume that if the confidence interval > does not contain 0 in at least 950 of the 1000 computations then it is > robustly different from 0? > > > > Any help would be greatly appreciated! > > > > Best regards, > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Darren.Price at mrc-cbu.cam.ac.uk Wed Oct 12 19:00:42 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Wed, 12 Oct 2016 17:00:42 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From son.ta.dinh at tum.de Thu Oct 13 11:25:14 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Thu, 13 Oct 2016 09:25:14 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Darren.Price at mrc-cbu.cam.ac.uk Thu Oct 13 14:15:53 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Thu, 13 Oct 2016 12:15:53 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son For who have emailed asking for code, it is pasted below. Son, I see what you mean. In that case creating surrogate data is still necessary, since you need a way to generate a confidence interval for each set of N channels. A rough outline of your pipeline would be: (this is all assuming your measure is not simply a function of the covariance matrix) for si = each surrogate dataset (1:1000): 64chanresult = compute result for 64 chan configuration for chani = each N of channels ranging from 64:32 Nchanresult = compute result for 64 chan configuration change(si, chani) = 64chanresult - Nchanresult end end then you can plot your data as a line graph with confidence intervals. I dug out a script I used a while ago, although you might want to check that it works properly (comparing correlation matrices of input/output). The main caveat is that you need to check that you take care of negative frequencies adequately. Here I have used a method of simply cancelling negative frequencies. The other way is to use the complex conjugate, but I found that less stable, perhaps due to numerical imprecision – I’m not sure. Anyway you should verify for yourself that the correlation matrix of your original data is almost exactly the same as your surrogate data (within reason: differences on the order of <1e-5, although this depends on the length of the data). You should detrend and filter before using this function. function data = randomisePhase(data, equalphase) % data = array: [time, channels] % equalphase boolean: [true | false] (do you want the same phase shift in % each channel? default = true) if nargin == 1 equalphase = true; end L = size(data, 1); data = fft(data)*2; data(L/2+1:end, :) = 0; randphase = exp(1i*randn(1,L)*2*pi)'; % uses the same phase for each channel for ii = 1:size(data,2) if equalphase == false randphase = exp(1i*rand(L,1)*2*pi)’; end data(:,ii) = real(ifft(data(:,ii).*randphase)); end Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 13 October 2016 10:25 To: FieldTrip discussion list Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RossiterH at cardiff.ac.uk Thu Oct 13 15:09:39 2016 From: RossiterH at cardiff.ac.uk (Holly Rossiter) Date: Thu, 13 Oct 2016 13:09:39 +0000 Subject: [FieldTrip] EMG detect Message-ID: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn't seem to recognise the term 'trialfun_emgdetect' - I've tried with the most recent version of fieldtrip and it's still not working. This is the error I'm getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 13 15:24:30 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 13 Oct 2016 13:24:30 +0000 Subject: [FieldTrip] EMG detect In-Reply-To: References: Message-ID: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> Hi Holly, You should first create this function, by copying and pasting from the example (essentially just take the second block of code on the page you are working from). Then, you may need to adjust a bit of the code for your own purpose (most likely the name of the emg-channel. Good luck, Jan-Mathijs On 13 Oct 2016, at 15:09, Holly Rossiter > wrote: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn’t seem to recognise the term ‘trialfun_emgdetect’ – I’ve tried with the most recent version of fieldtrip and it’s still not working. This is the error I’m getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RossiterH at cardiff.ac.uk Thu Oct 13 15:29:47 2016 From: RossiterH at cardiff.ac.uk (Holly Rossiter) Date: Thu, 13 Oct 2016 13:29:47 +0000 Subject: [FieldTrip] EMG detect In-Reply-To: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> References: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> Message-ID: Oh I see, thank you. It’s working now. Holly From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Schoffelen, J.M. (Jan Mathijs) Sent: 13 October 2016 14:25 To: FieldTrip discussion list Subject: Re: [FieldTrip] EMG detect Hi Holly, You should first create this function, by copying and pasting from the example (essentially just take the second block of code on the page you are working from). Then, you may need to adjust a bit of the code for your own purpose (most likely the name of the emg-channel. Good luck, Jan-Mathijs On 13 Oct 2016, at 15:09, Holly Rossiter > wrote: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn’t seem to recognise the term ‘trialfun_emgdetect’ – I’ve tried with the most recent version of fieldtrip and it’s still not working. This is the error I’m getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Fri Oct 14 08:08:09 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Fri, 14 Oct 2016 15:08:09 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering Message-ID: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> Dear community, My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. I am new to Fieldtrip. My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). The recording system is Neuralynx. I have encountered 2 problems which I don’t believe are related. I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. 1) Fsample discrepancy between data and header. When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. 2) 50Hz line noise filtering The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. To give an idea: cfg = []; cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 cfg.bsfreq = [49.9 50.1]; filtDat = ft_preprocessing(cfg, data_lite); cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below changes this into that {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: dat = ft_read_data(dataset_dir); dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); changes this into that Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) Of course, I tried to feed that filtered data into the preprocessing pipeline by doing cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. data_artifact_rejected = ft_preprocessing(cfg, dat_filt); But I get the error that dat_filt is not raw or comp data. I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. So for this point: - how to make the (recommended) 50Hz post processing work? - or more simply, how could I feed prefiltered data to ft_preprocessing? Thank you very much for your consideration and I look forward to your help. All the best, Florian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: data_lite.jpeg Type: image/jpeg Size: 32603 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: filtDat.jpeg Type: image/jpeg Size: 32794 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RawData.jpeg Type: image/jpeg Size: 51182 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RawData_after_filter.jpeg Type: image/jpeg Size: 46294 bytes Desc: not available URL: From knutsenpm at gmail.com Fri Oct 14 10:43:12 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 10:43:12 +0200 Subject: [FieldTrip] Data browser trouble Message-ID: Hi, My calls to ft_databrowser([], data) is failing with: >the input is raw data with 16 channels and 10 trials >detected 0 visual artifacts >Error using zeros >Size inputs must be integers. >Error in convert_event>artifact2artvec (line 179) >artvec = zeros(length(artifact), endsample); >Error in convert_event (line 103) > obj = artifact2artvec(obj,endsample); >Error in ft_databrowser (line 535) >artdata.trial{1} = convert_event(artifact, 'boolvec', 'endsample', datendsample); % every >artifact is a "channel" I am not certain if this is triggered by a lack of artifacts in my data, that my data structure is missing information, or that the code does not allow for "zero artifacts" by design. Here is my data structure: data = hdr: [1x1 struct] fsample: 4800 sampleinfo: [10x2 double] trial: {1x10 cell} time: {1x10 cell} label: {16x1 cell} cfg: [1x1 struct] My data is loaded through a custom reader as the data format I have is not supported natively by fieldtrip. I have succeeded in pre processing the data with ft_redefinetrial() and ft_preprocessing(). Any ideas? *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Fri Oct 14 11:08:44 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 11:08:44 +0200 Subject: [FieldTrip] Data browser trouble In-Reply-To: References: Message-ID: Oops, seems I was too quick to ask for help. I traced the error to my trial definitions which were not specified as integer samples. That led to the "​Size inputs must be integers" error below. Might it be an idea to place a check for integer values in cfg.trl when passed to ft_redefinetrial()? - Per On Fri, Oct 14, 2016 at 10:43 AM, Per Knutsen wrote: > Hi, > My calls to ft_databrowser([], data) is failing with: > > >the input is raw data with 16 channels and 10 trials > >detected 0 visual artifacts > >Error using zeros > > > ​​ > Size inputs must be integers. > >Error in convert_event>artifact2artvec (line 179) > >artvec = zeros(length(artifact), endsample); > >Error in convert_event (line 103) > > obj = artifact2artvec(obj,endsample); > >Error in ft_databrowser (line 535) > >artdata.trial{1} = convert_event(artifact, 'boolvec', 'endsample', > datendsample); % every >artifact is a "channel" > > I am not certain if this is triggered by a lack of artifacts in my data, > that my data structure is missing information, or that the code does not > allow for "zero artifacts" by design. > > Here is my data structure: > > data = > hdr: [1x1 struct] > fsample: 4800 > sampleinfo: [10x2 double] > trial: {1x10 cell} > time: {1x10 cell} > label: {16x1 cell} > cfg: [1x1 struct] > > My data is loaded through a custom reader as the data format I have is not > supported natively by fieldtrip. > > I have succeeded in pre processing the data with ft_redefinetrial() and > ft_preprocessing(). > > Any ideas? > > > *Per M Knutsen* > University of Oslo > Dept. of Molecular Medicine, Physiology Sect. > PB 1103 Blindern, NO-0317 Oslo > +47.45103762 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Fri Oct 14 15:17:23 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 15:17:23 +0200 Subject: [FieldTrip] Definition of "mid-sagittal point" Message-ID: I am working my way through the mouse EEG tutorial, here: http://www.fieldtriptoolbox.org/tutorial/mouse_eeg In the "Reading and coregistering..." I load the reference MRI data and start realignment to stereotactic coordinates with ft_volumerealign(). I need to select 3 fiducials: lambda, bregma and the midsagittal point. In this context, where should the "midsagittal point" be put in xyz? *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 ​​ -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Sat Oct 15 09:25:38 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Sat, 15 Oct 2016 16:25:38 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> Message-ID: <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Dear all, I am wondering, was my question unclear, or maybe no one is using Neuralynx data? I can think of ways to avoid these two problems, but I would prefer to find a proper solution if possible. Thanks in advance, Florian Gerard-Mercier > On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier wrote: > > Dear community, > > > My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. > > > I am new to Fieldtrip. > My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). > The recording system is Neuralynx. > > I have encountered 2 problems which I don’t believe are related. > I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. > > 1) Fsample discrepancy between data and header. > When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). > This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). > Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). > This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… > Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. > > 2) 50Hz line noise filtering > The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. > To give an idea: > cfg = []; > cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 > cfg.bsfreq = [49.9 50.1]; > filtDat = ft_preprocessing(cfg, data_lite); > > cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; > ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below > > changes this > > > into that > > > > {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} > > This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: > dat = ft_read_data(dataset_dir); > dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); > changes this > > > into that > > > > Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) > > Of course, I tried to feed that filtered data into the preprocessing pipeline by doing > cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. > data_artifact_rejected = ft_preprocessing(cfg, dat_filt); > But I get the error that dat_filt is not raw or comp data. > > I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. > > So for this point: > - how to make the (recommended) 50Hz post processing work? > - or more simply, how could I feed prefiltered data to ft_preprocessing? > > > > > Thank you very much for your consideration and I look forward to your help. > > All the best, > > > Florian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Sat Oct 15 14:18:55 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Sat, 15 Oct 2016 14:18:55 +0200 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Message-ID: Dear Florian, You are not clear about your actual sample rate: > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. Clearly, you should know your own sampling rate from the Neurolynx acquisition software. It would seem this is the primary thing you need to resolve. Regards, Per *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 On Sat, Oct 15, 2016 at 9:25 AM, Florian Gerard-Mercier < florian at brain.riken.jp> wrote: > Dear all, > > I am wondering, was my question unclear, or maybe no one is using > Neuralynx data? > I can think of ways to avoid these two problems, but I would prefer to > find a proper solution if possible. > > Thanks in advance, > > Florian Gerard-Mercier > > > > On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier < > florian at brain.riken.jp> wrote: > > Dear community, > > > My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory > in Riken BSI, Japan. > > > I am new to Fieldtrip. > My goal is to do a simple analysis of ECoG data in response to electrical > stimulation (all in monkey cortex). To this effect I followed the TMS-EEG > tutorial (since the issues are almost identical). > The recording system is Neuralynx. > > I have encountered 2 problems which I don’t believe are related. > I have basically followed the tutorials to the letter so except if I > mention otherwise, the cfg, etc. are standard. > > *1) Fsample discrepancy between data and header.* > When I load Neuralynx data, I get warnings that the sample rate is > actually half that in the header, and is thus being corrected (note, 16129 > instead of 32258Hz). > This is no problem, until I get the final results where I noticed that my > 50Hz noise is now represented as lasting 40ms for each cycle (= twice > longer than it actually is). > Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as > expected, somehow the data outputted by ft_preprocessing has a field > fsample equal to half that number (8064.5). > This later gives many conflicts such as: if I force data.fsample to be > 16129, I have the correct time axis in the end, but now my trial duration > is only half that which I want… > Any idea on how to solve this issue? I haven’t found any previous ticket > on this Fsample discrepancy issue. > I do not know either how much trust I have to put in that warning and > correction of the sampling rate in the first place. > > *2) 50Hz line noise filtering* > The previous point makes it so that if I filter 50Hz, of course nothing > happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back > to 16129), the attenuation is far too small (whether I use padding or not). > I did look up the similar problems that had been submitted to this list in > the past, but didn’t find any satisfactory fix. > To give an idea: > cfg = []; > cfg.Fsample = 1000; % I downsampled the data in the meantime as said in > the tuto > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; % somehow I have an error that the filtering > doesn’t work every time I try to run it with an order >2 > cfg.bsfreq = [49.9 50.1]; > filtDat = ft_preprocessing(cfg, data_lite); > > cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; > ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both > below > > changes this > > > into that > > > > {Note also the issue with Fsample: here I have a time axis that > corresponds to my 50Hz noise, but the duration of the trial is reduced from > [-0.05, 0.45] by a factor of 2.} > > This is in stark contrast to what happens if I use the bandstop filter > directly on the raw data: > dat = ft_read_data(dataset_dir); > dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); > changes this > > > into that > > > > Which should be perfect for my simple purposes. (Here I just did a simple > Matlab plot, so the x axis numbering is not actual time) > > Of course, I tried to feed that filtered data into the preprocessing > pipeline by doing > cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in > the tutorial, it is to reject the electrical stimulation artifacts. The > problem should not stem from here. > data_artifact_rejected = ft_preprocessing(cfg, dat_filt); > But I get the error that dat_filt is not raw or comp data. > > I have read that it is recommended to do the line noise filtering after > the trial segmentation and stimulation artefact removal, but 1) it doesn’t > seem to work well, 2) I don’t really understand why, given that my > artefacts are nowhere near the 50Hz frequency. > > So for this point: > - how to make the (recommended) 50Hz post processing work? > - or more simply, how could I feed prefiltered data to ft_preprocessing? > > > > > Thank you very much for your consideration and I look forward to your help. > > All the best, > > > Florian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Sun Oct 16 10:02:12 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Sun, 16 Oct 2016 17:02:12 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Message-ID: Dear Per, Thank you for your reply. Well if I don’t know how much trust I can have in it, it is because the sampling frequency inputted on my side (in the settings of the Cheetah DAS) is indeed 32kHz, that was the default. Now it is an old system so maybe it is doing something differently, who knows. However, when I filter the raw data with ft_preprocbandstopfilter I get the desired result for a sampling frequency of 16k. So Fieldtrip is probably right about this, and is self-consistent up till then. The problem for me is that within the data outputted by ft_preprocessing you get two different Fsample values: data.hdr.fs = 16k vs data.fsample = 8k. This sounds strange to me, however you look at it. Also, that 8kHz comes out of nowhere, there is no warning and no rationale for it. So, it seems like an intempestive division by two of the sampling rate that happens during the correction fieldtrip does when it reads the data. Also, the second problem is that for which I am most interested in the answer: whether it is possible - and if so, how - to filter the 50Hz line noise before feeding the data into ft_preprocessing. All the best, Florian > On 15 Oct, 2016, at 9:18 PM, Per Knutsen wrote: > > Dear Florian, > You are not clear about your actual sample rate: > > > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. > > Clearly, you should know your own sampling rate from the Neurolynx acquisition software. > > It would seem this is the primary thing you need to resolve. > > > Regards, > Per > > > > > Per M Knutsen > University of Oslo > Dept. of Molecular Medicine, Physiology Sect. > PB 1103 Blindern, NO-0317 Oslo > +47.45103762 > > On Sat, Oct 15, 2016 at 9:25 AM, Florian Gerard-Mercier > wrote: > Dear all, > > I am wondering, was my question unclear, or maybe no one is using Neuralynx data? > I can think of ways to avoid these two problems, but I would prefer to find a proper solution if possible. > > Thanks in advance, > > Florian Gerard-Mercier > > > >> On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier > wrote: >> >> Dear community, >> >> >> My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. >> >> >> I am new to Fieldtrip. >> My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). >> The recording system is Neuralynx. >> >> I have encountered 2 problems which I don’t believe are related. >> I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. >> >> 1) Fsample discrepancy between data and header. >> When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). >> This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). >> Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). >> This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… >> Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. >> I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. >> >> 2) 50Hz line noise filtering >> The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. >> To give an idea: >> cfg = []; >> cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto >> cfg.bsfilter = 'yes'; >> cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 >> cfg.bsfreq = [49.9 50.1]; >> filtDat = ft_preprocessing(cfg, data_lite); >> >> cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; >> ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below >> >> changes this >> >> >> into that >> >> >> >> {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} >> >> This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: >> dat = ft_read_data(dataset_dir); >> dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); >> changes this >> >> >> into that >> >> >> >> Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) >> >> Of course, I tried to feed that filtered data into the preprocessing pipeline by doing >> cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. >> data_artifact_rejected = ft_preprocessing(cfg, dat_filt); >> But I get the error that dat_filt is not raw or comp data. >> >> I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. >> >> So for this point: >> - how to make the (recommended) 50Hz post processing work? >> - or more simply, how could I feed prefiltered data to ft_preprocessing? >> >> >> >> >> Thank you very much for your consideration and I look forward to your help. >> >> All the best, >> >> >> Florian >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 17 13:38:37 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 17 Oct 2016 17:08:37 +0530 Subject: [FieldTrip] Standard mri dimension and fiducial point Message-ID: Dear FieldTrip community I am using standard mri providded by fieldTrip. The dimension of it is 181 x 217 x 181 [image: Inline image 1] The fiducial points are [image: Inline image 2] It is quite confusing since the coordinate of lpa exceeds the dimension. I would be very thankful if you can help me in this regard. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 6452 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From son.ta.dinh at tum.de Mon Oct 17 17:07:03 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Mon, 17 Oct 2016 15:07:03 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Darren, thanks a lot for the code and the detailed explanation! I just noticed a more basic problem with my analysis so I’m going to have to address that first before trying out your solution. I will let you know how it went as soon as I’ve finished solving the other problem! Thanks again for your help. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Donnerstag, 13. Oktober 2016 14:16 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Son For who have emailed asking for code, it is pasted below. Son, I see what you mean. In that case creating surrogate data is still necessary, since you need a way to generate a confidence interval for each set of N channels. A rough outline of your pipeline would be: (this is all assuming your measure is not simply a function of the covariance matrix) for si = each surrogate dataset (1:1000): 64chanresult = compute result for 64 chan configuration for chani = each N of channels ranging from 64:32 Nchanresult = compute result for 64 chan configuration change(si, chani) = 64chanresult - Nchanresult end end then you can plot your data as a line graph with confidence intervals. I dug out a script I used a while ago, although you might want to check that it works properly (comparing correlation matrices of input/output). The main caveat is that you need to check that you take care of negative frequencies adequately. Here I have used a method of simply cancelling negative frequencies. The other way is to use the complex conjugate, but I found that less stable, perhaps due to numerical imprecision – I’m not sure. Anyway you should verify for yourself that the correlation matrix of your original data is almost exactly the same as your surrogate data (within reason: differences on the order of <1e-5, although this depends on the length of the data). You should detrend and filter before using this function. function data = randomisePhase(data, equalphase) % data = array: [time, channels] % equalphase boolean: [true | false] (do you want the same phase shift in % each channel? default = true) if nargin == 1 equalphase = true; end L = size(data, 1); data = fft(data)*2; data(L/2+1:end, :) = 0; randphase = exp(1i*randn(1,L)*2*pi)'; % uses the same phase for each channel for ii = 1:size(data,2) if equalphase == false randphase = exp(1i*rand(L,1)*2*pi)’; end data(:,ii) = real(ifft(data(:,ii).*randphase)); end Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 13 October 2016 10:25 To: FieldTrip discussion list > Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Tue Oct 18 08:38:14 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Tue, 18 Oct 2016 12:08:14 +0530 Subject: [FieldTrip] Fiducial points of standard mri Message-ID: Dear FieldTrip community, I want to construct a headmodel from the mri data (standard mri providded by fieldTrip). The dimension of the mri is 181 x 217 X 181The coordinate system of the mri is *spm. *I want to change to coordinate system to *yokogawa*. For that purpose, I have used *ft_volumerealign *function. However, I have to provide at least three fiducial points (nsa, lpa and rpa). I noticed that mri structure itself contains the location of the fiducial points (*mri.hdr.fiducial.mri *and *mri.hdr.fiducial.head*). Th fiducial points are like these [image: Inline image 1] Clearly the lpa coordinate exceeds mri dimension and both nas and rpa coordinates do not indicate these two positions. I am quite confused how I can use the given information about the fiducial points. It would be of great help if anyone could help me in this regards. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From siddharthtalwar0309 at gmail.com Tue Oct 18 11:55:12 2016 From: siddharthtalwar0309 at gmail.com (siddharth talwar) Date: Tue, 18 Oct 2016 15:25:12 +0530 Subject: [FieldTrip] EEG source localization Message-ID: Hello I am trying to localize an ERP obtained via EEG using fieldtrip. There has been no problems in developing the forward model. The doubt i am encountering is, should the peak of the ERP alone be feeded in for ft_sourceanalysis (i.e. timepoint where the highest amplitude is observed) or the whole interval of the ERP. Having tried both, I am getting different results. Any help would be really appreciated. Thank you. Regards, Siddharth Talwar -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 00:45:15 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Tue, 18 Oct 2016 22:45:15 +0000 Subject: [FieldTrip] error with ft_appenddata In-Reply-To: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> References: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> Message-ID: Thanks Jan for your help! I ended up doing the following steps: addpath /path/to/fieldtrip ft_defaults cfg1 = []; cfg1.dataset = '1.fif'; data1 = ft_preprocessing ( cfg1 ); cfg2 = []; cfg2.dataset = '2.fif'; data2 = ft_preprocessing ( cfg2 ); cfg3 = []; cfg3.dataset = '3.fif'; data3 = ft_preprocessing ( cfg3 ); cfg=[]; data = ft_appenddata ( cfg, data1, data2, data3 ) save stitched.mat data -v7.3 Which worked. If you see any other problem that I may have missed, please feel free to educate me. Thanks! Mona On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won’t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif’; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 01:17:15 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Tue, 18 Oct 2016 23:17:15 +0000 Subject: [FieldTrip] Separating MEG/EEG data Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* From tzvetan.popov at uni-konstanz.de Wed Oct 19 07:14:27 2016 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Wed, 19 Oct 2016 07:14:27 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D@uni-konstanz.de> Dear Mona, please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting In the section “segment and read MEG data” there is a call to ft_rejectvisual for example where the different MEG sensors are separated. Further down the tutorial deals also with the EEG part of the analysis. Good luck tzvetan Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stephen.whitmarsh at gmail.com Wed Oct 19 07:22:17 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 19 Oct 2016 07:22:17 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven’t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 08:02:25 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 11:32:25 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. [image: Inline image 1] [image: Inline image 2] Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens1.jpg Type: image/jpeg Size: 51012 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens2.jpg Type: image/jpeg Size: 58687 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Oct 19 09:15:34 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 19 Oct 2016 07:15:34 +0000 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition In-Reply-To: References: Message-ID: Dear Susmita, It looks as if there is a discrepancy between the definition of the coordinate system according to fieldtrip (see ft_headcoordinates in fieldtrip/utilities, where it seems that an ALS axis system is imposed), when specifying cfg.coordsys = ‘yokogawa’, and the coordinate system of the sensors in your data file (which is probably RAS). I could not find any documentation about the ‘yokogawa’-convention (which is probably the reason why the yokogawa-entry in the table on http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is empty). Perhaps one of the Yokogawa-users on this list could chime in to enlighten you, or you could check the system’s documentation to find out what the expected. The easy solution would be to register the mri to an RAS-based coordinate system (e.g. use cfg.coordsys = ’neuromag’ for ft_volumerealign), but I would recommend to get to the bottom of this, and provide a principled solution. Once you have found out about the conventional coordinate system for yokogawa systems, it would be great if you could update the table on (http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined). Note, that if it turns out to be that there is no specific convention (e.g. site-specific ALS or RAS or so) it is worth documenting, too. Good luck Jan-Mathijs J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands On 19 Oct 2016, at 08:02, Susmita Sen > wrote: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nicolas.Zink at uniklinikum-dresden.de Wed Oct 19 11:46:25 2016 From: Nicolas.Zink at uniklinikum-dresden.de (Zink, Nicolas) Date: Wed, 19 Oct 2016 09:46:25 +0000 Subject: [FieldTrip] Performing group analysis with whole brain connectivity Message-ID: <2DDD0A108FC1004DA65570D8BA0A267B5C5899@G06EDBN1.med.tu-dresden.de> Dear Fieldtripper community! I am currently working on a pipeline for EEG data to perform network analysis with Fieldtrip (well documented example in http://www.fieldtriptoolbox.org/tutorial/networkanalysis). So far, I have successfully adapted the MEG example for performing EEG network analysis with single subjects, which seems to produce reliable outcomes. However, I want to perform a group analysis where I want to plot the connectivity of networks from group A with group B. Therefore, a prerequisite is to compute group averages from source data. So my question is: Has anyone performed a connectivity and/or network analysis on a group level? Here is what I have tried out that did not work: · Calculating the group mean of the source data with ft_math after using ft_sourcedescriptives, which caused problems for the connectivity (ft_connectivityanalysis) and subsequent network analysis (ft_networkanalysis) · I also tried ft_sourcegrandaverage, which also is not capable to provide enough (single) trial information for the following connectivity analysis steps. At the end I took preprocessed EEG data for each subject in my groups and put them together in one dataset using ft_appenddata, which produces some plausible data. Using this strategy, I tricked the algorithm, so it operates the data thinking it is a single subject. I am concerned whether this could cause methodological issues. Is there another (easier) way to do this? Can anyone give me some advice which strategy would be best to calculate the group mean and why? Cheers and thanks in advance Nicolas Zink wissenschaftlicher Mitarbeiter Universitätsklinikum Carl Gustav Carus Klinik für Kinder- und Jugendpsychiatrie und -psychotherapie Schubertstraße 42 01307 Dresden Tel. +49 (0)351 458-2303 Universitätsklinikum Carl Gustav Carus an der Technischen Universität Dresden Anstalt des öffentlichen Rechts des Freistaates Sachsen Fetscherstraße 74, 01307 Dresden http://www.uniklinikum-dresden.de Vorstand: Prof. Dr. med. D. M. Albrecht (Sprecher), Wilfried E. B. Winzer Vorsitzender des Aufsichtsrates: Prof. Dr. med. Peter C. Scriba USt.-IDNr.: DE 140 135 217, St.-Nr.: 203 145 03113 -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.sowman at mq.edu.au Wed Oct 19 12:31:56 2016 From: paul.sowman at mq.edu.au (Paul Sowman) Date: Wed, 19 Oct 2016 10:31:56 +0000 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition (Susmita Sen) In-Reply-To: References: Message-ID: Dear Susmita, you may check that your sensor positions extracted from the .con file are in the same co-ordinate frame as the MRI. Using the KIT/Yokogawa system software to co-register the sensor locations and the headshape/mri might be a necessary first step as "Unlike other systems, the Yokogawa system software does not automatically analyze its sensorlocations relative to fiducial coils":- http://www.fieldtriptoolbox.org/getting_started/yokogawa The way we deal with it is to first do coregistration in MEG160 - the KIT/Yokogawa software, and then export the sensor locations which are then in headspace. Then coregistration with the MRI brings sensors and MRI into alignment. This may or may not be your problem. Good luck. Paul Paul F Sowman ARC DECRA Fellow Department of Cognitive Science Level 3, Room 3.824 Australian Hearing Hub 16 University Drive Macquarie University, NSW 2109, Australia T: +61 2 9850 6732 | F: +61 2 9850 6059 W: Profile Page W: MQU Stuttering Research Facebook Page [Macquarie University] CRICOS Provider Number 00002J. Think before you print. Please consider the environment before printing this email. This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of Macquarie University. ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of fieldtrip-request at science.ru.nl Sent: Wednesday, 19 October 2016 6:15 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 71, Issue 24 Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit https://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Re: error with ft_appenddata (Wong-Barnum, Mona) 2. Separating MEG/EEG data (Wong-Barnum, Mona) 3. Re: Separating MEG/EEG data (Tzvetan Popov) 4. Re: Separating MEG/EEG data (Stephen Whitmarsh) 5. Orientation of headmodel with respect to sensors poisition (Susmita Sen) 6. Re: Orientation of headmodel with respect to sensors poisition (Schoffelen, J.M. (Jan Mathijs)) ---------------------------------------------------------------------- Message: 1 Date: Tue, 18 Oct 2016 22:45:15 +0000 From: "Wong-Barnum, Mona" To: FieldTrip discussion list Subject: Re: [FieldTrip] error with ft_appenddata Message-ID: Content-Type: text/plain; charset="utf-8" Thanks Jan for your help! I ended up doing the following steps: addpath /path/to/fieldtrip ft_defaults cfg1 = []; cfg1.dataset = '1.fif'; data1 = ft_preprocessing ( cfg1 ); cfg2 = []; cfg2.dataset = '2.fif'; data2 = ft_preprocessing ( cfg2 ); cfg3 = []; cfg3.dataset = '3.fif'; data3 = ft_preprocessing ( cfg3 ); cfg=[]; data = ft_appenddata ( cfg, data1, data2, data3 ) save stitched.mat data -v7.3 Which worked. If you see any other problem that I may have missed, please feel free to educate me. Thanks! Mona On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won?t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif?; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I?m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ??;? before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 18 Oct 2016 23:17:15 +0000 From: "Wong-Barnum, Mona" To: FieldTrip discussion list Subject: [FieldTrip] Separating MEG/EEG data Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A at mail.ucsd.edu> Content-Type: text/plain; charset="utf-8" I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven?t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* ------------------------------ Message: 3 Date: Wed, 19 Oct 2016 07:14:27 +0200 From: Tzvetan Popov To: FieldTrip discussion list Subject: Re: [FieldTrip] Separating MEG/EEG data Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D at uni-konstanz.de> Content-Type: text/plain; charset=windows-1252 Dear Mona, please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting In the section ?segment and read MEG data? there is a call to ft_rejectvisual for example where the different MEG sensors are separated. Further down the tutorial deals also with the EEG part of the analysis. Good luck tzvetan Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------ Message: 4 Date: Wed, 19 Oct 2016 07:22:17 +0200 From: Stephen Whitmarsh To: FieldTrip discussion list Subject: Re: [FieldTrip] Separating MEG/EEG data Message-ID: Content-Type: text/plain; charset="utf-8" Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 5 Date: Wed, 19 Oct 2016 11:32:25 +0530 From: Susmita Sen To: FieldTrip discussion list Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Content-Type: text/plain; charset="utf-8" Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. [image: Inline image 1] [image: Inline image 2] Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens1.jpg Type: image/jpeg Size: 51012 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens2.jpg Type: image/jpeg Size: 58687 bytes Desc: not available URL: ------------------------------ Message: 6 Date: Wed, 19 Oct 2016 07:15:34 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Content-Type: text/plain; charset="utf-8" Dear Susmita, It looks as if there is a discrepancy between the definition of the coordinate system according to fieldtrip (see ft_headcoordinates in fieldtrip/utilities, where it seems that an ALS axis system is imposed), when specifying cfg.coordsys = ?yokogawa?, and the coordinate system of the sensors in your data file (which is probably RAS). I could not find any documentation about the ?yokogawa?-convention (which is probably the reason why the yokogawa-entry in the table on http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is empty). Perhaps one of the Yokogawa-users on this list could chime in to enlighten you, or you could check the system?s documentation to find out what the expected. The easy solution would be to register the mri to an RAS-based coordinate system (e.g. use cfg.coordsys = ?neuromag? for ft_volumerealign), but I would recommend to get to the bottom of this, and provide a principled solution. Once you have found out about the conventional coordinate system for yokogawa systems, it would be great if you could update the table on (http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined). Note, that if it turns out to be that there is no specific convention (e.g. site-specific ALS or RAS or so) it is worth documenting, too. Good luck Jan-Mathijs J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands On 19 Oct 2016, at 08:02, Susmita Sen > wrote: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 71, Issue 24 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at donders.ru.nl Wed Oct 19 16:40:08 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 19 Oct 2016 16:40:08 +0200 Subject: [FieldTrip] Special research topic: From raw MEG/EEG to publication Message-ID: <50E1B506-1B93-40CB-B3A1-B9896D14CE1A@donders.ru.nl> Dear colleagues, We would like to invite you to contribute to Frontiers in Neuroscience Special Research Topic "From raw MEG/EEG to publication: how to perform MEG/EEG group analysis with free academic software". The idea is to create a collection of well-described group analyses of EEG and MEG data that can be fully reproduced by anyone and ported by researchers to their own data. Furthermore, as the analyses will be endorsed by peer review, any analysis choices will be citeable in future publications. This will hopefully contribute to wider adoption of good practices by the MEG/EEG research community. For you this is an opportunity to create the ultimate reference for those exciting analyses in your papers that everyone keeps asking you about and increase the impact of the methods you developed on the work of others. Furthermore, by investing some time and effort now into preparing your paper, you can save yourself much more time and efforts in the future by using this resource to train junior researchers in your group and those of your collaborators. We are sorry for the long list of requirements for prospective submissions but these are necessary to ensure that your papers are really useful for other researchers and will remain useful for at least the next decade. The requirements should be straightforward to comply with. Finally, we know that the 'Frontiers' brand has attracted some criticism due to their controversial promotion and marketing techniques. However, at present Frontiers and particularly the section on Brain Imaging Methods seems to be the most convenient platform for this project and they are able to provide adequate technical and administrative support for all its stages. As the topic editors we will do everything possible to ensure professional and transparent review for all submissions. We are looking forward to receiving your contributions. With best wishes, The topic editors: Arnaud Delorme Alexandre Gramfort Vladimir Litvak Sri Nagarajan Robert Oostenveld Francois Tadel ----- Please find more information about Research Topics below, including the publishing fees that apply. You can also visit the homepage we have created on the Frontiers website, which defines the focus of the topic, and where all published articles will appear. http://frontiersin.org/Brain_Imaging_Methods/researchtopics/From_raw_MEG_EEG_to_publication_how_to_perform_MEG_EEG_group_analysis_with_free_academic_software_/5158 Please note the submission deadline for this Research Topic: Oct 01, 2017 ABOUT FRONTIERS RESEARCH TOPICS Founded by scientists in 2007, Frontiers is a community-rooted open-access publisher, driving innovations in peer review, article-level metrics and research networking. The "Frontiers in" journal series hosts 54 journals covering more than 350 academic specialties, with a network of over 200,000 leading researchers worldwide. Frontiers is a registered member of the Open Access Scholarly Publishers Association (http://www.oaspa.org/member/Frontiers ) and was recognized by the ALPSP Award for Innovation in Publishing in 2014. The idea behind a Frontiers Research Topic is to create a comprehensive collection of peer-reviewed articles that address a specific theme of research, as well as a forum for discussion and debate. Contributions can be articles describing original research, methods, hypothesis & theory, opinions, and more. Please see the relevant journal for a full list of accepted article types. Frontiers will also compile an e-book, as soon as all contributing articles are published, that can be used as educational material, be sent to foundations that fund your research, to journalists and press agencies, or to your professional network. E-books are free to read and download. Once published, your articles will be free to access for all readers, indexed in relevant repositories, and as an author in Frontiers, you retain the copyright to your own papers and figures. FRONTIERS PUBLISHING FEES Manuscripts accepted for publication are subject to publishing fees, which vary depending on the article type. Research Topic A type articles receive a discount on publishing fees; please see here for a full fee table, and further relevant FAQs: http://www.frontiersin.org/about/PublishingFees . -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:31:35 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:01:35 +0530 Subject: [FieldTrip] function ft_convert_coordsys Message-ID: Dear fieldtrip community, The function *ft_convert_coordsys *does not consider of converting the *yokogawa *coordinate system to another coordinate system. In line number 95 it includes *{'ctf' 'bti' '4d'}*. Can I include yokogawa coordinate system in the similar fashion? Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:39:38 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:09:38 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition (Susmita Sen) In-Reply-To: References: Message-ID: Thanks a lot. I will try that. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Wed, Oct 19, 2016 at 4:01 PM, Paul Sowman wrote: > Dear Susmita, you may check that your sensor positions extracted from the > .con file are in the same co-ordinate frame as the MRI. Using the > KIT/Yokogawa system software to co-register the sensor locations and the > headshape/mri might be a necessary first step as "Unlike other systems, > the Yokogawa system software does not automatically analyze its > sensorlocations relative to fiducial coils":- http://www.fieldtriptoolbox. > org/getting_started/yokogawa > > The way we deal with it is to first do coregistration in MEG160 - the > KIT/Yokogawa software, and then export the sensor locations which are then > in headspace. Then coregistration with the MRI brings sensors and MRI into > alignment. > > This may or may not be your problem. Good luck. > > > Paul > > > *Paul F Sowman* > > ARC DECRA Fellow > > *Department of Cognitive Science * > > Level 3, Room 3.824 > > Australian Hearing Hub > 16 University Drive > Macquarie University, NSW 2109, Australia > > *T:* +61 2 9850 6732* | **F:* +61 2 9850 6059 > *W: Profile Page > * > *W: MQU > Stuttering Research Facebook Page > * > > > > > [image: Macquarie University] > > CRICOS Provider Number 00002J. Think before you print. > Please consider the environment before printing this email. > > This message is intended for the addressee named and may > contain confidential information. If you are not the intended > recipient, please delete it and notify the sender. Views expressed > in this message are those of the individual sender, and are not > necessarily the views of Macquarie University. > > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of fieldtrip-request at science.ru.nl < > fieldtrip-request at science.ru.nl> > *Sent:* Wednesday, 19 October 2016 6:15 PM > *To:* fieldtrip at science.ru.nl > *Subject:* fieldtrip Digest, Vol 71, Issue 24 > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: error with ft_appenddata (Wong-Barnum, Mona) > 2. Separating MEG/EEG data (Wong-Barnum, Mona) > 3. Re: Separating MEG/EEG data (Tzvetan Popov) > 4. Re: Separating MEG/EEG data (Stephen Whitmarsh) > 5. Orientation of headmodel with respect to sensors poisition > (Susmita Sen) > 6. Re: Orientation of headmodel with respect to sensors > poisition (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 18 Oct 2016 22:45:15 +0000 > From: "Wong-Barnum, Mona" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] error with ft_appenddata > Message-ID: > Content-Type: text/plain; charset="utf-8" > > > Thanks Jan for your help! > > I ended up doing the following steps: > > addpath /path/to/fieldtrip > ft_defaults > > cfg1 = []; > cfg1.dataset = '1.fif'; > data1 = ft_preprocessing ( cfg1 ); > > cfg2 = []; > cfg2.dataset = '2.fif'; > data2 = ft_preprocessing ( cfg2 ); > > cfg3 = []; > cfg3.dataset = '3.fif'; > data3 = ft_preprocessing ( cfg3 ); > > cfg=[]; > data = ft_appenddata ( cfg, data1, data2, data3 ) > > save stitched.mat data -v7.3 > > > Which worked. > > If you see any other problem that I may have missed, please feel free to > educate me. > > Thanks! > > Mona > > > On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Mona, > > If you directly use the output of ft_read_data as input into > ft_appenddata, it won?t work. The reason is that ft_appenddata expects in > the input (data#) matlab structures that are generated by ft_preprocessing. > Ft_read_data outputs a numeric data matrix, which is only part of the > ft_preprocessing generated output. Have you something like this yet?: > > cfg = []; > cfg.dataset = ;somefiffile.fif?; > data = ft_preprocessing(cfg); > > Best > > Jan-Mathijs > > On 05 Oct 2016, at 23:06, Wong-Barnum, Mona sdsc.edu>> wrote: > > > I?m getting a runtime error with ft_appenddata: > > data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, > data7, data8, data9, data10, data11, data12, data13, data14 ) > > > Error using ft_checkdata (line 468) This function requires raw+comp or raw > data as input. > > Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, > 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); > > Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, > data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, > data14, data15, data16, data17, data18, data19, data20 ) > > Error in run (line 96) evalin('caller', [script ';']); > > I have Neuromag data and was able to read the files into data# using > ft_read_data. > > In the documentation, it says cfg can be empty so I declared it by "cfg = > ??;? before the ft_appenddata call; is that ok? > > Any help/suggstions/tips regarding the ft_appenddata error would be > appreciated. Thanks! > > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "To handle yourself, use your head; > to handle others, use your heart." > > -- Eleanor Roosevelt > ********************************************* > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161018/df4b482a/attachment-0001.html> > > ------------------------------ > > Message: 2 > Date: Tue, 18 Oct 2016 23:17:15 +0000 > From: "Wong-Barnum, Mona" > To: FieldTrip discussion list > Subject: [FieldTrip] Separating MEG/EEG data > Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A at mail.ucsd.edu> > Content-Type: text/plain; charset="utf-8" > > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > > > ------------------------------ > > Message: 3 > Date: Wed, 19 Oct 2016 07:14:27 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Separating MEG/EEG data > Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D at uni-konstanz.de> > Content-Type: text/plain; charset=windows-1252 > > Dear Mona, > > please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/ > dipolefitting > > In the section ?segment and read MEG data? there is a call to > ft_rejectvisual for example where the different MEG sensors are separated. > Further down the tutorial deals also with the EEG part of the analysis. > Good luck > tzvetan > > > Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > > > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > > > thanks, > > Mona > > > > > > ********************************************* > > Mona Wong > > Web & iPad Application Developer > > San Diego Supercomputer Center > > > > "Strive not to be a success, but > > rather to be of value." > > --- Albert Einstein > > ********************************************* > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------------ > > Message: 4 > Date: Wed, 19 Oct 2016 07:22:17 +0200 > From: Stephen Whitmarsh > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Separating MEG/EEG data > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Mona, > > To add to Tzvetan: > > - You can in many FieldTrip functions specify on which channels you want to > work (cfg.channel), e.g. in ft_preprocessing. > - You can also split the data later using ft_selectdata, e.g.: > > cfg = [] > cfg.channel = 'MEG'; > data_MEG = ft_selectdata(cfg,data_combined); > > cfg = [] > cfg.channel = 'EEG'; > data_EEG = ft_selectdata(cfg,data_combined); > > - To selecting magnetometers or gradiometers you can use: > cfg.channel = 'MEG*1' > cfg.channel = {'MEG*2', 'MEG*3'} > > Cheers, > Stephen > > > On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > > > > I have Elekta Neuromag .fif files which contains MEG and EEG > > data. What steps do I need to do to separate the MEG from EEG and the 3 > > different MEG sensor data (magnetometer, 2 gradiometer)? > > > > I have been looking through the FieldTrip documentation but > > haven?t found what I need. All help is appreciated. > > > > thanks, > > Mona > > > > > > ********************************************* > > Mona Wong > > Web & iPad Application Developer > > San Diego Supercomputer Center > > > > "Strive not to be a success, but > > rather to be of value." > > --- Albert Einstein > > ********************************************* > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/aebcfda4/attachment-0001.html> > > ------------------------------ > > Message: 5 > Date: Wed, 19 Oct 2016 11:32:25 +0530 > From: Susmita Sen > To: FieldTrip discussion list > Subject: [FieldTrip] Orientation of headmodel with respect to sensors > poisition > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I am > working with is recorded using yokogawa system. I have used the following > code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > [image: Inline image 1] > > [image: Inline image 2] > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/da553626/attachment-0001.html> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Headmodel_sens1.jpg > Type: image/jpeg > Size: 51012 bytes > Desc: not available > URL: attachments/20161019/da553626/attachment-0002.jpg> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Headmodel_sens2.jpg > Type: image/jpeg > Size: 58687 bytes > Desc: not available > URL: attachments/20161019/da553626/attachment-0003.jpg> > > ------------------------------ > > Message: 6 > Date: Wed, 19 Oct 2016 07:15:34 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Orientation of headmodel with respect to > sensors poisition > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Dear Susmita, > > It looks as if there is a discrepancy between the definition of the > coordinate system according to fieldtrip (see ft_headcoordinates in > fieldtrip/utilities, where it seems that an ALS axis system is imposed), > when specifying cfg.coordsys = ?yokogawa?, and the coordinate system of the > sensors in your data file (which is probably RAS). I could not find any > documentation about the ?yokogawa?-convention (which is probably the reason > why the yokogawa-entry in the table on http://www.fieldtriptoolbox. > org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is > empty). Perhaps one of the Yokogawa-users on this list could chime in to > enlighten you, or you could check the system?s documentation to find out > what the expected. > > The easy solution would be to register the mri to an RAS-based coordinate > system (e.g. use cfg.coordsys = ?neuromag? for ft_volumerealign), but I > would recommend to get to the bottom of this, and provide a principled > solution. Once you have found out about the conventional coordinate system > for yokogawa systems, it would be great if you could update the table on ( > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined). Note, that if it turns out to > be that there is no specific convention (e.g. site-specific ALS or RAS or > so) it is worth documenting, too. > > Good luck > > Jan-Mathijs > > J.M.Schoffelen > Senior Researcher > Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands > > > > On 19 Oct 2016, at 08:02, Susmita Sen susmitasen.ece at gmail.com>> wrote: > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I > am working with is recorded using yokogawa system. I have used the > following code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > > > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/e84dd46a/attachment.html> > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 71, Issue 24 > ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:40:12 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:10:12 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition In-Reply-To: References: Message-ID: Thanks a lot. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Wed, Oct 19, 2016 at 12:45 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Dear Susmita, > > It looks as if there is a discrepancy between the definition of the > coordinate system according to fieldtrip (see ft_headcoordinates in > fieldtrip/utilities, where it seems that an ALS axis system is imposed), > when specifying cfg.coordsys = ‘yokogawa’, and the coordinate system of the > sensors in your data file (which is probably RAS). I could not find any > documentation about the ‘yokogawa’-convention (which is probably the reason > why the yokogawa-entry in the table on http://www. > fieldtriptoolbox.org/faq/how_are_the_different_head_and_ > mri_coordinate_systems_defined is empty). Perhaps one of the > Yokogawa-users on this list could chime in to enlighten you, or you could > check the system’s documentation to find out what the expected. > > The easy solution would be to register the mri to an RAS-based coordinate > system (e.g. use cfg.coordsys = ’neuromag’ for ft_volumerealign), but I > would recommend to get to the bottom of this, and provide a principled > solution. Once you have found out about the conventional coordinate system > for yokogawa systems, it would be great if you could update the table on ( > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined). Note, that if it turns out to > be that there is no specific convention (e.g. site-specific ALS or RAS or > so) it is worth documenting, too. > > Good luck > > Jan-Mathijs > > J.M.Schoffelen > Senior Researcher > Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands > > > > > On 19 Oct 2016, at 08:02, Susmita Sen wrote: > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I > am working with is recorded using yokogawa system. I have used the > following code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > > > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 18:42:58 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 16:42:58 +0000 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Thanks Stephen, your code was very helpful (: My data has 2 gradiometers but it appears that there is only a single megplanar channel type. Is there a way to further separate the 2 gradiometers? Mona On Oct 18, 2016, at 10:22 PM, Stephen Whitmarsh > wrote: Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona > wrote: I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 19:31:44 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 17:31:44 +0000 Subject: [FieldTrip] how to save continuous data Message-ID: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> Hi: I have Neuromag data broken out in 14 files for a single subject. I’ve read each file in using ft_preprocessing() and then combined them using ft_appenddata(). Is there a way I can save this combined data to a file so that on my next session of running FieldTrip, I can read the combined data back without having to repeat the above steps? I have enough memory so that’s not a problem. I’ve tried saving the combined data using matlab save function but was unable to read it back using ft_preprocessing() so that I can do further processing. Is there a trick to save continuous/combined data? thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 20:29:10 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 18:29:10 +0000 Subject: [FieldTrip] how to save continuous data In-Reply-To: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> References: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> Message-ID: <288CE519-2CB9-4398-B441-A5DF33010604@mail.ucsd.edu> I think I figured out my answer…I need to use matlab’s importdata() to read in my combined data file. Mona On Oct 19, 2016, at 10:31 AM, Wong-Barnum, Mona > wrote: Hi: I have Neuromag data broken out in 14 files for a single subject. I’ve read each file in using ft_preprocessing() and then combined them using ft_appenddata(). Is there a way I can save this combined data to a file so that on my next session of running FieldTrip, I can read the combined data back without having to repeat the above steps? I have enough memory so that’s not a problem. I’ve tried saving the combined data using matlab save function but was unable to read it back using ft_preprocessing() so that I can do further processing. Is there a trick to save continuous/combined data? thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 21:33:12 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 19:33:12 +0000 Subject: [FieldTrip] ft_appenddata() and trials Message-ID: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> Hi: I have 14 Neuromag .fif files recorded for a single subject; each file contains about 20 minutes of recording for a total of about 4.6 hours of recording. I’d like to concatenate the data together. I used ft_appenddata() but ti seems to have created 14 trials. How can I get all the data to go into a single trial? Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "The two most important days in your life are the day you are born and the day you find out why." -- Mark Twain ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed Oct 19 21:48:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 19 Oct 2016 21:48:34 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Hi Mona, I'm not sure I understand your question but ill give it a go: In Elekta, labels of magnetometers end in 1, (e.g. MEG10*1*), gradiometers in (e.g. MEG22)2 and 3. The latter are the orthogonal 8-shaped coils that are often combined, e.g. using ft_combineplanar. This will reduce the 204 gradiometers in 102 combined gradiometer, that FT assigns labels to, showing you which sensors are combined, e.g. "MEG102+MEG103". If you use ft_selectdata, or a cfg.channel configuration field, you can use * as I mentioned before, or ? and other wildcards such as MEG, and MAG, to select sensortypes. Hope this helps, Stephen On 19 October 2016 at 18:42, Wong-Barnum, Mona wrote: > > Thanks Stephen, your code was very helpful (: > > My data has 2 gradiometers but it appears that there is only a single > megplanar channel type. Is there a way to further separate the 2 > gradiometers? > > Mona > > > On Oct 18, 2016, at 10:22 PM, Stephen Whitmarsh < > stephen.whitmarsh at gmail.com> wrote: > > Hi Mona, > > To add to Tzvetan: > > - You can in many FieldTrip functions specify on which channels you want > to work (cfg.channel), e.g. in ft_preprocessing. > - You can also split the data later using ft_selectdata, e.g.: > > cfg = [] > cfg.channel = 'MEG'; > data_MEG = ft_selectdata(cfg,data_combined); > > cfg = [] > cfg.channel = 'EEG'; > data_EEG = ft_selectdata(cfg,data_combined); > > - To selecting magnetometers or gradiometers you can use: > cfg.channel = 'MEG*1' > cfg.channel = {'MEG*2', 'MEG*3'} > > Cheers, > Stephen > > > On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > >> >> I have Elekta Neuromag .fif files which contains MEG and EEG >> data. What steps do I need to do to separate the MEG from EEG and the 3 >> different MEG sensor data (magnetometer, 2 gradiometer)? >> >> I have been looking through the FieldTrip documentation but >> haven’t found what I need. All help is appreciated. >> >> thanks, >> Mona >> >> >> ********************************************* >> Mona Wong >> Web & iPad Application Developer >> San Diego Supercomputer Center >> >> "Strive not to be a success, but >> rather to be of value." >> --- Albert Einstein >> ********************************************* >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "To handle yourself, use your head; > to handle others, use your heart." > > -- Eleanor Roosevelt > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 19 22:33:04 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 19 Oct 2016 20:33:04 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> Message-ID: <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> Hi Mona, I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); data.trial = trial;data.time = time; Best, Jan-Mathijs On 19 Oct 2016, at 21:33, Wong-Barnum, Mona > wrote: Hi: I have 14 Neuromag .fif files recorded for a single subject; each file contains about 20 minutes of recording for a total of about 4.6 hours of recording. I’d like to concatenate the data together. I used ft_appenddata() but ti seems to have created 14 trials. How can I get all the data to go into a single trial? Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "The two most important days in your life are the day you are born and the day you find out why." -- Mark Twain ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Thu Oct 20 00:44:35 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 22:44:35 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> Message-ID: <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Hi Jan-Mathijs: Yes, these should be continuous time recordings, just broken up and saved into separate files, each file represents about 20 minutes of recording so the end of one file should be the beginning of the next file. I tried your suggestion but it seems the cat didn’t work. Do you spot any problem with my steps: >> addpath /path/to/fieldtrip >> ft_defaults >> data = importdata ( ‘appended.mat' ) data = label: {389x1 cell} trial: {1x14 cell} time: {1x14 cell} fsample: 603.1072 cfg: [1x1 struct] >> whos Name Size Bytes Class Attributes data 1x1 29058186864 struct >> trial{1} = cat(2,data.trial{:}); >> time{1} = cat(2,data.time{:}); >> whos Name Size Bytes Class Attributes data 1x1 29058186864 struct time 1x1 74505712 cell trial 1x1 28982678512 cell >> data.trial = trial; >> data.time = time; >> data data = label: {389x1 cell} trial: {[389x9313200 double]} time: {[1x9313200 double]} fsample: 603.1072 cfg: [1x1 struct] >> save continous.mat data -v7.3 Then later, I used ft_databrowser() to view the data imported from the continuous.mat file and it says 15445 segments with time from 0 to 0.998164 seconds. I’m not sure what it means by segment but the time should be over 4 hours. Do you know what I’m doing wrong? Mona On Oct 19, 2016, at 1:33 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); data.trial = trial;data.time = time; Best, Jan-Mathijs ************************************************ Mona Wong Web & iPad Application Developer San Diego Supercomputer Center You are the light you wish to see. ************************************************ -------------- next part -------------- An HTML attachment was scrubbed... URL: From aborna at sandia.gov Thu Oct 20 02:35:44 2016 From: aborna at sandia.gov (Borna, Amir) Date: Thu, 20 Oct 2016 00:35:44 +0000 Subject: [FieldTrip] magnetic dipoles Message-ID: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> Hi, I have a question regarding source localization of head coils; it seems the fieldtrip's tutorials are directed toward localizing "current dipoles" as opposed to "magnetic dipoles", e.g. head localization coils. So how should I setup the configuration (headmodel, vol, etc.) for source localization (and simulation) of magnetic dipoles? Thank you for your help in advance. Best, Borna. SNL -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 20 06:02:32 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 20 Oct 2016 04:02:32 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 70, Issue 25 In-Reply-To: References: Message-ID: From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From two.frank at gmail.com Thu Oct 20 07:27:36 2016 From: two.frank at gmail.com (Frank Hsieh) Date: Thu, 20 Oct 2016 05:27:36 +0000 Subject: [FieldTrip] Postdoc Position at the Dynamic Memory Lab at UC Davis Message-ID: Postdoctoral Researcher: The Dynamic Memory Lab (C. Ranganath, PI) at the University of California, Davis, now has an open position for a funded postdoctoral researcher. We currently are running studies that involve multimodal imaging (EEG, fMRI, ECoG, Diffusion Imaging, MR Spectroscopy) as well as concurrent transcranial electrical stimulation (tDCS/tACS). The lab is located at the UC Davis Center for Neuroscience, which houses a 3T Siemens Skyra MRI scanner, an MR-compatible tDCS/tACS system, and EEG systems both at the lab and in-scanner. Start date is flexible and can be delayed to accommodate defense and publication of thesis work. In addition to lab funding, candidates might be eligible for funding from the NIA T32 grant on the Neuroscience of Cognitive Aging (collaboration with Charles DeCarli) or from a joint R01 to examine memory in schizophrenia (collaboration with J. Daniel Ragland and Cam Carter). Qualifications: Candidates must have completed a Ph.D. in Psychology, Neuroscience, or a related field and have first-authored publications that reflect familiarity with neuroscience techniques (e.g., EEG, fMRI, tDCS/tACS, TMS, etc.). For this position, successful candidates will need to have strong analytical skills in multivariate analysis of fMRI, EEG, or other neurophysiological data. Strong preference will be given to candidates with research background in learning and memory and expertise in probabalistic tractography, model-based analysis, representational similarity analysis, or pattern classification of fMRI data, time-frequency analysis, cortical source estimation and/or multivariate analysis of EEG or MEG in humans, or corresponding LFP analyses in animal models. Beyond experience, we are looking for someone who is resourceful, collaborative, resilient, productive, honest, and enthusiastic about mentoring junior lab members. Prof. Charan Ranganath will go through applicant information starting Nov. 1st, 2016, until position is filled. Interested individuals please send your CV and names of 3 references to DML Lab Manager Nichole Bouffard (nrbouffard at ucdavis.edu) -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.hauswald at me.com Thu Oct 20 09:30:25 2016 From: anne.hauswald at me.com (anne Hauswald) Date: Thu, 20 Oct 2016 09:30:25 +0200 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: Hi Mona, the default setting in ft_databrowser for continuous data is to show blocksizes of 1 sec. Given your sampling rate, I guess the 0.998164 seconds is the closest time point to that. Then if, you have 15445 segments, each approx. 1 second long, you end up with more than 4 hours of data. However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Hope this helps a bit Anne > Am 20.10.2016 um 00:44 schrieb Wong-Barnum, Mona : > > > Hi Jan-Mathijs: > > Yes, these should be continuous time recordings, just broken up and saved into separate files, each file represents about 20 minutes of recording so the end of one file should be the beginning of the next file. > > I tried your suggestion but it seems the cat didn’t work. Do you spot any problem with my steps: > > >> addpath /path/to/fieldtrip > >> ft_defaults > >> data = importdata ( ‘appended.mat' ) > > data = > > label: {389x1 cell} > trial: {1x14 cell} > time: {1x14 cell} > fsample: 603.1072 > cfg: [1x1 struct] > > >> whos > Name Size Bytes Class Attributes > > data 1x1 29058186864 struct > > >> trial{1} = cat(2,data.trial{:}); > >> time{1} = cat(2,data.time{:}); > >> whos > Name Size Bytes Class Attributes > > data 1x1 29058186864 struct > time 1x1 74505712 cell > trial 1x1 28982678512 cell > > >> data.trial = trial; > >> data.time = time; > >> data > > data = > > label: {389x1 cell} > trial: {[389x9313200 double]} > time: {[1x9313200 double]} > fsample: 603.1072 > cfg: [1x1 struct] > > >> save continous.mat data -v7.3 > > Then later, I used ft_databrowser() to view the data imported from the continuous.mat file and it says 15445 segments with time from 0 to 0.998164 seconds. I’m not sure what it means by segment but the time should be over 4 hours. > > Do you know what I’m doing wrong? > > Mona > > >> On Oct 19, 2016, at 1:33 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: >> >> Hi Mona, >> I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? >> >> If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); >> data.trial = trial;data.time = time; >> >> Best, >> Jan-Mathijs > > ************************************************ > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > You are the light you wish to see. > ************************************************ > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Oct 20 10:15:54 2016 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 20 Oct 2016 08:15:54 +0000 Subject: [FieldTrip] =?windows-1252?q?PhD-Position_in_Multisensory_Integra?= =?windows-1252?q?tion_=28Charit=E9_Berlin=29?= Message-ID: The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A project grant of the Deutsche Forschungsgemeinschaft (DFG), entitled “The influence of local cortical oscillations and distributed connectivity networks on multisensory perception“ will fund the currently open position (duration 36 months). The main objective of this project is to examine neural markers of multisensory perception and to test the dynamic interplay of synchronized neural populationsunderlying multisensory processes. The studies within this program include EEG, ECoG and behavioral experiments. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as basic German language skills for interacting with the study participants are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until October 31, 2016, electronically to: julian.keil at charite.de ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://multisensorymind.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From robert.oostenveld at donders.ru.nl Thu Oct 20 10:48:06 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 20 Oct 2016 10:48:06 +0200 Subject: [FieldTrip] magnetic dipoles In-Reply-To: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> References: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> Message-ID: <417B9C48-4EB1-4565-B97A-C28C74A72C56@donders.ru.nl> Hi Borna, For MEG the FieldTrip forward and inverse functionality will make use of a magnetic dipole if you specify the headmodel (or “vol” structure) as headmodel = []; headmodel.type = ‘infinite’; Important is that the sensor array should be detected as a “meg” sensor array, i.e. it should have coilpos, coilori and tra fields. See http://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described for that. If the sensors describe eeg electrodes, the forward computation with the same headmodel specification will be for an electric dipole in an infinite conductive medium. Hope this helps, Robert PS if would actually be good to document the magnetic dipole on http://www.fieldtriptoolbox.org/faq/what_kind_of_volume_conduction_models_are_implemented Feel free to edit that page and add the information from this mail. > On 20 Oct 2016, at 02:35, Borna, Amir wrote: > > Hi, > > I have a question regarding source localization of head coils; it seems the fieldtrip’s tutorials are directed toward localizing “current dipoles” as opposed to “magnetic dipoles”, e.g. head localization coils. So how should I setup the configuration (headmodel, vol, etc.) for source localization (and simulation) of magnetic dipoles? Thank you for your help in advance. > > > > Best, > > Borna. > > SNL > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 20 12:08:31 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 20 Oct 2016 10:08:31 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models References: Message-ID: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Thu Oct 20 12:49:00 2016 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 20 Oct 2016 06:49:00 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) wrote: > Note: this is the second time I post this reply, and the reason is that I > forgot to add an appropriate Subject (for findability) to my email (shame > on me…(-;) > > *From: *Elisabeth May > *Subject: **[FieldTrip] Question about cluster-based permutation tests on > linear mixed models* > *Date: *27 September 2016 at 14:46:55 GMT+2 > *To: * > *Reply-To: *FieldTrip discussion list > > > Dear FieldTripers, > > I have a question about the potential use of cluster-based permutation > tests for results obtained using linear mixed models. > > We are working with data from a 10 min EEG experiment on source level with > the aim to quantify the relationship of brain activity in different > frequency bands with continous perceptual ratings across 20 subjects in > different experimental conditions. Thus, we have 10 min time courses of > brain activity and ratings for each voxel for different conditions and want > to test a) if there are significant relationships in the single conditions > and b) if these relationships differ between two conditions. To this end, I > have calculated linear mixed models in R using the lme4 toolbox. For both > the single condition relationships and the condition contrasts, they result > in a single t-value (and a corresponding p-value), which is based on > information on both the single subject and the group level (i.e. we perform > a multi-level analysis). However, with more than 2000 voxels, we have a lot > of t-values and are wondering if there is a way to apply cluster-based > tests to correct for multiple comparisons. > > The main problem I see is that I only have one multilevel t-value for the > effect across all subjects, i.e. I don't have single subjects values, which > I could then e.g. randomize between conditions as normally done in > cluster-based permutation tests. (Or rather, I would be able to extract > single subject values but would then loose the advantage of the multi-level > analysis.) > > I found an old thread in the mailinglist archive where it was suggested to > flip the signs of the t-statistic for cluster-level correction ( > https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). > I understand that, in our case, I would do this randomly for all voxels in > each randomization and then build spatial clusters on the resulting (partly > flipped) t-values. However, I am not sure if that is a valid approach based > on the null hypothesis that there are no significant relations in my single > conditions (a) or no significant relationship differences in my condition > contrasts (b). > > For the condition contrasts, I would be able to permute the condition > labels as normally done in cluster-based permutation tests,I think, but > would then have to recalculate the linear mixed models for all voxels in > every permutation. This would result in a very high computational load. > > Does anyone have any experience with this kind of analysis? Would the > flipping of t-values be a valid approach (and if yes, is there anything to > keep in mind in particular)? Can you think of other ways to combine linear > mixed models with a multiple comparison correction on the cluster level? > > > Hi Elisabeth, > > I’m not an expert on linear mixed modelling, at least not with respect to > the different ways in which they can be used to deal with correlated > observations (typically, time series). However, from a theoretical point of > view, I do not see how these models could be combined with > permutation-based inference; they are just different statistical > frameworks. However, it IS possible to answer your questions ("we have 10 > min time courses of brain activity and ratings for each voxel for different > conditions and wan to test a) if there are significant relationships in the > single conditions and b) if these relationships differ between two > conditions.”) within the framework of cluster-based permutation tests. > Question b) is the most straightforward because it amounts to a > cluster-based permutation test using the depsamplesT statfun applied to the > regression coefficients in each of the two conditions. Answering question > a) requires that you bin your ratings in a number of categories, calculate > the trial-averaged EEG data for each of the categoreies, and test the > difference between them using a cluster-based permutation test using the > depsamplesregrT statfun. Both of these approaches have been described > previously on this discussion list, and for the depsamplesregrT statfun > (your question a), it was Vladimir Litvak who used it first (actually, I > implemented it for him). The approach for question b) is actually a variant > on the general approach for testing interactions using cluster-based > permutation tests. > > Have a look here: > http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_ > correlations_between_neuronal_data_and_quantitative_ > stimulus_and_behavioural_variables > and > http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_ > interaction_effect_using_cluster-based_permutation_tests > > These tutorials provide all the necessary concepts, although they do not > answer your question in a recipe-like fashion. > > best, > Eric Maris > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Thu Oct 20 19:39:59 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 20 Oct 2016 17:39:59 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: <96BB27E4-C1B2-4D33-BD20-5076D7A0E31C@mail.ucsd.edu> > However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Ah that might be the case, I will check. Thank you Anne! cheers, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Nothing is impossible, the word itself says 'I'm possible'!" --- Audrey Hepburn ********************************************* From mona at sdsc.edu Thu Oct 20 19:50:08 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 20 Oct 2016 17:50:08 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: <96BB27E4-C1B2-4D33-BD20-5076D7A0E31C@mail.ucsd.edu> > However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Ah that might be the case, I will check. Thank you Anne! cheers, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Nothing is impossible, the word itself says 'I'm possible'!" --- Audrey Hepburn ********************************************* From stan.vanpelt at donders.ru.nl Fri Oct 21 13:49:43 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 21 Oct 2016 11:49:43 +0000 Subject: [FieldTrip] CTF MEG issue In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C5215EA5B@exprd03.hosting.ru.nl> Dear José, I’ve forwarded your email to the FieldTrip email discussion list, since this is a more appropriate forum for a question like this (more experts=more potential answers). 10-50pT is way too strong to be a brain signal I’m afraid. Typical range would be 10-100 fT for CTF data, so your signal is more than 2 orders of magnitude higher. I think it is most likely noise coming from outside the scanner (room). Regarding the use of ft_databrowser, this is nicely decribed in the following tutorial: http://www.fieldtriptoolbox.org/tutorial/visual_artifact_rejection#use_ft_databrowser_to_mark_the_artifacts_manually Scaling will be done automatically if you only plot the MEG-channels. So you do not need to specify cfg.megscale (or cfg.eogscale, for that matter). Best, Stan From: joseluisblues at gmail.com [mailto:joseluisblues at gmail.com] On Behalf Of José Luis Sent: vrijdag 21 oktober 2016 12:30 To: Pelt, S. van (Stan) Subject: CTF MEG issue Dear Stan Van Pelt, I found your post in the Fieldtrip list and I thought you could help with an issue I have with my CTF MEG data, I have analysed this data for an ERF study with a home-made software a few years ago. Now I am re-analysing this data to investigate oscillatory activity, I usually never pay attention to the range of my raw data since I will always end up with averages values of ERFs around the typical 10-30 fT range. However, looking now to my raw data I find it on the range of 10000 - 50000 fT. My guess is that this should be Ok, since ERFs are always smaller in size relative to the raw data. I would like to check this with someone that has CTF MEG data. Second, since is not in the typical range I have the issue of visualizing my data with ft_databrowser. So the typical setting with: cfg.alim = 1e-12; cfg.megscale = 1; cfg.eogscale = 5e-8; doesn't work for me, I would like to know how do you manage to visualize your data, Many thanks in advance, By the way, the link to your paper "Higher-level processes in the formation and application of associations during action understanding" is not working properly, Jose -- José Luis ULLOA FULGERI, PhD +32477429007 +32492646477 https://sites.google.com/site/joseluisulloafulgeri/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisabethsusanne.may at gmail.com Fri Oct 21 19:38:51 2016 From: elisabethsusanne.may at gmail.com (Elisabeth May) Date: Fri, 21 Oct 2016 19:38:51 +0200 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge : > Eric, I don't think I understand why you would say "I do not see how these > models could be combined with permutation-based inference; they are just > different statistical frameworks". As you somewhat hint, the (G)LMM is a > regression, and the beta coefficient for the independent-variable of > interest at each voxel/vertex/sensor x timepoint can be interpreted as "how > much does the independent variable explain the brain activity?" In that > framework, it seems to me that one could do the following: > > for n=1:1000 > 1) Permute the condition labels (within subjects) of the individual > trials > 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and > corresponding t-map > 3) Threshold and construct cluster mass statistic as usual > end > 4) Identify cluster in the original (unpermuted) analysis and report > cluster p-value > > > Now, the main thing that has come up when we've tried to do this is that > re-fitting a (voxel x time) GLM 1000 times by the standard iterative > maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine > it would require rewriting at least a statfun, maybe other pieces of the > code. (We had an idea that, since the betas likely should vary smoothly > over time and space, one could use the output of one GLM as the seed to the > next, which would speed up convergence.) So it still does not seem like a > good idea, but based on the above, is there actually a *theoretical* reason > it wouldn't work? > > > Alik Widge, MD, PhD > Director, Translational NeuroEngineering Laboratory > Division of Neurotherapeutics, Massachusetts General Hospital > Assistant Professor of Psychiatry, Harvard Medical School > Clinical Fellow, Picower Institute for Learning & Memory (MIT) > awidge at partners.org > http://scholar.harvard.edu/awidge/ > 617-643-2580 > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < > e.maris at donders.ru.nl> wrote: > >> Note: this is the second time I post this reply, and the reason is that I >> forgot to add an appropriate Subject (for findability) to my email (shame >> on me…(-;) >> >> *From: *Elisabeth May >> *Subject: **[FieldTrip] Question about cluster-based permutation tests >> on linear mixed models* >> *Date: *27 September 2016 at 14:46:55 GMT+2 >> *To: * >> *Reply-To: *FieldTrip discussion list >> >> >> Dear FieldTripers, >> >> I have a question about the potential use of cluster-based permutation >> tests for results obtained using linear mixed models. >> >> We are working with data from a 10 min EEG experiment on source level >> with the aim to quantify the relationship of brain activity in different >> frequency bands with continous perceptual ratings across 20 subjects in >> different experimental conditions. Thus, we have 10 min time courses of >> brain activity and ratings for each voxel for different conditions and want >> to test a) if there are significant relationships in the single conditions >> and b) if these relationships differ between two conditions. To this end, I >> have calculated linear mixed models in R using the lme4 toolbox. For both >> the single condition relationships and the condition contrasts, they result >> in a single t-value (and a corresponding p-value), which is based on >> information on both the single subject and the group level (i.e. we perform >> a multi-level analysis). However, with more than 2000 voxels, we have a lot >> of t-values and are wondering if there is a way to apply cluster-based >> tests to correct for multiple comparisons. >> >> The main problem I see is that I only have one multilevel t-value for the >> effect across all subjects, i.e. I don't have single subjects values, which >> I could then e.g. randomize between conditions as normally done in >> cluster-based permutation tests. (Or rather, I would be able to extract >> single subject values but would then loose the advantage of the multi-level >> analysis.) >> >> I found an old thread in the mailinglist archive where it was suggested >> to flip the signs of the t-statistic for cluster-level correction ( >> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >> I understand that, in our case, I would do this randomly for all voxels in >> each randomization and then build spatial clusters on the resulting (partly >> flipped) t-values. However, I am not sure if that is a valid approach based >> on the null hypothesis that there are no significant relations in my single >> conditions (a) or no significant relationship differences in my condition >> contrasts (b). >> >> For the condition contrasts, I would be able to permute the condition >> labels as normally done in cluster-based permutation tests,I think, but >> would then have to recalculate the linear mixed models for all voxels in >> every permutation. This would result in a very high computational load. >> >> Does anyone have any experience with this kind of analysis? Would the >> flipping of t-values be a valid approach (and if yes, is there anything to >> keep in mind in particular)? Can you think of other ways to combine linear >> mixed models with a multiple comparison correction on the cluster level? >> >> >> Hi Elisabeth, >> >> I’m not an expert on linear mixed modelling, at least not with respect to >> the different ways in which they can be used to deal with correlated >> observations (typically, time series). However, from a theoretical point of >> view, I do not see how these models could be combined with >> permutation-based inference; they are just different statistical >> frameworks. However, it IS possible to answer your questions ("we have >> 10 min time courses of brain activity and ratings for each voxel for >> different conditions and wan to test a) if there are significant >> relationships in the single conditions and b) if these relationships differ >> between two conditions.”) within the framework of cluster-based permutation >> tests. Question b) is the most straightforward because it amounts to a >> cluster-based permutation test using the depsamplesT statfun applied to the >> regression coefficients in each of the two conditions. Answering question >> a) requires that you bin your ratings in a number of categories, calculate >> the trial-averaged EEG data for each of the categoreies, and test the >> difference between them using a cluster-based permutation test using the >> depsamplesregrT statfun. Both of these approaches have been described >> previously on this discussion list, and for the depsamplesregrT statfun >> (your question a), it was Vladimir Litvak who used it first (actually, I >> implemented it for him). The approach for question b) is actually a variant >> on the general approach for testing interactions using cluster-based >> permutation tests. >> >> Have a look here: >> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >> lations_between_neuronal_data_and_quantitative_stimulus_and_ >> behavioural_variables >> and >> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >> ction_effect_using_cluster-based_permutation_tests >> >> These tutorials provide all the necessary concepts, although they do not >> answer your question in a recipe-like fashion. >> >> best, >> Eric Maris >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From na.so.ir at gmail.com Mon Oct 24 15:49:14 2016 From: na.so.ir at gmail.com (Narjes Soltani) Date: Mon, 24 Oct 2016 17:19:14 +0330 Subject: [FieldTrip] error in ft_artifact_ecg Message-ID: Dear Sir/Madam Hi, I am running ft_artifact_ecg on some MEG data recorded by Neuromag Elekta device. I just pass the output produced by ft_defineTrial to ft_artifact_ecg, but I encounter the following error: Undefined function or variable "labelmlt". Error in ft_channelselection (line 428) if findmlt, channel = [channel; labelmlt]; end Error in ft_artifact_ecg (line 233) sgn = ft_channelselection(artfctdef.inspect, hdr.label); I guess I should explicitly set the cfg.artfctdef.ecg.channel, but I don't know how should I set this parameter? The set of channel labels in my data are as follows: 'MEG0113' 'MEG0112' 'MEG0111' 'MEG0122' 'MEG0123' 'MEG0121' 'MEG0132' 'MEG0133' 'MEG0131' 'MEG0143' 'MEG0142' 'MEG0141' 'MEG0213' 'MEG0212' 'MEG0211' 'MEG0222' 'MEG0223' 'MEG0221' 'MEG0232' 'MEG0233' 'MEG0231' 'MEG0243' 'MEG0242' 'MEG0241' 'MEG0313' 'MEG0312' 'MEG0311' 'MEG0322' 'MEG0323' 'MEG0321' 'MEG0333' 'MEG0332' 'MEG0331' 'MEG0343' 'MEG0342' 'MEG0341' 'MEG0413' 'MEG0412' 'MEG0411' 'MEG0422' 'MEG0423' 'MEG0421' 'MEG0432' 'MEG0433' 'MEG0431' 'MEG0443' 'MEG0442' 'MEG0441' 'MEG0513' 'MEG0512' 'MEG0511' 'MEG0523' 'MEG0522' 'MEG0521' 'MEG0532' 'MEG0533' 'MEG0531' 'MEG0542' 'MEG0543' 'MEG0541' 'MEG0613' 'MEG0612' 'MEG0611' 'MEG0622' 'MEG0623' 'MEG0621' 'MEG0633' 'MEG0632' 'MEG0631' 'MEG0642' 'MEG0643' 'MEG0641' 'MEG0713' 'MEG0712' 'MEG0711' 'MEG0723' 'MEG0722' 'MEG0721' 'MEG0733' 'MEG0732' 'MEG0731' 'MEG0743' 'MEG0742' 'MEG0741' 'MEG0813' 'MEG0812' 'MEG0811' 'MEG0822' 'MEG0823' 'MEG0821' 'MEG0913' 'MEG0912' 'MEG0911' 'MEG0923' 'MEG0922' 'MEG0921' 'MEG0932' 'MEG0933' 'MEG0931' 'MEG0942' 'MEG0943' 'MEG0941' 'MEG1013' 'MEG1012' 'MEG1011' 'MEG1023' 'MEG1022' 'MEG1021' 'MEG1032' 'MEG1033' 'MEG1031' 'MEG1043' 'MEG1042' 'MEG1041' 'MEG1112' 'MEG1113' 'MEG1111' 'MEG1123' 'MEG1122' 'MEG1121' 'MEG1133' 'MEG1132' 'MEG1131' 'MEG1142' 'MEG1143' 'MEG1141' 'MEG1213' 'MEG1212' 'MEG1211' 'MEG1223' 'MEG1222' 'MEG1221' 'MEG1232' 'MEG1233' 'MEG1231' 'MEG1243' 'MEG1242' 'MEG1241' 'MEG1312' 'MEG1313' 'MEG1311' 'MEG1323' 'MEG1322' 'MEG1321' 'MEG1333' 'MEG1332' 'MEG1331' 'MEG1342' 'MEG1343' 'MEG1341' 'MEG1412' 'MEG1413' 'MEG1411' 'MEG1423' 'MEG1422' 'MEG1421' 'MEG1433' 'MEG1432' 'MEG1431' 'MEG1442' 'MEG1443' 'MEG1441' 'MEG1512' 'MEG1513' 'MEG1511' 'MEG1522' 'MEG1523' 'MEG1521' 'MEG1533' 'MEG1532' 'MEG1531' 'MEG1543' 'MEG1542' 'MEG1541' 'MEG1613' 'MEG1612' 'MEG1611' 'MEG1622' 'MEG1623' 'MEG1621' 'MEG1632' 'MEG1633' 'MEG1631' 'MEG1643' 'MEG1642' 'MEG1641' 'MEG1713' 'MEG1712' 'MEG1711' 'MEG1722' 'MEG1723' 'MEG1721' 'MEG1732' 'MEG1733' 'MEG1731' 'MEG1743' 'MEG1742' 'MEG1741' 'MEG1813' 'MEG1812' 'MEG1811' 'MEG1822' 'MEG1823' 'MEG1821' 'MEG1832' 'MEG1833' 'MEG1831' 'MEG1843' 'MEG1842' 'MEG1841' 'MEG1912' 'MEG1913' 'MEG1911' 'MEG1923' 'MEG1922' 'MEG1921' 'MEG1932' 'MEG1933' 'MEG1931' 'MEG1943' 'MEG1942' 'MEG1941' 'MEG2013' 'MEG2012' 'MEG2011' 'MEG2023' 'MEG2022' 'MEG2021' 'MEG2032' 'MEG2033' 'MEG2031' 'MEG2042' 'MEG2043' 'MEG2041' 'MEG2113' 'MEG2112' 'MEG2111' 'MEG2122' 'MEG2123' 'MEG2121' 'MEG2133' 'MEG2132' 'MEG2131' 'MEG2143' 'MEG2142' 'MEG2141' 'MEG2212' 'MEG2213' 'MEG2211' 'MEG2223' 'MEG2222' 'MEG2221' 'MEG2233' 'MEG2232' 'MEG2231' 'MEG2242' 'MEG2243' 'MEG2241' 'MEG2312' 'MEG2313' 'MEG2311' 'MEG2323' 'MEG2322' 'MEG2321' 'MEG2332' 'MEG2333' 'MEG2331' 'MEG2343' 'MEG2342' 'MEG2341' 'MEG2412' 'MEG2413' 'MEG2411' 'MEG2423' 'MEG2422' 'MEG2421' 'MEG2433' 'MEG2432' 'MEG2431' 'MEG2442' 'MEG2443' 'MEG2441' 'MEG2512' 'MEG2513' 'MEG2511' 'MEG2522' 'MEG2523' 'MEG2521' 'MEG2533' 'MEG2532' 'MEG2531' 'MEG2543' 'MEG2542' 'MEG2541' 'MEG2612' 'MEG2613' 'MEG2611' 'MEG2623' 'MEG2622' 'MEG2621' 'MEG2633' 'MEG2632' 'MEG2631' 'MEG2642' 'MEG2643' 'MEG2641' 'EOG061' 'ECG062' 'STI101' 'STI201' 'STI301' 'MISC201' 'MISC202' 'MISC203' 'MISC204' 'MISC205' 'MISC206' 'MISC301' 'MISC302' 'MISC303' 'MISC304' 'MISC305' 'MISC306' Would you please help me with this problem? Best Regards Narjes -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Mon Oct 24 18:18:46 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Mon, 24 Oct 2016 16:18:46 +0000 Subject: [FieldTrip] eLORETA Message-ID: Hello, Is there any difference between using the eLORETA-KEY software and using ft_sourceanalysis, cfg.method = 'eloreta'. I am going to use eLoreta in MEG resting state. Thanks Mehdy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Mon Oct 24 20:33:46 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Mon, 24 Oct 2016 18:33:46 +0000 Subject: [FieldTrip] eLORETA In-Reply-To: References: Message-ID: Hello, For using the eLORETA in resting state of MEG signals, do I need to compute Timelock analysis? If it is so, as they are resting state, how valid they would be? Thanks On Mon, Oct 24, 2016 at 10:18 AM mehdy dousty wrote: > Hello, > > Is there any difference between using the eLORETA-KEY software and using > ft_sourceanalysis, cfg.method = 'eloreta'. I am going to use eLoreta in MEG > resting state. > > Thanks > Mehdy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Tue Oct 25 13:33:24 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Tue, 25 Oct 2016 11:33:24 +0000 Subject: [FieldTrip] Fwd: [Women in M/EEG]: please fwd to reach female scientist in the field References: <73b2b35a8cc36f97.580f4111@limbe.rz.uni-konstanz.de> Message-ID: <14E0CEED-3A2A-41AF-9C83-DCA5A4FF5952@cfin.au.dk> Hi everyone, I thought this initiative could use some wider distribution. Biaswatchneuro was covered in the New York Times recently ( http://nyti.ms/2bOEPj6 ) and now Biomag and the MEG community is under its watch. :-) See below. Cheers, Sarang > Begin forwarded message: > >> Dear friends and colleagues, >> I hope you are doing great. Probably your are aware of the gender bias in science (e.g. at conferences: https://biaswatchneuro.com). >> There is an initiative which hopefully will help counteracting (see below for details). That is, currently information about female scientist with M/EEG expertise are collected. This will provide material for gender representation to future organizers of Biomag and potentially other conferences. >> >> @ Female scientist in the field: You may want to fill in this link (or one of the links below): https://docs.google.com/spreadsheets/d/1KaqR_ONjH4DShmzDS0SlpWho0hp6NuswWmYrrDC0OSY/edit?usp=sharing >> >> @ All: Please, pass on the link / mail to reach female scientist in the field. >> >> Cheers, >> Anne >> From robert.oostenveld at donders.ru.nl Tue Oct 25 13:39:41 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 25 Oct 2016 13:39:41 +0200 Subject: [FieldTrip] gender bias in the M/EEG research community Message-ID: <9ADAB85C-9752-4F54-8035-66FB5F255F73@donders.ru.nl> Dear FieldTrip users, Probably your are aware of the gender bias in science (e.g. at conferences: https://biaswatchneuro.com ). There is an initiative which hopefully will help counteracting (see below for details). That is, currently information about female scientist with M/EEG expertise are collected. This will provide material for gender representation to future organizers of Biomag and potentially other conferences. @ Female scientist in the field: You may want to fill in this link (or one of the links below): https://docs.google.com/spreadsheets/d/1KaqR_ONjH4DShmzDS0SlpWho0hp6NuswWmYrrDC0OSY/edit?usp=sharing @ All: Please, pass on the link / mail to reach female scientist in the field. best regards, Robert PS Biaswatchneuro was covered in the New York Times recently, see http://nyti.ms/2bOEPj6 ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Radboud University, Nijmegen, The Netherlands Visiting Professor NatMEG - the Swedish National MEG facility Karolinska Institute, Stockholm, Sweden tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/donders skype: r.oostenveld ----------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Tue Oct 25 17:30:10 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Tue, 25 Oct 2016 11:30:10 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. *Canadian journal of fisheries and aquatic sciences*, *58*(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. *Psychophysiology*, *48*(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < elisabethsusanne.may at gmail.com> wrote: > Dear Eric and Alik, > > thanks a lot for your helpful responses! > > I will have a close look at the faqs, Eric, and test the approaches you > outlined. I am curious, anyway, as to how different results will be for > simple regressions compared to the multilevel results of the linear-mixed > models. > > Like Alik, I am also curious about other people's opinions on the general > question if there are theoretical reasons against a combination of the > approaches like Alik suggested. We also thought about this approach but > haven't fully tested it yet because of the very long calculation times. > > Thanks again and have a nice weekend! > Elisabeth > > 2016-10-20 12:49 GMT+02:00 Alik Widge : > >> Eric, I don't think I understand why you would say "I do not see how >> these models could be combined with permutation-based inference; they are >> just different statistical frameworks". As you somewhat hint, the (G)LMM is >> a regression, and the beta coefficient for the independent-variable of >> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >> much does the independent variable explain the brain activity?" In that >> framework, it seems to me that one could do the following: >> >> for n=1:1000 >> 1) Permute the condition labels (within subjects) of the individual >> trials >> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >> corresponding t-map >> 3) Threshold and construct cluster mass statistic as usual >> end >> 4) Identify cluster in the original (unpermuted) analysis and report >> cluster p-value >> >> >> Now, the main thing that has come up when we've tried to do this is that >> re-fitting a (voxel x time) GLM 1000 times by the standard iterative >> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >> it would require rewriting at least a statfun, maybe other pieces of the >> code. (We had an idea that, since the betas likely should vary smoothly >> over time and space, one could use the output of one GLM as the seed to the >> next, which would speed up convergence.) So it still does not seem like a >> good idea, but based on the above, is there actually a *theoretical* reason >> it wouldn't work? >> >> >> Alik Widge, MD, PhD >> Director, Translational NeuroEngineering Laboratory >> Division of Neurotherapeutics, Massachusetts General Hospital >> Assistant Professor of Psychiatry, Harvard Medical School >> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >> awidge at partners.org >> http://scholar.harvard.edu/awidge/ >> 617-643-2580 >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >> e.maris at donders.ru.nl> wrote: >> >>> Note: this is the second time I post this reply, and the reason is that >>> I forgot to add an appropriate Subject (for findability) to my email (shame >>> on me…(-;) >>> >>> *From: *Elisabeth May >>> *Subject: **[FieldTrip] Question about cluster-based permutation tests >>> on linear mixed models* >>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>> *To: * >>> *Reply-To: *FieldTrip discussion list >>> >>> >>> Dear FieldTripers, >>> >>> I have a question about the potential use of cluster-based permutation >>> tests for results obtained using linear mixed models. >>> >>> We are working with data from a 10 min EEG experiment on source level >>> with the aim to quantify the relationship of brain activity in different >>> frequency bands with continous perceptual ratings across 20 subjects in >>> different experimental conditions. Thus, we have 10 min time courses of >>> brain activity and ratings for each voxel for different conditions and want >>> to test a) if there are significant relationships in the single conditions >>> and b) if these relationships differ between two conditions. To this end, I >>> have calculated linear mixed models in R using the lme4 toolbox. For both >>> the single condition relationships and the condition contrasts, they result >>> in a single t-value (and a corresponding p-value), which is based on >>> information on both the single subject and the group level (i.e. we perform >>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>> of t-values and are wondering if there is a way to apply cluster-based >>> tests to correct for multiple comparisons. >>> >>> The main problem I see is that I only have one multilevel t-value for >>> the effect across all subjects, i.e. I don't have single subjects values, >>> which I could then e.g. randomize between conditions as normally done in >>> cluster-based permutation tests. (Or rather, I would be able to extract >>> single subject values but would then loose the advantage of the multi-level >>> analysis.) >>> >>> I found an old thread in the mailinglist archive where it was suggested >>> to flip the signs of the t-statistic for cluster-level correction ( >>> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >>> I understand that, in our case, I would do this randomly for all voxels in >>> each randomization and then build spatial clusters on the resulting (partly >>> flipped) t-values. However, I am not sure if that is a valid approach based >>> on the null hypothesis that there are no significant relations in my single >>> conditions (a) or no significant relationship differences in my condition >>> contrasts (b). >>> >>> For the condition contrasts, I would be able to permute the condition >>> labels as normally done in cluster-based permutation tests,I think, but >>> would then have to recalculate the linear mixed models for all voxels in >>> every permutation. This would result in a very high computational load. >>> >>> Does anyone have any experience with this kind of analysis? Would the >>> flipping of t-values be a valid approach (and if yes, is there anything to >>> keep in mind in particular)? Can you think of other ways to combine linear >>> mixed models with a multiple comparison correction on the cluster level? >>> >>> >>> Hi Elisabeth, >>> >>> I’m not an expert on linear mixed modelling, at least not with respect >>> to the different ways in which they can be used to deal with correlated >>> observations (typically, time series). However, from a theoretical point of >>> view, I do not see how these models could be combined with >>> permutation-based inference; they are just different statistical >>> frameworks. However, it IS possible to answer your questions ("we have >>> 10 min time courses of brain activity and ratings for each voxel for >>> different conditions and wan to test a) if there are significant >>> relationships in the single conditions and b) if these relationships differ >>> between two conditions.”) within the framework of cluster-based permutation >>> tests. Question b) is the most straightforward because it amounts to a >>> cluster-based permutation test using the depsamplesT statfun applied to the >>> regression coefficients in each of the two conditions. Answering question >>> a) requires that you bin your ratings in a number of categories, calculate >>> the trial-averaged EEG data for each of the categoreies, and test the >>> difference between them using a cluster-based permutation test using the >>> depsamplesregrT statfun. Both of these approaches have been described >>> previously on this discussion list, and for the depsamplesregrT statfun >>> (your question a), it was Vladimir Litvak who used it first (actually, I >>> implemented it for him). The approach for question b) is actually a variant >>> on the general approach for testing interactions using cluster-based >>> permutation tests. >>> >>> Have a look here: >>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>> behavioural_variables >>> and >>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>> ction_effect_using_cluster-based_permutation_tests >>> >>> These tutorials provide all the necessary concepts, although they do not >>> answer your question in a recipe-like fashion. >>> >>> best, >>> Eric Maris >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Tue Oct 25 19:29:54 2016 From: alik.widge at gmail.com (Alik Widge) Date: Tue, 25 Oct 2016 13:29:54 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe wrote: > Hi Elisabeth and Alik, > Permutation methods applied to multiple regression models are not > generally guaranteed to be accurate because testing individual terms in > such models (e.g., partial correlation coefficients) requires accurate > knowledge of other terms in the model (e.g., the slope coefficients for all > the other predictors in the multiple regression). Because such parameters > have to be estimated from the data, permutation tests are only > ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). > Though there are special cases (e.g., a two factor ANOVA with two levels of > each factor), where permutation methods do guarantee accuracy. > In lieu of permutation testing, you might want to try using one of > Benjamini and colleagues' false discovery rate (FDR) control algorithms to > control for multiple comparisons. In my tests on simulated ERP data (Groppe > et al., 2011), FDR correction was nearly as powerful as cluster-based > permutation testing for detecting a very broadly distributed effect (e.g., > a P300-like effect) and it was far more sensitive than cluster-based > testing for an effect with a very limited distribution (e.g., an N170-like > effect). FDR correction is also very computationally efficient. > hope this is helpful, > -David > > > Refs: > Anderson, M. J. (2001). Permutation tests for univariate or multivariate > analysis of variance and regression. *Canadian journal of fisheries and > aquatic sciences*, *58*(3), 626-639. > > Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of > Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. > > Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis > of event‐related brain potentials/fields II: Simulation studies. > *Psychophysiology*, *48*(12), 1726-1737. > > > On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < > elisabethsusanne.may at gmail.com> wrote: > >> Dear Eric and Alik, >> >> thanks a lot for your helpful responses! >> >> I will have a close look at the faqs, Eric, and test the approaches you >> outlined. I am curious, anyway, as to how different results will be for >> simple regressions compared to the multilevel results of the linear-mixed >> models. >> >> Like Alik, I am also curious about other people's opinions on the general >> question if there are theoretical reasons against a combination of the >> approaches like Alik suggested. We also thought about this approach but >> haven't fully tested it yet because of the very long calculation times. >> >> Thanks again and have a nice weekend! >> Elisabeth >> >> 2016-10-20 12:49 GMT+02:00 Alik Widge : >> >>> Eric, I don't think I understand why you would say "I do not see how >>> these models could be combined with permutation-based inference; they are >>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>> a regression, and the beta coefficient for the independent-variable of >>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>> much does the independent variable explain the brain activity?" In that >>> framework, it seems to me that one could do the following: >>> >>> for n=1:1000 >>> 1) Permute the condition labels (within subjects) of the individual >>> trials >>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >>> corresponding t-map >>> 3) Threshold and construct cluster mass statistic as usual >>> end >>> 4) Identify cluster in the original (unpermuted) analysis and report >>> cluster p-value >>> >>> >>> Now, the main thing that has come up when we've tried to do this is that >>> re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>> it would require rewriting at least a statfun, maybe other pieces of the >>> code. (We had an idea that, since the betas likely should vary smoothly >>> over time and space, one could use the output of one GLM as the seed to the >>> next, which would speed up convergence.) So it still does not seem like a >>> good idea, but based on the above, is there actually a *theoretical* reason >>> it wouldn't work? >>> >>> >>> Alik Widge, MD, PhD >>> Director, Translational NeuroEngineering Laboratory >>> Division of Neurotherapeutics, Massachusetts General Hospital >>> Assistant Professor of Psychiatry, Harvard Medical School >>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>> awidge at partners.org >>> http://scholar.harvard.edu/awidge/ >>> 617-643-2580 >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>> e.maris at donders.ru.nl> wrote: >>> >>>> Note: this is the second time I post this reply, and the reason is that >>>> I forgot to add an appropriate Subject (for findability) to my email (shame >>>> on me…(-;) >>>> >>>> *From: *Elisabeth May >>>> *Subject: **[FieldTrip] Question about cluster-based permutation tests >>>> on linear mixed models* >>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>> *To: * >>>> *Reply-To: *FieldTrip discussion list >>>> >>>> >>>> Dear FieldTripers, >>>> >>>> I have a question about the potential use of cluster-based permutation >>>> tests for results obtained using linear mixed models. >>>> >>>> We are working with data from a 10 min EEG experiment on source level >>>> with the aim to quantify the relationship of brain activity in different >>>> frequency bands with continous perceptual ratings across 20 subjects in >>>> different experimental conditions. Thus, we have 10 min time courses of >>>> brain activity and ratings for each voxel for different conditions and want >>>> to test a) if there are significant relationships in the single conditions >>>> and b) if these relationships differ between two conditions. To this end, I >>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>> the single condition relationships and the condition contrasts, they result >>>> in a single t-value (and a corresponding p-value), which is based on >>>> information on both the single subject and the group level (i.e. we perform >>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>> of t-values and are wondering if there is a way to apply cluster-based >>>> tests to correct for multiple comparisons. >>>> >>>> The main problem I see is that I only have one multilevel t-value for >>>> the effect across all subjects, i.e. I don't have single subjects values, >>>> which I could then e.g. randomize between conditions as normally done in >>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>> single subject values but would then loose the advantage of the multi-level >>>> analysis.) >>>> >>>> I found an old thread in the mailinglist archive where it was suggested >>>> to flip the signs of the t-statistic for cluster-level correction ( >>>> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >>>> I understand that, in our case, I would do this randomly for all voxels in >>>> each randomization and then build spatial clusters on the resulting (partly >>>> flipped) t-values. However, I am not sure if that is a valid approach based >>>> on the null hypothesis that there are no significant relations in my single >>>> conditions (a) or no significant relationship differences in my condition >>>> contrasts (b). >>>> >>>> For the condition contrasts, I would be able to permute the condition >>>> labels as normally done in cluster-based permutation tests,I think, but >>>> would then have to recalculate the linear mixed models for all voxels in >>>> every permutation. This would result in a very high computational load. >>>> >>>> Does anyone have any experience with this kind of analysis? Would the >>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>> keep in mind in particular)? Can you think of other ways to combine linear >>>> mixed models with a multiple comparison correction on the cluster level? >>>> >>>> >>>> Hi Elisabeth, >>>> >>>> I’m not an expert on linear mixed modelling, at least not with respect >>>> to the different ways in which they can be used to deal with correlated >>>> observations (typically, time series). However, from a theoretical point of >>>> view, I do not see how these models could be combined with >>>> permutation-based inference; they are just different statistical >>>> frameworks. However, it IS possible to answer your questions ("we have >>>> 10 min time courses of brain activity and ratings for each voxel for >>>> different conditions and wan to test a) if there are significant >>>> relationships in the single conditions and b) if these relationships differ >>>> between two conditions.”) within the framework of cluster-based permutation >>>> tests. Question b) is the most straightforward because it amounts to a >>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>> regression coefficients in each of the two conditions. Answering question >>>> a) requires that you bin your ratings in a number of categories, calculate >>>> the trial-averaged EEG data for each of the categoreies, and test the >>>> difference between them using a cluster-based permutation test using the >>>> depsamplesregrT statfun. Both of these approaches have been described >>>> previously on this discussion list, and for the depsamplesregrT statfun >>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>> implemented it for him). The approach for question b) is actually a variant >>>> on the general approach for testing interactions using cluster-based >>>> permutation tests. >>>> >>>> Have a look here: >>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>> behavioural_variables >>>> and >>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>> ction_effect_using_cluster-based_permutation_tests >>>> >>>> These tutorials provide all the necessary concepts, although they do >>>> not answer your question in a recipe-like fashion. >>>> >>>> best, >>>> Eric Maris >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Tue Oct 25 21:28:55 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Tue, 25 Oct 2016 15:28:55 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: > Thanks, that was super interesting! Was not aware of those. > > Have been meditating this afternoon on this and related Anderson papers. > What's interesting is that he appears to think my suggestion below *would* > be asymptotically acceptable -- *if* one specifically permutes the > dependent variable (power/ERP observation) rather than permuting each > column of the independent variables separately (i.e., if one preserves any > correlational structure that exists between the independent variables). > That's the Manly (1997) method, and it appears that the only reason it > breaks down sometimes is if there's an outlier in the independent variable. > This could presumably be a problem in the ecological sciences, for which > he's writing, where one can't control things like temperature in a season > or numbers of eels that swim past a given sensor. In cognitive > neuroscience, where the predictor/independent variables are usually dummy > coded properties of the trial, this seems like we might be on firmer > ground. > > Opinion based on reading and reasoning, of course, and not to be trusted > until and unless I or someone else were to back it up by doing some > simulated-data experiments... > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: > >> Hi Elisabeth and Alik, >> Permutation methods applied to multiple regression models are not >> generally guaranteed to be accurate because testing individual terms in >> such models (e.g., partial correlation coefficients) requires accurate >> knowledge of other terms in the model (e.g., the slope coefficients for all >> the other predictors in the multiple regression). Because such parameters >> have to be estimated from the data, permutation tests are only >> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >> Though there are special cases (e.g., a two factor ANOVA with two levels of >> each factor), where permutation methods do guarantee accuracy. >> In lieu of permutation testing, you might want to try using one of >> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >> control for multiple comparisons. In my tests on simulated ERP data (Groppe >> et al., 2011), FDR correction was nearly as powerful as cluster-based >> permutation testing for detecting a very broadly distributed effect (e.g., >> a P300-like effect) and it was far more sensitive than cluster-based >> testing for an effect with a very limited distribution (e.g., an N170-like >> effect). FDR correction is also very computationally efficient. >> hope this is helpful, >> -David >> >> >> Refs: >> Anderson, M. J. (2001). Permutation tests for univariate or multivariate >> analysis of variance and regression. *Canadian journal of fisheries and >> aquatic sciences*, *58*(3), 626-639. >> >> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >> >> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >> analysis of event‐related brain potentials/fields II: Simulation studies. >> *Psychophysiology*, *48*(12), 1726-1737. >> >> >> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >> elisabethsusanne.may at gmail.com> wrote: >> >>> Dear Eric and Alik, >>> >>> thanks a lot for your helpful responses! >>> >>> I will have a close look at the faqs, Eric, and test the approaches you >>> outlined. I am curious, anyway, as to how different results will be for >>> simple regressions compared to the multilevel results of the linear-mixed >>> models. >>> >>> Like Alik, I am also curious about other people's opinions on the >>> general question if there are theoretical reasons against a combination of >>> the approaches like Alik suggested. We also thought about this approach but >>> haven't fully tested it yet because of the very long calculation times. >>> >>> Thanks again and have a nice weekend! >>> Elisabeth >>> >>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>> >>>> Eric, I don't think I understand why you would say "I do not see how >>>> these models could be combined with permutation-based inference; they are >>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>> a regression, and the beta coefficient for the independent-variable of >>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>> much does the independent variable explain the brain activity?" In that >>>> framework, it seems to me that one could do the following: >>>> >>>> for n=1:1000 >>>> 1) Permute the condition labels (within subjects) of the individual >>>> trials >>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >>>> corresponding t-map >>>> 3) Threshold and construct cluster mass statistic as usual >>>> end >>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>> cluster p-value >>>> >>>> >>>> Now, the main thing that has come up when we've tried to do this is >>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>> it would require rewriting at least a statfun, maybe other pieces of the >>>> code. (We had an idea that, since the betas likely should vary smoothly >>>> over time and space, one could use the output of one GLM as the seed to the >>>> next, which would speed up convergence.) So it still does not seem like a >>>> good idea, but based on the above, is there actually a *theoretical* reason >>>> it wouldn't work? >>>> >>>> >>>> Alik Widge, MD, PhD >>>> Director, Translational NeuroEngineering Laboratory >>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>> Assistant Professor of Psychiatry, Harvard Medical School >>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>> awidge at partners.org >>>> http://scholar.harvard.edu/awidge/ >>>> 617-643-2580 >>>> >>>> Alik Widge >>>> alik.widge at gmail.com >>>> (206) 866-5435 >>>> >>>> >>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>> e.maris at donders.ru.nl> wrote: >>>> >>>>> Note: this is the second time I post this reply, and the reason is >>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>> (shame on me…(-;) >>>>> >>>>> *From: *Elisabeth May >>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>> tests on linear mixed models* >>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>> *To: * >>>>> *Reply-To: *FieldTrip discussion list >>>>> >>>>> >>>>> Dear FieldTripers, >>>>> >>>>> I have a question about the potential use of cluster-based permutation >>>>> tests for results obtained using linear mixed models. >>>>> >>>>> We are working with data from a 10 min EEG experiment on source level >>>>> with the aim to quantify the relationship of brain activity in different >>>>> frequency bands with continous perceptual ratings across 20 subjects in >>>>> different experimental conditions. Thus, we have 10 min time courses of >>>>> brain activity and ratings for each voxel for different conditions and want >>>>> to test a) if there are significant relationships in the single conditions >>>>> and b) if these relationships differ between two conditions. To this end, I >>>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>>> the single condition relationships and the condition contrasts, they result >>>>> in a single t-value (and a corresponding p-value), which is based on >>>>> information on both the single subject and the group level (i.e. we perform >>>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>>> of t-values and are wondering if there is a way to apply cluster-based >>>>> tests to correct for multiple comparisons. >>>>> >>>>> The main problem I see is that I only have one multilevel t-value for >>>>> the effect across all subjects, i.e. I don't have single subjects values, >>>>> which I could then e.g. randomize between conditions as normally done in >>>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>>> single subject values but would then loose the advantage of the multi-level >>>>> analysis.) >>>>> >>>>> I found an old thread in the mailinglist archive where it was >>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>> /005375.html). I understand that, in our case, I would do this >>>>> randomly for all voxels in each randomization and then build spatial >>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>> if that is a valid approach based on the null hypothesis that there are no >>>>> significant relations in my single conditions (a) or no significant >>>>> relationship differences in my condition contrasts (b). >>>>> >>>>> For the condition contrasts, I would be able to permute the condition >>>>> labels as normally done in cluster-based permutation tests,I think, but >>>>> would then have to recalculate the linear mixed models for all voxels in >>>>> every permutation. This would result in a very high computational load. >>>>> >>>>> Does anyone have any experience with this kind of analysis? Would the >>>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>>> keep in mind in particular)? Can you think of other ways to combine linear >>>>> mixed models with a multiple comparison correction on the cluster level? >>>>> >>>>> >>>>> Hi Elisabeth, >>>>> >>>>> I’m not an expert on linear mixed modelling, at least not with respect >>>>> to the different ways in which they can be used to deal with correlated >>>>> observations (typically, time series). However, from a theoretical point of >>>>> view, I do not see how these models could be combined with >>>>> permutation-based inference; they are just different statistical >>>>> frameworks. However, it IS possible to answer your questions ("we >>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>> different conditions and wan to test a) if there are significant >>>>> relationships in the single conditions and b) if these relationships differ >>>>> between two conditions.”) within the framework of cluster-based permutation >>>>> tests. Question b) is the most straightforward because it amounts to a >>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>> regression coefficients in each of the two conditions. Answering question >>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>> difference between them using a cluster-based permutation test using the >>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>> implemented it for him). The approach for question b) is actually a variant >>>>> on the general approach for testing interactions using cluster-based >>>>> permutation tests. >>>>> >>>>> Have a look here: >>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>> behavioural_variables >>>>> and >>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>> ction_effect_using_cluster-based_permutation_tests >>>>> >>>>> These tutorials provide all the necessary concepts, although they do >>>>> not answer your question in a recipe-like fashion. >>>>> >>>>> best, >>>>> Eric Maris >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maximilien.chaumon at gmail.com Wed Oct 26 10:42:27 2016 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Wed, 26 Oct 2016 08:42:27 +0000 Subject: [FieldTrip] filtering during artifact detection Message-ID: Dear all, when attempting to detect blinks automatically on a continuous recording without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: cfg = []; cfg.dataset = fullfile(rootdir,f{iD}); cfg.layout = 'neuromag306mag.lay'; cfg.trialdef.eventtype = 'STI101'; cfg.trialdef.eventvalue = {255}; cfg = ft_definetrial(cfg); cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; cfg.channel = 'megmag'; cfg.continuous = 'yes'; data = ft_preprocessing(cfg); cfg.artfctdef.eog = []; cfg.artfctdef.eog.channel = eogchans; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); This opens an interactive window in which the EOG signal is not BPfiltered, and contains in particular slow drifts that make the threshold detection pretty inefficient. I'm surprised because cfg.artfctdef is supposed to bpfilter 1-15Hz the data, isn't it? Is this normal? Thanks, Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Wed Oct 26 11:15:52 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Wed, 26 Oct 2016 11:15:52 +0200 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: Dear Maximilien, You should specify the filter parameters in the cfg: cfg.artfctdef.eog.bpfilter = 'yes' cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details cfg.artfctdef.eog.bpfreq = [1 15] cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see Take a look to the fft_artifact_eog.m documentation. To know more about filtering you might want to take a look here: http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics Best, Diego On 26 October 2016 at 10:42, Maximilien Chaumon < maximilien.chaumon at gmail.com> wrote: > Dear all, > when attempting to detect blinks automatically on a continuous recording > without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not > BPfiltered, and contains in particular slow drifts that make the threshold > detection pretty inefficient. I'm surprised because cfg.artfctdef is > supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maximilien.chaumon at gmail.com Wed Oct 26 14:27:32 2016 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Wed, 26 Oct 2016 12:27:32 +0000 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: Thank you Diego for your quick reply. Whether or not I include those filter parameters explicitly does not change anything. This is what i have now: cfg.artfctdef.eog = []; cfg.artfctdef.eog.bpfilter = 'yes'; cfg.artfctdef.eog.bpfilttype = 'but'; cfg.artfctdef.eog.bpfreq = [1 15]; cfg.artfctdef.eog.bpfiltord = 4; cfg.artfctdef.eog.channel = eogchans; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; cfg.artfctdef.eog.cutoff = 2.5; [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); but the resulting interactive window looks like this: [image: pasted1] Seems like the preprocessing step isn't applied... any clue why that is? Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla < dlozanosoldevilla at gmail.com> a écrit : > Dear Maximilien, > > You should specify the filter parameters in the cfg: > > cfg.artfctdef.eog.bpfilter = 'yes' > cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details > cfg.artfctdef.eog.bpfreq = [1 15] > cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see > > > Take a look to the fft_artifact_eog.m documentation. To know more about > filtering you might want to take a look here: > > http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics > > Best, > > Diego > > On 26 October 2016 at 10:42, Maximilien Chaumon < > maximilien.chaumon at gmail.com> wrote: > > Dear all, > when attempting to detect blinks automatically on a continuous recording > without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not > BPfiltered, and contains in particular slow drifts that make the threshold > detection pretty inefficient. I'm surprised because cfg.artfctdef is > supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Wed Oct 26 14:36:03 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Wed, 26 Oct 2016 21:36:03 +0900 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> Dear all, Note that I encountered the same problem (absence of intended filtering) when using high-level ft_preprocessing function (I talked about it in a a precedent email). I solved the problem by doing the filtering separately, as a first step, and using the low-level ft_preprocbandstopfilter function. Anyway I needed access to the data in an unstructured format (i.e. just a matrix, easy to manipulate), so in the end this low-level function fitted my needs better. All the best, Florian > On 26 Oct, 2016, at 9:27 PM, Maximilien Chaumon wrote: > > Thank you Diego for your quick reply. > Whether or not I include those filter parameters explicitly does not change anything. > This is what i have now: > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.bpfilter = 'yes'; > cfg.artfctdef.eog.bpfilttype = 'but'; > cfg.artfctdef.eog.bpfreq = [1 15]; > cfg.artfctdef.eog.bpfiltord = 4; > > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > cfg.artfctdef.eog.cutoff = 2.5; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > > but the resulting interactive window looks like this: > > > > Seems like the preprocessing step isn't applied... any clue why that is? > > > Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla > a écrit : > Dear Maximilien, > > You should specify the filter parameters in the cfg: > > cfg.artfctdef.eog.bpfilter = 'yes' > cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details > cfg.artfctdef.eog.bpfreq = [1 15] > cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see > > Take a look to the fft_artifact_eog.m documentation. To know more about filtering you might want to take a look here: > http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics > > Best, > > Diego > > On 26 October 2016 at 10:42, Maximilien Chaumon > wrote: > Dear all, > when attempting to detect blinks automatically on a continuous recording without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not BPfiltered, and contains in particular slow drifts that make the threshold detection pretty inefficient. I'm surprised because cfg.artfctdef is supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elinor.tzvi at neuro.uni-luebeck.de Wed Oct 26 14:43:20 2016 From: elinor.tzvi at neuro.uni-luebeck.de (Elinor Tzvi) Date: Wed, 26 Oct 2016 14:43:20 +0200 Subject: [FieldTrip] PHD POSITION IN NON-INVASIVE BRAIN STIMULATION AND IMAGING Message-ID: <810A8E06C75EB447A8CEB73DBFD7BB0EFA6AC0D24E@solaris.neuro.uni-luebeck.de> The Neurology department of the University of Lübeck offers a PhD position (65% E13 TV-L) starting on January 1st, 2017 or later. The candidate will be working on a project using combined non-invasive brain stimulation (tDCS) and MR-imaging to study dynamics of neural connectivity underlying motor skill learning. We offer The department of Neurology is part of the Center for Brain, Behavior and Metabolism (CBBM), which offers an excellent and state-of the-art research environment. The research group "Cognitive Neuroscience" (headed by Prof. Ulrike Krämer) is working on different topics related to cognitive and affective control (anger and aggression, response inhibition, regulation of eating behavior) and motor control. In addition, our researchers use diverse and complex methods to analyze brain-behavior relationships. Thus, we offer an excellent environment for interdisciplinary research. In addition, the group has a number of national and international collaborations. We require The successful candidate will hold an MSc/MA/Dipl. in Biomedical Engineering, Psychology or related fields (cognitive science, biology, medicine, neuroscience or other). Experience in acquisition and analysis of human neuroimaging data (fMRI, EEG, MEG or NIRS) and Programming skills in Matlab (or equivalent) is preferred. Interest and/or experience in the field of cognitive neuroscience are obligatory. We are looking for a motivated, analytic and problem-solving oriented candidate who enjoys interdisciplinary challenges. The candidate will work in the "Cognitive Neuroscience Group" headed by Prof. Dr. Ulrike M. Krämer under the supervision of Dr. Elinor Tzvi-Minker. Applicants with disabilities are preferred if qualification is equal. The University of Lübeck is an equal opportunity employer, aiming to increase the proportion of women in science. Applications by women are particularly welcome. For questions about the details of the assignment please contact Dr. Elinor Tzvi-Minker (elinor.tzvi at neuro.uni-luebeck.de). Please send your application (Letter of motivation, CV, two recommendation letters, relevant certificates) as one single complete PDF file to the Email-address mentioned above. Applications will be considered until the position has been filled. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Wed Oct 26 15:47:08 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Wed, 26 Oct 2016 15:47:08 +0200 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> References: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> Message-ID: Hi Maximilien and Florian, Thank for letting us know. I can reproduce your problem and the problem relies in an unfortunate combination of fieldtrip defaults in some functions. The issue starts with the cfg.artfctdef.eog.fltpadding default which is 0.1. This parameter introduces a 0.1s padding with NaNs (line 301 in ft_artifact_zvalue) and the private function preproc.m does not filter the data because it contains NaNs. For now, set explicitly cfg.artfctdef.eog.fltpadding = 0; to carry on while we fix it: cfg=[]; cfg.artfctdef.eog = []; cfg.artfctdef.eog.bpfilter = 'yes'; cfg.artfctdef.eog.bpfilttype = 'but'; cfg.artfctdef.eog.bpfreq = [8 10]; cfg.artfctdef.eog.bpfiltord = 4; cfg.artfctdef.eog.channel = 'MLF22'; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.fltpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; cfg.artfctdef.eog.cutoff = 2.5; [cfg, artifact] = ft_artifact_eog(cfg,data); You can follow the development of the issue here: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3193 Best, Diego On 26 October 2016 at 14:36, Florian Gerard-Mercier wrote: > Dear all, > > Note that I encountered the same problem (absence of intended filtering) > when using high-level ft_preprocessing function (I talked about it in a a > precedent email). > I solved the problem by doing the filtering separately, as a first step, > and using the low-level ft_preprocbandstopfilter function. > Anyway I needed access to the data in an unstructured format (i.e. just a > matrix, easy to manipulate), so in the end this low-level function fitted > my needs better. > > All the best, > > Florian > > On 26 Oct, 2016, at 9:27 PM, Maximilien Chaumon < > maximilien.chaumon at gmail.com> wrote: > > Thank you Diego for your quick reply. > Whether or not I include those filter parameters explicitly does not > change anything. > This is what i have now: > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.bpfilter = 'yes'; > cfg.artfctdef.eog.bpfilttype = 'but'; > cfg.artfctdef.eog.bpfreq = [1 15]; > cfg.artfctdef.eog.bpfiltord = 4; > > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > cfg.artfctdef.eog.cutoff = 2.5; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > > but the resulting interactive window looks like this: > > > Seems like the preprocessing step isn't applied... any clue why that is? > > > Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla < > dlozanosoldevilla at gmail.com> a écrit : > >> Dear Maximilien, >> >> You should specify the filter parameters in the cfg: >> >> cfg.artfctdef.eog.bpfilter = 'yes' >> cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details >> cfg.artfctdef.eog.bpfreq = [1 15] >> cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see >> >> >> Take a look to the fft_artifact_eog.m documentation. To know more about >> filtering you might want to take a look here: >> http://www.fieldtriptoolbox.org/example/determine_the_ >> filter_characteristics >> >> Best, >> >> Diego >> >> On 26 October 2016 at 10:42, Maximilien Chaumon < >> maximilien.chaumon at gmail.com> wrote: >> >> Dear all, >> when attempting to detect blinks automatically on a continuous recording >> without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: >> >> cfg = []; >> cfg.dataset = fullfile(rootdir,f{iD}); >> cfg.layout = 'neuromag306mag.lay'; >> cfg.trialdef.eventtype = 'STI101'; >> cfg.trialdef.eventvalue = {255}; >> cfg = ft_definetrial(cfg); >> >> cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; >> cfg.channel = 'megmag'; >> cfg.continuous = 'yes'; >> data = ft_preprocessing(cfg); >> >> >> cfg.artfctdef.eog = []; >> cfg.artfctdef.eog.channel = eogchans; >> cfg.artfctdef.eog.trlpadding = 0; >> cfg.artfctdef.eog.interactive = 'yes'; >> >> [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); >> >> This opens an interactive window in which the EOG signal is not >> BPfiltered, and contains in particular slow drifts that make the threshold >> detection pretty inefficient. I'm surprised because cfg.artfctdef is >> supposed to bpfilter 1-15Hz the data, isn't it? >> >> Is this normal? >> Thanks, >> Max >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Wed Oct 26 19:35:03 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Wed, 26 Oct 2016 13:35:03 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe wrote: > I would definitely recommend running some simulations. > > It might be simpler to use bootstrap samples rather than permutations to > generate your null distribution. Bootstrapping in also asymptotically > accurate. > -David > > > > On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: > >> Thanks, that was super interesting! Was not aware of those. >> >> Have been meditating this afternoon on this and related Anderson papers. >> What's interesting is that he appears to think my suggestion below *would* >> be asymptotically acceptable -- *if* one specifically permutes the >> dependent variable (power/ERP observation) rather than permuting each >> column of the independent variables separately (i.e., if one preserves any >> correlational structure that exists between the independent variables). >> That's the Manly (1997) method, and it appears that the only reason it >> breaks down sometimes is if there's an outlier in the independent variable. >> This could presumably be a problem in the ecological sciences, for which >> he's writing, where one can't control things like temperature in a season >> or numbers of eels that swim past a given sensor. In cognitive >> neuroscience, where the predictor/independent variables are usually dummy >> coded properties of the trial, this seems like we might be on firmer >> ground. >> >> Opinion based on reading and reasoning, of course, and not to be trusted >> until and unless I or someone else were to back it up by doing some >> simulated-data experiments... >> >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> wrote: >> >>> Hi Elisabeth and Alik, >>> Permutation methods applied to multiple regression models are not >>> generally guaranteed to be accurate because testing individual terms in >>> such models (e.g., partial correlation coefficients) requires accurate >>> knowledge of other terms in the model (e.g., the slope coefficients for all >>> the other predictors in the multiple regression). Because such parameters >>> have to be estimated from the data, permutation tests are only >>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>> each factor), where permutation methods do guarantee accuracy. >>> In lieu of permutation testing, you might want to try using one of >>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>> permutation testing for detecting a very broadly distributed effect (e.g., >>> a P300-like effect) and it was far more sensitive than cluster-based >>> testing for an effect with a very limited distribution (e.g., an N170-like >>> effect). FDR correction is also very computationally efficient. >>> hope this is helpful, >>> -David >>> >>> >>> Refs: >>> Anderson, M. J. (2001). Permutation tests for univariate or multivariate >>> analysis of variance and regression. *Canadian journal of fisheries and >>> aquatic sciences*, *58*(3), 626-639. >>> >>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>> >>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>> analysis of event‐related brain potentials/fields II: Simulation studies. >>> *Psychophysiology*, *48*(12), 1726-1737. >>> >>> >>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >>> elisabethsusanne.may at gmail.com> wrote: >>> >>>> Dear Eric and Alik, >>>> >>>> thanks a lot for your helpful responses! >>>> >>>> I will have a close look at the faqs, Eric, and test the approaches you >>>> outlined. I am curious, anyway, as to how different results will be for >>>> simple regressions compared to the multilevel results of the linear-mixed >>>> models. >>>> >>>> Like Alik, I am also curious about other people's opinions on the >>>> general question if there are theoretical reasons against a combination of >>>> the approaches like Alik suggested. We also thought about this approach but >>>> haven't fully tested it yet because of the very long calculation times. >>>> >>>> Thanks again and have a nice weekend! >>>> Elisabeth >>>> >>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>> >>>>> Eric, I don't think I understand why you would say "I do not see how >>>>> these models could be combined with permutation-based inference; they are >>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>> a regression, and the beta coefficient for the independent-variable of >>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>> much does the independent variable explain the brain activity?" In that >>>>> framework, it seems to me that one could do the following: >>>>> >>>>> for n=1:1000 >>>>> 1) Permute the condition labels (within subjects) of the individual >>>>> trials >>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>> and corresponding t-map >>>>> 3) Threshold and construct cluster mass statistic as usual >>>>> end >>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>> cluster p-value >>>>> >>>>> >>>>> Now, the main thing that has come up when we've tried to do this is >>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>> over time and space, one could use the output of one GLM as the seed to the >>>>> next, which would speed up convergence.) So it still does not seem like a >>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>> it wouldn't work? >>>>> >>>>> >>>>> Alik Widge, MD, PhD >>>>> Director, Translational NeuroEngineering Laboratory >>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>> awidge at partners.org >>>>> http://scholar.harvard.edu/awidge/ >>>>> 617-643-2580 >>>>> >>>>> Alik Widge >>>>> alik.widge at gmail.com >>>>> (206) 866-5435 >>>>> >>>>> >>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>> e.maris at donders.ru.nl> wrote: >>>>> >>>>>> Note: this is the second time I post this reply, and the reason is >>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>> (shame on me…(-;) >>>>>> >>>>>> *From: *Elisabeth May >>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>> tests on linear mixed models* >>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>> *To: * >>>>>> *Reply-To: *FieldTrip discussion list >>>>>> >>>>>> >>>>>> Dear FieldTripers, >>>>>> >>>>>> I have a question about the potential use of cluster-based >>>>>> permutation tests for results obtained using linear mixed models. >>>>>> >>>>>> We are working with data from a 10 min EEG experiment on source level >>>>>> with the aim to quantify the relationship of brain activity in different >>>>>> frequency bands with continous perceptual ratings across 20 subjects in >>>>>> different experimental conditions. Thus, we have 10 min time courses of >>>>>> brain activity and ratings for each voxel for different conditions and want >>>>>> to test a) if there are significant relationships in the single conditions >>>>>> and b) if these relationships differ between two conditions. To this end, I >>>>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>>>> the single condition relationships and the condition contrasts, they result >>>>>> in a single t-value (and a corresponding p-value), which is based on >>>>>> information on both the single subject and the group level (i.e. we perform >>>>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>>>> of t-values and are wondering if there is a way to apply cluster-based >>>>>> tests to correct for multiple comparisons. >>>>>> >>>>>> The main problem I see is that I only have one multilevel t-value for >>>>>> the effect across all subjects, i.e. I don't have single subjects values, >>>>>> which I could then e.g. randomize between conditions as normally done in >>>>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>>>> single subject values but would then loose the advantage of the multi-level >>>>>> analysis.) >>>>>> >>>>>> I found an old thread in the mailinglist archive where it was >>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>> /005375.html). I understand that, in our case, I would do this >>>>>> randomly for all voxels in each randomization and then build spatial >>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>> significant relations in my single conditions (a) or no significant >>>>>> relationship differences in my condition contrasts (b). >>>>>> >>>>>> For the condition contrasts, I would be able to permute the condition >>>>>> labels as normally done in cluster-based permutation tests,I think, but >>>>>> would then have to recalculate the linear mixed models for all voxels in >>>>>> every permutation. This would result in a very high computational load. >>>>>> >>>>>> Does anyone have any experience with this kind of analysis? Would the >>>>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>>>> keep in mind in particular)? Can you think of other ways to combine linear >>>>>> mixed models with a multiple comparison correction on the cluster level? >>>>>> >>>>>> >>>>>> Hi Elisabeth, >>>>>> >>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>> respect to the different ways in which they can be used to deal with >>>>>> correlated observations (typically, time series). However, from a >>>>>> theoretical point of view, I do not see how these models could be combined >>>>>> with permutation-based inference; they are just different statistical >>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>> different conditions and wan to test a) if there are significant >>>>>> relationships in the single conditions and b) if these relationships differ >>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>> regression coefficients in each of the two conditions. Answering question >>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>> difference between them using a cluster-based permutation test using the >>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>> on the general approach for testing interactions using cluster-based >>>>>> permutation tests. >>>>>> >>>>>> Have a look here: >>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>> behavioural_variables >>>>>> and >>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>> >>>>>> These tutorials provide all the necessary concepts, although they do >>>>>> not answer your question in a recipe-like fashion. >>>>>> >>>>>> best, >>>>>> Eric Maris >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.opie at adelaide.edu.au Wed Oct 26 22:39:38 2016 From: george.opie at adelaide.edu.au (George McKenzie Opie) Date: Wed, 26 Oct 2016 20:39:38 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency Message-ID: Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Oct 26 22:50:40 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 26 Oct 2016 22:50:40 +0200 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency In-Reply-To: References: Message-ID: Dear George, You have a typo in the cfg at cfg.frequency. Hope this helps, Julian Am Mittwoch, 26. Oktober 2016 schrieb George McKenzie Opie : > Hi all, > > > Im trying to run some between-subject cluster-based analyses on some > time-frequency data, but am having some issues getting the analysis to > average over a specified frequency range. For some reason this only happens > with between-subject comparisons and not within-subject. My cfg structure > is shown below. D1 and D2 are grandaverage data from two groups calculated > using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it > averages over all frequencies (5 - 45 Hz), instead of the specified > frequency range (31 - 45 Hz). Any help would be very much appreciated. > > > cfg = []; > cfg.channel = {'all'}; > cfg.minnbchan = 2; > cfg.clusteralpha = 0.01; > cfg.clusterstatistic = 'maxsum'; > cfg.alpha = 0.05; > cfg.latency = [0.025, 0.220]; > cfg.avgoverfreq = 'yes'; > cfg.frequnecy = [31 45]; > cfg.avgovertime = 'yes'; > cfg.avgoverchan = 'no'; > cfg.statistic = 'indepsamplesT'; > cfg.numrandomization = 2000; > cfg.correctm = 'cluster'; > cfg.method = 'montecarlo'; > cfg.tail = 0; > cfg.clustertail = 0; > cfg.neighbours = neighbours; > cfg.parameter = 'powspctrm'; > > design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); > design(1,1:size(D1.powspctrm,1)) = 1; > design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + > size(D2.powspctrm,1)))= 2; > > cfg.design = design; > cfg.ivar = 1; > > [stat] = ft_freqstatistics(cfg, D1, D2); > > > kind regards, > > > George Opie > > ARC Research Associate > Discipline of Physiology > School of Medicine > The University of Adelaide, AUSTRALIA 5005 > Ph : +61 8 8313 4157 > Fax : +61 8 8303 5384 > e-mail: george.opie at adelaide.edu.au > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.opie at adelaide.edu.au Wed Oct 26 22:51:57 2016 From: george.opie at adelaide.edu.au (George McKenzie Opie) Date: Wed, 26 Oct 2016 20:51:57 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency In-Reply-To: References: , Message-ID: Wow, cant believe I missed that! Thanks Julian, much appreciated. George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Julian Keil Sent: Thursday, 27 October 2016 7:20:40 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] between-subject cluster-stats wont average over specified frequency Dear George, You have a typo in the cfg at cfg.frequency. Hope this helps, Julian Am Mittwoch, 26. Oktober 2016 schrieb George McKenzie Opie : Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Wed Oct 26 23:36:32 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Wed, 26 Oct 2016 21:36:32 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency Message-ID: Hi George, There's a typo in cfg.frequency (in the script it reads cfg.frequnecy). This could explain the behaviour. Peter On 27 Oct 2016 07:58, George McKenzie Opie wrote: Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 27 13:57:07 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 27 Oct 2016 11:57:07 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Fri Oct 28 00:48:22 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 27 Oct 2016 22:48:22 +0000 Subject: [FieldTrip] shifting data time Message-ID: Hi: I need a way to “stitch” together a single subject’s data recorded over many hours which were saved in 14 separate files. When stitched together, file 1 end time is the start time of file 2, file 2 end time is the start of file 3, and so on. Unfortunately the recorded files all start at time t = 0 so ft_appenddata() put them into 14 separate trials. I need to shift the time for each file so they will be jointed into a single trial. I didn’t find any ft_ function to do this. Any suggestions? thanks, Mona ************************************************ Mona Wong Web & iPad Application Developer San Diego Supercomputer Center You are the light you wish to see. ************************************************ From anne.hauswald at me.com Fri Oct 28 10:36:31 2016 From: anne.hauswald at me.com (anne Hauswald) Date: Fri, 28 Oct 2016 10:36:31 +0200 Subject: [FieldTrip] shifting data time In-Reply-To: References: Message-ID: Hi Mona, if you do cfg=[]; all=ft_appenddata(cfg, data1, data2, data3, data4); you get among the other fields all= time: {1x4 cell} %assuming each dataset equals one trial, which is what you want to replace. you could try to create a matrix, based on your sampling rate with all the continuous time points, here just for illustration: all_timepoints=[0:0.025:9.975] %adapt to your sampling rate and length of data, be very sure the end of one file is the beginning of the next one. (This is giving you all points from 0 to 9.975 with steps of 0.025) trl_timepoints=mat2cell(all_timepoints, 1, [100 100 100 100]) %here I create 4 cell arrays, corresponding e.g. to 4 trials will result in trl_timepoints = [1x100 double] [1x100 double] [1x100 double] [1x100 double] with continuous time information (trial 1 starts at 0, trial 2 at 2.5, trials 3 at 5, and trial 4 at 7.5) of the same length. this you can then use to replace the original time information: all_data.time_old=all_data.time %if you want to keep the original time information all_data.time=trl_timepoints In general: are you really sure that you need the continuous time information? There are many processing and analyses steps that can be done on the appended time information… There might be more elegant ways to do this. Hope there is no typo and that it helps Best Anne > Am 28.10.2016 um 00:48 schrieb Wong-Barnum, Mona : > > > Hi: > > I need a way to “stitch” together a single subject’s data recorded over many hours which were saved in 14 separate files. When stitched together, file 1 end time is the start time of file 2, file 2 end time is the start of file 3, and so on. Unfortunately the recorded files all start at time t = 0 so ft_appenddata() put them into 14 separate trials. I need to shift the time for each file so they will be jointed into a single trial. I didn’t find any ft_ function to do this. Any suggestions? > > thanks, > Mona > > ************************************************ > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > You are the light you wish to see. > ************************************************ > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayelet.landau at gmail.com Fri Oct 28 10:30:27 2016 From: ayelet.landau at gmail.com (Ayelet Landau) Date: Fri, 28 Oct 2016 11:30:27 +0300 Subject: [FieldTrip] Postdoc/PhD positions - Cognitive Neuroscience @ the Hebrew University of Jerusalem, Israel Message-ID: *Post Doc and PhD positions at the Brain Attention and Time Lab, at the Hebrew University of Jerusalem, Israel* Full-time post doc and PhD positions are available in the Brain Attention and Time Lab of Dr. Ayelet N. Landau at the Hebrew University of Jerusalem. Initial appointment will be for one year with the option to renew annually up to 4 years. Preferred starting date: January 2017 The lab’s core research areas include the guidance of attention and temporal processing and their underlying neural mechanisms. As cognitive neuroscientists we try to construe models of cognition and examine them using both in perception and in physiology. The positions are part of two externally funded projects focused on: (1) Fluctuations in attention and rhythmic attentional sampling. (2) Neural mechanisms of interval timing. Both research programs examine the role of brain rhythms in cognition. In the lab, we measure perception in different modalities (tactile, visual and auditory) together with non-invasive physiology (MEG/EEG) and eye-tracking. You can read about the research and the lab here. We are seeking a highly qualified post doc with a doctorate in a relevant field (e.g., Psychology, Neuroscience, and Cognitive Science) and shared interests in the core research areas described above. The researcher, ideally, should have extensive experience with EEG/MEG methodology and neural oscillations measurement. Experience with other techniques - such as fMRI, computational modeling, etc. - is also welcome but not required. In addition, we are looking for strong candidates for a funded PhD studentship. The Hebrew University offers several training opportunities in different departments. The successful candidate will be competitive for one of the flagship programs (psychology, cognitive science or neuroscience) and will have demonstrated experience in research from their post-bac or BA education (as research assistants or honors students). Knowledge of programming is an advantage. For both positions, a passion and a commitment to science, strong social skills, trouble shooting skills and fast learning abilities are a requirement. Interested candidates should send a CV, a brief statement of research interests, and the names and contact details of two academic references to ayelet.landau at huji.ac.il preferably by December 1st. Applications will be considered until the positions are filled. I look forward to hearing from you! -- Ayelet N. Landau, PhD *Senior Lecturer* *Department of Psychology & Department of Cognitive SciencesThe Hebrew University of JerusalemJerusalem 91905Israel* -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Oct 28 14:36:39 2016 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 28 Oct 2016 08:36:39 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> References: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Message-ID: So, two further questions. 1) Anyone reading this thread have some code for a reasonable ERP generator, especially one that models different ERPs per subject? I'm getting increasingly interested in doing some simulations to test my claims. (I'm thinking to do the 1d case just because it's faster to run. ) However, I'd like to do that on stimulated data that properly models, E.g., inter-subject variability of the precise timing of major peaks. 2) Eric, why are you describing the below as a fixed effects model? If we do a mixed model (with subject as a random intercept) at each time/frequency/sensor point, that seems like it handles the random effect that most people care about. Are you saying that you think each predictor variable would also need to be modeled as a per-subject slope? I guess I'm also thinking here that (to your second point), if the resulting values are used for thresholding to create cluster statistics for inference, inflation in the t/p values should be controlled for because the null distribution created during the permutation will have the same inflation. However, I don't believe I have a formal mathematical backup for that intuition, hence (1) above. On Oct 27, 2016 7:58 AM, "Maris, E.G.G. (Eric)" wrote: > Dear colleagues, > > @alik : > 1. The approach you propose is a so-called fixed-effects approach, of > which the outcome may depend on just a few subjects (provided the number of > trials is high). Some neuroscientists consider a fixed-effects approach > insufficient to support a scientific claim. E.g., the whole neuroimaging > community does so. > 2. Your approach is actually a genuine permutation test, in which the > LLM-derived t-stats are only used for thresholding (and not for inference). > > @david : > 1. There is nothing wrong with using FDR correction, if you think the > false discovery rate is the quantity that one should control. Others may > disagree though, stating the more strict family-wise error rate is the > relevant quantity. > 2. FDR correction assumes that the sample-specific (sample = a > channel-time-frequency triplet) p-values are unbiased. Because the > unbiasedness of these p-values depends on auxiliary assumptions, there may > be good reasons not to trust them. This is supported by the recent Ekstrom > et al paper on the inflated type 1 error rate in neuroimaging studies. > > best, > Eric Maris > > > > > > > > *From: *David Groppe > *Subject: **Re: [FieldTrip] Question about cluster-based permutation > tests on linear mixed models* > *Date: *26 October 2016 at 19:35:03 GMT+2 > *To: *FieldTrip discussion list , < > alik.widge at gmail.com> > *Reply-To: *FieldTrip discussion list > > > P.S. If you want to explore using FDR control to correct for multiple > comparisons, I would not recommend limiting yourself to FieldTrip's FDR > correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR > control procedure, which is guaranteed to control the FDR at or below the > desired level, but tends to be quite overly conservative in practice. The > more popular FDR control algorithm by Benjamini & Hochberg is not always > guaranteed to control the FDR at or below the desired level, but it is > much less conservative and tends to accurately control FDR in practice. > Here is some code for the > Benjamini & Hochberg algorithm: > > https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh > > MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also > implements the > Benjamini & Hochberg algorithm. > > > > On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: > >> I would definitely recommend running some simulations. >> >> It might be simpler to use bootstrap samples rather than permutations to >> generate your null distribution. Bootstrapping in also asymptotically >> accurate. >> -David >> >> >> >> On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: >> >>> Thanks, that was super interesting! Was not aware of those. >>> >>> Have been meditating this afternoon on this and related Anderson papers. >>> What's interesting is that he appears to think my suggestion below *would* >>> be asymptotically acceptable -- *if* one specifically permutes the >>> dependent variable (power/ERP observation) rather than permuting each >>> column of the independent variables separately (i.e., if one preserves any >>> correlational structure that exists between the independent variables). >>> That's the Manly (1997) method, and it appears that the only reason it >>> breaks down sometimes is if there's an outlier in the independent variable. >>> This could presumably be a problem in the ecological sciences, for which >>> he's writing, where one can't control things like temperature in a season >>> or numbers of eels that swim past a given sensor. In cognitive >>> neuroscience, where the predictor/independent variables are usually dummy >>> coded properties of the trial, this seems like we might be on firmer ground. >>> >>> >>> Opinion based on reading and reasoning, of course, and not to be trusted >>> until and unless I or someone else were to back it up by doing some >>> simulated-data experiments... >>> >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> > wrote: >>> >>>> Hi Elisabeth and Alik, >>>> Permutation methods applied to multiple regression models are not >>>> generally guaranteed to be accurate because testing individual terms in >>>> such models (e.g., partial correlation coefficients) requires accurate >>>> knowledge of other terms in the model (e.g., the slope coefficients for all >>>> the other predictors in the multiple regression). Because such parameters >>>> have to be estimated from the data, permutation tests are only >>>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>>> each factor), where permutation methods do guarantee accuracy. >>>> In lieu of permutation testing, you might want to try using one of >>>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>>> permutation testing for detecting a very broadly distributed effect (e.g., >>>> a P300-like effect) and it was far more sensitive than cluster-based >>>> testing for an effect with a very limited distribution (e.g., an N170-like >>>> effect). FDR correction is also very computationally efficient. >>>> hope this is helpful, >>>> -David >>>> >>>> >>>> Refs: >>>> Anderson, M. J. (2001). Permutation tests for univariate or >>>> multivariate analysis of variance and regression. *Canadian journal of >>>> fisheries and aquatic sciences*, *58*(3), 626-639. >>>> >>>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>>> >>>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>>> analysis of event‐related brain potentials/fields II: Simulation studies. >>>> *Psychophysiology*, *48*(12), 1726-1737. >>>> >>>> >>>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May >>> gmail.com> wrote: >>>> >>>>> Dear Eric and Alik, >>>>> >>>>> thanks a lot for your helpful responses! >>>>> >>>>> I will have a close look at the faqs, Eric, and test the approaches >>>>> you outlined. I am curious, anyway, as to how different results will be for >>>>> simple regressions compared to the multilevel results of the linear-mixed >>>>> models. >>>>> >>>>> Like Alik, I am also curious about other people's opinions on the >>>>> general question if there are theoretical reasons against a combination of >>>>> the approaches like Alik suggested. We also thought about this approach but >>>>> haven't fully tested it yet because of the very long calculation times. >>>>> >>>>> Thanks again and have a nice weekend! >>>>> Elisabeth >>>>> >>>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>>> >>>>>> Eric, I don't think I understand why you would say "I do not see how >>>>>> these models could be combined with permutation-based inference; they are >>>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>>> a regression, and the beta coefficient for the independent-variable of >>>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>>> much does the independent variable explain the brain activity?" In that >>>>>> framework, it seems to me that one could do the following: >>>>>> >>>>>> for n=1:1000 >>>>>> 1) Permute the condition labels (within subjects) of the >>>>>> individual trials >>>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>>> and corresponding t-map >>>>>> 3) Threshold and construct cluster mass statistic as usual >>>>>> end >>>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>>> cluster p-value >>>>>> >>>>>> >>>>>> Now, the main thing that has come up when we've tried to do this is >>>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>>> over time and space, one could use the output of one GLM as the seed to the >>>>>> next, which would speed up convergence.) So it still does not seem like a >>>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>>> it wouldn't work? >>>>>> >>>>>> >>>>>> Alik Widge, MD, PhD >>>>>> Director, Translational NeuroEngineering Laboratory >>>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>>> awidge at partners.org >>>>>> http://scholar.harvard.edu/awidge/ >>>>>> 617-643-2580 >>>>>> >>>>>> Alik Widge >>>>>> alik.widge at gmail.com >>>>>> (206) 866-5435 >>>>>> >>>>>> >>>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>>> e.maris at donders.ru.nl> wrote: >>>>>> >>>>>>> Note: this is the second time I post this reply, and the reason is >>>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>>> (shame on me…(-;) >>>>>>> >>>>>>> *From: *Elisabeth May >>>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>>> tests on linear mixed models* >>>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>>> *To: * >>>>>>> *Reply-To: *FieldTrip discussion list >>>>>>> >>>>>>> >>>>>>> Dear FieldTripers, >>>>>>> >>>>>>> I have a question about the potential use of cluster-based >>>>>>> permutation tests for results obtained using linear mixed models. >>>>>>> >>>>>>> We are working with data from a 10 min EEG experiment on source >>>>>>> level with the aim to quantify the relationship of brain activity in >>>>>>> different frequency bands with continous perceptual ratings across 20 >>>>>>> subjects in different experimental conditions. Thus, we have 10 min time >>>>>>> courses of brain activity and ratings for each voxel for different >>>>>>> conditions and want to test a) if there are significant relationships in >>>>>>> the single conditions and b) if these relationships differ between two >>>>>>> conditions. To this end, I have calculated linear mixed models in R using >>>>>>> the lme4 toolbox. For both the single condition relationships and the >>>>>>> condition contrasts, they result in a single t-value (and a corresponding >>>>>>> p-value), which is based on information on both the single subject and the >>>>>>> group level (i.e. we perform a multi-level analysis). However, with more >>>>>>> than 2000 voxels, we have a lot of t-values and are wondering if there is a >>>>>>> way to apply cluster-based tests to correct for multiple comparisons. >>>>>>> >>>>>>> The main problem I see is that I only have one multilevel t-value >>>>>>> for the effect across all subjects, i.e. I don't have single subjects >>>>>>> values, which I could then e.g. randomize between conditions as normally >>>>>>> done in cluster-based permutation tests. (Or rather, I would be able to >>>>>>> extract single subject values but would then loose the advantage of the >>>>>>> multi-level analysis.) >>>>>>> >>>>>>> I found an old thread in the mailinglist archive where it was >>>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>>> /005375.html). I understand that, in our case, I would do this >>>>>>> randomly for all voxels in each randomization and then build spatial >>>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>>> significant relations in my single conditions (a) or no significant >>>>>>> relationship differences in my condition contrasts (b). >>>>>>> >>>>>>> For the condition contrasts, I would be able to permute the >>>>>>> condition labels as normally done in cluster-based permutation tests,I >>>>>>> think, but would then have to recalculate the linear mixed models for all >>>>>>> voxels in every permutation. This would result in a very high computational >>>>>>> load. >>>>>>> >>>>>>> Does anyone have any experience with this kind of analysis? Would >>>>>>> the flipping of t-values be a valid approach (and if yes, is there anything >>>>>>> to keep in mind in particular)? Can you think of other ways to combine >>>>>>> linear mixed models with a multiple comparison correction on the cluster >>>>>>> level? >>>>>>> >>>>>>> >>>>>>> Hi Elisabeth, >>>>>>> >>>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>>> respect to the different ways in which they can be used to deal with >>>>>>> correlated observations (typically, time series). However, from a >>>>>>> theoretical point of view, I do not see how these models could be combined >>>>>>> with permutation-based inference; they are just different statistical >>>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>>> different conditions and wan to test a) if there are significant >>>>>>> relationships in the single conditions and b) if these relationships differ >>>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>>> regression coefficients in each of the two conditions. Answering question >>>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>>> difference between them using a cluster-based permutation test using the >>>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>>> on the general approach for testing interactions using cluster-based >>>>>>> permutation tests. >>>>>>> >>>>>>> Have a look here: >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>>> behavioural_variables >>>>>>> and >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>>> >>>>>>> These tutorials provide all the necessary concepts, although they do >>>>>>> not answer your question in a recipe-like fashion. >>>>>>> >>>>>>> best, >>>>>>> Eric Maris >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From K.Muller at psych.ru.nl Fri Oct 28 15:06:59 2016 From: K.Muller at psych.ru.nl (=?iso-8859-1?B?TfxsbGVyLCBLLiAoS2F0amEp?=) Date: Fri, 28 Oct 2016 13:06:59 +0000 Subject: [FieldTrip] MNE single trial time courses Message-ID: Dear list, What is the current way to go (if there is one) to obtain *single trial* source time courses from source reconstructions from Minimum Norm Estimate? Is there a tutorial? I used the MNE tutorial as a basis, i.e. I have a FreeSurfer based source model. In old mailing list messages there is some information about options like .rawtrial='yes' or .singletrial='yes', but some of them are very old and I am unable to extract which way to go at the moment. E.g. .singletrial is deprecated. Best regards, Katja From mehdy.dousty at gmail.com Fri Oct 28 18:49:03 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Fri, 28 Oct 2016 16:49:03 +0000 Subject: [FieldTrip] Covaraince matrix for MEG resting state Message-ID: Hi all I am using the resting state MEG signal for constructing the inverse problem by eLoreta, and as it is resting state, the covariance matrix needs to be used, so I am going to use HCP R-noise to construct the covariance matrix, but there are two main issues which I need your help. 1- as I am going to use preprocess data for resting state, do I need process the noise as well? if it is so, I can't find the time series of the noise in the raw data after using ft_read_header. 2- do I need to redefine the time series which add the noise time series at the beginning of the signal and then add the resting state time series so I can use the below code for computing the covariance? cfg= [] cfg.covariance = 'yes'; % I dont know how to enter the noise covariance to the data cfg.covariancewindow = [-inf 0]; timelockanalysis = ft_timelockanalysis(cfg, inputdata); I look forward to hearing from you. *Mehdy Dousty* *Hotchkiss Brain Institute* *University of Calgary* *HSC Building, Room 2932B* *3330 Hospital Drive NW* *Calgary, AB T2N 4N1* *Email Mehdy.Dousty at Ucalgary.ca* -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Sat Oct 29 20:20:05 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Sat, 29 Oct 2016 14:20:05 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> References: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Message-ID: @Eric 1. Note the FDR control actually provides "weak" control of the family-wise error rate (FWER). This is exactly the same degree of FWER control provided by cluster-based permutation tests. If you want strong control of FWER you will need to do something like Bonferroni-Holm or max-statistic (i.e., non-cluster) based permutation tests. 2. It's true that FDR assumes that the individual test p-values are accurate. You can derive these p-values though via non-parametric techniques like non-cluster-based permutation tests, thus the underlying statistical assumptions will be the same as if you had done a cluster-based permutation test. Moreover, if you have good reason to make parametric assumptions, FDR will let you exploit them. @Alik 1. I simulated data in that 2011 paper by randomly flipping the polarity of real EEG data to generate 0 mean, realistic ERP noise. The noise was subject-specific, but the simulated ERP effects were exactly the same for all simulated participants. So it couldn't be used to address the question you're after. On Thu, Oct 27, 2016 at 7:57 AM, Maris, E.G.G. (Eric) wrote: > Dear colleagues, > > @alik : > 1. The approach you propose is a so-called fixed-effects approach, of > which the outcome may depend on just a few subjects (provided the number of > trials is high). Some neuroscientists consider a fixed-effects approach > insufficient to support a scientific claim. E.g., the whole neuroimaging > community does so. > 2. Your approach is actually a genuine permutation test, in which the > LLM-derived t-stats are only used for thresholding (and not for inference). > > @david : > 1. There is nothing wrong with using FDR correction, if you think the > false discovery rate is the quantity that one should control. Others may > disagree though, stating the more strict family-wise error rate is the > relevant quantity. > 2. FDR correction assumes that the sample-specific (sample = a > channel-time-frequency triplet) p-values are unbiased. Because the > unbiasedness of these p-values depends on auxiliary assumptions, there may > be good reasons not to trust them. This is supported by the recent Ekstrom > et al paper on the inflated type 1 error rate in neuroimaging studies. > > best, > Eric Maris > > > > > > > > *From: *David Groppe > *Subject: **Re: [FieldTrip] Question about cluster-based permutation > tests on linear mixed models* > *Date: *26 October 2016 at 19:35:03 GMT+2 > *To: *FieldTrip discussion list , < > alik.widge at gmail.com> > *Reply-To: *FieldTrip discussion list > > > P.S. If you want to explore using FDR control to correct for multiple > comparisons, I would not recommend limiting yourself to FieldTrip's FDR > correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR > control procedure, which is guaranteed to control the FDR at or below the > desired level, but tends to be quite overly conservative in practice. The > more popular FDR control algorithm by Benjamini & Hochberg is not always > guaranteed to control the FDR at or below the desired level, but it is > much less conservative and tends to accurately control FDR in practice. > Here is some code for the > Benjamini & Hochberg algorithm: > > https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh > > MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also > implements the > Benjamini & Hochberg algorithm. > > > > On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: > >> I would definitely recommend running some simulations. >> >> It might be simpler to use bootstrap samples rather than permutations to >> generate your null distribution. Bootstrapping in also asymptotically >> accurate. >> -David >> >> >> >> On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: >> >>> Thanks, that was super interesting! Was not aware of those. >>> >>> Have been meditating this afternoon on this and related Anderson papers. >>> What's interesting is that he appears to think my suggestion below *would* >>> be asymptotically acceptable -- *if* one specifically permutes the >>> dependent variable (power/ERP observation) rather than permuting each >>> column of the independent variables separately (i.e., if one preserves any >>> correlational structure that exists between the independent variables). >>> That's the Manly (1997) method, and it appears that the only reason it >>> breaks down sometimes is if there's an outlier in the independent variable. >>> This could presumably be a problem in the ecological sciences, for which >>> he's writing, where one can't control things like temperature in a season >>> or numbers of eels that swim past a given sensor. In cognitive >>> neuroscience, where the predictor/independent variables are usually dummy >>> coded properties of the trial, this seems like we might be on firmer ground. >>> >>> >>> Opinion based on reading and reasoning, of course, and not to be trusted >>> until and unless I or someone else were to back it up by doing some >>> simulated-data experiments... >>> >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> > wrote: >>> >>>> Hi Elisabeth and Alik, >>>> Permutation methods applied to multiple regression models are not >>>> generally guaranteed to be accurate because testing individual terms in >>>> such models (e.g., partial correlation coefficients) requires accurate >>>> knowledge of other terms in the model (e.g., the slope coefficients for all >>>> the other predictors in the multiple regression). Because such parameters >>>> have to be estimated from the data, permutation tests are only >>>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>>> each factor), where permutation methods do guarantee accuracy. >>>> In lieu of permutation testing, you might want to try using one of >>>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>>> permutation testing for detecting a very broadly distributed effect (e.g., >>>> a P300-like effect) and it was far more sensitive than cluster-based >>>> testing for an effect with a very limited distribution (e.g., an N170-like >>>> effect). FDR correction is also very computationally efficient. >>>> hope this is helpful, >>>> -David >>>> >>>> >>>> Refs: >>>> Anderson, M. J. (2001). Permutation tests for univariate or >>>> multivariate analysis of variance and regression. *Canadian journal of >>>> fisheries and aquatic sciences*, *58*(3), 626-639. >>>> >>>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>>> >>>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>>> analysis of event‐related brain potentials/fields II: Simulation studies. >>>> *Psychophysiology*, *48*(12), 1726-1737. >>>> >>>> >>>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >>>> elisabethsusanne.may at gmail.com> wrote: >>>> >>>>> Dear Eric and Alik, >>>>> >>>>> thanks a lot for your helpful responses! >>>>> >>>>> I will have a close look at the faqs, Eric, and test the approaches >>>>> you outlined. I am curious, anyway, as to how different results will be for >>>>> simple regressions compared to the multilevel results of the linear-mixed >>>>> models. >>>>> >>>>> Like Alik, I am also curious about other people's opinions on the >>>>> general question if there are theoretical reasons against a combination of >>>>> the approaches like Alik suggested. We also thought about this approach but >>>>> haven't fully tested it yet because of the very long calculation times. >>>>> >>>>> Thanks again and have a nice weekend! >>>>> Elisabeth >>>>> >>>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>>> >>>>>> Eric, I don't think I understand why you would say "I do not see how >>>>>> these models could be combined with permutation-based inference; they are >>>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>>> a regression, and the beta coefficient for the independent-variable of >>>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>>> much does the independent variable explain the brain activity?" In that >>>>>> framework, it seems to me that one could do the following: >>>>>> >>>>>> for n=1:1000 >>>>>> 1) Permute the condition labels (within subjects) of the >>>>>> individual trials >>>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>>> and corresponding t-map >>>>>> 3) Threshold and construct cluster mass statistic as usual >>>>>> end >>>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>>> cluster p-value >>>>>> >>>>>> >>>>>> Now, the main thing that has come up when we've tried to do this is >>>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>>> over time and space, one could use the output of one GLM as the seed to the >>>>>> next, which would speed up convergence.) So it still does not seem like a >>>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>>> it wouldn't work? >>>>>> >>>>>> >>>>>> Alik Widge, MD, PhD >>>>>> Director, Translational NeuroEngineering Laboratory >>>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>>> awidge at partners.org >>>>>> http://scholar.harvard.edu/awidge/ >>>>>> 617-643-2580 >>>>>> >>>>>> Alik Widge >>>>>> alik.widge at gmail.com >>>>>> (206) 866-5435 >>>>>> >>>>>> >>>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>>> e.maris at donders.ru.nl> wrote: >>>>>> >>>>>>> Note: this is the second time I post this reply, and the reason is >>>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>>> (shame on me…(-;) >>>>>>> >>>>>>> *From: *Elisabeth May >>>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>>> tests on linear mixed models* >>>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>>> *To: * >>>>>>> *Reply-To: *FieldTrip discussion list >>>>>>> >>>>>>> >>>>>>> Dear FieldTripers, >>>>>>> >>>>>>> I have a question about the potential use of cluster-based >>>>>>> permutation tests for results obtained using linear mixed models. >>>>>>> >>>>>>> We are working with data from a 10 min EEG experiment on source >>>>>>> level with the aim to quantify the relationship of brain activity in >>>>>>> different frequency bands with continous perceptual ratings across 20 >>>>>>> subjects in different experimental conditions. Thus, we have 10 min time >>>>>>> courses of brain activity and ratings for each voxel for different >>>>>>> conditions and want to test a) if there are significant relationships in >>>>>>> the single conditions and b) if these relationships differ between two >>>>>>> conditions. To this end, I have calculated linear mixed models in R using >>>>>>> the lme4 toolbox. For both the single condition relationships and the >>>>>>> condition contrasts, they result in a single t-value (and a corresponding >>>>>>> p-value), which is based on information on both the single subject and the >>>>>>> group level (i.e. we perform a multi-level analysis). However, with more >>>>>>> than 2000 voxels, we have a lot of t-values and are wondering if there is a >>>>>>> way to apply cluster-based tests to correct for multiple comparisons. >>>>>>> >>>>>>> The main problem I see is that I only have one multilevel t-value >>>>>>> for the effect across all subjects, i.e. I don't have single subjects >>>>>>> values, which I could then e.g. randomize between conditions as normally >>>>>>> done in cluster-based permutation tests. (Or rather, I would be able to >>>>>>> extract single subject values but would then loose the advantage of the >>>>>>> multi-level analysis.) >>>>>>> >>>>>>> I found an old thread in the mailinglist archive where it was >>>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>>> /005375.html). I understand that, in our case, I would do this >>>>>>> randomly for all voxels in each randomization and then build spatial >>>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>>> significant relations in my single conditions (a) or no significant >>>>>>> relationship differences in my condition contrasts (b). >>>>>>> >>>>>>> For the condition contrasts, I would be able to permute the >>>>>>> condition labels as normally done in cluster-based permutation tests,I >>>>>>> think, but would then have to recalculate the linear mixed models for all >>>>>>> voxels in every permutation. This would result in a very high computational >>>>>>> load. >>>>>>> >>>>>>> Does anyone have any experience with this kind of analysis? Would >>>>>>> the flipping of t-values be a valid approach (and if yes, is there anything >>>>>>> to keep in mind in particular)? Can you think of other ways to combine >>>>>>> linear mixed models with a multiple comparison correction on the cluster >>>>>>> level? >>>>>>> >>>>>>> >>>>>>> Hi Elisabeth, >>>>>>> >>>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>>> respect to the different ways in which they can be used to deal with >>>>>>> correlated observations (typically, time series). However, from a >>>>>>> theoretical point of view, I do not see how these models could be combined >>>>>>> with permutation-based inference; they are just different statistical >>>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>>> different conditions and wan to test a) if there are significant >>>>>>> relationships in the single conditions and b) if these relationships differ >>>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>>> regression coefficients in each of the two conditions. Answering question >>>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>>> difference between them using a cluster-based permutation test using the >>>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>>> on the general approach for testing interactions using cluster-based >>>>>>> permutation tests. >>>>>>> >>>>>>> Have a look here: >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>>> behavioural_variables >>>>>>> and >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>>> >>>>>>> These tutorials provide all the necessary concepts, although they do >>>>>>> not answer your question in a recipe-like fashion. >>>>>>> >>>>>>> best, >>>>>>> Eric Maris >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Mon Oct 31 07:34:03 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Mon, 31 Oct 2016 06:34:03 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <3089E043-217F-49DC-A4D7-F33E00969FDE@donders.ru.nl> Hi Alik, So, two further questions. 1) Anyone reading this thread have some code for a reasonable ERP generator, especially one that models different ERPs per subject? I'm getting increasingly interested in doing some simulations to test my claims. (I'm thinking to do the 1d case just because it's faster to run. ) However, I'd like to do that on stimulated data that properly models, E.g., inter-subject variability of the precise timing of major peaks. 2) Eric, why are you describing the below as a fixed effects model? If we do a mixed model (with subject as a random intercept) at each time/frequency/sensor point, that seems like it handles the random effect that most people care about. Are you saying that you think each predictor variable would also need to be modeled as a per-subject slope? If you are permuting trials across conditions within every subject, this corresponds to the null hypothesis that WITHIN EVERY SUBJECT, there is no association between biological data and the condition labels. This is the permutation-version of a fixed-effects test. Keep in mind that you use your LMM t-stats only for thresholding and not for inference. I’m aware that this may be confusing at first sight. Actually, the topic (fixed versus random effects tests in the permutation framework) have not been described in a paper yet. I’m thinking about writing one, though... I guess I'm also thinking here that (to your second point), if the resulting values are used for thresholding to create cluster statistics for inference, inflation in the t/p values should be controlled for because the null distribution created during the permutation will have the same inflation. However, I don't believe I have a formal mathematical backup for that intuition, hence (1) above. The formal proof of the unbiasedness of the permutation test is in Maris & Oostenveld (2007), section "4.3.3. The permutation test controls the false alarm rate unconditionally”. I’m aware that very few readers go through this section, but it is one of the 2 reasons for the popularity of the method. The other reason is its sensitivity, which is the result of clustering. best, Eric On Oct 27, 2016 7:58 AM, "Maris, E.G.G. (Eric)" > wrote: Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From: Müller, K. (Katja) > Subject: [FieldTrip] MNE single trial time courses Date: 28 October 2016 at 15:06:59 GMT+2 To: "fieldtrip at science.ru.nl" > Reply-To: FieldTrip discussion list > Dear list, What is the current way to go (if there is one) to obtain *single trial* source time courses from source reconstructions from Minimum Norm Estimate? Is there a tutorial? I used the MNE tutorial as a basis, i.e. I have a FreeSurfer based source model. In old mailing list messages there is some information about options like .rawtrial='yes' or .singletrial='yes', but some of them are very old and I am unable to extract which way to go at the moment. E.g. .singletrial is deprecated. Best regards, Katja From: mehdy dousty > Subject: [FieldTrip] Covaraince matrix for MEG resting state Date: 28 October 2016 at 18:49:03 GMT+2 To: "hcp-users at humanconnectome.org" >, > Reply-To: FieldTrip discussion list > Hi all I am using the resting state MEG signal for constructing the inverse problem by eLoreta, and as it is resting state, the covariance matrix needs to be used, so I am going to use HCP R-noise to construct the covariance matrix, but there are two main issues which I need your help. 1- as I am going to use preprocess data for resting state, do I need process the noise as well? if it is so, I can't find the time series of the noise in the raw data after using ft_read_header. 2- do I need to redefine the time series which add the noise time series at the beginning of the signal and then add the resting state time series so I can use the below code for computing the covariance? cfg= [] cfg.covariance = 'yes'; % I dont know how to enter the noise covariance to the data cfg.covariancewindow = [-inf 0]; timelockanalysis = ft_timelockanalysis(cfg, inputdata); I look forward to hearing from you. Mehdy Dousty Hotchkiss Brain Institute University of Calgary HSC Building, Room 2932B 3330 Hospital Drive NW Calgary, AB T2N 4N1 Email Mehdy.Dousty at Ucalgary.ca _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Mon Oct 31 09:05:02 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Mon, 31 Oct 2016 08:05:02 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <739EDB8F-B6F8-4502-998F-4210697B6B0F@donders.ru.nl> Hi David, @Eric 1. Note the FDR control actually provides "weak" control of the family-wise error rate (FWER). This is exactly the same degree of FWER control provided by cluster-based permutation tests. If you want strong control of FWER you will need to do something like Bonferroni-Holm or max-statistic (i.e., non-cluster) based permutation tests. Do you have a pointer to a statistics paper that proves that controlling the FDR (false discovery rate) implies a control of the family-wise error rate (FWER)? I agree that there is difference between strong an weak FWER control, but that is a different issue than FDR-control versus FWER-control. best, Eric 2. It's true that FDR assumes that the individual test p-values are accurate. You can derive these p-values though via non-parametric techniques like non-cluster-based permutation tests, thus the underlying statistical assumptions will be the same as if you had done a cluster-based permutation test. Moreover, if you have good reason to make parametric assumptions, FDR will let you exploit them. @Alik 1. I simulated data in that 2011 paper by randomly flipping the polarity of real EEG data to generate 0 mean, realistic ERP noise. The noise was subject-specific, but the simulated ERP effects were exactly the same for all simulated participants. So it couldn't be used to address the question you're after. On Thu, Oct 27, 2016 at 7:57 AM, Maris, E.G.G. (Eric) > wrote: Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From justinctanner at gmail.com Mon Oct 31 20:15:15 2016 From: justinctanner at gmail.com (Justin Tanner) Date: Mon, 31 Oct 2016 12:15:15 -0700 Subject: [FieldTrip] ft_freqstatistics in a 2 way ANOVA - design and implementation Message-ID: I have a dataset consisting of 6 stimulation locations and 8 stimulation intensities. I am trying to calculate a 2 way (6 by 8) anova with regards to those two variables. Each input structure consists of freq_loc#{intensity#} output of ft_freqanalysis with just the chosen 10 trials of the respective conditions (so for location1 and intensity 1, chosen trial indices are indicated in cfg.trials). - cfg.keeptrials = 'yes' cfg.design = [loc ; int ; tri] 1 1 ... 1 1 ... 1 1 ... 1 1 ... 2 2 ... 2 2 ... 2 2 ... 2 2 ... 6 6 > ... 6 6 > 1 1 ... 1 1 ... 8 8 ... 8 8 ... 1 1 ... 1 1 ... 8 8 ... 8 8 ... 8 8 > ... 8 8 > 1 2 ... 9 10 ... 1 2 ... 9 10 ... 1 2 ... 9 10 ... 1 2 ... 9 10 ...1 2 ... > 9 10 > *OR* - cfg.keeptrials = 'no' cfg.design = [loc ; int] 1 1 ... 1 1 ... 1 1 ... 1 1 ... 2 2 ... 2 2 ... 2 2 ... 2 2 ... 6 6 > ... 6 6 > 1 1 ... 1 1 ... 8 8 ... 8 8 ... 1 1 ... 1 1 ... 8 8 ... 8 8 ... 8 8 > ... 8 8 For ft_freqstatistics: cfg.method = 'montecarlo'; > cfg.numrandomization = 500; cfg.correctm = 'bonferroni' % Going to do 'cluster' once I define my > distance function for neighbors > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.design=design; > cfg.statistic='indepsamplesF'; > cfg.correcttail = 'prob'; > > % Run with LOCATION as independent variable > cfg.ivar=[1]; > [stat_loc] = ft_freqstatistics(cfg, freq_loc0{:}, freq_loc1{:}, > freq_loc2{:}, freq_loc3{:}, freq_loc4{:}, freq_loc5{:}); % Run with INTENSITY as independent variable > cfg.ivar=[2]; [stat_int] = ft_freqstatistics(cfg, freq_loc0{:}, freq_loc1{:}, > freq_loc2{:}, freq_loc3{:}, freq_loc4{:}, freq_loc5{:}); > I want to ensure I am calling this appropriately. If I run it once with cfg.ivar =1 and again with cfg.ivar = 2, is that calculating the main effect of the cfg.design row's variable? First row is location, so running cfg.ivar=1 is giving me a [num_chan X TFR ] stat.stat/prob/mask for location, correct? I feel that I am missing something that would allow for both comparisons in one call of the ft_freqstatistics function, either in cfg properties or in the cfg.design structuring / ft_freqanalysis output structuring. Any clarification would be greatly appreciated. -- Justin C. Tanner Sensory Motor Research Group Arizona State University (360) 607-7544 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sat Oct 1 18:34:52 2016 From: russgport at gmail.com (russ port) Date: Sat, 1 Oct 2016 12:34:52 -0400 Subject: [FieldTrip] Failure of LCMV beamformer for Neuromag VectorView planar gradiometers Message-ID: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> Dear Fieldtrippers/Fieldtrippians I was hoping someone could help me with an issue I have come across during my analyses of a preliminary study. In brief, for the study a person was scanned on a CTF 275 channel biomagnetometer and then directly after on a 306 channel Elekta Neuromag VectorView platform. During the scans, the subject listened to a 40Hz amplitude modulated 500Hz tone (to generate a 40Hz Auditory Steady-state Response [ASSR]). In order to get the Elekta-derived data into a workable format, the Elekta-derived was MaxFilter’d for SSS (not tsss). After this, to analyze the datasets in an analogous manner, all datasets (both CTF- and Elekta-derived datasets [planar gradiometers and magnetometers analyzed separately]) were artifact cleaned (artifact rejection for jump/muscle artifact, ICA rejection of EOG/ECG components - OF NOTE FOR ELEKTA DATA THE ICA OUTPUT WAS LIMITED TO THE RANK OF THE DATA [BECAUSE OF SSS NOTED ABOVE]). Then the data was averaged, and a LCMV beamformer (ipsi-lateral channels only) targeted at the subject’s right or left hemisphere Helsch’s Gyrus was used to generate a ASSR time course. Attached (within the powerpoint slide deck) are figures showing the results . For each figure, the left column shows data that is just read with with no artifact correction (incase the ICA routines were improperly deforming the data), and the right column show the results of the methodology described above. The first and second row is the time-locked data from all sensors, both broad band (1st row - and also what is passed to the LCMV beamformer), and band-passed for gamma-band activity (30-58Hz). The third and forth rows are similar, though show the virtual electrodes time course (orientated to the ASSR). Hopefully you would agree that the CTF and Elekta magnetometer virtual electrode time course/results seem very appropriate. On the other hand, the Elekta planar gradiometer time course seem “lack-luster” to say the best. I did try to look into this, and found that during the beamforming, both CTF and Elekta magnetometers are rank sufficient (rank= number of channels for that hemisphere). The planar gradiometers on the other hand are rank deficient, which based on my understanding of the steps of an LCMV beamformer may be quite problematic. Has anyone else experienced this before and/or have suggestions how to circumvent this issue of poor planar gradiometer results from a LCMV beamformer? Best, Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip_LCMV_results.pptx Type: application/vnd.openxmlformats-officedocument.presentationml.presentation Size: 224785 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From rleese12 at berkeley.edu Sat Oct 1 21:42:57 2016 From: rleese12 at berkeley.edu (Nakyung Lee) Date: Sat, 1 Oct 2016 12:42:57 -0700 Subject: [FieldTrip] (no subject) Message-ID: Dear Fieldtrip community, I've been working on recreating one of the works of my predecessor with Fieldtrip. However, there's a discrepancy between high gamma signals that was filtered using Fieldtrip and high gamma signals that was filtered using other MATLAB functions. More specifically, it seems like there's always some lag between those two data and I've not been able to remove the lag entirely even with 'xcorr'. This is my Fieldtrip code (I used 'fir' here but I got the same problem with other filter types): cfg = []; cfg.continuous = 'yes'; cfg.bpfilter = 'yes'; cfg.bpfreq = [freq_low, freq_high]; cfg.bpfilttype = 'fir'; cfg.hilbert = 'yes'; cfg.N = N; signal_HG_fieldtrip = ft_preprocessing(cfg, signal); And this is the MATLAB code: h = fdesign.bandpass('N,Fst1,Fst2,Ast', N, freq_low/(srate/2), freq_high/(srate/2),60); BP = design(h); bp = filter(BP,signal); signal_HG_matlab = abs(hilbert(bp)); And those codes result in these: ​ ​ I've been looking at this for weeks now without coming up with a solution. Is anybody who had a similar problem and managed to fix it? Thank you in advance. Best, Rachel Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: scatter.jpg Type: image/jpeg Size: 43222 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot.jpg Type: image/jpeg Size: 14343 bytes Desc: not available URL: From rleese12 at berkeley.edu Sat Oct 1 21:44:30 2016 From: rleese12 at berkeley.edu (Nakyung Lee) Date: Sat, 1 Oct 2016 12:44:30 -0700 Subject: [FieldTrip] Discrepancies after filtering Message-ID: Dear Fieldtrip community, First, I apologize for duplicate emails. I forgot to add a title. I've been working on recreating one of the works of my predecessor with Fieldtrip. However, there's a discrepancy between high gamma signals that was filtered using Fieldtrip and high gamma signals that was filtered using other MATLAB functions. More specifically, it seems like there's always some lag between those two data and I've not been able to remove the lag entirely even with 'xcorr'. This is my Fieldtrip code (I used 'fir' here but I got the same problem with other filter types): cfg = []; cfg.continuous = 'yes'; cfg.bpfilter = 'yes'; cfg.bpfreq = [freq_low, freq_high]; cfg.bpfilttype = 'fir'; cfg.hilbert = 'yes'; cfg.N = N; signal_HG_fieldtrip = ft_preprocessing(cfg, signal); And this is the MATLAB code: h = fdesign.bandpass('N,Fst1,Fst2,Ast', N, freq_low/(srate/2), freq_high/(srate/2),60); BP = design(h); bp = filter(BP,signal); signal_HG_matlab = abs(hilbert(bp)); And those codes result in these: ​ ​ I've been looking at this for weeks now without coming up with a solution. Is anybody who had a similar problem and managed to fix it? Thank you in advance. Best, Rachel Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot.jpg Type: image/jpeg Size: 14343 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: scatter.jpg Type: image/jpeg Size: 43222 bytes Desc: not available URL: From pooneh.baniasad at gmail.com Sun Oct 2 12:22:55 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Sun, 2 Oct 2016 13:52:55 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix Message-ID: Dear FieldTrip community I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. Since I used the template electrode 'standard_1020.elc', m = 97 according to: chanpos: [97x3 double] chantype: {97x1 cell} chanunit: {97x1 cell} elecpos: [97x3 double] label: {97x1 cell} type: 'eeg1010' unit: 'mm' while the dimension of lead-field matrix is: 2000x122880 I use this function for calculating lead-field matrix: LF = ft_compute_leadfield(DipPos, elec, VolBEM); ​I do not understand why the number of raws are different​! ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ ​I will be so thankful if anyone can help me.​ -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: From mklados at gmail.com Sun Oct 2 20:55:10 2016 From: mklados at gmail.com (Manousos Klados) Date: Sun, 2 Oct 2016 11:55:10 -0700 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) Message-ID: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Mon Oct 3 02:27:05 2016 From: alik.widge at gmail.com (Alik Widge) Date: Sun, 2 Oct 2016 20:27:05 -0400 Subject: [FieldTrip] Postdoctoral opportunity: Human electrophysiology, Harvard/Mass General Message-ID: Fellow FieldTrippers, Our laboratory is hiring! Please see announcement below. We're a mixed-software shop, but I trained in MATLAB and still use FieldTrip, so that skillset is obviously welcome. Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 *Postdoctoral Research Fellowship in Human Invasive Neuroscience and Neural Engineering at MGH/Harvard Medical School * The Translational NeuroEngineering Laboratory (Alik Widge, MD, PhD) in the Division of Neurotherapeutics at Massachusetts General Hospital is seeking applicants for a multi-year, Federally funded postdoctoral fellowship in the areas of invasive human neuroscience and brain stimulation. The fellow will be responsible for collection and analysis of electrophysiologic recordings from patients who are undergoing or have recently undergone neurosurgical procedures. Modalities we currently use include EEG, MEG, intracranial LFP recording (stereo-EEG, ECOG), long-term recordings through implanted devices, and intraoperative single-unit/LFP mapping. Many of these experiments involve psychophysical tasks and/or electrical stimulation in the awake, behaving human. The overall goal is to better understand how brain networks give rise to and regulate emotional experiences, how those networks malfunction in severe psychiatric illness, and how that might lead to neurostimulation treatments for mental illness. The fellow will gain experience in working with rare clinical populations and a unique set of multi-resolution investigations of the human mind. There will be extensive opportunities to learn electrophysiologic techniques, novel statistical approaches, the fundamentals of human brain intervention, and the art of translational neuroscience. Much of the work is related to projects under the United States BRAIN Initiative, and there will be frequent interactions with other BRAIN projects. If desired, the fellow will also have opportunities to be exposed to neurosurgical and other clinical aspects of his/her research. The successful candidate will have a rich dataset and toolbox of skills to launch an independent research program in human cognition or medical device research. Successful applicants should have a PhD, or another doctoral degree with substantial research experience in a relevant discipline. This may include (and is not limited to) engineering, mathematics, psychology, neuroscience, computer science, or physics. For engineering and computer science specifically, we will consider candidates with a terminal masters' degree. Candidates should describe in their cover letter how their specific academic background is relevant to this position. Candidates should have one or more of: • Prior experience in electrophysiologic recordings and analysis in human or animals • Prior work in human cognitive neuroscience and/or a demonstrated understanding of psychophysical task design/executions • Prior conduct of neurostimulation experiments, with an understanding of the strengths and limitations of various designs • Past work in medical device design or research with neurological devices • Strong programming skills, particularly in MATLAB or Python • The psychology and neurobiology of mental illness • Grounding or formal training in signal processing for time-series data in the time and frequency domains We expect to be able to train a successful candidate in several of these areas according to his/her ability and interests. We would particularly welcome applicants with prior experience in neural engineering, brain-computer interfaces, or network/systems-level neuroscience. Please send a cover letter, a CV, and the names of 2-3 references to Dr. Widge at awidge at partners.org . A good cover letter will explain why your skills and interests overlap with our laboratory's goals, what you hope to gain from working with us, and what you think you might uniquely bring to our team. MGH is an equal-opportunity employer and welcomes applicants from any ethnicity, gender, nationality, or background. For this position in particular, visa sponsorship is available for qualified non-citizens, but the need for such sponsorship should be disclosed early in the interview process. -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 10:19:48 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 10:19:48 +0200 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: Dear Susmita, I used your code and could reproduce the same results. The step that goes wrong here is the segmentation step. cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri = ft_volumesegment(cfg, mri_aligned); seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','indexed'); cfg = []; cfg.funparameter = 'seg'; cfg.funcolormap = lines(6); % distinct color per tissue cfg.location = 'center'; cfg.atlas = seg_i; % the segmentation can also be used as atlas ft_sourceplot(cfg, seg_i); I segmented additionally to the scalp the brain and the skull tissues as well so that you can clearly see whats going on. You should tweak the cfg for the ft_volumesegment to improve your pipeline. Best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 30 Sep 2016, at 19:16, Susmita Sen wrote: > > I am Susmita Sen, MS research scholar in the dept of Electronics and Electrical Communication Engineering, IIT Kharagpur. > I am currently working on MEG data recorded by yokogawa system. I want to perform source reconstruction on the data. However, I do not have the MRI data along with that. so, I have planned to use the standard MRI provided by fieldtrip (downloaded from https://github.com/fieldtrip/fieldtrip/blob/master/template/headmodel/standard_mri.mat ). > > For preparing the head model I have followed the steps provided in the fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg ). > > %% align the coordinate system > load('standard_mri.mat'); % load mri data > disp(mri) > > cfg = []; > cfg.method = 'interactive'; > cfg.coordsys = 'yokogawa'; > cfg.snapshot = 'yes'; > [mri_aligned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > %% create headmodel > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > load grad % load gradiometer info > vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm > > figure; > ft_plot_sens(grad, 'style', '*b'); > hold on > ft_plot_vol(vol); > > while aligning the coordinate system I have chosen fiducial points (naison, LPA and RPA) using the instruction given by http://neuroimage.usc.edu/brainstorm/CoordinateSystems . > > I am attaching the figures that display the shape of the 'vol' along with the position of the sensors (from different viewing angle). However, I doubt the headmodel is corrected prepared (It dosen't look alike the figure given in the tutorial). It seems I have made some mistakes, but I am not able to detect it. I would be very thankful if you can help me in this regard. > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 10:23:46 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 10:23:46 +0200 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: Dear pooh, Could you provide more information how you constructed your BEM-model? best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 02 Oct 2016, at 12:22, pooneh baniasad wrote: > > Dear FieldTrip community > > I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. > > First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. > Since I used the template electrode 'standard_1020.elc', m = 97 according to: > > chanpos: [97x3 double] > chantype: {97x1 cell} > chanunit: {97x1 cell} > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > while the dimension of lead-field matrix is: 2000x122880 > I use this function for calculating lead-field matrix: > > LF = ft_compute_leadfield(DipPos, elec, VolBEM); > > ​I do not understand why the number of raws are different​! > > ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ > > ​I will be so thankful if anyone can help me.​ > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From pooneh.baniasad at gmail.com Mon Oct 3 13:01:37 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Mon, 3 Oct 2016 14:31:37 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: Dear Simon, I've followed this tutorial: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct the headmodel ('VolBEM') I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for 'DipPos'. Is it clear or should I explain more? 🙂 On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle wrote: > Dear pooh, > > Could you provide more information how you constructed your BEM-model? > > best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 02 Oct 2016, at 12:22, pooneh baniasad > wrote: > > Dear FieldTrip community > > I'm using the forward model to simulating EEG signal although it seems the > dimension of the lead-field matrix is not correct. Here is a review of the > procedure. > > First I constructed a BEM headmodel for EEG source analysis ​and then by > loading the template cortex, I put the dipoles with specific current source > on that. I expect the dimension of the lead-field matrix will be m*n which > m=electrode's number and n=3*dipole's number but 'm' is different. > Since I used the template electrode 'standard_1020.elc', m = 97 according > to: > > chanpos: [97x3 double] > chantype: {97x1 cell} > chanunit: {97x1 cell} > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > while the dimension of lead-field matrix is: 2000x122880 > > I use this function for calculating lead-field matrix: > > LF = ft_compute_leadfield(DipPos, elec, VolBEM); > ​I do not understand why the number of raws are different​! > > ​On the other hand I guess that there is a similarity between the number > of raws in the volume head model and LF matrix due to the dimension of > headmodel matrix is: 2000x8000 double .​ > > ​I will be so thankful if anyone can help me.​ > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 3 14:59:59 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 3 Oct 2016 18:29:59 +0530 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for your response. I am sorry to bother you once again with my doubt. The headmodel that I have constructed, has a flat surface at the bottom. I would like to ask you to explain why that is happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look like this. I am attaching a file comparing these two headmodels. I have circled some part of the figure which actually raises the question of whether I am doing it correctly or not. Is there anything wrong in choosing the fiducial points? Thank you in anticipation. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle wrote: > Dear Susmita, > > I used your code and could reproduce the same results. The step that goes > wrong here is the segmentation step. > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > > seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','i > ndexed'); > > > cfg = []; > cfg.funparameter = 'seg'; > cfg.funcolormap = lines(6); % distinct color per tissue > cfg.location = 'center'; > cfg.atlas = seg_i; % the segmentation can also be used as atlas > ft_sourceplot(cfg, seg_i); > > > I segmented additionally to the scalp the brain and the skull tissues as > well so that you can clearly see whats going on. > > You should tweak the cfg for the ft_volumesegment to improve your pipeline. > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 30 Sep 2016, at 19:16, Susmita Sen wrote: > > I am Susmita Sen, MS research scholar in the dept of Electronics and > Electrical Communication Engineering, IIT Kharagpur. > I am currently working on MEG data recorded by yokogawa system. I > want to perform source reconstruction on the data. However, I do not have > the MRI data along with that. so, I have planned to use the standard MRI > provided by fieldtrip (downloaded from https://github.com/fieldt > rip/fieldtrip/blob/master/template/headmodel/standard_mri.mat). > > For preparing the head model I have followed the steps provided in the > fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg > ). > > %% align the coordinate system > load('standard_mri.mat'); % load mri data > disp(mri) > > cfg = []; > cfg.method = 'interactive'; > cfg.coordsys = 'yokogawa'; > cfg.snapshot = 'yes'; > [mri_aligned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > %% create headmodel > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > load grad % load gradiometer info > vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm > > figure; > ft_plot_sens(grad, 'style', '*b'); > hold on > ft_plot_vol(vol); > > while aligning the coordinate system I have chosen fiducial points > (naison, LPA and RPA) using the instruction given by > http://neuroimage.usc.edu/brainstorm/CoordinateSystems. > > I am attaching the figures that display the shape of the 'vol' along with > the position of the sensors (from different viewing angle). However, I > doubt the headmodel is corrected prepared (It dosen't look alike the figure > given in the tutorial). It seems I have made some mistakes, but I am not > able to detect it. I would be very thankful if you can help me in this > regard. > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > ______________________________ > _________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodels.png Type: image/png Size: 231910 bytes Desc: not available URL: From s.homolle at donders.ru.nl Mon Oct 3 15:18:53 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 15:18:53 +0200 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> Dear Susmita, I think first all http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is a nice place to go to understand the different coordinate systems. I’m not to well aware about the Yokogawa coordinate system, but my first expectation would be that this coordinate systems is shifted lower than the CTF. After aligning with the different coordinate systems you should look at mri_aligned.coordsys Best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 03 Oct 2016, at 14:59, Susmita Sen wrote: > > Dear Simon, > > Thank you very much for your response. I am sorry to bother you once again with my doubt. The headmodel that I have constructed, has a flat surface at the bottom. I would like to ask you to explain why that is happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look like this. I am attaching a file comparing these two headmodels. I have circled some part of the figure which actually raises the question of whether I am doing it correctly or not. Is there anything wrong in choosing the fiducial points? Thank you in anticipation. > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > > On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle > wrote: > Dear Susmita, > > I used your code and could reproduce the same results. The step that goes wrong here is the segmentation step. > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','indexed'); > > cfg = []; > cfg.funparameter = 'seg'; > cfg.funcolormap = lines(6); % distinct color per tissue > cfg.location = 'center'; > cfg.atlas = seg_i; % the segmentation can also be used as atlas > ft_sourceplot(cfg, seg_i); > > > I segmented additionally to the scalp the brain and the skull tissues as well so that you can clearly see whats going on. > > You should tweak the cfg for the ft_volumesegment to improve your pipeline. > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > >> On 30 Sep 2016, at 19:16, Susmita Sen > wrote: >> >> I am Susmita Sen, MS research scholar in the dept of Electronics and Electrical Communication Engineering, IIT Kharagpur. >> I am currently working on MEG data recorded by yokogawa system. I want to perform source reconstruction on the data. However, I do not have the MRI data along with that. so, I have planned to use the standard MRI provided by fieldtrip (downloaded from https://github.com/fieldtrip/fieldtrip/blob/master/template/headmodel/standard_mri.mat ). >> >> For preparing the head model I have followed the steps provided in the fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg ). >> >> %% align the coordinate system >> load('standard_mri.mat'); % load mri data >> disp(mri) >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.coordsys = 'yokogawa'; >> cfg.snapshot = 'yes'; >> [mri_aligned] = ft_volumerealign(cfg,mri); >> >> %% SEGMENTATION >> cfg = []; >> cfg.output = 'brain'; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> %% create headmodel >> cfg = []; >> cfg.method='singleshell'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> %% visualize >> load grad % load gradiometer info >> vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm >> >> figure; >> ft_plot_sens(grad, 'style', '*b'); >> hold on >> ft_plot_vol(vol); >> >> while aligning the coordinate system I have chosen fiducial points (naison, LPA and RPA) using the instruction given by http://neuroimage.usc.edu/brainstorm/CoordinateSystems . >> >> I am attaching the figures that display the shape of the 'vol' along with the position of the sensors (from different viewing angle). However, I doubt the headmodel is corrected prepared (It dosen't look alike the figure given in the tutorial). It seems I have made some mistakes, but I am not able to detect it. I would be very thankful if you can help me in this regard. >> >> >> >> Thanks and Regards, >> Susmita Sen >> Research Scholar >> Audio and Bio Signal Processing Lab. >> E & ECE Dept. >> IIT Kharagpur >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 15:27:09 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 15:27:09 +0200 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> Dear Pooneh, http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem I relate to this part: When the forward solution is computed, the lead field matrix (= channels X source points matrix) is calculated for each grid point taking into account the head model and the channel positions. So I assume your mesh consists of 2000 grid points? Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 03 Oct 2016, at 13:01, pooneh baniasad wrote: > > Dear Simon, > > I've followed this tutorial: > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct the headmodel ('VolBEM') > I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for 'DipPos'. > Is it clear or should I explain more? 🙂 > > On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle > wrote: > Dear pooh, > > Could you provide more information how you constructed your BEM-model? > > best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > >> On 02 Oct 2016, at 12:22, pooneh baniasad > wrote: >> >> Dear FieldTrip community >> >> I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. >> >> First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. >> Since I used the template electrode 'standard_1020.elc', m = 97 according to: >> >> chanpos: [97x3 double] >> chantype: {97x1 cell} >> chanunit: {97x1 cell} >> elecpos: [97x3 double] >> label: {97x1 cell} >> type: 'eeg1010' >> unit: 'mm' >> >> while the dimension of lead-field matrix is: 2000x122880 >> I use this function for calculating lead-field matrix: >> >> LF = ft_compute_leadfield(DipPos, elec, VolBEM); >> >> ​I do not understand why the number of raws are different​! >> >> ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ >> >> ​I will be so thankful if anyone can help me.​ >> >> -- >> Bests >> >> Pouneh Baniasad >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 3 15:40:12 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 3 Oct 2016 19:10:12 +0530 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> References: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> Message-ID: Dear Simon, Thanks a lot for your suggestion. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Mon, Oct 3, 2016 at 6:48 PM, Simon Homolle wrote: > Dear Susmita, > > I think first all > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined > is a nice place to go to understand the different coordinate systems. > > I’m not to well aware about the Yokogawa coordinate system, but my first > expectation would be that this coordinate systems is shifted lower than the > CTF. After aligning with the different coordinate systems you should look > at mri_aligned.coordsys > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 03 Oct 2016, at 14:59, Susmita Sen wrote: > > Dear Simon, > > Thank you very much for your response. I am sorry to bother you once > again with my doubt. The headmodel that I have constructed, has a flat > surface at the bottom. I would like to ask you to explain why that is > happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look > like this. I am attaching a file comparing these two headmodels. I have > circled some part of the figure which actually raises the question of > whether I am doing it correctly or not. Is there anything wrong in choosing > the fiducial points? Thank you in anticipation. > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > > On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle > wrote: > >> Dear Susmita, >> >> I used your code and could reproduce the same results. The step that goes >> wrong here is the segmentation step. >> >> cfg = []; >> cfg.output = {'brain','skull','scalp'}; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','i >> ndexed'); >> >> cfg = []; >> cfg.funparameter = 'seg'; >> cfg.funcolormap = lines(6); % distinct color per tissue >> cfg.location = 'center'; >> cfg.atlas = seg_i; % the segmentation can also be used as >> atlas >> ft_sourceplot(cfg, seg_i); >> >> >> I segmented additionally to the scalp the brain and the skull tissues as >> well so that you can clearly see whats going on. >> >> You should tweak the cfg for the ft_volumesegment to improve your >> pipeline. >> >> Best regards, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 30 Sep 2016, at 19:16, Susmita Sen wrote: >> >> I am Susmita Sen, MS research scholar in the dept of Electronics and >> Electrical Communication Engineering, IIT Kharagpur. >> I am currently working on MEG data recorded by yokogawa system. I >> want to perform source reconstruction on the data. However, I do not have >> the MRI data along with that. so, I have planned to use the standard MRI >> provided by fieldtrip (downloaded from https://github.com/fieldt >> rip/fieldtrip/blob/master/template/headmodel/standard_mri.mat). >> >> For preparing the head model I have followed the steps provided in the >> fieldtrip tutorial (http://www.fieldtriptoolbox.o >> rg/tutorial/headmodel_meg). >> >> %% align the coordinate system >> load('standard_mri.mat'); % load mri data >> disp(mri) >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.coordsys = 'yokogawa'; >> cfg.snapshot = 'yes'; >> [mri_aligned] = ft_volumerealign(cfg,mri); >> >> %% SEGMENTATION >> cfg = []; >> cfg.output = 'brain'; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> %% create headmodel >> cfg = []; >> cfg.method='singleshell'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> %% visualize >> load grad % load gradiometer info >> vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm >> >> figure; >> ft_plot_sens(grad, 'style', '*b'); >> hold on >> ft_plot_vol(vol); >> >> while aligning the coordinate system I have chosen fiducial points >> (naison, LPA and RPA) using the instruction given by >> http://neuroimage.usc.edu/brainstorm/CoordinateSystems. >> >> I am attaching the figures that display the shape of the 'vol' along with >> the position of the sensors (from different viewing angle). However, I >> doubt the headmodel is corrected prepared (It dosen't look alike the figure >> given in the tutorial). It seems I have made some mistakes, but I am not >> able to detect it. I would be very thankful if you can help me in this >> regard. >> >> >> >> Thanks and Regards, >> Susmita Sen >> Research Scholar >> Audio and Bio Signal Processing Lab. >> E & ECE Dept. >> IIT Kharagpur >> ______________________________ >> _________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From singht at musc.edu Mon Oct 3 17:34:18 2016 From: singht at musc.edu (Singh, Tarkeshwar) Date: Mon, 3 Oct 2016 15:34:18 +0000 Subject: [FieldTrip] ft_timelockanalysis outputs average data with different trial lengths Message-ID: Dear All, I am new to Fieldtrip and am trying to compare ERPs between two conditions using the following lines of code. ‘data_iccleaned’ is the processed data structure. The code below is in red and my message in black. cfg=[]; cfg.keeptrials = 'yes'; cfg.vartrllength=1; cfg.trials = find(data_iccleaned.trialinfo(:,1) == 1); erp_pictures = ft_timelockanalysis(cfg, data_iccleaned); cfg=[]; cfg.keeptrials = 'yes'; cfg.vartrllength=1; cfg.trials = find(data_iccleaned.trialinfo(:,1) == 2); erp_abstract = ft_timelockanalysis(cfg, data_iccleaned); %Baseline Correction cfg=[]; cfg.baseline = [twin(1) 0]; erp_pictures_TL = ft_timelockbaseline(cfg, erp_pictures); erp_abstract_TL = ft_timelockbaseline(cfg, erp_abstract); cfgp=[]; cfgp.interactive = 'yes'; cfgp.layout = 'easycapM11.mat'; cfgp.box='yes'; cfgp.showoutline = 'yes'; ft_multiplotER(cfgp, erp_pictures_TL,erp_abstract_TL. When I run the last line of code, I get the following error: [cid:image001.png at 01D21D6A.13970950] I believe the problem is that erp_abstract.time and erp_picture.time are of different lengths (please see the picture below). We have sampled the data at 1000 Hz and each trial is approx. 8 seconds long (trial lengths vary from 7989 to 8012 points). To circumvent the problem, I tried an additional constraint on the accepted trials (accept only those that are exactly 8000 points) but that did not solve the problem. What am I doing wrong? [cid:image002.png at 01D21D6A.13970950] -- Tarkeshwar Singh Postdoctoral Scholar Department of Health Sciences and Research Medical University of South Carolina 77 President Street, Room C305 Charleston, SC 29425 singht at musc.edu ------------------------------------------------------------------------- This message was secured via TLS by MUSC. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 22130 bytes Desc: image001.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 77227 bytes Desc: image002.png URL: From SXM1085 at student.bham.ac.uk Mon Oct 3 18:40:04 2016 From: SXM1085 at student.bham.ac.uk (Sebastian Michelmann) Date: Mon, 3 Oct 2016 16:40:04 +0000 Subject: [FieldTrip] neuralynx problem with repeated timestamps Message-ID: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> Dear Fieldtrippers, when reading Neuralynx ncs data I run into the following problem: %----------------------------------------------------------------------------------% cfg = []; cfg.dataset = [dataset_directory filesep electrode '.ncs']; data_nse = ft_preprocessing(cfg); >> Index exceeds matrix dimensions. Error in ft_read_data (line 1013) dat = ncs.dat(begsample:endsample); Error in ft_preprocessing (line 576) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); %----------------------------------------------------------------------------------% The problem seems to be due to repeated timestamps in the data, that are corrected in @read_neuralynx_ncs line: 230 [A,I] = unique(val); % consider only the unique values indx = indx(I); This causes the information about the number of samples in the header and the actual samples to be different. My question is now: How do I deal with this? Especially since I am not entirely sure why fieldtrip handles this dataformat the way it does (e.g. sorting the timestamps at each sampling point) So, can I just comment this out and accept the multiple sampling of some Timestamps? Or should I rather correct the information about the number of samples? Should I even interpolate plausible Timestamps? Any help is highly appreciated! All the best, Sebastian -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Mon Oct 3 18:51:40 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Mon, 03 Oct 2016 17:51:40 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> References: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> Message-ID: <8865e168a6639693d5d9e5106563e21c@cam.ac.uk> Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? Many thanks From lindseyrtate at ou.edu Mon Oct 3 23:23:02 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Mon, 3 Oct 2016 21:23:02 +0000 Subject: [FieldTrip] REPOST: Beamforming, "Inf" during source estimation by subject In-Reply-To: References: , Message-ID: Tate, Lindsey R. has shared a?OneDrive for Business?file with you. To view it, click the link below. [https://r1.res.office365.com/owa/prem/images/dc-generic_20.png] dataFIC4.mat Tate, Lindsey R. has shared a?OneDrive for Business?file with you. To view it, click the link below. [https://r1.res.office365.com/owa/prem/images/dc-generic_20.png] dataFIC4.mat Hello Fieldtrip Community, On Tuesday 6/28, I sent out the original message forwarded below. I received some response but have been unable to resolve my problem. [Attempted to allow lambda to be estimated/not specified, but this didn't eliminate the "Inf" in the pow matrices.] I've been working on beamforming the MEG data collected from 16 subjects during a saccade task. There are 4 conditions, with a maximum of 30 trials each per subject (some trials eliminated due to loss of focus). This is my first time beamforming so I've been heavily relying on the tutorial. I'm having what appears to be two issues: 1) Number of trials per subject may be too low. When I collapse across all subjects or even collapse across two random subjects so as to artificially increase the number of trials per "artificial subject," real numbers are produced by ft_sourceinterpolate in the pow matrix. When I run each subject individually, the pow matrix from ft_sourceinterpolate "Inf" where numbers were for the other runs. Is there a way to resolve this issue, such as a default setting to override? Or do I have too few trials per condition? 2) The pow matrix from ft_sourceinterpolate produces primarily "NaN," with about 90% of the rows being "NaN." This seems problematic. Also, it seems like it may be causing problems with ft_sourcestatistics as the stat.prob and stat.mask matrices always come back empty, even when ft_sourceinterpolate produces pow matrices with real numbers divided by "artificial subjects." Could this prevalence of "NaN" be an indication that the beamforming isn't happening correctly? Could the prevalence be causing the ft_sourcestatistics to produce blank stat.prob and stat.mask matrices? Code and raw dataset attached. Thank you for any assistance or guidance you may offer! Lindsey University of Oklahoma ________________________________ From: Tate, Lindsey R. Sent: Tuesday, June 28, 2016 3:05 AM To: fieldtrip at science.ru.nl Subject: Beamforming, "Inf" during source estimation by subject Hello Fieldtrip Community, I've been working on beamforming the MEG data collected from 16 subjects during a saccade task. This is my first time beamforming so I've been heavily relying on the tutorial. When I collapse trials across subjects and do beamforming, I can get the ft_sourceplot commands to produce something that makes some sense. However, I need to be able to have the data separated by subject for ft_sourcestatistics. I've created structures that should work for this purpose and that look correct. However, the ".pow" from the Neural Activity Index calculation step ends up mostly "NaN" and partly "Inf" when I run the beamforming divided by subject. Is this related to the number of trials per subject somehow (e.g., do I have too few? is there some kind of setting I need to change?)? Why is the ".pow" coming back "Inf" instead of a real number? Does anyone have suggestions for fixing this problem so that I don't get "Inf" anymore? My code and raw data structure are attached. Thank you, Lindsey Tate University of Oklahoma -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BF_trial4.m URL: From lindseyrtate at ou.edu Mon Oct 3 23:23:06 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Mon, 3 Oct 2016 21:23:06 +0000 Subject: [FieldTrip] Tate, Lindsey R. wants to share the file dataFIC4.mat with you Message-ID: To view dataFIC4.mat, sign in or create an account. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at donders.ru.nl Tue Oct 4 04:29:42 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 4 Oct 2016 11:29:42 +0900 Subject: [FieldTrip] Fwd: Job posting: PhD position at MPI-CBS Germany References: <943142109.19332.1475485117729.JavaMail.zimbra@cbs.mpg.de> Message-ID: <95458A7B-907C-4102-B962-326C7434B44B@donders.ru.nl> On behalf of Claudia Männel, please see the attachment for a job opening for a highly motivated and qualified PhD student. -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Maennel_DFGNov2016.pdf Type: application/pdf Size: 85151 bytes Desc: not available URL: -------------- next part -------------- From robert.oostenveld at donders.ru.nl Tue Oct 4 04:30:25 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 4 Oct 2016 11:30:25 +0900 Subject: [FieldTrip] Fwd: Job posting: PhD position at MPI-CBS Germany References: <943142109.19332.1475485117729.JavaMail.zimbra@cbs.mpg.de> Message-ID: <2BFD51EB-660D-4FFF-92C7-1E5767673587@donders.ru.nl> On behalf of Claudia Männel, please see the attachment for a job opening for a highly motivated and qualified PhD student. -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Maennel_DFGNov2016.pdf Type: application/pdf Size: 85151 bytes Desc: not available URL: -------------- next part -------------- From ph442 at cam.ac.uk Tue Oct 4 10:45:47 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 09:45:47 +0100 Subject: [FieldTrip] =?utf-8?q?Fwd=3A_plotting_freesurfer_mesh_on_the_mri?= =?utf-8?b?X2FsaWduZWQu?= Message-ID: Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? Many thanks -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From ph442 at cam.ac.uk Tue Oct 4 16:41:27 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 15:41:27 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= Message-ID: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? The reason that I ask is that I would like to plot my solution on the MRI image. Unfortunately I do not use dipoles. In EEG, I model the irrotational component of the current as a scalar function and therefore I am doing function estimation. IF you use dipoles, it is straightforward because you follow one of the tutorials. But if you do not use dipoles and model the current as the gradient of the irrotational component of the current in EEG then one can get lost. Any help would be appreciated. Many thanks -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From jan.schoffelen at donders.ru.nl Tue Oct 4 17:29:49 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 4 Oct 2016 15:29:49 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> Message-ID: <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> Hi Parham, It is possible, but certainly not pain free, nor straightforward. I think this is not really a fieldtrip question, but more a general matlab related issue. It should be possible to plot a slice through an MRI volume as a MATLAB patch, where the coordinates of the voxels are expressed in some coordinate system. Then, it is possible to generate and intersection of the freesurfer mesh through the plane of visualization. Best, Jan-Mathijs > On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: > > Dear Fieldtrippers > Is there a straightforward pain free method ( I appreciate if you can give me the command) > to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? > The reason that I ask is that I would like to plot my solution on the MRI image. > Unfortunately I do not use dipoles. In EEG, I model the irrotational component of the current as a scalar function and therefore I am doing function estimation. > IF you use dipoles, it is straightforward because you follow one of the tutorials. > But if you do not use dipoles and model the current as the gradient of the irrotational component of the current in EEG then one can get lost. > Any help would be appreciated. > Many thanks > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ph442 at cam.ac.uk Tue Oct 4 17:59:06 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 16:59:06 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> Message-ID: <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Hi Jan Thank you, my functional data are the function values of some function (irrotational component of the current). From my limited experience of Fieldtrip, your explanation feels (to myself) a bit cryptic at the moment. You see if my inversion strategy was one of the classical ones such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta then the available fieldtrip tutorials are great in showing how to plot functional values on the top of anatomical values. But, since, I work on inversion methods, then I need a hacking strategy to be able to plot functional values of "some function"(estimated) on top of anatomical data MRI. I would appreciate if you would kindly let me know, if there is hack to it such that ft_sourceplot can accept the input. best regards parham On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > It is possible, but certainly not pain free, nor straightforward. > I think this is not really a fieldtrip question, but more a general > matlab related issue. > > It should be possible to plot a slice through an MRI volume as a > MATLAB patch, where the coordinates of the voxels are expressed in > some coordinate system. Then, it is possible to generate and > intersection of the freesurfer mesh through the plane of > visualization. > > Best, > Jan-Mathijs > > > >> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >> >> Dear Fieldtrippers >> Is there a straightforward pain free method ( I appreciate if you can >> give me the command) >> to plot arbitrary points such as the vertices of the freesurfer output >> (mesh) onto the MRI image? >> The reason that I ask is that I would like to plot my solution on the >> MRI image. >> Unfortunately I do not use dipoles. In EEG, I model the irrotational >> component of the current as a scalar function and therefore I am doing >> function estimation. >> IF you use dipoles, it is straightforward because you follow one of >> the tutorials. >> But if you do not use dipoles and model the current as the gradient >> of the irrotational component of the current in EEG then one can get >> lost. >> Any help would be appreciated. >> Many thanks >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From Darren.Price at mrc-cbu.cam.ac.uk Tue Oct 4 18:45:07 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Tue, 4 Oct 2016 16:45:07 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi Parham For a non-linear interpolation onto a regular grid, spm_mesh_to_grid might be ideal (from the spm package of course). I don't have a working example to hand, but I may be able to dig one out if you can't get it working. Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL:  darren.price at mrc-cbu.cam.ac.uk URL:    http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL     +44 (0)1223 355 294 x202 FAX     +44 (0)1223 359 062 MOB     +44 (0)7717822431 ------------------------------------------------------- -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham hashemzadeh Sent: 04 October 2016 16:59 To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Hi Jan Thank you, my functional data are the function values of some function (irrotational component of the current). From my limited experience of Fieldtrip, your explanation feels (to myself) a bit cryptic at the moment. You see if my inversion strategy was one of the classical ones such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta then the available fieldtrip tutorials are great in showing how to plot functional values on the top of anatomical values. But, since, I work on inversion methods, then I need a hacking strategy to be able to plot functional values of "some function"(estimated) on top of anatomical data MRI. I would appreciate if you would kindly let me know, if there is hack to it such that ft_sourceplot can accept the input. best regards parham On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > It is possible, but certainly not pain free, nor straightforward. > I think this is not really a fieldtrip question, but more a general > matlab related issue. > > It should be possible to plot a slice through an MRI volume as a > MATLAB patch, where the coordinates of the voxels are expressed in > some coordinate system. Then, it is possible to generate and > intersection of the freesurfer mesh through the plane of > visualization. > > Best, > Jan-Mathijs > > > >> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >> >> Dear Fieldtrippers >> Is there a straightforward pain free method ( I appreciate if you can >> give me the command) >> to plot arbitrary points such as the vertices of the freesurfer output >> (mesh) onto the MRI image? >> The reason that I ask is that I would like to plot my solution on the >> MRI image. >> Unfortunately I do not use dipoles. In EEG, I model the irrotational >> component of the current as a scalar function and therefore I am doing >> function estimation. >> IF you use dipoles, it is straightforward because you follow one of >> the tutorials. >> But if you do not use dipoles and model the current as the gradient >> of the irrotational component of the current in EEG then one can get >> lost. >> Any help would be appreciated. >> Many thanks >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ph442 at cam.ac.uk Tue Oct 4 19:08:29 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 18:08:29 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL:  darren.price at mrc-cbu.cam.ac.uk > URL:    http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL     +44 (0)1223 355 294 x202 > FAX     +44 (0)1223 359 062 > MOB     +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From a.donda at hotmail.com Wed Oct 5 00:47:27 2016 From: a.donda at hotmail.com (A. Donda) Date: Tue, 4 Oct 2016 22:47:27 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> , Message-ID: Hi Parham, if you wanna plot it in FieldTrip, these commands worked well for me, but in my case (MEG data) I had to make sure first that these data were on the same coordinate system (co-registration of MRI and MEG sensor-data). If you do not have this issue, then you can simply plot an MRI and a mesh obtained from freesurfer the following way (make sure that both MRI and the mesh are in the same units, e.g. cm or mm): ft_determine_coordsys(mricor_cm, 'interactive', 'no') hold on ft_plot_mesh(sourcespace); Alternatively, if you want to plot the vertices of the mesh as dots, you can use ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); sourcespace has the following structure (in case this is helpful for you): pnt: [8196x3 double] tri: [16384x3 double] area: [16384x1 double] orig: [1x1 struct] unit: 'm' I obtained sourcespace by loading the boundary element model (bem) surface, created with the watershed algorthim of Freesurfer: sourcespace = ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], 'format', 'mne_source'); %in meters Note that I had to transform the sourcespace dataset to the right coordinate system and units. Finally I plotted the mri and mesh in cm To convert units in Fieldtrip, as you know, use X_cm = ft_convert_units(X,'cm'); I hope this is helpful. Best A.Donda ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of parham hashemzadeh Sent: Tuesday, October 4, 2016 6:08 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL: darren.price at mrc-cbu.cam.ac.uk > URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL +44 (0)1223 355 294 x202 > FAX +44 (0)1223 359 062 > MOB +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 5 03:15:07 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 5 Oct 2016 01:15:07 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi Parham, Sorry for sounding cryptic earlier, I was just reciprocating the crypticity of the question. I think that the suggestion made in the previous e-mail is an excellent one. With the addition that, rather than using ft_determine_coordsys, you could use ft_plot_ortho to visualize an arbitrary cross-cut through your volumetric image. Note however, that the MR and the sourcespace should be in the same coordinate system for this to work. Best, Jan-Mathijs On 05 Oct 2016, at 00:47, A. Donda > wrote: Hi Parham, if you wanna plot it in FieldTrip, these commands worked well for me, but in my case (MEG data) I had to make sure first that these data were on the same coordinate system (co-registration of MRI and MEG sensor-data). If you do not have this issue, then you can simply plot an MRI and a mesh obtained from freesurfer the following way (make sure that both MRI and the mesh are in the same units, e.g. cm or mm): ft_determine_coordsys(mricor_cm, 'interactive', 'no') hold on ft_plot_mesh(sourcespace); Alternatively, if you want to plot the vertices of the mesh as dots, you can use ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); sourcespace has the following structure (in case this is helpful for you): pnt: [8196x3 double] tri: [16384x3 double] area: [16384x1 double] orig: [1x1 struct] unit: 'm' I obtained sourcespace by loading the boundary element model (bem) surface, created with the watershed algorthim of Freesurfer: sourcespace = ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], 'format', 'mne_source'); %in meters Note that I had to transform the sourcespace dataset to the right coordinate system and units. Finally I plotted the mri and mesh in cm To convert units in Fieldtrip, as you know, use X_cm = ft_convert_units(X,'cm'); I hope this is helpful. Best A.Donda ________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of parham hashemzadeh > Sent: Tuesday, October 4, 2016 6:08 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL: darren.price at mrc-cbu.cam.ac.uk > URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL +44 (0)1223 355 294 x202 > FAX +44 (0)1223 359 062 > MOB +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh > wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From son.ta.dinh at tum.de Wed Oct 5 06:54:31 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Wed, 5 Oct 2016 04:54:31 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Message-ID: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let's say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 5 07:57:01 2016 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 5 Oct 2016 16:57:01 +1100 Subject: [FieldTrip] Plotting confidence intervals in multiplotER In-Reply-To: References: Message-ID: Dear Kousik, Thank you very much for your help. I am not sure how to change the "dat_sem" as you suggested. My grand averaged file has the fields as follows GrandAvg_Target1 = avg: [132x601 double] var: [132x601 double] dof: [132x601 double] time: [1x601 double] label: {132x1 cell} dimord: 'chan_time' cfg: [1x1 struct] I am a beginner in MATLAB and any help would be greatly appreciated. Thanks, Arti On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy wrote: > Hey Arti, > > This is not such a trivial thing to solve. Here's a recipe I used. You > need to find and edit two scripts. If this spurns any more interest, I'll > initiate a 'bug' and try to send in a pull request. This is a dirty fix and > in all probability will be considered blasphemy. ;) > > 1. Find in ft_multiplotER > > : > ft_plot_vector(xval, yval, 'width', width(m), 'height', height(m), 'hpos', > layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', [ymin ymax], 'color > ', color, 'style', cfg.linestyle{i}, 'linewidth', cfg.linewidth, 'axis', > cfg.axes, 'highlight', mask, 'highlightstyle', cfg.maskstyle, 'label', > label, 'box', cfg.box, 'fontsize', cfg.fontsize); > This basically calls a plotting function which in turn does the plotting > for you. You need to send in the extra 'sem' or a 'ci' variable. > Change this to: > ft_plot_vector(xval, yval, 'ysem', ysem, 'width', width(m), 'height', > height(m), 'hpos', layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', > [ymin ymax], 'color', color, 'style', cfg.linestyle{i}, 'linewidth', > cfg.linewidth, 'axis', cfg.axes, 'highlight', mask, 'highlightstyle', > cfg.maskstyle, 'label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); > > 2. Find in ft_plot_vector > > : > You need to first get the sem parameter from your data and setup so FT can > see your sem or CI info. Follow the code here > . > Search for "data_sem" and fix those lines. > Then: > h = plot(hdat, vdat, style, 'LineWidth', linewidth, 'Color', color, ' > markersize', markersize, 'markerfacecolor', markerfacecolor); > Change this to: > [h hp ]= boundedline(hdat, vdat, vdat_sem); > > Boundedline > is > a submission in the MATLAB file exchange. You can use any other thing. > > > Good luck trying! :) > > > -- > Regards, > Kousik Sarathy, S > > > On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek > wrote: > >> Dear fieldtrip community, >> >> I was wondering whether there is a way to plot the confidence intervals >> in the ERP plot? I see that this question was asked multiple times in the >> discussion list before, but I could not find an answer to this. >> >> Thanks, >> Arti >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Wed Oct 5 10:08:53 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Wed, 05 Oct 2016 09:08:53 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: <39b0115d2f09176a1ffada64668e300e@cam.ac.uk> Hi Jan and A.Donda Thank you both very much for your input. I will try what you suggested. Many thanks best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From susmitasen.ece at gmail.com Wed Oct 5 12:41:06 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 5 Oct 2016 16:11:06 +0530 Subject: [FieldTrip] Standard mri dimension and fiducial point Message-ID: Dear FieldTrip community I am using standard mri providded by fieldTrip. The dimension of it is 181 x 217 x 181 [image: Inline image 1] The fiducial points are [image: Inline image 2] It is quite confusing since the coordinate of lpa exceeds the dimension. I would be very thankful if you can help me in this regard. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 6452 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From matt.gerhold at gmail.com Wed Oct 5 13:31:40 2016 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 5 Oct 2016 13:31:40 +0200 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son wrote: > Dear Fieldtrippers, > > > > the general problem we are facing is one of statistics. In particular, we > are trying to test the robustness of a graph measure when reducing the > amount of nodes it is computed with. In our case, we use the EEG electrodes > as nodes. > > > > We are trying to find out whether a graph measure differs significantly > from zero over a group of subjects. The exact calculation of the measure is > rather complicated to explain, suffice it to say that every subject has > exactly one scalar value in the end. Computation of this measure using 64 > electrodes is straightforward and we can easily calculate a p-value and/or > a confidence interval. > > When we calculate based on only 32 electrodes however, we draw 32 > electrodes randomly. Therefore, we need to repeat this computation many > times (let’s say 1000 times). So we then get [1000 x number of subjects] > values, or 1000 p-values/confidence intervals. > > How do we statistically test whether the measure is robustly different > from 0? Is it too naive to simply assume that if the confidence interval > does not contain 0 in at least 950 of the 1000 computations then it is > robustly different from 0? > > > > Any help would be greatly appreciated! > > > > Best regards, > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Wed Oct 5 15:55:26 2016 From: sarathykousik at gmail.com (kousik sarathy) Date: Wed, 5 Oct 2016 15:55:26 +0200 Subject: [FieldTrip] Plotting confidence intervals in multiplotER In-Reply-To: References: Message-ID: Hi Arti, The best I can suggest is a two step process. ft_timelockgrandaverage you should see a keepindividual option. You can collate your subject x chan x time as a single 3-D dataset. Then you can manually make your own fields of mean and sem. -- Regards, Kousik Sarathy, S On Wed, Oct 5, 2016 at 7:57 AM, Arti Abhishek wrote: > Dear Kousik, > > Thank you very much for your help. I am not sure how to change the > "dat_sem" as you suggested. My grand averaged file has the fields as follows > > GrandAvg_Target1 = > > avg: [132x601 double] > var: [132x601 double] > dof: [132x601 double] > time: [1x601 double] > label: {132x1 cell} > dimord: 'chan_time' > cfg: [1x1 struct] > > I am a beginner in MATLAB and any help would be greatly appreciated. > > Thanks, > Arti > > On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy > wrote: > >> Hey Arti, >> >> This is not such a trivial thing to solve. Here's a recipe I used. You >> need to find and edit two scripts. If this spurns any more interest, I'll >> initiate a 'bug' and try to send in a pull request. This is a dirty fix and >> in all probability will be considered blasphemy. ;) >> >> 1. Find in ft_multiplotER >> >> : >> ft_plot_vector(xval, yval, 'width', width(m), 'height', height(m), 'hpos', >> layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', [ymin ymax], ' >> color', color, 'style', cfg.linestyle{i}, 'linewidth', cfg.linewidth, ' >> axis', cfg.axes, 'highlight', mask, 'highlightstyle', cfg.maskstyle, ' >> label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); >> This basically calls a plotting function which in turn does the plotting >> for you. You need to send in the extra 'sem' or a 'ci' variable. >> Change this to: >> ft_plot_vector(xval, yval, 'ysem', ysem, 'width', width(m), 'height', >> height(m), 'hpos', layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', >> [ymin ymax], 'color', color, 'style', cfg.linestyle{i}, 'linewidth', >> cfg.linewidth, 'axis', cfg.axes, 'highlight', mask, 'highlightstyle', >> cfg.maskstyle, 'label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); >> >> 2. Find in ft_plot_vector >> >> : >> You need to first get the sem parameter from your data and setup so FT >> can see your sem or CI info. Follow the code here >> . >> Search for "data_sem" and fix those lines. >> Then: >> h = plot(hdat, vdat, style, 'LineWidth', linewidth, 'Color', color, ' >> markersize', markersize, 'markerfacecolor', markerfacecolor); >> Change this to: >> [h hp ]= boundedline(hdat, vdat, vdat_sem); >> >> Boundedline >> is >> a submission in the MATLAB file exchange. You can use any other thing. >> >> >> Good luck trying! :) >> >> >> -- >> Regards, >> Kousik Sarathy, S >> >> >> On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek >> wrote: >> >>> Dear fieldtrip community, >>> >>> I was wondering whether there is a way to plot the confidence intervals >>> in the ERP plot? I see that this question was asked multiple times in the >>> discussion list before, but I could not find an answer to this. >>> >>> Thanks, >>> Arti >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From belahian at memphis.edu Wed Oct 5 15:59:41 2016 From: belahian at memphis.edu (Bahareh Elahian (belahian)) Date: Wed, 5 Oct 2016 13:59:41 +0000 Subject: [FieldTrip] fieldtrip structure Message-ID: Hi All, I have a ".mat" file which contains: <8x10350000 double> and sampling rate. How should I import this data to field trip? By using [data] = ft_preprocessing( cfg); I am getting an error that the data should be in the format of raw or raw + comp. Any idea? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From belahian at memphis.edu Wed Oct 5 16:10:00 2016 From: belahian at memphis.edu (Bahareh Elahian (belahian)) Date: Wed, 5 Oct 2016 14:10:00 +0000 Subject: [FieldTrip] fieldtrip structure In-Reply-To: References: Message-ID: Sorry for the duplicated email. My mailbox sent it automatically. Please discard this email. Thanks! Bahar ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Bahareh Elahian (belahian) Sent: Wednesday, October 5, 2016 8:59:41 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] fieldtrip structure Hi All, I have a ".mat" file which contains: <8x10350000 double> and sampling rate. How should I import this data to field trip? By using [data] = ft_preprocessing( cfg); I am getting an error that the data should be in the format of raw or raw + comp. Any idea? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Wed Oct 5 17:21:19 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Wed, 5 Oct 2016 11:21:19 -0400 Subject: [FieldTrip] Neighbors for Elekta Neuromag 306 gradiometers separately? In-Reply-To: References: Message-ID: Dear all, I have the same question. Do we need to separate the two gradiometer sensors at one position when defining the neighbours for interpolating bad sensors? Thanks! Lin On Thu, Sep 17, 2015 at 3:43 AM, Darinka Trübutschek wrote: > Dear Fieldtrip community, > > I am new to MEG/fieldtrip and have a question regarding the neighbor > structure necessary for computing cluster-based statistics. I am currently > analyzing data from a Neuromag 306 system (with 102 Mags and 204 Grads) and > would like to look separately at Mags, Grad1, and Grad2. > I assume that this means that I also need to compute the neighbors > separately for the different channel types. > > My question therefore concerns fieldtrip's standard neighbor templates for > Neuromag. Is there a specific reason (theoretical or methodological), why > there are no separate templates for Grad1 and 2? All that I could find are > separate templates for Mag (neuromag306mag_neighb.mat), the combined planar > gradients (neuromag306cmb_neighb.mat), and the neuromag306planar_neighb.mat > template, which, if I understand correctly, does not combine the Grads, but > still lists sensors of one type as neighbors of sensors of another type > (e.g., for sensor 0713 - a gradiometer measuring the derivative along the > longitudinal component, the neighbors listed include 0432, 0723, but also > sensors that, if I interpret it correctly, should measure the derivative > along the latitudinal component, such as 0433, 0712, etc.) Is there a > specific reason, why sometimes, for a given sensor position, both Grad1 and > Grad2 are included in the neighbors (e.g., 0432 and 0433), but sometimes > only one of the two (e.g., 0742)? > > Many thanks in advance for your help! > > Best, > Darinka > -- > Darinka Trübutschek (PhD Candidate) > > Inserm-CEA Cognitive Neuroimaging Unit > CEA/SAC/DSV/DRM/Neurospin > Bât 145, Point Courier 156 > F-91191 Gif-sur-Yvette > > website: https://sites.google.com/site/dtruebutschek/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mklados at gmail.com Wed Oct 5 20:55:05 2016 From: mklados at gmail.com (Manousos Klados) Date: Wed, 5 Oct 2016 14:55:05 -0400 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) Message-ID: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Wed Oct 5 21:36:02 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Wed, 5 Oct 2016 21:36:02 +0200 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) In-Reply-To: References: Message-ID: Dear Dr Klados, thank you for sharing this event. I'm interested and I would like to ask you if video material will be sent to all the e-participants. I'm in the EEST time zone, but I'll be busy working at the time of the talks. Thank you in advance. Best Regards, Federica Mauro, Ph.D. Psychology Department - Sapienza University of Rome (Italy) Il 5 ott 2016 9:26 PM, "Manousos Klados" ha scritto: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 5 22:24:16 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 5 Oct 2016 20:24:16 +0000 Subject: [FieldTrip] fiff_read_tag error Message-ID: I have some old Neuromag MEG/EEG data files that I’m trying to read. One file is giving me a runtime error (the others appears ok): Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle 306 MEG channel locations transformed Reading sleep_DC_s3_13_raw.fif ... Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle Opening raw data file sleep_DC_s3_13_raw.fif... Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle Range : 28800 ... 518399 = 47.753 ... 859.547 secs Ready. Reading 28800 ... 518399 = 47.753 ... 859.547 secs...Error using fiff_read_tag (line 232) Cannot handle other than dense or sparse matrices yet Error in fiff_read_raw_segment (line 152) tag = fiff_read_tag(fid,this.ent.pos); Error in ft_read_data (line 1105) dat = fiff_read_raw_segment(hdr.orig.raw,begsample+hdr.orig.raw.first_samp-1,endsample+hdr.orig.raw.first_samp-1,chanindx); Any suggestions on how to debug/fix/read this file? All help is appreciated as I’m just starting with FieldTrip. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel." --- Maya Angelou ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 5 23:06:18 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 5 Oct 2016 21:06:18 +0000 Subject: [FieldTrip] error with ft_appenddata Message-ID: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From rhancock at email.arizona.edu Thu Oct 6 01:05:46 2016 From: rhancock at email.arizona.edu (Roeland Hancock) Date: Wed, 5 Oct 2016 16:05:46 -0700 Subject: [FieldTrip] Postdoctoral Position at UCSF in California, USA on cognitive neuroscience of language processing Message-ID: The Hoeft Lab (http://brainLENS.org PI: Fumiko Hoeft MD PhD) at the UCSF Dept of Psychiatry and Weill Institute for Neurosciences is looking for an exceptional postdoc in the field of neurolinguistics, with advanced neuroimaging, computational, programming and organizational skills. Training in genetics is a plus. The primary project that the postdoc will be responsible for is the examination of intergenerational neuroimaging using a ‘natural’ cross-fostering design that allows dissociation of genetic, prenatal and postnatal environment on brain networks that are transmitted across generations. Related articles from our lab can be found here - Yamagata et al. J Neurosci 2016 (http://goo.gl/vMK8iy), Ho et al. Trends in Neurosci 2016 (http://goo.gl/SyXLcK), and Scientific American (http://goo.gl/YTiH6D). There are many opportunities to be involved in other projects on the neuroscience of language and literacy. The position can begin immediately. Please email info at brainlens.org with a cover letter and your CV. Please add “[Postdoc job]” and your full name in the Subject of the email. Qualified candidates will be asked to have 3 letters of reference forwarded. Roeland Hancock -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 6 02:21:02 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 6 Oct 2016 00:21:02 +0000 Subject: [FieldTrip] error with ft_appenddata In-Reply-To: References: Message-ID: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won’t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif’; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Thu Oct 6 11:24:11 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Thu, 06 Oct 2016 10:24:11 +0100 Subject: [FieldTrip] =?utf-8?q?Official_Fieldtrip_Courses/Meetings_in_Euro?= =?utf-8?q?pe_this_year=3F?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear Fieldtrippers I was wondering if there are any official Fieldtrip courses/Meetings in Europe this year or early next year? best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From dlozanosoldevilla at gmail.com Thu Oct 6 11:47:29 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Thu, 6 Oct 2016 11:47:29 +0200 Subject: [FieldTrip] Official Fieldtrip Courses/Meetings in Europe this year? In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi, Take a look here: http://www.fieldtriptoolbox.org/workshop There's one in Tuebingen and another in Marseille. Ask the organizers to see if there're available seats best, Diego On 6 October 2016 at 11:24, parham hashemzadeh wrote: > Dear Fieldtrippers > I was wondering if there are any official Fieldtrip courses/Meetings in > Europe this year or early next year? > best regards parham > > On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > >> Hi Parham, >> >> Sorry for sounding cryptic earlier, I was just reciprocating the >> crypticity of the question. >> I think that the suggestion made in the previous e-mail is an >> excellent one. >> With the addition that, rather than using ft_determine_coordsys, you >> could use ft_plot_ortho to visualize an arbitrary cross-cut through >> your volumetric image. >> Note however, that the MR and the sourcespace should be in the same >> coordinate system for this to work. >> >> Best, >> Jan-Mathijs >> >> On 05 Oct 2016, at 00:47, A. Donda wrote: >>> >>> Hi Parham, >>> >>> if you wanna plot it in FieldTrip, these commands worked well for >>> me, but in my case (MEG data) I had to make sure first that these >>> data were on the same coordinate system (co-registration of MRI and >>> MEG sensor-data). If you do not have this issue, then you can simply >>> plot an MRI and a mesh obtained from freesurfer the following way >>> (make sure that both MRI and the mesh are in the same units, e.g. cm >>> or mm): >>> >>> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >>> >>> hold on >>> >>> ft_plot_mesh(sourcespace); >>> >>> Alternatively, if you want to plot the vertices of the mesh as dots, >>> you can use >>> >>> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >>> >>> sourcespace has the following structure (in case this is helpful for >>> you): >>> >>> pnt: [8196x3 double] >>> tri: [16384x3 double] >>> area: [16384x1 double] >>> orig: [1x1 struct] >>> unit: 'm' >>> >>> I obtained sourcespace by loading the boundary element model (bem) >>> surface, created with the watershed algorthim of Freesurfer: >>> >>> sourcespace = >>> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >>> 'format', 'mne_source'); %in meters >>> >>> Note that I had to transform the sourcespace dataset to the right >>> coordinate system and units. >>> >>> Finally I plotted the mri and mesh in cm >>> >>> To convert units in Fieldtrip, as you know, use X_cm = >>> ft_convert_units(X,'cm'); >>> >>> I hope this is helpful. >>> >>> Best >>> >>> A.Donda >>> >>> ------------------------- >>> >>> FROM: fieldtrip-bounces at science.ru.nl >>> on behalf of parham hashemzadeh >>> >>> SENT: Tuesday, October 4, 2016 6:08 PM >>> TO: FieldTrip discussion list >>> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >>> mri_aligned. >>> >>> Dear Darren >>> Thank you very much, and I will try to give it a go. >>> In the event that I can not. You are a life saver if you can help >>> me >>> out. Everything is in place except this incredibly important item. >>> I >>> have noticed that you are in Cambridge, maybe we can meet at some >>> point. >>> I am close by at the mathematics department. >>> Many many thanks >>> best regards parham >>> >>> On 2016-10-04 17:45, Darren Price wrote: >>> >>>> Hi Parham >>>> >>>> For a non-linear interpolation onto a regular grid, >>>> >>> spm_mesh_to_grid >>> >>>> might be ideal (from the spm package of course). I don't have a >>>> working example to hand, but I may be able to dig one out if you >>>> >>> can't >>> >>>> get it working. >>>> >>>> Darren >>>> >>>> >>>> ------------------------------------------------------- >>>> Dr. Darren Price >>>> Investigator Scientist and Cam-CAN Data Manager >>>> MRC Cognition & Brain Sciences Unit >>>> 15 Chaucer Road >>>> Cambridge, CB2 7EF >>>> England >>>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>>> TEL +44 (0)1223 355 294 x202 >>>> FAX +44 (0)1223 359 062 >>>> MOB +44 (0)7717822431 >>>> ------------------------------------------------------- >>>> >>>> >>>> -----Original Message----- >>>> From: fieldtrip-bounces at science.ru.nl >>>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>>> hashemzadeh >>>> Sent: 04 October 2016 16:59 >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >>>> >>> mri_aligned. >>> >>>> >>>> Hi Jan >>>> Thank you, my functional data are the function values of some >>>> function (irrotational component of the current). From my limited >>>> experience of Fieldtrip, your explanation feels (to myself) a bit >>>> cryptic at the moment. >>>> >>>> You see if my inversion strategy was one of the classical ones >>>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >>>> >>> eloreta >>> >>>> then the available fieldtrip tutorials are great in showing >>>> how to plot functional values on the top of anatomical values. >>>> But, since, I work on inversion methods, then I need a hacking >>>> strategy to be able to plot functional values of "some >>>> function"(estimated) on top of anatomical data MRI. >>>> >>>> I would appreciate if you would kindly let me know, if there is >>>> >>> hack >>> >>>> to it such that >>>> ft_sourceplot can accept the input. >>>> best regards parham >>>> >>>> >>>> >>>> >>>> >>>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> >>>>> Hi Parham, >>>>> >>>>> It is possible, but certainly not pain free, nor >>>>> >>>> straightforward. >>> >>>> I think this is not really a fieldtrip question, but more a >>>>> >>>> general >>> >>>> matlab related issue. >>>>> >>>>> It should be possible to plot a slice through an MRI volume as a >>>>> MATLAB patch, where the coordinates of the voxels are expressed >>>>> >>>> in >>> >>>> some coordinate system. Then, it is possible to generate and >>>>> intersection of the freesurfer mesh through the plane of >>>>> visualization. >>>>> >>>>> Best, >>>>> Jan-Mathijs >>>>> >>>>> >>>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >>>>>> >>>>> wrote: >>> >>>> >>>>>> Dear Fieldtrippers >>>>>> Is there a straightforward pain free method ( I appreciate if >>>>>> >>>>> you can >>> >>>> give me the command) >>>>>> to plot arbitrary points such as the vertices of the freesurfer >>>>>> >>>>> >>> output >>>>>> (mesh) onto the MRI image? >>>>>> The reason that I ask is that I would like to plot my solution >>>>>> >>>>> on the >>> >>>> MRI image. >>>>>> Unfortunately I do not use dipoles. In EEG, I model the >>>>>> >>>>> irrotational >>> >>>> component of the current as a scalar function and therefore I >>>>>> >>>>> am >>> >>>> doing >>>>>> function estimation. >>>>>> IF you use dipoles, it is straightforward because you follow >>>>>> >>>>> one of >>> >>>> the tutorials. >>>>>> But if you do not use dipoles and model the current as the >>>>>> >>>>> gradient >>> >>>> of the irrotational component of the current in EEG then one >>>>>> >>>>> can get >>> >>>> lost. >>>>>> Any help would be appreciated. >>>>>> Many thanks >>>>>> >>>>>> -- >>>>>> best regards >>>>>> Parham Hashemzadeh >>>>>> Research Associate >>>>>> Department of Applied Mathematics and Theoretical Physics >>>>>> University of Cambridge, UK. >>>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>>> >>>> >>>> -- >>>> best regards >>>> Parham Hashemzadeh >>>> Research Associate >>>> Department of Applied Mathematics and Theoretical Physics >>>> University of Cambridge, UK. >>>> email: hashemzadeh at damtp.cam.ac.uk >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >> >> >> >> Links: >> ------ >> [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price >> [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Thu Oct 6 15:35:01 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Thu, 6 Oct 2016 09:35:01 -0400 Subject: [FieldTrip] ICA components for gradiometer sensors Message-ID: Dear all, I applied ICA ('runica' method) to 202 gradiometer sensors (collected with neuromag system) after removing two bad channels and some trials that contained obvious artifacts. I could identify the EOG and ECG components, but the topographic distributions of the components look quite weird to me (i.e., the strips). I attached a screenshot of some components in the email. Could you help me to see whether there is anything wrong with the ICA analysis? Thanks a lot! Best, Lin [image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ICA_GRAD.png Type: image/png Size: 574403 bytes Desc: not available URL: From elizabeth.1.shephard at kcl.ac.uk Thu Oct 6 16:03:01 2016 From: elizabeth.1.shephard at kcl.ac.uk (Shephard, Elizabeth) Date: Thu, 6 Oct 2016 14:03:01 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis Message-ID: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King's College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 6 16:35:39 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 6 Oct 2016 14:35:39 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis In-Reply-To: References: Message-ID: <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> Dear Lizzie, You haven’t done anything wrong, and the output is exactly as expected. You almost solved it yourself, since indeed you would want to need the option cfg.avgoverfreq = ‘yes’, but this should be invoked in another function: cfg = []; cfg.avgoverfreq = ‘yes’; FFThann = ft_freqanalysis(cfg, FFThann); Best wishes, Jan-Mathijs On 06 Oct 2016, at 16:03, Shephard, Elizabeth > wrote: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.1.shephard at kcl.ac.uk Thu Oct 6 16:51:45 2016 From: elizabeth.1.shephard at kcl.ac.uk (Shephard, Elizabeth) Date: Thu, 6 Oct 2016 14:51:45 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis In-Reply-To: <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> References: , <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> Message-ID: Dear Jan-Mathijs Brilliant, thanks for getting back to me. I have it working now with the second step :) Many thanks Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Schoffelen, J.M. (Jan Mathijs) Sent: 06 October 2016 15:35:39 To: FieldTrip discussion list Subject: Re: [FieldTrip] Outputting average power with ft_freqanalysis Dear Lizzie, You haven’t done anything wrong, and the output is exactly as expected. You almost solved it yourself, since indeed you would want to need the option cfg.avgoverfreq = ‘yes’, but this should be invoked in another function: cfg = []; cfg.avgoverfreq = ‘yes’; FFThann = ft_freqanalysis(cfg, FFThann); Best wishes, Jan-Mathijs On 06 Oct 2016, at 16:03, Shephard, Elizabeth > wrote: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Fri Oct 7 03:08:15 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Fri, 07 Oct 2016 01:08:15 +0000 Subject: [FieldTrip] inverse problem for HCP Message-ID: Hi all, I am trying to compute the inverse source localization with beamforming in HCP, then the volume segment of provided MRI is one of the first steps, but as the ordsys of the MRI is not available this segmentation is not possible, I would to know what is solution? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Oct 7 21:40:56 2016 From: russgport at gmail.com (russ port) Date: Fri, 7 Oct 2016 15:40:56 -0400 Subject: [FieldTrip] Failure of LCMV beamformer for Neuromag VectorView planar gradiometers In-Reply-To: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> References: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> Message-ID: <0C79E9BD-15C3-40EF-820C-7B676A9D1D7D@gmail.com> Hi, I realize that my previous email was far too long. In short: I'm having some trouble localizing some auditory steady state elekta data using LCMV beamformer in fieldtrip. I'm localizing the magnetometers and gradiometers separately and while the magnetometers are giving good results the gradiometers are not (see attached ppt). I suspect that this is due to the gradiometer data matrix being rank difficient due to running maxFilter. Does anyone have any suggestions on how to run LCMV beamforming on SSS’d elekta gradiometer data? Thanks​ Russ > On Oct 1, 2016, at 12:34 PM, russ port wrote: > > Dear Fieldtrippers/Fieldtrippians > > I was hoping someone could help me with an issue I have come across during my analyses of a preliminary study. In brief, for the study a person was scanned on a CTF 275 channel biomagnetometer and then directly after on a 306 channel Elekta Neuromag VectorView platform. During the scans, the subject listened to a 40Hz amplitude modulated 500Hz tone (to generate a 40Hz Auditory Steady-state Response [ASSR]). In order to get the Elekta-derived data into a workable format, the Elekta-derived was MaxFilter’d for SSS (not tsss). After this, to analyze the datasets in an analogous manner, all datasets (both CTF- and Elekta-derived datasets [planar gradiometers and magnetometers analyzed separately]) were artifact cleaned (artifact rejection for jump/muscle artifact, ICA rejection of EOG/ECG components - OF NOTE FOR ELEKTA DATA THE ICA OUTPUT WAS LIMITED TO THE RANK OF THE DATA [BECAUSE OF SSS NOTED ABOVE]). Then the data was averaged, and a LCMV beamformer (ipsi-lateral channels only) targeted at the subject’s right or left hemisphere Helsch’s Gyrus was used to generate a ASSR time course. Attached (within the powerpoint slide deck) are figures showing the results . For each figure, the left column shows data that is just read with with no artifact correction (incase the ICA routines were improperly deforming the data), and the right column show the results of the methodology described above. The first and second row is the time-locked data from all sensors, both broad band (1st row - and also what is passed to the LCMV beamformer), and band-passed for gamma-band activity (30-58Hz). The third and forth rows are similar, though show the virtual electrodes time course (orientated to the ASSR). Hopefully you would agree that the CTF and Elekta magnetometer virtual electrode time course/results seem very appropriate. On the other hand, the Elekta planar gradiometer time course seem “lack-luster” to say the best. I did try to look into this, and found that during the beamforming, both CTF and Elekta magnetometers are rank sufficient (rank= number of channels for that hemisphere). The planar gradiometers on the other hand are rank deficient, which based on my understanding of the steps of an LCMV beamformer may be quite problematic. Has anyone else experienced this before and/or have suggestions how to circumvent this issue of poor planar gradiometer results from a LCMV beamformer? > > Best, > Russ Port > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pooneh.baniasad at gmail.com Mon Oct 10 13:55:02 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Mon, 10 Oct 2016 15:25:02 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> References: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> Message-ID: Dear Simon Thanks a lot for your attention and sorry for the late response. I've actually found which part of the code makes a problem. I used the ft_prepare_vol_sens's function in a wrong way. Now I have another problem. I change the coordination system from 'ctf' to 'spm' by using this code: cfg = []; [mri] = ft_volumenormalise(cfg, mri); When I segmented 'scalp' separately and prepared mesh from it, the figure was well (1.fig). On the other hand when I changed the segmentation into {'brain', 'skull', 'scalp'}, the scalp can not be computed properly (2.fig). On Mon, Oct 3, 2016 at 4:57 PM, Simon Homolle wrote: > Dear Pooneh, > > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem > > I relate to this part: > > > When the forward solution is computed, the lead field matrix (= channels > X source points matrix) is calculated *for each grid point* taking into > account the head model and the channel positions. > > > So I assume your mesh consists of 2000 grid points? > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 03 Oct 2016, at 13:01, pooneh baniasad > wrote: > > Dear Simon, > > I've followed this tutorial: > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct > the headmodel ('VolBEM') > I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for > 'DipPos'. > Is it clear or should I explain more? 🙂 > > On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle > wrote: > >> Dear pooh, >> >> Could you provide more information how you constructed your BEM-model? >> >> best regards, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 02 Oct 2016, at 12:22, pooneh baniasad >> wrote: >> >> Dear FieldTrip community >> >> I'm using the forward model to simulating EEG signal although it seems >> the dimension of the lead-field matrix is not correct. Here is a review of >> the procedure. >> >> First I constructed a BEM headmodel for EEG source analysis ​and then by >> loading the template cortex, I put the dipoles with specific current source >> on that. I expect the dimension of the lead-field matrix will be m*n which >> m=electrode's number and n=3*dipole's number but 'm' is different. >> Since I used the template electrode 'standard_1020.elc', m = 97 according >> to: >> >> chanpos: [97x3 double] >> chantype: {97x1 cell} >> chanunit: {97x1 cell} >> elecpos: [97x3 double] >> label: {97x1 cell} >> type: 'eeg1010' >> unit: 'mm' >> >> while the dimension of lead-field matrix is: 2000x122880 >> >> I use this function for calculating lead-field matrix: >> >> LF = ft_compute_leadfield(DipPos, elec, VolBEM); >> ​I do not understand why the number of raws are different​! >> >> ​On the other hand I guess that there is a similarity between the number >> of raws in the volume head model and LF matrix due to the dimension of >> headmodel matrix is: 2000x8000 double .​ >> >> ​I will be so thankful if anyone can help me.​ >> >> -- >> Bests >> >> Pouneh Baniasad >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.jpg Type: image/jpeg Size: 96708 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.jpg Type: image/jpeg Size: 84068 bytes Desc: not available URL: From alexander.whillier at med.uni-goettingen.de Mon Oct 10 19:39:03 2016 From: alexander.whillier at med.uni-goettingen.de (Whillier, Alexander) Date: Mon, 10 Oct 2016 17:39:03 +0000 Subject: [FieldTrip] Help importing and reading data Message-ID: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> Dear Fieldtrip, I have inherited a dataset of EMG and EEG data that was gathered using two different programs. One of my colleagues has taught me the basics of fieldtrip and I only a beginner at Matlab at the moment. I am trying to analyse both data sets using fieldtrip. The first dataset (which works) is .cnt data gathered using EEG Probe. The second dataset (which fieldtrip currently fails to recognise) is .cfs data gathered using Signal. I am able to export the data as .mat files, to read them in Matlab using Fieldtrip. However, in spite of my best efforts to create a header file and header format that the preprocessing code will accept, I am unable to proceed. I get constant errors: Error using ft_read_header (line 2158) unsupported header format (matlab) Error in ft_preprocessing (line 394) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Even though my cfg.hdr section has all of these values, I cannot find a way to get it to run the preprocessing code. Can you help? Kind regards, Alexander Whillier -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.sciences at gmail.com Mon Oct 10 19:58:23 2016 From: peter.sciences at gmail.com (Peter Soros) Date: Mon, 10 Oct 2016 19:58:23 +0200 Subject: [FieldTrip] PhD position in psychiatric neuroimaging (Oldenburg, Germany) Message-ID: Dear All, The University Clinic of Psychiatry and Psychotherapy, University of Oldenburg, Germany (Director: Prof. Dr. Alexandra Philipsen) offers a PhD position (65 % of full time TV-L 13, 3 years) in multimodal psychiatric neuroimaging. The successful PhD student will investigate the neural correlates of attention deficit hyperactivity disorder (ADHD) and borderline personality disorder, using the state-of-the-art infrastructure of the University Clinic and the newly founded Neuroimaging Center, including a Siemens Prisma MRI at 3 Tesla with 64-channel head coil, a 306-channel Elekta Neuromag Triux magnetoencephalography system, EEG and TMS. This position is embedded in an excellent interdisciplinary scientific environment with a strong focus on neurosensory, neurocognitive and psychiatric research. The University Clinic of Psychiatry and Psychotherapy is part of the rapidly growing European Medical School, founded by the Universities of Oldenburg, Germany, and Groningen, The Netherlands. Applicants are expected to hold a master's degree in the field of psychology, neuroscience, physics or a related discipline, or a medical degree. Prior experience with the analysis of MRI, EEG or MEG data is highly desirable. Computer programming and statistical skills are an asset. Oldenburg is an attractive and safe city with a population of 160.000 in Germany's northwest with excellent quality of life. It is close to Bremen, Hamburg and Groningen, and approximately 1 h from the North Sea. The University of Oldenburg is an equal opportunity employer aiming to increase the proportion of female academic members. Therefore, we especially encourage women to apply. Applicants with disabilities will be given preference if equally qualified. Applications should include a cover letter, CV, copy of the master's thesis or other written work, university grades and the contact details of two academic references and should be sent to Prof. Dr. Alexandra Philipsen, Director of the University Clinic of Psychiatry and Psychotherapy, University of Oldenburg, Germany via e-mail (alexandra.philipsen at uni-oldenburg.de ). For additional information, please contact Dr. Peter Soros (phone +49.441.9615.1503; peter.soeroes at uni-oldenburg.de ) Deadline for application: October 31, 2016 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Holding at nottingham.ac.uk Tue Oct 11 18:26:11 2016 From: Martin.Holding at nottingham.ac.uk (Martin Holding) Date: Tue, 11 Oct 2016 16:26:11 +0000 Subject: [FieldTrip] Cluster Based Permutation Stats on Source Spaced Frequency Data Message-ID: <218876b60d2a47b99ad1d80347ff8e8c@frigg-vm0.nus.ihr.mrc.ac.uk> Hello Fieldtrip, This is my first posting so I'll introduce myself. My name is Martin and I'm a PhD student at the Institute of Hearing Research in Nottingham, primarily interested in auditory oscillations associated with tinnitus using EEG and MEG. This problem is from a project I did a while back but I'm just wrapping up now. I'm having a problem with running some cluster based permutation statistics on some frequency and timelocked MEG data I have. The first thing to mention is that the code runs fine. Fieldtrip is happy to run the tests, the problem is that I am getting no significant clusters out of it. This is in spite of some rather large t-values that might suggest otherwise. I suspect this is due to the fact that the frequency and timelocked data I am passing to the relevant stats functions (ft_freqstatistics and ft_timelockstatistics respectively) is analysed in source space, not sensor space. Unfortunately, due to data artefacts it isn't possible for me to do these analyses in sensor space. As such, I think that fieldtrip is telling me I have no clusters because it defines clusters based on neighbouring channels/sensors supplied by a layout template which it no longer has access too because I'm in source space on an MNI grid system. I have 2 questions then: 1. Is this a sensible conclusion for why I'm getting no significant clusters? 2. And if so, is there a way I can make the fieldtrip statistics functions recognise MNI grids and calculate the neighbours on grid points rather than sensors? Many thanks, Martin ============================================================== Martin Holding PhD Student MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115 74) 86938 Email: martin.holding at nottingham.ac.uk ============================================================== Martin Holding PhD Student MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115 74) 86938 Email: martin.holding at nottingham.ac.uk This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 12 09:48:31 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 12 Oct 2016 07:48:31 +0000 Subject: [FieldTrip] Help importing and reading data In-Reply-To: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> References: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> Message-ID: Hi Alexander, If you have managed to convert the data into a mat-file, in general it is not needed to go through ft_preprocessing to get the data loaded into memory. In general, providing cfg.datafile = ‘somefilename.mat’ will not work. I’d recommend to look here: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat, and in particular at the ‘circumvent the fieldtrip reading functions’ section. The idea is to create a fieldtrip-style data structure that can serve as an input argument to downstream processing functions. Good luck, Jan-Mathijs On 10 Oct 2016, at 19:39, Whillier, Alexander > wrote: Dear Fieldtrip, I have inherited a dataset of EMG and EEG data that was gathered using two different programs. One of my colleagues has taught me the basics of fieldtrip and I only a beginner at Matlab at the moment. I am trying to analyse both data sets using fieldtrip. The first dataset (which works) is .cnt data gathered using EEG Probe. The second dataset (which fieldtrip currently fails to recognise) is .cfs data gathered using Signal. I am able to export the data as .mat files, to read them in Matlab using Fieldtrip. However, in spite of my best efforts to create a header file and header format that the preprocessing code will accept, I am unable to proceed. I get constant errors: Error using ft_read_header (line 2158) unsupported header format (matlab) Error in ft_preprocessing (line 394) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Even though my cfg.hdr section has all of these values, I cannot find a way to get it to run the preprocessing code. Can you help? Kind regards, Alexander Whillier _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Oct 12 11:51:34 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 12 Oct 2016 11:51:34 +0200 Subject: [FieldTrip] Post-doctoral position in Cognitive Neuroscience, Charite Berlin Message-ID: The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a Post-doctoral position. A Grant by the German Research Foundation (DFG) will fund the position for a 30-months period. The main objective of the project is to examine multisensory processing in patients with schizophrenia. Recent studies have suggested multisensory processing deficits in patients with schizophrenia, but the neurophysiologic mechanisms underlying these deficits are not well understood. This project comprises of electroencephalography studies using multisensory paradigms for which effects in neural oscillations have been previously established in healthy individuals. Multisensory processing, as reflected in local power, dynamic network patterns, and functional connectivity will be examined in schizophrenia patients and healthy control participants. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Experience in human EEG/MEG studies, Matlab programming skills, as well as German language skills for interacting with patients are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades), as well as information on the earliest possible date to start the position until October 21, 2016, electronically to: Daniel Senkowski, Department of Psychiatry and Psychotherapy, Charité, University Medicine Berlin, 10115 Berlin, Germany, Phone: +49-30-2311-2738, Fax: +49-30-2311-2209, daniel.senkowski at charite.de. Regards, Daniel Senkowski -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From ph442 at cam.ac.uk Wed Oct 12 12:33:36 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Wed, 12 Oct 2016 11:33:36 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear All I tried your recommendations and I was unsuccessful. The platform is hardwired for dipole analysis. Any other suggestions, would be appreciated. best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From sander at mpib-berlin.mpg.de Wed Oct 12 14:46:56 2016 From: sander at mpib-berlin.mpg.de (Sander, Myriam) Date: Wed, 12 Oct 2016 12:46:56 +0000 Subject: [FieldTrip] Post-doctoral position at MPI for Human Development, Berlin Message-ID: Dear Colleagues, We have an open post-doc position for which we are still searching the ideal candidate – a person with a strong background in memory research and experience with advanced statistical analysis (machine-learning techniques like SVM, RSA…). In collaboration with Nikolai Axmacher (Ruhr Universität Bochum), we plan a project on age-differences in memory reactivation that will be conducted at the Center for Lifespan Research of the Max Planck Institut for Human Development in Berlin in the context of the MINERVA research group headed by Dr. Myriam Sander (https://www.mpib-berlin.mpg.de/en/research/lifespan-psychology/projects/cognitive-and-neuronal-dynamics-of-memory) Research of the MINERVA research group (PI: Dr. Myriam Sander) focuses on age-differences in memory representations. We aim to track memory representations across their life-cycles in terms of specific distributed patterns of neural activity. We investigate whether aging changes the quality of the representational patterns and thereby affects memory performance. We want to understand how aging affects the distinctiveness and similarity of memory representations during memory formation, replay, and retrieval. Research of the MINERVA group uses mainly electroencephalography (EEG) with a focus on oscillatory measures to uncover lifespan differences in mechanisms underlying memory performance (see e.g. Sander, et al., Neurosci. Biobehav. Rev., 2012). We also have access to a 3T scanner, TMS and eye tracker. Our research group is located at the Max Planck Institute for Human Development (MPIB) in Berlin with an international working atmosphere. The official deadline for applications has passed already, but we decided to wait for the ideal candidate for this project – so if you know her or him, please let her/him know and encourage her/him to apply! Thanks for spreading the word! With best regards from Berlin, Myriam Sander -- Dr. Myriam C. Sander Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94 14195 Berlin +49 (0)30 82 406 414 sander at mpib-berlin.mpg.de www.mpib-berlin.mpg.de/en/staff/myriam-c-sander -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PostDoc MPIB.pdf Type: application/pdf Size: 56405 bytes Desc: PostDoc MPIB.pdf URL: From son.ta.dinh at tum.de Wed Oct 12 17:06:08 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Wed, 12 Oct 2016 15:06:08 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Wed Oct 12 18:00:59 2016 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 12 Oct 2016 18:00:59 +0200 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son, Without directly referring to the Achard paper: In one sentence, how do you define the hub disruption index in terms of human brain function? In one sentence, how does the single value represent the definition you have provided in the previous sentence? If you have the right answers to these two simple questions, then the manner in which the null is defined computationally should be intuitive to you. Regards, Matthew On Wed, Oct 12, 2016 at 5:06 PM, Ta Dinh, Son wrote: > Hey Matthew, > > > > Thanks for the answer, but the question is exactly how to actually build a > representative null distribution. As the calculation using all (64) > electrodes is deterministic, it can’t really be used to create a > distribution, it would just be a vector of 1000 x 1 exact same value. > > The graph measure is called hub disruption index and was introduced here: > Achard, S., et al. (2012). "Hubs of brain functional networks are radically > reorganized in comatose patients." PNAS. > > To put it in a nutshell, it compares a subject against a group of > controls, thereby giving a single value for every subject (in comparison to > the control group). > > > > I hope this has cleared up the context a bit. > > > > Best > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > *Von:* Nickel, Moritz > *Gesendet:* Mittwoch, 12. Oktober 2016 16:37 > *An:* Ta Dinh, Son > *Betreff:* Fwd: [FieldTrip] Statistical test of robustness of a graph > measure based on reduced amount of nodes > > > > > > ---------- Forwarded message ---------- > From: *Matt Gerhold* > Date: 2016-10-05 13:31 GMT+02:00 > Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure > based on reduced amount of nodes > To: FieldTrip discussion list > > Hi Son, > > What you are explaining sounds like resampling to build a distribution > under the null hypothesis. You would need to make sure that your random > draws are representative in some way of an instance where the test > statistic (graph theoretic measure) is truly zero, i.e. representative of > the null hypothesis. There is no info on your measure, so one can't comment > any further on how one would achieve this. > > Once you have the bootstrapped distribution you compute the proportion of > values above the test statistic and those below the test statistic--the > test statistic is the measure you got from the actual sample, not the > bootstrapped distribution. > > Then it depends whether you use a two-tail or one-tail test and the > direction of the hypothesized effect: for a one-tail test you could > potentially take the proportion of the distribution above equal to the test > statistic, that would be your p-value. For two tailed-tests take the min > value of the two-proportions as your p-value and remember to divide alpha > by 2 to test for significance. > > That, in a nutshell, is a simple approach; however, there are other ways > to go about this. > > Matthew > > > > On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son wrote: > > Dear Fieldtrippers, > > > > the general problem we are facing is one of statistics. In particular, we > are trying to test the robustness of a graph measure when reducing the > amount of nodes it is computed with. In our case, we use the EEG electrodes > as nodes. > > > > We are trying to find out whether a graph measure differs significantly > from zero over a group of subjects. The exact calculation of the measure is > rather complicated to explain, suffice it to say that every subject has > exactly one scalar value in the end. Computation of this measure using 64 > electrodes is straightforward and we can easily calculate a p-value and/or > a confidence interval. > > When we calculate based on only 32 electrodes however, we draw 32 > electrodes randomly. Therefore, we need to repeat this computation many > times (let’s say 1000 times). So we then get [1000 x number of subjects] > values, or 1000 p-values/confidence intervals. > > How do we statistically test whether the measure is robustly different > from 0? Is it too naive to simply assume that if the confidence interval > does not contain 0 in at least 950 of the 1000 computations then it is > robustly different from 0? > > > > Any help would be greatly appreciated! > > > > Best regards, > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Darren.Price at mrc-cbu.cam.ac.uk Wed Oct 12 19:00:42 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Wed, 12 Oct 2016 17:00:42 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From son.ta.dinh at tum.de Thu Oct 13 11:25:14 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Thu, 13 Oct 2016 09:25:14 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Darren.Price at mrc-cbu.cam.ac.uk Thu Oct 13 14:15:53 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Thu, 13 Oct 2016 12:15:53 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son For who have emailed asking for code, it is pasted below. Son, I see what you mean. In that case creating surrogate data is still necessary, since you need a way to generate a confidence interval for each set of N channels. A rough outline of your pipeline would be: (this is all assuming your measure is not simply a function of the covariance matrix) for si = each surrogate dataset (1:1000): 64chanresult = compute result for 64 chan configuration for chani = each N of channels ranging from 64:32 Nchanresult = compute result for 64 chan configuration change(si, chani) = 64chanresult - Nchanresult end end then you can plot your data as a line graph with confidence intervals. I dug out a script I used a while ago, although you might want to check that it works properly (comparing correlation matrices of input/output). The main caveat is that you need to check that you take care of negative frequencies adequately. Here I have used a method of simply cancelling negative frequencies. The other way is to use the complex conjugate, but I found that less stable, perhaps due to numerical imprecision – I’m not sure. Anyway you should verify for yourself that the correlation matrix of your original data is almost exactly the same as your surrogate data (within reason: differences on the order of <1e-5, although this depends on the length of the data). You should detrend and filter before using this function. function data = randomisePhase(data, equalphase) % data = array: [time, channels] % equalphase boolean: [true | false] (do you want the same phase shift in % each channel? default = true) if nargin == 1 equalphase = true; end L = size(data, 1); data = fft(data)*2; data(L/2+1:end, :) = 0; randphase = exp(1i*randn(1,L)*2*pi)'; % uses the same phase for each channel for ii = 1:size(data,2) if equalphase == false randphase = exp(1i*rand(L,1)*2*pi)’; end data(:,ii) = real(ifft(data(:,ii).*randphase)); end Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 13 October 2016 10:25 To: FieldTrip discussion list Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RossiterH at cardiff.ac.uk Thu Oct 13 15:09:39 2016 From: RossiterH at cardiff.ac.uk (Holly Rossiter) Date: Thu, 13 Oct 2016 13:09:39 +0000 Subject: [FieldTrip] EMG detect Message-ID: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn't seem to recognise the term 'trialfun_emgdetect' - I've tried with the most recent version of fieldtrip and it's still not working. This is the error I'm getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 13 15:24:30 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 13 Oct 2016 13:24:30 +0000 Subject: [FieldTrip] EMG detect In-Reply-To: References: Message-ID: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> Hi Holly, You should first create this function, by copying and pasting from the example (essentially just take the second block of code on the page you are working from). Then, you may need to adjust a bit of the code for your own purpose (most likely the name of the emg-channel. Good luck, Jan-Mathijs On 13 Oct 2016, at 15:09, Holly Rossiter > wrote: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn’t seem to recognise the term ‘trialfun_emgdetect’ – I’ve tried with the most recent version of fieldtrip and it’s still not working. This is the error I’m getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RossiterH at cardiff.ac.uk Thu Oct 13 15:29:47 2016 From: RossiterH at cardiff.ac.uk (Holly Rossiter) Date: Thu, 13 Oct 2016 13:29:47 +0000 Subject: [FieldTrip] EMG detect In-Reply-To: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> References: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> Message-ID: Oh I see, thank you. It’s working now. Holly From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Schoffelen, J.M. (Jan Mathijs) Sent: 13 October 2016 14:25 To: FieldTrip discussion list Subject: Re: [FieldTrip] EMG detect Hi Holly, You should first create this function, by copying and pasting from the example (essentially just take the second block of code on the page you are working from). Then, you may need to adjust a bit of the code for your own purpose (most likely the name of the emg-channel. Good luck, Jan-Mathijs On 13 Oct 2016, at 15:09, Holly Rossiter > wrote: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn’t seem to recognise the term ‘trialfun_emgdetect’ – I’ve tried with the most recent version of fieldtrip and it’s still not working. This is the error I’m getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Fri Oct 14 08:08:09 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Fri, 14 Oct 2016 15:08:09 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering Message-ID: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> Dear community, My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. I am new to Fieldtrip. My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). The recording system is Neuralynx. I have encountered 2 problems which I don’t believe are related. I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. 1) Fsample discrepancy between data and header. When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. 2) 50Hz line noise filtering The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. To give an idea: cfg = []; cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 cfg.bsfreq = [49.9 50.1]; filtDat = ft_preprocessing(cfg, data_lite); cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below changes this into that {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: dat = ft_read_data(dataset_dir); dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); changes this into that Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) Of course, I tried to feed that filtered data into the preprocessing pipeline by doing cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. data_artifact_rejected = ft_preprocessing(cfg, dat_filt); But I get the error that dat_filt is not raw or comp data. I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. So for this point: - how to make the (recommended) 50Hz post processing work? - or more simply, how could I feed prefiltered data to ft_preprocessing? Thank you very much for your consideration and I look forward to your help. All the best, Florian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: data_lite.jpeg Type: image/jpeg Size: 32603 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: filtDat.jpeg Type: image/jpeg Size: 32794 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RawData.jpeg Type: image/jpeg Size: 51182 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RawData_after_filter.jpeg Type: image/jpeg Size: 46294 bytes Desc: not available URL: From knutsenpm at gmail.com Fri Oct 14 10:43:12 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 10:43:12 +0200 Subject: [FieldTrip] Data browser trouble Message-ID: Hi, My calls to ft_databrowser([], data) is failing with: >the input is raw data with 16 channels and 10 trials >detected 0 visual artifacts >Error using zeros >Size inputs must be integers. >Error in convert_event>artifact2artvec (line 179) >artvec = zeros(length(artifact), endsample); >Error in convert_event (line 103) > obj = artifact2artvec(obj,endsample); >Error in ft_databrowser (line 535) >artdata.trial{1} = convert_event(artifact, 'boolvec', 'endsample', datendsample); % every >artifact is a "channel" I am not certain if this is triggered by a lack of artifacts in my data, that my data structure is missing information, or that the code does not allow for "zero artifacts" by design. Here is my data structure: data = hdr: [1x1 struct] fsample: 4800 sampleinfo: [10x2 double] trial: {1x10 cell} time: {1x10 cell} label: {16x1 cell} cfg: [1x1 struct] My data is loaded through a custom reader as the data format I have is not supported natively by fieldtrip. I have succeeded in pre processing the data with ft_redefinetrial() and ft_preprocessing(). Any ideas? *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Fri Oct 14 11:08:44 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 11:08:44 +0200 Subject: [FieldTrip] Data browser trouble In-Reply-To: References: Message-ID: Oops, seems I was too quick to ask for help. I traced the error to my trial definitions which were not specified as integer samples. That led to the "​Size inputs must be integers" error below. Might it be an idea to place a check for integer values in cfg.trl when passed to ft_redefinetrial()? - Per On Fri, Oct 14, 2016 at 10:43 AM, Per Knutsen wrote: > Hi, > My calls to ft_databrowser([], data) is failing with: > > >the input is raw data with 16 channels and 10 trials > >detected 0 visual artifacts > >Error using zeros > > > ​​ > Size inputs must be integers. > >Error in convert_event>artifact2artvec (line 179) > >artvec = zeros(length(artifact), endsample); > >Error in convert_event (line 103) > > obj = artifact2artvec(obj,endsample); > >Error in ft_databrowser (line 535) > >artdata.trial{1} = convert_event(artifact, 'boolvec', 'endsample', > datendsample); % every >artifact is a "channel" > > I am not certain if this is triggered by a lack of artifacts in my data, > that my data structure is missing information, or that the code does not > allow for "zero artifacts" by design. > > Here is my data structure: > > data = > hdr: [1x1 struct] > fsample: 4800 > sampleinfo: [10x2 double] > trial: {1x10 cell} > time: {1x10 cell} > label: {16x1 cell} > cfg: [1x1 struct] > > My data is loaded through a custom reader as the data format I have is not > supported natively by fieldtrip. > > I have succeeded in pre processing the data with ft_redefinetrial() and > ft_preprocessing(). > > Any ideas? > > > *Per M Knutsen* > University of Oslo > Dept. of Molecular Medicine, Physiology Sect. > PB 1103 Blindern, NO-0317 Oslo > +47.45103762 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Fri Oct 14 15:17:23 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 15:17:23 +0200 Subject: [FieldTrip] Definition of "mid-sagittal point" Message-ID: I am working my way through the mouse EEG tutorial, here: http://www.fieldtriptoolbox.org/tutorial/mouse_eeg In the "Reading and coregistering..." I load the reference MRI data and start realignment to stereotactic coordinates with ft_volumerealign(). I need to select 3 fiducials: lambda, bregma and the midsagittal point. In this context, where should the "midsagittal point" be put in xyz? *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 ​​ -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Sat Oct 15 09:25:38 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Sat, 15 Oct 2016 16:25:38 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> Message-ID: <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Dear all, I am wondering, was my question unclear, or maybe no one is using Neuralynx data? I can think of ways to avoid these two problems, but I would prefer to find a proper solution if possible. Thanks in advance, Florian Gerard-Mercier > On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier wrote: > > Dear community, > > > My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. > > > I am new to Fieldtrip. > My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). > The recording system is Neuralynx. > > I have encountered 2 problems which I don’t believe are related. > I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. > > 1) Fsample discrepancy between data and header. > When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). > This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). > Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). > This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… > Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. > > 2) 50Hz line noise filtering > The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. > To give an idea: > cfg = []; > cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 > cfg.bsfreq = [49.9 50.1]; > filtDat = ft_preprocessing(cfg, data_lite); > > cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; > ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below > > changes this > > > into that > > > > {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} > > This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: > dat = ft_read_data(dataset_dir); > dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); > changes this > > > into that > > > > Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) > > Of course, I tried to feed that filtered data into the preprocessing pipeline by doing > cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. > data_artifact_rejected = ft_preprocessing(cfg, dat_filt); > But I get the error that dat_filt is not raw or comp data. > > I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. > > So for this point: > - how to make the (recommended) 50Hz post processing work? > - or more simply, how could I feed prefiltered data to ft_preprocessing? > > > > > Thank you very much for your consideration and I look forward to your help. > > All the best, > > > Florian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Sat Oct 15 14:18:55 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Sat, 15 Oct 2016 14:18:55 +0200 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Message-ID: Dear Florian, You are not clear about your actual sample rate: > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. Clearly, you should know your own sampling rate from the Neurolynx acquisition software. It would seem this is the primary thing you need to resolve. Regards, Per *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 On Sat, Oct 15, 2016 at 9:25 AM, Florian Gerard-Mercier < florian at brain.riken.jp> wrote: > Dear all, > > I am wondering, was my question unclear, or maybe no one is using > Neuralynx data? > I can think of ways to avoid these two problems, but I would prefer to > find a proper solution if possible. > > Thanks in advance, > > Florian Gerard-Mercier > > > > On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier < > florian at brain.riken.jp> wrote: > > Dear community, > > > My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory > in Riken BSI, Japan. > > > I am new to Fieldtrip. > My goal is to do a simple analysis of ECoG data in response to electrical > stimulation (all in monkey cortex). To this effect I followed the TMS-EEG > tutorial (since the issues are almost identical). > The recording system is Neuralynx. > > I have encountered 2 problems which I don’t believe are related. > I have basically followed the tutorials to the letter so except if I > mention otherwise, the cfg, etc. are standard. > > *1) Fsample discrepancy between data and header.* > When I load Neuralynx data, I get warnings that the sample rate is > actually half that in the header, and is thus being corrected (note, 16129 > instead of 32258Hz). > This is no problem, until I get the final results where I noticed that my > 50Hz noise is now represented as lasting 40ms for each cycle (= twice > longer than it actually is). > Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as > expected, somehow the data outputted by ft_preprocessing has a field > fsample equal to half that number (8064.5). > This later gives many conflicts such as: if I force data.fsample to be > 16129, I have the correct time axis in the end, but now my trial duration > is only half that which I want… > Any idea on how to solve this issue? I haven’t found any previous ticket > on this Fsample discrepancy issue. > I do not know either how much trust I have to put in that warning and > correction of the sampling rate in the first place. > > *2) 50Hz line noise filtering* > The previous point makes it so that if I filter 50Hz, of course nothing > happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back > to 16129), the attenuation is far too small (whether I use padding or not). > I did look up the similar problems that had been submitted to this list in > the past, but didn’t find any satisfactory fix. > To give an idea: > cfg = []; > cfg.Fsample = 1000; % I downsampled the data in the meantime as said in > the tuto > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; % somehow I have an error that the filtering > doesn’t work every time I try to run it with an order >2 > cfg.bsfreq = [49.9 50.1]; > filtDat = ft_preprocessing(cfg, data_lite); > > cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; > ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both > below > > changes this > > > into that > > > > {Note also the issue with Fsample: here I have a time axis that > corresponds to my 50Hz noise, but the duration of the trial is reduced from > [-0.05, 0.45] by a factor of 2.} > > This is in stark contrast to what happens if I use the bandstop filter > directly on the raw data: > dat = ft_read_data(dataset_dir); > dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); > changes this > > > into that > > > > Which should be perfect for my simple purposes. (Here I just did a simple > Matlab plot, so the x axis numbering is not actual time) > > Of course, I tried to feed that filtered data into the preprocessing > pipeline by doing > cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in > the tutorial, it is to reject the electrical stimulation artifacts. The > problem should not stem from here. > data_artifact_rejected = ft_preprocessing(cfg, dat_filt); > But I get the error that dat_filt is not raw or comp data. > > I have read that it is recommended to do the line noise filtering after > the trial segmentation and stimulation artefact removal, but 1) it doesn’t > seem to work well, 2) I don’t really understand why, given that my > artefacts are nowhere near the 50Hz frequency. > > So for this point: > - how to make the (recommended) 50Hz post processing work? > - or more simply, how could I feed prefiltered data to ft_preprocessing? > > > > > Thank you very much for your consideration and I look forward to your help. > > All the best, > > > Florian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Sun Oct 16 10:02:12 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Sun, 16 Oct 2016 17:02:12 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Message-ID: Dear Per, Thank you for your reply. Well if I don’t know how much trust I can have in it, it is because the sampling frequency inputted on my side (in the settings of the Cheetah DAS) is indeed 32kHz, that was the default. Now it is an old system so maybe it is doing something differently, who knows. However, when I filter the raw data with ft_preprocbandstopfilter I get the desired result for a sampling frequency of 16k. So Fieldtrip is probably right about this, and is self-consistent up till then. The problem for me is that within the data outputted by ft_preprocessing you get two different Fsample values: data.hdr.fs = 16k vs data.fsample = 8k. This sounds strange to me, however you look at it. Also, that 8kHz comes out of nowhere, there is no warning and no rationale for it. So, it seems like an intempestive division by two of the sampling rate that happens during the correction fieldtrip does when it reads the data. Also, the second problem is that for which I am most interested in the answer: whether it is possible - and if so, how - to filter the 50Hz line noise before feeding the data into ft_preprocessing. All the best, Florian > On 15 Oct, 2016, at 9:18 PM, Per Knutsen wrote: > > Dear Florian, > You are not clear about your actual sample rate: > > > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. > > Clearly, you should know your own sampling rate from the Neurolynx acquisition software. > > It would seem this is the primary thing you need to resolve. > > > Regards, > Per > > > > > Per M Knutsen > University of Oslo > Dept. of Molecular Medicine, Physiology Sect. > PB 1103 Blindern, NO-0317 Oslo > +47.45103762 > > On Sat, Oct 15, 2016 at 9:25 AM, Florian Gerard-Mercier > wrote: > Dear all, > > I am wondering, was my question unclear, or maybe no one is using Neuralynx data? > I can think of ways to avoid these two problems, but I would prefer to find a proper solution if possible. > > Thanks in advance, > > Florian Gerard-Mercier > > > >> On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier > wrote: >> >> Dear community, >> >> >> My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. >> >> >> I am new to Fieldtrip. >> My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). >> The recording system is Neuralynx. >> >> I have encountered 2 problems which I don’t believe are related. >> I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. >> >> 1) Fsample discrepancy between data and header. >> When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). >> This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). >> Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). >> This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… >> Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. >> I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. >> >> 2) 50Hz line noise filtering >> The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. >> To give an idea: >> cfg = []; >> cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto >> cfg.bsfilter = 'yes'; >> cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 >> cfg.bsfreq = [49.9 50.1]; >> filtDat = ft_preprocessing(cfg, data_lite); >> >> cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; >> ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below >> >> changes this >> >> >> into that >> >> >> >> {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} >> >> This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: >> dat = ft_read_data(dataset_dir); >> dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); >> changes this >> >> >> into that >> >> >> >> Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) >> >> Of course, I tried to feed that filtered data into the preprocessing pipeline by doing >> cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. >> data_artifact_rejected = ft_preprocessing(cfg, dat_filt); >> But I get the error that dat_filt is not raw or comp data. >> >> I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. >> >> So for this point: >> - how to make the (recommended) 50Hz post processing work? >> - or more simply, how could I feed prefiltered data to ft_preprocessing? >> >> >> >> >> Thank you very much for your consideration and I look forward to your help. >> >> All the best, >> >> >> Florian >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 17 13:38:37 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 17 Oct 2016 17:08:37 +0530 Subject: [FieldTrip] Standard mri dimension and fiducial point Message-ID: Dear FieldTrip community I am using standard mri providded by fieldTrip. The dimension of it is 181 x 217 x 181 [image: Inline image 1] The fiducial points are [image: Inline image 2] It is quite confusing since the coordinate of lpa exceeds the dimension. I would be very thankful if you can help me in this regard. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 6452 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From son.ta.dinh at tum.de Mon Oct 17 17:07:03 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Mon, 17 Oct 2016 15:07:03 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Darren, thanks a lot for the code and the detailed explanation! I just noticed a more basic problem with my analysis so I’m going to have to address that first before trying out your solution. I will let you know how it went as soon as I’ve finished solving the other problem! Thanks again for your help. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Donnerstag, 13. Oktober 2016 14:16 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Son For who have emailed asking for code, it is pasted below. Son, I see what you mean. In that case creating surrogate data is still necessary, since you need a way to generate a confidence interval for each set of N channels. A rough outline of your pipeline would be: (this is all assuming your measure is not simply a function of the covariance matrix) for si = each surrogate dataset (1:1000): 64chanresult = compute result for 64 chan configuration for chani = each N of channels ranging from 64:32 Nchanresult = compute result for 64 chan configuration change(si, chani) = 64chanresult - Nchanresult end end then you can plot your data as a line graph with confidence intervals. I dug out a script I used a while ago, although you might want to check that it works properly (comparing correlation matrices of input/output). The main caveat is that you need to check that you take care of negative frequencies adequately. Here I have used a method of simply cancelling negative frequencies. The other way is to use the complex conjugate, but I found that less stable, perhaps due to numerical imprecision – I’m not sure. Anyway you should verify for yourself that the correlation matrix of your original data is almost exactly the same as your surrogate data (within reason: differences on the order of <1e-5, although this depends on the length of the data). You should detrend and filter before using this function. function data = randomisePhase(data, equalphase) % data = array: [time, channels] % equalphase boolean: [true | false] (do you want the same phase shift in % each channel? default = true) if nargin == 1 equalphase = true; end L = size(data, 1); data = fft(data)*2; data(L/2+1:end, :) = 0; randphase = exp(1i*randn(1,L)*2*pi)'; % uses the same phase for each channel for ii = 1:size(data,2) if equalphase == false randphase = exp(1i*rand(L,1)*2*pi)’; end data(:,ii) = real(ifft(data(:,ii).*randphase)); end Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 13 October 2016 10:25 To: FieldTrip discussion list > Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Tue Oct 18 08:38:14 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Tue, 18 Oct 2016 12:08:14 +0530 Subject: [FieldTrip] Fiducial points of standard mri Message-ID: Dear FieldTrip community, I want to construct a headmodel from the mri data (standard mri providded by fieldTrip). The dimension of the mri is 181 x 217 X 181The coordinate system of the mri is *spm. *I want to change to coordinate system to *yokogawa*. For that purpose, I have used *ft_volumerealign *function. However, I have to provide at least three fiducial points (nsa, lpa and rpa). I noticed that mri structure itself contains the location of the fiducial points (*mri.hdr.fiducial.mri *and *mri.hdr.fiducial.head*). Th fiducial points are like these [image: Inline image 1] Clearly the lpa coordinate exceeds mri dimension and both nas and rpa coordinates do not indicate these two positions. I am quite confused how I can use the given information about the fiducial points. It would be of great help if anyone could help me in this regards. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From siddharthtalwar0309 at gmail.com Tue Oct 18 11:55:12 2016 From: siddharthtalwar0309 at gmail.com (siddharth talwar) Date: Tue, 18 Oct 2016 15:25:12 +0530 Subject: [FieldTrip] EEG source localization Message-ID: Hello I am trying to localize an ERP obtained via EEG using fieldtrip. There has been no problems in developing the forward model. The doubt i am encountering is, should the peak of the ERP alone be feeded in for ft_sourceanalysis (i.e. timepoint where the highest amplitude is observed) or the whole interval of the ERP. Having tried both, I am getting different results. Any help would be really appreciated. Thank you. Regards, Siddharth Talwar -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 00:45:15 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Tue, 18 Oct 2016 22:45:15 +0000 Subject: [FieldTrip] error with ft_appenddata In-Reply-To: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> References: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> Message-ID: Thanks Jan for your help! I ended up doing the following steps: addpath /path/to/fieldtrip ft_defaults cfg1 = []; cfg1.dataset = '1.fif'; data1 = ft_preprocessing ( cfg1 ); cfg2 = []; cfg2.dataset = '2.fif'; data2 = ft_preprocessing ( cfg2 ); cfg3 = []; cfg3.dataset = '3.fif'; data3 = ft_preprocessing ( cfg3 ); cfg=[]; data = ft_appenddata ( cfg, data1, data2, data3 ) save stitched.mat data -v7.3 Which worked. If you see any other problem that I may have missed, please feel free to educate me. Thanks! Mona On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won’t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif’; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 01:17:15 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Tue, 18 Oct 2016 23:17:15 +0000 Subject: [FieldTrip] Separating MEG/EEG data Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* From tzvetan.popov at uni-konstanz.de Wed Oct 19 07:14:27 2016 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Wed, 19 Oct 2016 07:14:27 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D@uni-konstanz.de> Dear Mona, please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting In the section “segment and read MEG data” there is a call to ft_rejectvisual for example where the different MEG sensors are separated. Further down the tutorial deals also with the EEG part of the analysis. Good luck tzvetan Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stephen.whitmarsh at gmail.com Wed Oct 19 07:22:17 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 19 Oct 2016 07:22:17 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven’t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 08:02:25 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 11:32:25 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. [image: Inline image 1] [image: Inline image 2] Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens1.jpg Type: image/jpeg Size: 51012 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens2.jpg Type: image/jpeg Size: 58687 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Oct 19 09:15:34 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 19 Oct 2016 07:15:34 +0000 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition In-Reply-To: References: Message-ID: Dear Susmita, It looks as if there is a discrepancy between the definition of the coordinate system according to fieldtrip (see ft_headcoordinates in fieldtrip/utilities, where it seems that an ALS axis system is imposed), when specifying cfg.coordsys = ‘yokogawa’, and the coordinate system of the sensors in your data file (which is probably RAS). I could not find any documentation about the ‘yokogawa’-convention (which is probably the reason why the yokogawa-entry in the table on http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is empty). Perhaps one of the Yokogawa-users on this list could chime in to enlighten you, or you could check the system’s documentation to find out what the expected. The easy solution would be to register the mri to an RAS-based coordinate system (e.g. use cfg.coordsys = ’neuromag’ for ft_volumerealign), but I would recommend to get to the bottom of this, and provide a principled solution. Once you have found out about the conventional coordinate system for yokogawa systems, it would be great if you could update the table on (http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined). Note, that if it turns out to be that there is no specific convention (e.g. site-specific ALS or RAS or so) it is worth documenting, too. Good luck Jan-Mathijs J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands On 19 Oct 2016, at 08:02, Susmita Sen > wrote: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nicolas.Zink at uniklinikum-dresden.de Wed Oct 19 11:46:25 2016 From: Nicolas.Zink at uniklinikum-dresden.de (Zink, Nicolas) Date: Wed, 19 Oct 2016 09:46:25 +0000 Subject: [FieldTrip] Performing group analysis with whole brain connectivity Message-ID: <2DDD0A108FC1004DA65570D8BA0A267B5C5899@G06EDBN1.med.tu-dresden.de> Dear Fieldtripper community! I am currently working on a pipeline for EEG data to perform network analysis with Fieldtrip (well documented example in http://www.fieldtriptoolbox.org/tutorial/networkanalysis). So far, I have successfully adapted the MEG example for performing EEG network analysis with single subjects, which seems to produce reliable outcomes. However, I want to perform a group analysis where I want to plot the connectivity of networks from group A with group B. Therefore, a prerequisite is to compute group averages from source data. So my question is: Has anyone performed a connectivity and/or network analysis on a group level? Here is what I have tried out that did not work: · Calculating the group mean of the source data with ft_math after using ft_sourcedescriptives, which caused problems for the connectivity (ft_connectivityanalysis) and subsequent network analysis (ft_networkanalysis) · I also tried ft_sourcegrandaverage, which also is not capable to provide enough (single) trial information for the following connectivity analysis steps. At the end I took preprocessed EEG data for each subject in my groups and put them together in one dataset using ft_appenddata, which produces some plausible data. Using this strategy, I tricked the algorithm, so it operates the data thinking it is a single subject. I am concerned whether this could cause methodological issues. Is there another (easier) way to do this? Can anyone give me some advice which strategy would be best to calculate the group mean and why? Cheers and thanks in advance Nicolas Zink wissenschaftlicher Mitarbeiter Universitätsklinikum Carl Gustav Carus Klinik für Kinder- und Jugendpsychiatrie und -psychotherapie Schubertstraße 42 01307 Dresden Tel. +49 (0)351 458-2303 Universitätsklinikum Carl Gustav Carus an der Technischen Universität Dresden Anstalt des öffentlichen Rechts des Freistaates Sachsen Fetscherstraße 74, 01307 Dresden http://www.uniklinikum-dresden.de Vorstand: Prof. Dr. med. D. M. Albrecht (Sprecher), Wilfried E. B. Winzer Vorsitzender des Aufsichtsrates: Prof. Dr. med. Peter C. Scriba USt.-IDNr.: DE 140 135 217, St.-Nr.: 203 145 03113 -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.sowman at mq.edu.au Wed Oct 19 12:31:56 2016 From: paul.sowman at mq.edu.au (Paul Sowman) Date: Wed, 19 Oct 2016 10:31:56 +0000 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition (Susmita Sen) In-Reply-To: References: Message-ID: Dear Susmita, you may check that your sensor positions extracted from the .con file are in the same co-ordinate frame as the MRI. Using the KIT/Yokogawa system software to co-register the sensor locations and the headshape/mri might be a necessary first step as "Unlike other systems, the Yokogawa system software does not automatically analyze its sensorlocations relative to fiducial coils":- http://www.fieldtriptoolbox.org/getting_started/yokogawa The way we deal with it is to first do coregistration in MEG160 - the KIT/Yokogawa software, and then export the sensor locations which are then in headspace. Then coregistration with the MRI brings sensors and MRI into alignment. This may or may not be your problem. Good luck. Paul Paul F Sowman ARC DECRA Fellow Department of Cognitive Science Level 3, Room 3.824 Australian Hearing Hub 16 University Drive Macquarie University, NSW 2109, Australia T: +61 2 9850 6732 | F: +61 2 9850 6059 W: Profile Page W: MQU Stuttering Research Facebook Page [Macquarie University] CRICOS Provider Number 00002J. Think before you print. Please consider the environment before printing this email. This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of Macquarie University. ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of fieldtrip-request at science.ru.nl Sent: Wednesday, 19 October 2016 6:15 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 71, Issue 24 Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit https://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Re: error with ft_appenddata (Wong-Barnum, Mona) 2. Separating MEG/EEG data (Wong-Barnum, Mona) 3. Re: Separating MEG/EEG data (Tzvetan Popov) 4. Re: Separating MEG/EEG data (Stephen Whitmarsh) 5. Orientation of headmodel with respect to sensors poisition (Susmita Sen) 6. Re: Orientation of headmodel with respect to sensors poisition (Schoffelen, J.M. (Jan Mathijs)) ---------------------------------------------------------------------- Message: 1 Date: Tue, 18 Oct 2016 22:45:15 +0000 From: "Wong-Barnum, Mona" To: FieldTrip discussion list Subject: Re: [FieldTrip] error with ft_appenddata Message-ID: Content-Type: text/plain; charset="utf-8" Thanks Jan for your help! I ended up doing the following steps: addpath /path/to/fieldtrip ft_defaults cfg1 = []; cfg1.dataset = '1.fif'; data1 = ft_preprocessing ( cfg1 ); cfg2 = []; cfg2.dataset = '2.fif'; data2 = ft_preprocessing ( cfg2 ); cfg3 = []; cfg3.dataset = '3.fif'; data3 = ft_preprocessing ( cfg3 ); cfg=[]; data = ft_appenddata ( cfg, data1, data2, data3 ) save stitched.mat data -v7.3 Which worked. If you see any other problem that I may have missed, please feel free to educate me. Thanks! Mona On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won?t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif?; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I?m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ??;? before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 18 Oct 2016 23:17:15 +0000 From: "Wong-Barnum, Mona" To: FieldTrip discussion list Subject: [FieldTrip] Separating MEG/EEG data Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A at mail.ucsd.edu> Content-Type: text/plain; charset="utf-8" I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven?t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* ------------------------------ Message: 3 Date: Wed, 19 Oct 2016 07:14:27 +0200 From: Tzvetan Popov To: FieldTrip discussion list Subject: Re: [FieldTrip] Separating MEG/EEG data Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D at uni-konstanz.de> Content-Type: text/plain; charset=windows-1252 Dear Mona, please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting In the section ?segment and read MEG data? there is a call to ft_rejectvisual for example where the different MEG sensors are separated. Further down the tutorial deals also with the EEG part of the analysis. Good luck tzvetan Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------ Message: 4 Date: Wed, 19 Oct 2016 07:22:17 +0200 From: Stephen Whitmarsh To: FieldTrip discussion list Subject: Re: [FieldTrip] Separating MEG/EEG data Message-ID: Content-Type: text/plain; charset="utf-8" Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 5 Date: Wed, 19 Oct 2016 11:32:25 +0530 From: Susmita Sen To: FieldTrip discussion list Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Content-Type: text/plain; charset="utf-8" Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. [image: Inline image 1] [image: Inline image 2] Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens1.jpg Type: image/jpeg Size: 51012 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens2.jpg Type: image/jpeg Size: 58687 bytes Desc: not available URL: ------------------------------ Message: 6 Date: Wed, 19 Oct 2016 07:15:34 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Content-Type: text/plain; charset="utf-8" Dear Susmita, It looks as if there is a discrepancy between the definition of the coordinate system according to fieldtrip (see ft_headcoordinates in fieldtrip/utilities, where it seems that an ALS axis system is imposed), when specifying cfg.coordsys = ?yokogawa?, and the coordinate system of the sensors in your data file (which is probably RAS). I could not find any documentation about the ?yokogawa?-convention (which is probably the reason why the yokogawa-entry in the table on http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is empty). Perhaps one of the Yokogawa-users on this list could chime in to enlighten you, or you could check the system?s documentation to find out what the expected. The easy solution would be to register the mri to an RAS-based coordinate system (e.g. use cfg.coordsys = ?neuromag? for ft_volumerealign), but I would recommend to get to the bottom of this, and provide a principled solution. Once you have found out about the conventional coordinate system for yokogawa systems, it would be great if you could update the table on (http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined). Note, that if it turns out to be that there is no specific convention (e.g. site-specific ALS or RAS or so) it is worth documenting, too. Good luck Jan-Mathijs J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands On 19 Oct 2016, at 08:02, Susmita Sen > wrote: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 71, Issue 24 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at donders.ru.nl Wed Oct 19 16:40:08 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 19 Oct 2016 16:40:08 +0200 Subject: [FieldTrip] Special research topic: From raw MEG/EEG to publication Message-ID: <50E1B506-1B93-40CB-B3A1-B9896D14CE1A@donders.ru.nl> Dear colleagues, We would like to invite you to contribute to Frontiers in Neuroscience Special Research Topic "From raw MEG/EEG to publication: how to perform MEG/EEG group analysis with free academic software". The idea is to create a collection of well-described group analyses of EEG and MEG data that can be fully reproduced by anyone and ported by researchers to their own data. Furthermore, as the analyses will be endorsed by peer review, any analysis choices will be citeable in future publications. This will hopefully contribute to wider adoption of good practices by the MEG/EEG research community. For you this is an opportunity to create the ultimate reference for those exciting analyses in your papers that everyone keeps asking you about and increase the impact of the methods you developed on the work of others. Furthermore, by investing some time and effort now into preparing your paper, you can save yourself much more time and efforts in the future by using this resource to train junior researchers in your group and those of your collaborators. We are sorry for the long list of requirements for prospective submissions but these are necessary to ensure that your papers are really useful for other researchers and will remain useful for at least the next decade. The requirements should be straightforward to comply with. Finally, we know that the 'Frontiers' brand has attracted some criticism due to their controversial promotion and marketing techniques. However, at present Frontiers and particularly the section on Brain Imaging Methods seems to be the most convenient platform for this project and they are able to provide adequate technical and administrative support for all its stages. As the topic editors we will do everything possible to ensure professional and transparent review for all submissions. We are looking forward to receiving your contributions. With best wishes, The topic editors: Arnaud Delorme Alexandre Gramfort Vladimir Litvak Sri Nagarajan Robert Oostenveld Francois Tadel ----- Please find more information about Research Topics below, including the publishing fees that apply. You can also visit the homepage we have created on the Frontiers website, which defines the focus of the topic, and where all published articles will appear. http://frontiersin.org/Brain_Imaging_Methods/researchtopics/From_raw_MEG_EEG_to_publication_how_to_perform_MEG_EEG_group_analysis_with_free_academic_software_/5158 Please note the submission deadline for this Research Topic: Oct 01, 2017 ABOUT FRONTIERS RESEARCH TOPICS Founded by scientists in 2007, Frontiers is a community-rooted open-access publisher, driving innovations in peer review, article-level metrics and research networking. The "Frontiers in" journal series hosts 54 journals covering more than 350 academic specialties, with a network of over 200,000 leading researchers worldwide. Frontiers is a registered member of the Open Access Scholarly Publishers Association (http://www.oaspa.org/member/Frontiers ) and was recognized by the ALPSP Award for Innovation in Publishing in 2014. The idea behind a Frontiers Research Topic is to create a comprehensive collection of peer-reviewed articles that address a specific theme of research, as well as a forum for discussion and debate. Contributions can be articles describing original research, methods, hypothesis & theory, opinions, and more. Please see the relevant journal for a full list of accepted article types. Frontiers will also compile an e-book, as soon as all contributing articles are published, that can be used as educational material, be sent to foundations that fund your research, to journalists and press agencies, or to your professional network. E-books are free to read and download. Once published, your articles will be free to access for all readers, indexed in relevant repositories, and as an author in Frontiers, you retain the copyright to your own papers and figures. FRONTIERS PUBLISHING FEES Manuscripts accepted for publication are subject to publishing fees, which vary depending on the article type. Research Topic A type articles receive a discount on publishing fees; please see here for a full fee table, and further relevant FAQs: http://www.frontiersin.org/about/PublishingFees . -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:31:35 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:01:35 +0530 Subject: [FieldTrip] function ft_convert_coordsys Message-ID: Dear fieldtrip community, The function *ft_convert_coordsys *does not consider of converting the *yokogawa *coordinate system to another coordinate system. In line number 95 it includes *{'ctf' 'bti' '4d'}*. Can I include yokogawa coordinate system in the similar fashion? Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:39:38 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:09:38 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition (Susmita Sen) In-Reply-To: References: Message-ID: Thanks a lot. I will try that. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Wed, Oct 19, 2016 at 4:01 PM, Paul Sowman wrote: > Dear Susmita, you may check that your sensor positions extracted from the > .con file are in the same co-ordinate frame as the MRI. Using the > KIT/Yokogawa system software to co-register the sensor locations and the > headshape/mri might be a necessary first step as "Unlike other systems, > the Yokogawa system software does not automatically analyze its > sensorlocations relative to fiducial coils":- http://www.fieldtriptoolbox. > org/getting_started/yokogawa > > The way we deal with it is to first do coregistration in MEG160 - the > KIT/Yokogawa software, and then export the sensor locations which are then > in headspace. Then coregistration with the MRI brings sensors and MRI into > alignment. > > This may or may not be your problem. Good luck. > > > Paul > > > *Paul F Sowman* > > ARC DECRA Fellow > > *Department of Cognitive Science * > > Level 3, Room 3.824 > > Australian Hearing Hub > 16 University Drive > Macquarie University, NSW 2109, Australia > > *T:* +61 2 9850 6732* | **F:* +61 2 9850 6059 > *W: Profile Page > * > *W: MQU > Stuttering Research Facebook Page > * > > > > > [image: Macquarie University] > > CRICOS Provider Number 00002J. Think before you print. > Please consider the environment before printing this email. > > This message is intended for the addressee named and may > contain confidential information. If you are not the intended > recipient, please delete it and notify the sender. Views expressed > in this message are those of the individual sender, and are not > necessarily the views of Macquarie University. > > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of fieldtrip-request at science.ru.nl < > fieldtrip-request at science.ru.nl> > *Sent:* Wednesday, 19 October 2016 6:15 PM > *To:* fieldtrip at science.ru.nl > *Subject:* fieldtrip Digest, Vol 71, Issue 24 > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: error with ft_appenddata (Wong-Barnum, Mona) > 2. Separating MEG/EEG data (Wong-Barnum, Mona) > 3. Re: Separating MEG/EEG data (Tzvetan Popov) > 4. Re: Separating MEG/EEG data (Stephen Whitmarsh) > 5. Orientation of headmodel with respect to sensors poisition > (Susmita Sen) > 6. Re: Orientation of headmodel with respect to sensors > poisition (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 18 Oct 2016 22:45:15 +0000 > From: "Wong-Barnum, Mona" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] error with ft_appenddata > Message-ID: > Content-Type: text/plain; charset="utf-8" > > > Thanks Jan for your help! > > I ended up doing the following steps: > > addpath /path/to/fieldtrip > ft_defaults > > cfg1 = []; > cfg1.dataset = '1.fif'; > data1 = ft_preprocessing ( cfg1 ); > > cfg2 = []; > cfg2.dataset = '2.fif'; > data2 = ft_preprocessing ( cfg2 ); > > cfg3 = []; > cfg3.dataset = '3.fif'; > data3 = ft_preprocessing ( cfg3 ); > > cfg=[]; > data = ft_appenddata ( cfg, data1, data2, data3 ) > > save stitched.mat data -v7.3 > > > Which worked. > > If you see any other problem that I may have missed, please feel free to > educate me. > > Thanks! > > Mona > > > On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Mona, > > If you directly use the output of ft_read_data as input into > ft_appenddata, it won?t work. The reason is that ft_appenddata expects in > the input (data#) matlab structures that are generated by ft_preprocessing. > Ft_read_data outputs a numeric data matrix, which is only part of the > ft_preprocessing generated output. Have you something like this yet?: > > cfg = []; > cfg.dataset = ;somefiffile.fif?; > data = ft_preprocessing(cfg); > > Best > > Jan-Mathijs > > On 05 Oct 2016, at 23:06, Wong-Barnum, Mona sdsc.edu>> wrote: > > > I?m getting a runtime error with ft_appenddata: > > data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, > data7, data8, data9, data10, data11, data12, data13, data14 ) > > > Error using ft_checkdata (line 468) This function requires raw+comp or raw > data as input. > > Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, > 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); > > Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, > data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, > data14, data15, data16, data17, data18, data19, data20 ) > > Error in run (line 96) evalin('caller', [script ';']); > > I have Neuromag data and was able to read the files into data# using > ft_read_data. > > In the documentation, it says cfg can be empty so I declared it by "cfg = > ??;? before the ft_appenddata call; is that ok? > > Any help/suggstions/tips regarding the ft_appenddata error would be > appreciated. Thanks! > > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "To handle yourself, use your head; > to handle others, use your heart." > > -- Eleanor Roosevelt > ********************************************* > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161018/df4b482a/attachment-0001.html> > > ------------------------------ > > Message: 2 > Date: Tue, 18 Oct 2016 23:17:15 +0000 > From: "Wong-Barnum, Mona" > To: FieldTrip discussion list > Subject: [FieldTrip] Separating MEG/EEG data > Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A at mail.ucsd.edu> > Content-Type: text/plain; charset="utf-8" > > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > > > ------------------------------ > > Message: 3 > Date: Wed, 19 Oct 2016 07:14:27 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Separating MEG/EEG data > Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D at uni-konstanz.de> > Content-Type: text/plain; charset=windows-1252 > > Dear Mona, > > please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/ > dipolefitting > > In the section ?segment and read MEG data? there is a call to > ft_rejectvisual for example where the different MEG sensors are separated. > Further down the tutorial deals also with the EEG part of the analysis. > Good luck > tzvetan > > > Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > > > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > > > thanks, > > Mona > > > > > > ********************************************* > > Mona Wong > > Web & iPad Application Developer > > San Diego Supercomputer Center > > > > "Strive not to be a success, but > > rather to be of value." > > --- Albert Einstein > > ********************************************* > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------------ > > Message: 4 > Date: Wed, 19 Oct 2016 07:22:17 +0200 > From: Stephen Whitmarsh > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Separating MEG/EEG data > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Mona, > > To add to Tzvetan: > > - You can in many FieldTrip functions specify on which channels you want to > work (cfg.channel), e.g. in ft_preprocessing. > - You can also split the data later using ft_selectdata, e.g.: > > cfg = [] > cfg.channel = 'MEG'; > data_MEG = ft_selectdata(cfg,data_combined); > > cfg = [] > cfg.channel = 'EEG'; > data_EEG = ft_selectdata(cfg,data_combined); > > - To selecting magnetometers or gradiometers you can use: > cfg.channel = 'MEG*1' > cfg.channel = {'MEG*2', 'MEG*3'} > > Cheers, > Stephen > > > On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > > > > I have Elekta Neuromag .fif files which contains MEG and EEG > > data. What steps do I need to do to separate the MEG from EEG and the 3 > > different MEG sensor data (magnetometer, 2 gradiometer)? > > > > I have been looking through the FieldTrip documentation but > > haven?t found what I need. All help is appreciated. > > > > thanks, > > Mona > > > > > > ********************************************* > > Mona Wong > > Web & iPad Application Developer > > San Diego Supercomputer Center > > > > "Strive not to be a success, but > > rather to be of value." > > --- Albert Einstein > > ********************************************* > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/aebcfda4/attachment-0001.html> > > ------------------------------ > > Message: 5 > Date: Wed, 19 Oct 2016 11:32:25 +0530 > From: Susmita Sen > To: FieldTrip discussion list > Subject: [FieldTrip] Orientation of headmodel with respect to sensors > poisition > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I am > working with is recorded using yokogawa system. I have used the following > code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > [image: Inline image 1] > > [image: Inline image 2] > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/da553626/attachment-0001.html> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Headmodel_sens1.jpg > Type: image/jpeg > Size: 51012 bytes > Desc: not available > URL: attachments/20161019/da553626/attachment-0002.jpg> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Headmodel_sens2.jpg > Type: image/jpeg > Size: 58687 bytes > Desc: not available > URL: attachments/20161019/da553626/attachment-0003.jpg> > > ------------------------------ > > Message: 6 > Date: Wed, 19 Oct 2016 07:15:34 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Orientation of headmodel with respect to > sensors poisition > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Dear Susmita, > > It looks as if there is a discrepancy between the definition of the > coordinate system according to fieldtrip (see ft_headcoordinates in > fieldtrip/utilities, where it seems that an ALS axis system is imposed), > when specifying cfg.coordsys = ?yokogawa?, and the coordinate system of the > sensors in your data file (which is probably RAS). I could not find any > documentation about the ?yokogawa?-convention (which is probably the reason > why the yokogawa-entry in the table on http://www.fieldtriptoolbox. > org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is > empty). Perhaps one of the Yokogawa-users on this list could chime in to > enlighten you, or you could check the system?s documentation to find out > what the expected. > > The easy solution would be to register the mri to an RAS-based coordinate > system (e.g. use cfg.coordsys = ?neuromag? for ft_volumerealign), but I > would recommend to get to the bottom of this, and provide a principled > solution. Once you have found out about the conventional coordinate system > for yokogawa systems, it would be great if you could update the table on ( > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined). Note, that if it turns out to > be that there is no specific convention (e.g. site-specific ALS or RAS or > so) it is worth documenting, too. > > Good luck > > Jan-Mathijs > > J.M.Schoffelen > Senior Researcher > Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands > > > > On 19 Oct 2016, at 08:02, Susmita Sen susmitasen.ece at gmail.com>> wrote: > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I > am working with is recorded using yokogawa system. I have used the > following code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > > > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/e84dd46a/attachment.html> > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 71, Issue 24 > ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:40:12 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:10:12 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition In-Reply-To: References: Message-ID: Thanks a lot. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Wed, Oct 19, 2016 at 12:45 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Dear Susmita, > > It looks as if there is a discrepancy between the definition of the > coordinate system according to fieldtrip (see ft_headcoordinates in > fieldtrip/utilities, where it seems that an ALS axis system is imposed), > when specifying cfg.coordsys = ‘yokogawa’, and the coordinate system of the > sensors in your data file (which is probably RAS). I could not find any > documentation about the ‘yokogawa’-convention (which is probably the reason > why the yokogawa-entry in the table on http://www. > fieldtriptoolbox.org/faq/how_are_the_different_head_and_ > mri_coordinate_systems_defined is empty). Perhaps one of the > Yokogawa-users on this list could chime in to enlighten you, or you could > check the system’s documentation to find out what the expected. > > The easy solution would be to register the mri to an RAS-based coordinate > system (e.g. use cfg.coordsys = ’neuromag’ for ft_volumerealign), but I > would recommend to get to the bottom of this, and provide a principled > solution. Once you have found out about the conventional coordinate system > for yokogawa systems, it would be great if you could update the table on ( > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined). Note, that if it turns out to > be that there is no specific convention (e.g. site-specific ALS or RAS or > so) it is worth documenting, too. > > Good luck > > Jan-Mathijs > > J.M.Schoffelen > Senior Researcher > Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands > > > > > On 19 Oct 2016, at 08:02, Susmita Sen wrote: > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I > am working with is recorded using yokogawa system. I have used the > following code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > > > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 18:42:58 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 16:42:58 +0000 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Thanks Stephen, your code was very helpful (: My data has 2 gradiometers but it appears that there is only a single megplanar channel type. Is there a way to further separate the 2 gradiometers? Mona On Oct 18, 2016, at 10:22 PM, Stephen Whitmarsh > wrote: Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona > wrote: I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 19:31:44 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 17:31:44 +0000 Subject: [FieldTrip] how to save continuous data Message-ID: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> Hi: I have Neuromag data broken out in 14 files for a single subject. I’ve read each file in using ft_preprocessing() and then combined them using ft_appenddata(). Is there a way I can save this combined data to a file so that on my next session of running FieldTrip, I can read the combined data back without having to repeat the above steps? I have enough memory so that’s not a problem. I’ve tried saving the combined data using matlab save function but was unable to read it back using ft_preprocessing() so that I can do further processing. Is there a trick to save continuous/combined data? thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 20:29:10 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 18:29:10 +0000 Subject: [FieldTrip] how to save continuous data In-Reply-To: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> References: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> Message-ID: <288CE519-2CB9-4398-B441-A5DF33010604@mail.ucsd.edu> I think I figured out my answer…I need to use matlab’s importdata() to read in my combined data file. Mona On Oct 19, 2016, at 10:31 AM, Wong-Barnum, Mona > wrote: Hi: I have Neuromag data broken out in 14 files for a single subject. I’ve read each file in using ft_preprocessing() and then combined them using ft_appenddata(). Is there a way I can save this combined data to a file so that on my next session of running FieldTrip, I can read the combined data back without having to repeat the above steps? I have enough memory so that’s not a problem. I’ve tried saving the combined data using matlab save function but was unable to read it back using ft_preprocessing() so that I can do further processing. Is there a trick to save continuous/combined data? thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 21:33:12 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 19:33:12 +0000 Subject: [FieldTrip] ft_appenddata() and trials Message-ID: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> Hi: I have 14 Neuromag .fif files recorded for a single subject; each file contains about 20 minutes of recording for a total of about 4.6 hours of recording. I’d like to concatenate the data together. I used ft_appenddata() but ti seems to have created 14 trials. How can I get all the data to go into a single trial? Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "The two most important days in your life are the day you are born and the day you find out why." -- Mark Twain ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed Oct 19 21:48:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 19 Oct 2016 21:48:34 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Hi Mona, I'm not sure I understand your question but ill give it a go: In Elekta, labels of magnetometers end in 1, (e.g. MEG10*1*), gradiometers in (e.g. MEG22)2 and 3. The latter are the orthogonal 8-shaped coils that are often combined, e.g. using ft_combineplanar. This will reduce the 204 gradiometers in 102 combined gradiometer, that FT assigns labels to, showing you which sensors are combined, e.g. "MEG102+MEG103". If you use ft_selectdata, or a cfg.channel configuration field, you can use * as I mentioned before, or ? and other wildcards such as MEG, and MAG, to select sensortypes. Hope this helps, Stephen On 19 October 2016 at 18:42, Wong-Barnum, Mona wrote: > > Thanks Stephen, your code was very helpful (: > > My data has 2 gradiometers but it appears that there is only a single > megplanar channel type. Is there a way to further separate the 2 > gradiometers? > > Mona > > > On Oct 18, 2016, at 10:22 PM, Stephen Whitmarsh < > stephen.whitmarsh at gmail.com> wrote: > > Hi Mona, > > To add to Tzvetan: > > - You can in many FieldTrip functions specify on which channels you want > to work (cfg.channel), e.g. in ft_preprocessing. > - You can also split the data later using ft_selectdata, e.g.: > > cfg = [] > cfg.channel = 'MEG'; > data_MEG = ft_selectdata(cfg,data_combined); > > cfg = [] > cfg.channel = 'EEG'; > data_EEG = ft_selectdata(cfg,data_combined); > > - To selecting magnetometers or gradiometers you can use: > cfg.channel = 'MEG*1' > cfg.channel = {'MEG*2', 'MEG*3'} > > Cheers, > Stephen > > > On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > >> >> I have Elekta Neuromag .fif files which contains MEG and EEG >> data. What steps do I need to do to separate the MEG from EEG and the 3 >> different MEG sensor data (magnetometer, 2 gradiometer)? >> >> I have been looking through the FieldTrip documentation but >> haven’t found what I need. All help is appreciated. >> >> thanks, >> Mona >> >> >> ********************************************* >> Mona Wong >> Web & iPad Application Developer >> San Diego Supercomputer Center >> >> "Strive not to be a success, but >> rather to be of value." >> --- Albert Einstein >> ********************************************* >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "To handle yourself, use your head; > to handle others, use your heart." > > -- Eleanor Roosevelt > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 19 22:33:04 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 19 Oct 2016 20:33:04 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> Message-ID: <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> Hi Mona, I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); data.trial = trial;data.time = time; Best, Jan-Mathijs On 19 Oct 2016, at 21:33, Wong-Barnum, Mona > wrote: Hi: I have 14 Neuromag .fif files recorded for a single subject; each file contains about 20 minutes of recording for a total of about 4.6 hours of recording. I’d like to concatenate the data together. I used ft_appenddata() but ti seems to have created 14 trials. How can I get all the data to go into a single trial? Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "The two most important days in your life are the day you are born and the day you find out why." -- Mark Twain ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Thu Oct 20 00:44:35 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 22:44:35 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> Message-ID: <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Hi Jan-Mathijs: Yes, these should be continuous time recordings, just broken up and saved into separate files, each file represents about 20 minutes of recording so the end of one file should be the beginning of the next file. I tried your suggestion but it seems the cat didn’t work. Do you spot any problem with my steps: >> addpath /path/to/fieldtrip >> ft_defaults >> data = importdata ( ‘appended.mat' ) data = label: {389x1 cell} trial: {1x14 cell} time: {1x14 cell} fsample: 603.1072 cfg: [1x1 struct] >> whos Name Size Bytes Class Attributes data 1x1 29058186864 struct >> trial{1} = cat(2,data.trial{:}); >> time{1} = cat(2,data.time{:}); >> whos Name Size Bytes Class Attributes data 1x1 29058186864 struct time 1x1 74505712 cell trial 1x1 28982678512 cell >> data.trial = trial; >> data.time = time; >> data data = label: {389x1 cell} trial: {[389x9313200 double]} time: {[1x9313200 double]} fsample: 603.1072 cfg: [1x1 struct] >> save continous.mat data -v7.3 Then later, I used ft_databrowser() to view the data imported from the continuous.mat file and it says 15445 segments with time from 0 to 0.998164 seconds. I’m not sure what it means by segment but the time should be over 4 hours. Do you know what I’m doing wrong? Mona On Oct 19, 2016, at 1:33 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); data.trial = trial;data.time = time; Best, Jan-Mathijs ************************************************ Mona Wong Web & iPad Application Developer San Diego Supercomputer Center You are the light you wish to see. ************************************************ -------------- next part -------------- An HTML attachment was scrubbed... URL: From aborna at sandia.gov Thu Oct 20 02:35:44 2016 From: aborna at sandia.gov (Borna, Amir) Date: Thu, 20 Oct 2016 00:35:44 +0000 Subject: [FieldTrip] magnetic dipoles Message-ID: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> Hi, I have a question regarding source localization of head coils; it seems the fieldtrip's tutorials are directed toward localizing "current dipoles" as opposed to "magnetic dipoles", e.g. head localization coils. So how should I setup the configuration (headmodel, vol, etc.) for source localization (and simulation) of magnetic dipoles? Thank you for your help in advance. Best, Borna. SNL -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 20 06:02:32 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 20 Oct 2016 04:02:32 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 70, Issue 25 In-Reply-To: References: Message-ID: From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From two.frank at gmail.com Thu Oct 20 07:27:36 2016 From: two.frank at gmail.com (Frank Hsieh) Date: Thu, 20 Oct 2016 05:27:36 +0000 Subject: [FieldTrip] Postdoc Position at the Dynamic Memory Lab at UC Davis Message-ID: Postdoctoral Researcher: The Dynamic Memory Lab (C. Ranganath, PI) at the University of California, Davis, now has an open position for a funded postdoctoral researcher. We currently are running studies that involve multimodal imaging (EEG, fMRI, ECoG, Diffusion Imaging, MR Spectroscopy) as well as concurrent transcranial electrical stimulation (tDCS/tACS). The lab is located at the UC Davis Center for Neuroscience, which houses a 3T Siemens Skyra MRI scanner, an MR-compatible tDCS/tACS system, and EEG systems both at the lab and in-scanner. Start date is flexible and can be delayed to accommodate defense and publication of thesis work. In addition to lab funding, candidates might be eligible for funding from the NIA T32 grant on the Neuroscience of Cognitive Aging (collaboration with Charles DeCarli) or from a joint R01 to examine memory in schizophrenia (collaboration with J. Daniel Ragland and Cam Carter). Qualifications: Candidates must have completed a Ph.D. in Psychology, Neuroscience, or a related field and have first-authored publications that reflect familiarity with neuroscience techniques (e.g., EEG, fMRI, tDCS/tACS, TMS, etc.). For this position, successful candidates will need to have strong analytical skills in multivariate analysis of fMRI, EEG, or other neurophysiological data. Strong preference will be given to candidates with research background in learning and memory and expertise in probabalistic tractography, model-based analysis, representational similarity analysis, or pattern classification of fMRI data, time-frequency analysis, cortical source estimation and/or multivariate analysis of EEG or MEG in humans, or corresponding LFP analyses in animal models. Beyond experience, we are looking for someone who is resourceful, collaborative, resilient, productive, honest, and enthusiastic about mentoring junior lab members. Prof. Charan Ranganath will go through applicant information starting Nov. 1st, 2016, until position is filled. Interested individuals please send your CV and names of 3 references to DML Lab Manager Nichole Bouffard (nrbouffard at ucdavis.edu) -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.hauswald at me.com Thu Oct 20 09:30:25 2016 From: anne.hauswald at me.com (anne Hauswald) Date: Thu, 20 Oct 2016 09:30:25 +0200 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: Hi Mona, the default setting in ft_databrowser for continuous data is to show blocksizes of 1 sec. Given your sampling rate, I guess the 0.998164 seconds is the closest time point to that. Then if, you have 15445 segments, each approx. 1 second long, you end up with more than 4 hours of data. However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Hope this helps a bit Anne > Am 20.10.2016 um 00:44 schrieb Wong-Barnum, Mona : > > > Hi Jan-Mathijs: > > Yes, these should be continuous time recordings, just broken up and saved into separate files, each file represents about 20 minutes of recording so the end of one file should be the beginning of the next file. > > I tried your suggestion but it seems the cat didn’t work. Do you spot any problem with my steps: > > >> addpath /path/to/fieldtrip > >> ft_defaults > >> data = importdata ( ‘appended.mat' ) > > data = > > label: {389x1 cell} > trial: {1x14 cell} > time: {1x14 cell} > fsample: 603.1072 > cfg: [1x1 struct] > > >> whos > Name Size Bytes Class Attributes > > data 1x1 29058186864 struct > > >> trial{1} = cat(2,data.trial{:}); > >> time{1} = cat(2,data.time{:}); > >> whos > Name Size Bytes Class Attributes > > data 1x1 29058186864 struct > time 1x1 74505712 cell > trial 1x1 28982678512 cell > > >> data.trial = trial; > >> data.time = time; > >> data > > data = > > label: {389x1 cell} > trial: {[389x9313200 double]} > time: {[1x9313200 double]} > fsample: 603.1072 > cfg: [1x1 struct] > > >> save continous.mat data -v7.3 > > Then later, I used ft_databrowser() to view the data imported from the continuous.mat file and it says 15445 segments with time from 0 to 0.998164 seconds. I’m not sure what it means by segment but the time should be over 4 hours. > > Do you know what I’m doing wrong? > > Mona > > >> On Oct 19, 2016, at 1:33 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: >> >> Hi Mona, >> I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? >> >> If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); >> data.trial = trial;data.time = time; >> >> Best, >> Jan-Mathijs > > ************************************************ > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > You are the light you wish to see. > ************************************************ > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Oct 20 10:15:54 2016 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 20 Oct 2016 08:15:54 +0000 Subject: [FieldTrip] =?windows-1252?q?PhD-Position_in_Multisensory_Integra?= =?windows-1252?q?tion_=28Charit=E9_Berlin=29?= Message-ID: The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A project grant of the Deutsche Forschungsgemeinschaft (DFG), entitled “The influence of local cortical oscillations and distributed connectivity networks on multisensory perception“ will fund the currently open position (duration 36 months). The main objective of this project is to examine neural markers of multisensory perception and to test the dynamic interplay of synchronized neural populationsunderlying multisensory processes. The studies within this program include EEG, ECoG and behavioral experiments. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as basic German language skills for interacting with the study participants are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until October 31, 2016, electronically to: julian.keil at charite.de ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://multisensorymind.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From robert.oostenveld at donders.ru.nl Thu Oct 20 10:48:06 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 20 Oct 2016 10:48:06 +0200 Subject: [FieldTrip] magnetic dipoles In-Reply-To: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> References: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> Message-ID: <417B9C48-4EB1-4565-B97A-C28C74A72C56@donders.ru.nl> Hi Borna, For MEG the FieldTrip forward and inverse functionality will make use of a magnetic dipole if you specify the headmodel (or “vol” structure) as headmodel = []; headmodel.type = ‘infinite’; Important is that the sensor array should be detected as a “meg” sensor array, i.e. it should have coilpos, coilori and tra fields. See http://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described for that. If the sensors describe eeg electrodes, the forward computation with the same headmodel specification will be for an electric dipole in an infinite conductive medium. Hope this helps, Robert PS if would actually be good to document the magnetic dipole on http://www.fieldtriptoolbox.org/faq/what_kind_of_volume_conduction_models_are_implemented Feel free to edit that page and add the information from this mail. > On 20 Oct 2016, at 02:35, Borna, Amir wrote: > > Hi, > > I have a question regarding source localization of head coils; it seems the fieldtrip’s tutorials are directed toward localizing “current dipoles” as opposed to “magnetic dipoles”, e.g. head localization coils. So how should I setup the configuration (headmodel, vol, etc.) for source localization (and simulation) of magnetic dipoles? Thank you for your help in advance. > > > > Best, > > Borna. > > SNL > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 20 12:08:31 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 20 Oct 2016 10:08:31 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models References: Message-ID: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Thu Oct 20 12:49:00 2016 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 20 Oct 2016 06:49:00 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) wrote: > Note: this is the second time I post this reply, and the reason is that I > forgot to add an appropriate Subject (for findability) to my email (shame > on me…(-;) > > *From: *Elisabeth May > *Subject: **[FieldTrip] Question about cluster-based permutation tests on > linear mixed models* > *Date: *27 September 2016 at 14:46:55 GMT+2 > *To: * > *Reply-To: *FieldTrip discussion list > > > Dear FieldTripers, > > I have a question about the potential use of cluster-based permutation > tests for results obtained using linear mixed models. > > We are working with data from a 10 min EEG experiment on source level with > the aim to quantify the relationship of brain activity in different > frequency bands with continous perceptual ratings across 20 subjects in > different experimental conditions. Thus, we have 10 min time courses of > brain activity and ratings for each voxel for different conditions and want > to test a) if there are significant relationships in the single conditions > and b) if these relationships differ between two conditions. To this end, I > have calculated linear mixed models in R using the lme4 toolbox. For both > the single condition relationships and the condition contrasts, they result > in a single t-value (and a corresponding p-value), which is based on > information on both the single subject and the group level (i.e. we perform > a multi-level analysis). However, with more than 2000 voxels, we have a lot > of t-values and are wondering if there is a way to apply cluster-based > tests to correct for multiple comparisons. > > The main problem I see is that I only have one multilevel t-value for the > effect across all subjects, i.e. I don't have single subjects values, which > I could then e.g. randomize between conditions as normally done in > cluster-based permutation tests. (Or rather, I would be able to extract > single subject values but would then loose the advantage of the multi-level > analysis.) > > I found an old thread in the mailinglist archive where it was suggested to > flip the signs of the t-statistic for cluster-level correction ( > https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). > I understand that, in our case, I would do this randomly for all voxels in > each randomization and then build spatial clusters on the resulting (partly > flipped) t-values. However, I am not sure if that is a valid approach based > on the null hypothesis that there are no significant relations in my single > conditions (a) or no significant relationship differences in my condition > contrasts (b). > > For the condition contrasts, I would be able to permute the condition > labels as normally done in cluster-based permutation tests,I think, but > would then have to recalculate the linear mixed models for all voxels in > every permutation. This would result in a very high computational load. > > Does anyone have any experience with this kind of analysis? Would the > flipping of t-values be a valid approach (and if yes, is there anything to > keep in mind in particular)? Can you think of other ways to combine linear > mixed models with a multiple comparison correction on the cluster level? > > > Hi Elisabeth, > > I’m not an expert on linear mixed modelling, at least not with respect to > the different ways in which they can be used to deal with correlated > observations (typically, time series). However, from a theoretical point of > view, I do not see how these models could be combined with > permutation-based inference; they are just different statistical > frameworks. However, it IS possible to answer your questions ("we have 10 > min time courses of brain activity and ratings for each voxel for different > conditions and wan to test a) if there are significant relationships in the > single conditions and b) if these relationships differ between two > conditions.”) within the framework of cluster-based permutation tests. > Question b) is the most straightforward because it amounts to a > cluster-based permutation test using the depsamplesT statfun applied to the > regression coefficients in each of the two conditions. Answering question > a) requires that you bin your ratings in a number of categories, calculate > the trial-averaged EEG data for each of the categoreies, and test the > difference between them using a cluster-based permutation test using the > depsamplesregrT statfun. Both of these approaches have been described > previously on this discussion list, and for the depsamplesregrT statfun > (your question a), it was Vladimir Litvak who used it first (actually, I > implemented it for him). The approach for question b) is actually a variant > on the general approach for testing interactions using cluster-based > permutation tests. > > Have a look here: > http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_ > correlations_between_neuronal_data_and_quantitative_ > stimulus_and_behavioural_variables > and > http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_ > interaction_effect_using_cluster-based_permutation_tests > > These tutorials provide all the necessary concepts, although they do not > answer your question in a recipe-like fashion. > > best, > Eric Maris > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Thu Oct 20 19:39:59 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 20 Oct 2016 17:39:59 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: <96BB27E4-C1B2-4D33-BD20-5076D7A0E31C@mail.ucsd.edu> > However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Ah that might be the case, I will check. Thank you Anne! cheers, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Nothing is impossible, the word itself says 'I'm possible'!" --- Audrey Hepburn ********************************************* From mona at sdsc.edu Thu Oct 20 19:50:08 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 20 Oct 2016 17:50:08 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: <96BB27E4-C1B2-4D33-BD20-5076D7A0E31C@mail.ucsd.edu> > However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Ah that might be the case, I will check. Thank you Anne! cheers, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Nothing is impossible, the word itself says 'I'm possible'!" --- Audrey Hepburn ********************************************* From stan.vanpelt at donders.ru.nl Fri Oct 21 13:49:43 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 21 Oct 2016 11:49:43 +0000 Subject: [FieldTrip] CTF MEG issue In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C5215EA5B@exprd03.hosting.ru.nl> Dear José, I’ve forwarded your email to the FieldTrip email discussion list, since this is a more appropriate forum for a question like this (more experts=more potential answers). 10-50pT is way too strong to be a brain signal I’m afraid. Typical range would be 10-100 fT for CTF data, so your signal is more than 2 orders of magnitude higher. I think it is most likely noise coming from outside the scanner (room). Regarding the use of ft_databrowser, this is nicely decribed in the following tutorial: http://www.fieldtriptoolbox.org/tutorial/visual_artifact_rejection#use_ft_databrowser_to_mark_the_artifacts_manually Scaling will be done automatically if you only plot the MEG-channels. So you do not need to specify cfg.megscale (or cfg.eogscale, for that matter). Best, Stan From: joseluisblues at gmail.com [mailto:joseluisblues at gmail.com] On Behalf Of José Luis Sent: vrijdag 21 oktober 2016 12:30 To: Pelt, S. van (Stan) Subject: CTF MEG issue Dear Stan Van Pelt, I found your post in the Fieldtrip list and I thought you could help with an issue I have with my CTF MEG data, I have analysed this data for an ERF study with a home-made software a few years ago. Now I am re-analysing this data to investigate oscillatory activity, I usually never pay attention to the range of my raw data since I will always end up with averages values of ERFs around the typical 10-30 fT range. However, looking now to my raw data I find it on the range of 10000 - 50000 fT. My guess is that this should be Ok, since ERFs are always smaller in size relative to the raw data. I would like to check this with someone that has CTF MEG data. Second, since is not in the typical range I have the issue of visualizing my data with ft_databrowser. So the typical setting with: cfg.alim = 1e-12; cfg.megscale = 1; cfg.eogscale = 5e-8; doesn't work for me, I would like to know how do you manage to visualize your data, Many thanks in advance, By the way, the link to your paper "Higher-level processes in the formation and application of associations during action understanding" is not working properly, Jose -- José Luis ULLOA FULGERI, PhD +32477429007 +32492646477 https://sites.google.com/site/joseluisulloafulgeri/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisabethsusanne.may at gmail.com Fri Oct 21 19:38:51 2016 From: elisabethsusanne.may at gmail.com (Elisabeth May) Date: Fri, 21 Oct 2016 19:38:51 +0200 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge : > Eric, I don't think I understand why you would say "I do not see how these > models could be combined with permutation-based inference; they are just > different statistical frameworks". As you somewhat hint, the (G)LMM is a > regression, and the beta coefficient for the independent-variable of > interest at each voxel/vertex/sensor x timepoint can be interpreted as "how > much does the independent variable explain the brain activity?" In that > framework, it seems to me that one could do the following: > > for n=1:1000 > 1) Permute the condition labels (within subjects) of the individual > trials > 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and > corresponding t-map > 3) Threshold and construct cluster mass statistic as usual > end > 4) Identify cluster in the original (unpermuted) analysis and report > cluster p-value > > > Now, the main thing that has come up when we've tried to do this is that > re-fitting a (voxel x time) GLM 1000 times by the standard iterative > maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine > it would require rewriting at least a statfun, maybe other pieces of the > code. (We had an idea that, since the betas likely should vary smoothly > over time and space, one could use the output of one GLM as the seed to the > next, which would speed up convergence.) So it still does not seem like a > good idea, but based on the above, is there actually a *theoretical* reason > it wouldn't work? > > > Alik Widge, MD, PhD > Director, Translational NeuroEngineering Laboratory > Division of Neurotherapeutics, Massachusetts General Hospital > Assistant Professor of Psychiatry, Harvard Medical School > Clinical Fellow, Picower Institute for Learning & Memory (MIT) > awidge at partners.org > http://scholar.harvard.edu/awidge/ > 617-643-2580 > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < > e.maris at donders.ru.nl> wrote: > >> Note: this is the second time I post this reply, and the reason is that I >> forgot to add an appropriate Subject (for findability) to my email (shame >> on me…(-;) >> >> *From: *Elisabeth May >> *Subject: **[FieldTrip] Question about cluster-based permutation tests >> on linear mixed models* >> *Date: *27 September 2016 at 14:46:55 GMT+2 >> *To: * >> *Reply-To: *FieldTrip discussion list >> >> >> Dear FieldTripers, >> >> I have a question about the potential use of cluster-based permutation >> tests for results obtained using linear mixed models. >> >> We are working with data from a 10 min EEG experiment on source level >> with the aim to quantify the relationship of brain activity in different >> frequency bands with continous perceptual ratings across 20 subjects in >> different experimental conditions. Thus, we have 10 min time courses of >> brain activity and ratings for each voxel for different conditions and want >> to test a) if there are significant relationships in the single conditions >> and b) if these relationships differ between two conditions. To this end, I >> have calculated linear mixed models in R using the lme4 toolbox. For both >> the single condition relationships and the condition contrasts, they result >> in a single t-value (and a corresponding p-value), which is based on >> information on both the single subject and the group level (i.e. we perform >> a multi-level analysis). However, with more than 2000 voxels, we have a lot >> of t-values and are wondering if there is a way to apply cluster-based >> tests to correct for multiple comparisons. >> >> The main problem I see is that I only have one multilevel t-value for the >> effect across all subjects, i.e. I don't have single subjects values, which >> I could then e.g. randomize between conditions as normally done in >> cluster-based permutation tests. (Or rather, I would be able to extract >> single subject values but would then loose the advantage of the multi-level >> analysis.) >> >> I found an old thread in the mailinglist archive where it was suggested >> to flip the signs of the t-statistic for cluster-level correction ( >> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >> I understand that, in our case, I would do this randomly for all voxels in >> each randomization and then build spatial clusters on the resulting (partly >> flipped) t-values. However, I am not sure if that is a valid approach based >> on the null hypothesis that there are no significant relations in my single >> conditions (a) or no significant relationship differences in my condition >> contrasts (b). >> >> For the condition contrasts, I would be able to permute the condition >> labels as normally done in cluster-based permutation tests,I think, but >> would then have to recalculate the linear mixed models for all voxels in >> every permutation. This would result in a very high computational load. >> >> Does anyone have any experience with this kind of analysis? Would the >> flipping of t-values be a valid approach (and if yes, is there anything to >> keep in mind in particular)? Can you think of other ways to combine linear >> mixed models with a multiple comparison correction on the cluster level? >> >> >> Hi Elisabeth, >> >> I’m not an expert on linear mixed modelling, at least not with respect to >> the different ways in which they can be used to deal with correlated >> observations (typically, time series). However, from a theoretical point of >> view, I do not see how these models could be combined with >> permutation-based inference; they are just different statistical >> frameworks. However, it IS possible to answer your questions ("we have >> 10 min time courses of brain activity and ratings for each voxel for >> different conditions and wan to test a) if there are significant >> relationships in the single conditions and b) if these relationships differ >> between two conditions.”) within the framework of cluster-based permutation >> tests. Question b) is the most straightforward because it amounts to a >> cluster-based permutation test using the depsamplesT statfun applied to the >> regression coefficients in each of the two conditions. Answering question >> a) requires that you bin your ratings in a number of categories, calculate >> the trial-averaged EEG data for each of the categoreies, and test the >> difference between them using a cluster-based permutation test using the >> depsamplesregrT statfun. Both of these approaches have been described >> previously on this discussion list, and for the depsamplesregrT statfun >> (your question a), it was Vladimir Litvak who used it first (actually, I >> implemented it for him). The approach for question b) is actually a variant >> on the general approach for testing interactions using cluster-based >> permutation tests. >> >> Have a look here: >> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >> lations_between_neuronal_data_and_quantitative_stimulus_and_ >> behavioural_variables >> and >> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >> ction_effect_using_cluster-based_permutation_tests >> >> These tutorials provide all the necessary concepts, although they do not >> answer your question in a recipe-like fashion. >> >> best, >> Eric Maris >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From na.so.ir at gmail.com Mon Oct 24 15:49:14 2016 From: na.so.ir at gmail.com (Narjes Soltani) Date: Mon, 24 Oct 2016 17:19:14 +0330 Subject: [FieldTrip] error in ft_artifact_ecg Message-ID: Dear Sir/Madam Hi, I am running ft_artifact_ecg on some MEG data recorded by Neuromag Elekta device. I just pass the output produced by ft_defineTrial to ft_artifact_ecg, but I encounter the following error: Undefined function or variable "labelmlt". Error in ft_channelselection (line 428) if findmlt, channel = [channel; labelmlt]; end Error in ft_artifact_ecg (line 233) sgn = ft_channelselection(artfctdef.inspect, hdr.label); I guess I should explicitly set the cfg.artfctdef.ecg.channel, but I don't know how should I set this parameter? The set of channel labels in my data are as follows: 'MEG0113' 'MEG0112' 'MEG0111' 'MEG0122' 'MEG0123' 'MEG0121' 'MEG0132' 'MEG0133' 'MEG0131' 'MEG0143' 'MEG0142' 'MEG0141' 'MEG0213' 'MEG0212' 'MEG0211' 'MEG0222' 'MEG0223' 'MEG0221' 'MEG0232' 'MEG0233' 'MEG0231' 'MEG0243' 'MEG0242' 'MEG0241' 'MEG0313' 'MEG0312' 'MEG0311' 'MEG0322' 'MEG0323' 'MEG0321' 'MEG0333' 'MEG0332' 'MEG0331' 'MEG0343' 'MEG0342' 'MEG0341' 'MEG0413' 'MEG0412' 'MEG0411' 'MEG0422' 'MEG0423' 'MEG0421' 'MEG0432' 'MEG0433' 'MEG0431' 'MEG0443' 'MEG0442' 'MEG0441' 'MEG0513' 'MEG0512' 'MEG0511' 'MEG0523' 'MEG0522' 'MEG0521' 'MEG0532' 'MEG0533' 'MEG0531' 'MEG0542' 'MEG0543' 'MEG0541' 'MEG0613' 'MEG0612' 'MEG0611' 'MEG0622' 'MEG0623' 'MEG0621' 'MEG0633' 'MEG0632' 'MEG0631' 'MEG0642' 'MEG0643' 'MEG0641' 'MEG0713' 'MEG0712' 'MEG0711' 'MEG0723' 'MEG0722' 'MEG0721' 'MEG0733' 'MEG0732' 'MEG0731' 'MEG0743' 'MEG0742' 'MEG0741' 'MEG0813' 'MEG0812' 'MEG0811' 'MEG0822' 'MEG0823' 'MEG0821' 'MEG0913' 'MEG0912' 'MEG0911' 'MEG0923' 'MEG0922' 'MEG0921' 'MEG0932' 'MEG0933' 'MEG0931' 'MEG0942' 'MEG0943' 'MEG0941' 'MEG1013' 'MEG1012' 'MEG1011' 'MEG1023' 'MEG1022' 'MEG1021' 'MEG1032' 'MEG1033' 'MEG1031' 'MEG1043' 'MEG1042' 'MEG1041' 'MEG1112' 'MEG1113' 'MEG1111' 'MEG1123' 'MEG1122' 'MEG1121' 'MEG1133' 'MEG1132' 'MEG1131' 'MEG1142' 'MEG1143' 'MEG1141' 'MEG1213' 'MEG1212' 'MEG1211' 'MEG1223' 'MEG1222' 'MEG1221' 'MEG1232' 'MEG1233' 'MEG1231' 'MEG1243' 'MEG1242' 'MEG1241' 'MEG1312' 'MEG1313' 'MEG1311' 'MEG1323' 'MEG1322' 'MEG1321' 'MEG1333' 'MEG1332' 'MEG1331' 'MEG1342' 'MEG1343' 'MEG1341' 'MEG1412' 'MEG1413' 'MEG1411' 'MEG1423' 'MEG1422' 'MEG1421' 'MEG1433' 'MEG1432' 'MEG1431' 'MEG1442' 'MEG1443' 'MEG1441' 'MEG1512' 'MEG1513' 'MEG1511' 'MEG1522' 'MEG1523' 'MEG1521' 'MEG1533' 'MEG1532' 'MEG1531' 'MEG1543' 'MEG1542' 'MEG1541' 'MEG1613' 'MEG1612' 'MEG1611' 'MEG1622' 'MEG1623' 'MEG1621' 'MEG1632' 'MEG1633' 'MEG1631' 'MEG1643' 'MEG1642' 'MEG1641' 'MEG1713' 'MEG1712' 'MEG1711' 'MEG1722' 'MEG1723' 'MEG1721' 'MEG1732' 'MEG1733' 'MEG1731' 'MEG1743' 'MEG1742' 'MEG1741' 'MEG1813' 'MEG1812' 'MEG1811' 'MEG1822' 'MEG1823' 'MEG1821' 'MEG1832' 'MEG1833' 'MEG1831' 'MEG1843' 'MEG1842' 'MEG1841' 'MEG1912' 'MEG1913' 'MEG1911' 'MEG1923' 'MEG1922' 'MEG1921' 'MEG1932' 'MEG1933' 'MEG1931' 'MEG1943' 'MEG1942' 'MEG1941' 'MEG2013' 'MEG2012' 'MEG2011' 'MEG2023' 'MEG2022' 'MEG2021' 'MEG2032' 'MEG2033' 'MEG2031' 'MEG2042' 'MEG2043' 'MEG2041' 'MEG2113' 'MEG2112' 'MEG2111' 'MEG2122' 'MEG2123' 'MEG2121' 'MEG2133' 'MEG2132' 'MEG2131' 'MEG2143' 'MEG2142' 'MEG2141' 'MEG2212' 'MEG2213' 'MEG2211' 'MEG2223' 'MEG2222' 'MEG2221' 'MEG2233' 'MEG2232' 'MEG2231' 'MEG2242' 'MEG2243' 'MEG2241' 'MEG2312' 'MEG2313' 'MEG2311' 'MEG2323' 'MEG2322' 'MEG2321' 'MEG2332' 'MEG2333' 'MEG2331' 'MEG2343' 'MEG2342' 'MEG2341' 'MEG2412' 'MEG2413' 'MEG2411' 'MEG2423' 'MEG2422' 'MEG2421' 'MEG2433' 'MEG2432' 'MEG2431' 'MEG2442' 'MEG2443' 'MEG2441' 'MEG2512' 'MEG2513' 'MEG2511' 'MEG2522' 'MEG2523' 'MEG2521' 'MEG2533' 'MEG2532' 'MEG2531' 'MEG2543' 'MEG2542' 'MEG2541' 'MEG2612' 'MEG2613' 'MEG2611' 'MEG2623' 'MEG2622' 'MEG2621' 'MEG2633' 'MEG2632' 'MEG2631' 'MEG2642' 'MEG2643' 'MEG2641' 'EOG061' 'ECG062' 'STI101' 'STI201' 'STI301' 'MISC201' 'MISC202' 'MISC203' 'MISC204' 'MISC205' 'MISC206' 'MISC301' 'MISC302' 'MISC303' 'MISC304' 'MISC305' 'MISC306' Would you please help me with this problem? Best Regards Narjes -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Mon Oct 24 18:18:46 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Mon, 24 Oct 2016 16:18:46 +0000 Subject: [FieldTrip] eLORETA Message-ID: Hello, Is there any difference between using the eLORETA-KEY software and using ft_sourceanalysis, cfg.method = 'eloreta'. I am going to use eLoreta in MEG resting state. Thanks Mehdy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Mon Oct 24 20:33:46 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Mon, 24 Oct 2016 18:33:46 +0000 Subject: [FieldTrip] eLORETA In-Reply-To: References: Message-ID: Hello, For using the eLORETA in resting state of MEG signals, do I need to compute Timelock analysis? If it is so, as they are resting state, how valid they would be? Thanks On Mon, Oct 24, 2016 at 10:18 AM mehdy dousty wrote: > Hello, > > Is there any difference between using the eLORETA-KEY software and using > ft_sourceanalysis, cfg.method = 'eloreta'. I am going to use eLoreta in MEG > resting state. > > Thanks > Mehdy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Tue Oct 25 13:33:24 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Tue, 25 Oct 2016 11:33:24 +0000 Subject: [FieldTrip] Fwd: [Women in M/EEG]: please fwd to reach female scientist in the field References: <73b2b35a8cc36f97.580f4111@limbe.rz.uni-konstanz.de> Message-ID: <14E0CEED-3A2A-41AF-9C83-DCA5A4FF5952@cfin.au.dk> Hi everyone, I thought this initiative could use some wider distribution. Biaswatchneuro was covered in the New York Times recently ( http://nyti.ms/2bOEPj6 ) and now Biomag and the MEG community is under its watch. :-) See below. Cheers, Sarang > Begin forwarded message: > >> Dear friends and colleagues, >> I hope you are doing great. Probably your are aware of the gender bias in science (e.g. at conferences: https://biaswatchneuro.com). >> There is an initiative which hopefully will help counteracting (see below for details). That is, currently information about female scientist with M/EEG expertise are collected. This will provide material for gender representation to future organizers of Biomag and potentially other conferences. >> >> @ Female scientist in the field: You may want to fill in this link (or one of the links below): https://docs.google.com/spreadsheets/d/1KaqR_ONjH4DShmzDS0SlpWho0hp6NuswWmYrrDC0OSY/edit?usp=sharing >> >> @ All: Please, pass on the link / mail to reach female scientist in the field. >> >> Cheers, >> Anne >> From robert.oostenveld at donders.ru.nl Tue Oct 25 13:39:41 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 25 Oct 2016 13:39:41 +0200 Subject: [FieldTrip] gender bias in the M/EEG research community Message-ID: <9ADAB85C-9752-4F54-8035-66FB5F255F73@donders.ru.nl> Dear FieldTrip users, Probably your are aware of the gender bias in science (e.g. at conferences: https://biaswatchneuro.com ). There is an initiative which hopefully will help counteracting (see below for details). That is, currently information about female scientist with M/EEG expertise are collected. This will provide material for gender representation to future organizers of Biomag and potentially other conferences. @ Female scientist in the field: You may want to fill in this link (or one of the links below): https://docs.google.com/spreadsheets/d/1KaqR_ONjH4DShmzDS0SlpWho0hp6NuswWmYrrDC0OSY/edit?usp=sharing @ All: Please, pass on the link / mail to reach female scientist in the field. best regards, Robert PS Biaswatchneuro was covered in the New York Times recently, see http://nyti.ms/2bOEPj6 ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Radboud University, Nijmegen, The Netherlands Visiting Professor NatMEG - the Swedish National MEG facility Karolinska Institute, Stockholm, Sweden tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/donders skype: r.oostenveld ----------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Tue Oct 25 17:30:10 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Tue, 25 Oct 2016 11:30:10 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. *Canadian journal of fisheries and aquatic sciences*, *58*(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. *Psychophysiology*, *48*(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < elisabethsusanne.may at gmail.com> wrote: > Dear Eric and Alik, > > thanks a lot for your helpful responses! > > I will have a close look at the faqs, Eric, and test the approaches you > outlined. I am curious, anyway, as to how different results will be for > simple regressions compared to the multilevel results of the linear-mixed > models. > > Like Alik, I am also curious about other people's opinions on the general > question if there are theoretical reasons against a combination of the > approaches like Alik suggested. We also thought about this approach but > haven't fully tested it yet because of the very long calculation times. > > Thanks again and have a nice weekend! > Elisabeth > > 2016-10-20 12:49 GMT+02:00 Alik Widge : > >> Eric, I don't think I understand why you would say "I do not see how >> these models could be combined with permutation-based inference; they are >> just different statistical frameworks". As you somewhat hint, the (G)LMM is >> a regression, and the beta coefficient for the independent-variable of >> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >> much does the independent variable explain the brain activity?" In that >> framework, it seems to me that one could do the following: >> >> for n=1:1000 >> 1) Permute the condition labels (within subjects) of the individual >> trials >> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >> corresponding t-map >> 3) Threshold and construct cluster mass statistic as usual >> end >> 4) Identify cluster in the original (unpermuted) analysis and report >> cluster p-value >> >> >> Now, the main thing that has come up when we've tried to do this is that >> re-fitting a (voxel x time) GLM 1000 times by the standard iterative >> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >> it would require rewriting at least a statfun, maybe other pieces of the >> code. (We had an idea that, since the betas likely should vary smoothly >> over time and space, one could use the output of one GLM as the seed to the >> next, which would speed up convergence.) So it still does not seem like a >> good idea, but based on the above, is there actually a *theoretical* reason >> it wouldn't work? >> >> >> Alik Widge, MD, PhD >> Director, Translational NeuroEngineering Laboratory >> Division of Neurotherapeutics, Massachusetts General Hospital >> Assistant Professor of Psychiatry, Harvard Medical School >> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >> awidge at partners.org >> http://scholar.harvard.edu/awidge/ >> 617-643-2580 >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >> e.maris at donders.ru.nl> wrote: >> >>> Note: this is the second time I post this reply, and the reason is that >>> I forgot to add an appropriate Subject (for findability) to my email (shame >>> on me…(-;) >>> >>> *From: *Elisabeth May >>> *Subject: **[FieldTrip] Question about cluster-based permutation tests >>> on linear mixed models* >>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>> *To: * >>> *Reply-To: *FieldTrip discussion list >>> >>> >>> Dear FieldTripers, >>> >>> I have a question about the potential use of cluster-based permutation >>> tests for results obtained using linear mixed models. >>> >>> We are working with data from a 10 min EEG experiment on source level >>> with the aim to quantify the relationship of brain activity in different >>> frequency bands with continous perceptual ratings across 20 subjects in >>> different experimental conditions. Thus, we have 10 min time courses of >>> brain activity and ratings for each voxel for different conditions and want >>> to test a) if there are significant relationships in the single conditions >>> and b) if these relationships differ between two conditions. To this end, I >>> have calculated linear mixed models in R using the lme4 toolbox. For both >>> the single condition relationships and the condition contrasts, they result >>> in a single t-value (and a corresponding p-value), which is based on >>> information on both the single subject and the group level (i.e. we perform >>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>> of t-values and are wondering if there is a way to apply cluster-based >>> tests to correct for multiple comparisons. >>> >>> The main problem I see is that I only have one multilevel t-value for >>> the effect across all subjects, i.e. I don't have single subjects values, >>> which I could then e.g. randomize between conditions as normally done in >>> cluster-based permutation tests. (Or rather, I would be able to extract >>> single subject values but would then loose the advantage of the multi-level >>> analysis.) >>> >>> I found an old thread in the mailinglist archive where it was suggested >>> to flip the signs of the t-statistic for cluster-level correction ( >>> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >>> I understand that, in our case, I would do this randomly for all voxels in >>> each randomization and then build spatial clusters on the resulting (partly >>> flipped) t-values. However, I am not sure if that is a valid approach based >>> on the null hypothesis that there are no significant relations in my single >>> conditions (a) or no significant relationship differences in my condition >>> contrasts (b). >>> >>> For the condition contrasts, I would be able to permute the condition >>> labels as normally done in cluster-based permutation tests,I think, but >>> would then have to recalculate the linear mixed models for all voxels in >>> every permutation. This would result in a very high computational load. >>> >>> Does anyone have any experience with this kind of analysis? Would the >>> flipping of t-values be a valid approach (and if yes, is there anything to >>> keep in mind in particular)? Can you think of other ways to combine linear >>> mixed models with a multiple comparison correction on the cluster level? >>> >>> >>> Hi Elisabeth, >>> >>> I’m not an expert on linear mixed modelling, at least not with respect >>> to the different ways in which they can be used to deal with correlated >>> observations (typically, time series). However, from a theoretical point of >>> view, I do not see how these models could be combined with >>> permutation-based inference; they are just different statistical >>> frameworks. However, it IS possible to answer your questions ("we have >>> 10 min time courses of brain activity and ratings for each voxel for >>> different conditions and wan to test a) if there are significant >>> relationships in the single conditions and b) if these relationships differ >>> between two conditions.”) within the framework of cluster-based permutation >>> tests. Question b) is the most straightforward because it amounts to a >>> cluster-based permutation test using the depsamplesT statfun applied to the >>> regression coefficients in each of the two conditions. Answering question >>> a) requires that you bin your ratings in a number of categories, calculate >>> the trial-averaged EEG data for each of the categoreies, and test the >>> difference between them using a cluster-based permutation test using the >>> depsamplesregrT statfun. Both of these approaches have been described >>> previously on this discussion list, and for the depsamplesregrT statfun >>> (your question a), it was Vladimir Litvak who used it first (actually, I >>> implemented it for him). The approach for question b) is actually a variant >>> on the general approach for testing interactions using cluster-based >>> permutation tests. >>> >>> Have a look here: >>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>> behavioural_variables >>> and >>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>> ction_effect_using_cluster-based_permutation_tests >>> >>> These tutorials provide all the necessary concepts, although they do not >>> answer your question in a recipe-like fashion. >>> >>> best, >>> Eric Maris >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Tue Oct 25 19:29:54 2016 From: alik.widge at gmail.com (Alik Widge) Date: Tue, 25 Oct 2016 13:29:54 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe wrote: > Hi Elisabeth and Alik, > Permutation methods applied to multiple regression models are not > generally guaranteed to be accurate because testing individual terms in > such models (e.g., partial correlation coefficients) requires accurate > knowledge of other terms in the model (e.g., the slope coefficients for all > the other predictors in the multiple regression). Because such parameters > have to be estimated from the data, permutation tests are only > ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). > Though there are special cases (e.g., a two factor ANOVA with two levels of > each factor), where permutation methods do guarantee accuracy. > In lieu of permutation testing, you might want to try using one of > Benjamini and colleagues' false discovery rate (FDR) control algorithms to > control for multiple comparisons. In my tests on simulated ERP data (Groppe > et al., 2011), FDR correction was nearly as powerful as cluster-based > permutation testing for detecting a very broadly distributed effect (e.g., > a P300-like effect) and it was far more sensitive than cluster-based > testing for an effect with a very limited distribution (e.g., an N170-like > effect). FDR correction is also very computationally efficient. > hope this is helpful, > -David > > > Refs: > Anderson, M. J. (2001). Permutation tests for univariate or multivariate > analysis of variance and regression. *Canadian journal of fisheries and > aquatic sciences*, *58*(3), 626-639. > > Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of > Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. > > Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis > of event‐related brain potentials/fields II: Simulation studies. > *Psychophysiology*, *48*(12), 1726-1737. > > > On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < > elisabethsusanne.may at gmail.com> wrote: > >> Dear Eric and Alik, >> >> thanks a lot for your helpful responses! >> >> I will have a close look at the faqs, Eric, and test the approaches you >> outlined. I am curious, anyway, as to how different results will be for >> simple regressions compared to the multilevel results of the linear-mixed >> models. >> >> Like Alik, I am also curious about other people's opinions on the general >> question if there are theoretical reasons against a combination of the >> approaches like Alik suggested. We also thought about this approach but >> haven't fully tested it yet because of the very long calculation times. >> >> Thanks again and have a nice weekend! >> Elisabeth >> >> 2016-10-20 12:49 GMT+02:00 Alik Widge : >> >>> Eric, I don't think I understand why you would say "I do not see how >>> these models could be combined with permutation-based inference; they are >>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>> a regression, and the beta coefficient for the independent-variable of >>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>> much does the independent variable explain the brain activity?" In that >>> framework, it seems to me that one could do the following: >>> >>> for n=1:1000 >>> 1) Permute the condition labels (within subjects) of the individual >>> trials >>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >>> corresponding t-map >>> 3) Threshold and construct cluster mass statistic as usual >>> end >>> 4) Identify cluster in the original (unpermuted) analysis and report >>> cluster p-value >>> >>> >>> Now, the main thing that has come up when we've tried to do this is that >>> re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>> it would require rewriting at least a statfun, maybe other pieces of the >>> code. (We had an idea that, since the betas likely should vary smoothly >>> over time and space, one could use the output of one GLM as the seed to the >>> next, which would speed up convergence.) So it still does not seem like a >>> good idea, but based on the above, is there actually a *theoretical* reason >>> it wouldn't work? >>> >>> >>> Alik Widge, MD, PhD >>> Director, Translational NeuroEngineering Laboratory >>> Division of Neurotherapeutics, Massachusetts General Hospital >>> Assistant Professor of Psychiatry, Harvard Medical School >>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>> awidge at partners.org >>> http://scholar.harvard.edu/awidge/ >>> 617-643-2580 >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>> e.maris at donders.ru.nl> wrote: >>> >>>> Note: this is the second time I post this reply, and the reason is that >>>> I forgot to add an appropriate Subject (for findability) to my email (shame >>>> on me…(-;) >>>> >>>> *From: *Elisabeth May >>>> *Subject: **[FieldTrip] Question about cluster-based permutation tests >>>> on linear mixed models* >>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>> *To: * >>>> *Reply-To: *FieldTrip discussion list >>>> >>>> >>>> Dear FieldTripers, >>>> >>>> I have a question about the potential use of cluster-based permutation >>>> tests for results obtained using linear mixed models. >>>> >>>> We are working with data from a 10 min EEG experiment on source level >>>> with the aim to quantify the relationship of brain activity in different >>>> frequency bands with continous perceptual ratings across 20 subjects in >>>> different experimental conditions. Thus, we have 10 min time courses of >>>> brain activity and ratings for each voxel for different conditions and want >>>> to test a) if there are significant relationships in the single conditions >>>> and b) if these relationships differ between two conditions. To this end, I >>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>> the single condition relationships and the condition contrasts, they result >>>> in a single t-value (and a corresponding p-value), which is based on >>>> information on both the single subject and the group level (i.e. we perform >>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>> of t-values and are wondering if there is a way to apply cluster-based >>>> tests to correct for multiple comparisons. >>>> >>>> The main problem I see is that I only have one multilevel t-value for >>>> the effect across all subjects, i.e. I don't have single subjects values, >>>> which I could then e.g. randomize between conditions as normally done in >>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>> single subject values but would then loose the advantage of the multi-level >>>> analysis.) >>>> >>>> I found an old thread in the mailinglist archive where it was suggested >>>> to flip the signs of the t-statistic for cluster-level correction ( >>>> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >>>> I understand that, in our case, I would do this randomly for all voxels in >>>> each randomization and then build spatial clusters on the resulting (partly >>>> flipped) t-values. However, I am not sure if that is a valid approach based >>>> on the null hypothesis that there are no significant relations in my single >>>> conditions (a) or no significant relationship differences in my condition >>>> contrasts (b). >>>> >>>> For the condition contrasts, I would be able to permute the condition >>>> labels as normally done in cluster-based permutation tests,I think, but >>>> would then have to recalculate the linear mixed models for all voxels in >>>> every permutation. This would result in a very high computational load. >>>> >>>> Does anyone have any experience with this kind of analysis? Would the >>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>> keep in mind in particular)? Can you think of other ways to combine linear >>>> mixed models with a multiple comparison correction on the cluster level? >>>> >>>> >>>> Hi Elisabeth, >>>> >>>> I’m not an expert on linear mixed modelling, at least not with respect >>>> to the different ways in which they can be used to deal with correlated >>>> observations (typically, time series). However, from a theoretical point of >>>> view, I do not see how these models could be combined with >>>> permutation-based inference; they are just different statistical >>>> frameworks. However, it IS possible to answer your questions ("we have >>>> 10 min time courses of brain activity and ratings for each voxel for >>>> different conditions and wan to test a) if there are significant >>>> relationships in the single conditions and b) if these relationships differ >>>> between two conditions.”) within the framework of cluster-based permutation >>>> tests. Question b) is the most straightforward because it amounts to a >>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>> regression coefficients in each of the two conditions. Answering question >>>> a) requires that you bin your ratings in a number of categories, calculate >>>> the trial-averaged EEG data for each of the categoreies, and test the >>>> difference between them using a cluster-based permutation test using the >>>> depsamplesregrT statfun. Both of these approaches have been described >>>> previously on this discussion list, and for the depsamplesregrT statfun >>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>> implemented it for him). The approach for question b) is actually a variant >>>> on the general approach for testing interactions using cluster-based >>>> permutation tests. >>>> >>>> Have a look here: >>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>> behavioural_variables >>>> and >>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>> ction_effect_using_cluster-based_permutation_tests >>>> >>>> These tutorials provide all the necessary concepts, although they do >>>> not answer your question in a recipe-like fashion. >>>> >>>> best, >>>> Eric Maris >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Tue Oct 25 21:28:55 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Tue, 25 Oct 2016 15:28:55 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: > Thanks, that was super interesting! Was not aware of those. > > Have been meditating this afternoon on this and related Anderson papers. > What's interesting is that he appears to think my suggestion below *would* > be asymptotically acceptable -- *if* one specifically permutes the > dependent variable (power/ERP observation) rather than permuting each > column of the independent variables separately (i.e., if one preserves any > correlational structure that exists between the independent variables). > That's the Manly (1997) method, and it appears that the only reason it > breaks down sometimes is if there's an outlier in the independent variable. > This could presumably be a problem in the ecological sciences, for which > he's writing, where one can't control things like temperature in a season > or numbers of eels that swim past a given sensor. In cognitive > neuroscience, where the predictor/independent variables are usually dummy > coded properties of the trial, this seems like we might be on firmer > ground. > > Opinion based on reading and reasoning, of course, and not to be trusted > until and unless I or someone else were to back it up by doing some > simulated-data experiments... > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: > >> Hi Elisabeth and Alik, >> Permutation methods applied to multiple regression models are not >> generally guaranteed to be accurate because testing individual terms in >> such models (e.g., partial correlation coefficients) requires accurate >> knowledge of other terms in the model (e.g., the slope coefficients for all >> the other predictors in the multiple regression). Because such parameters >> have to be estimated from the data, permutation tests are only >> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >> Though there are special cases (e.g., a two factor ANOVA with two levels of >> each factor), where permutation methods do guarantee accuracy. >> In lieu of permutation testing, you might want to try using one of >> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >> control for multiple comparisons. In my tests on simulated ERP data (Groppe >> et al., 2011), FDR correction was nearly as powerful as cluster-based >> permutation testing for detecting a very broadly distributed effect (e.g., >> a P300-like effect) and it was far more sensitive than cluster-based >> testing for an effect with a very limited distribution (e.g., an N170-like >> effect). FDR correction is also very computationally efficient. >> hope this is helpful, >> -David >> >> >> Refs: >> Anderson, M. J. (2001). Permutation tests for univariate or multivariate >> analysis of variance and regression. *Canadian journal of fisheries and >> aquatic sciences*, *58*(3), 626-639. >> >> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >> >> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >> analysis of event‐related brain potentials/fields II: Simulation studies. >> *Psychophysiology*, *48*(12), 1726-1737. >> >> >> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >> elisabethsusanne.may at gmail.com> wrote: >> >>> Dear Eric and Alik, >>> >>> thanks a lot for your helpful responses! >>> >>> I will have a close look at the faqs, Eric, and test the approaches you >>> outlined. I am curious, anyway, as to how different results will be for >>> simple regressions compared to the multilevel results of the linear-mixed >>> models. >>> >>> Like Alik, I am also curious about other people's opinions on the >>> general question if there are theoretical reasons against a combination of >>> the approaches like Alik suggested. We also thought about this approach but >>> haven't fully tested it yet because of the very long calculation times. >>> >>> Thanks again and have a nice weekend! >>> Elisabeth >>> >>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>> >>>> Eric, I don't think I understand why you would say "I do not see how >>>> these models could be combined with permutation-based inference; they are >>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>> a regression, and the beta coefficient for the independent-variable of >>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>> much does the independent variable explain the brain activity?" In that >>>> framework, it seems to me that one could do the following: >>>> >>>> for n=1:1000 >>>> 1) Permute the condition labels (within subjects) of the individual >>>> trials >>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >>>> corresponding t-map >>>> 3) Threshold and construct cluster mass statistic as usual >>>> end >>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>> cluster p-value >>>> >>>> >>>> Now, the main thing that has come up when we've tried to do this is >>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>> it would require rewriting at least a statfun, maybe other pieces of the >>>> code. (We had an idea that, since the betas likely should vary smoothly >>>> over time and space, one could use the output of one GLM as the seed to the >>>> next, which would speed up convergence.) So it still does not seem like a >>>> good idea, but based on the above, is there actually a *theoretical* reason >>>> it wouldn't work? >>>> >>>> >>>> Alik Widge, MD, PhD >>>> Director, Translational NeuroEngineering Laboratory >>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>> Assistant Professor of Psychiatry, Harvard Medical School >>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>> awidge at partners.org >>>> http://scholar.harvard.edu/awidge/ >>>> 617-643-2580 >>>> >>>> Alik Widge >>>> alik.widge at gmail.com >>>> (206) 866-5435 >>>> >>>> >>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>> e.maris at donders.ru.nl> wrote: >>>> >>>>> Note: this is the second time I post this reply, and the reason is >>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>> (shame on me…(-;) >>>>> >>>>> *From: *Elisabeth May >>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>> tests on linear mixed models* >>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>> *To: * >>>>> *Reply-To: *FieldTrip discussion list >>>>> >>>>> >>>>> Dear FieldTripers, >>>>> >>>>> I have a question about the potential use of cluster-based permutation >>>>> tests for results obtained using linear mixed models. >>>>> >>>>> We are working with data from a 10 min EEG experiment on source level >>>>> with the aim to quantify the relationship of brain activity in different >>>>> frequency bands with continous perceptual ratings across 20 subjects in >>>>> different experimental conditions. Thus, we have 10 min time courses of >>>>> brain activity and ratings for each voxel for different conditions and want >>>>> to test a) if there are significant relationships in the single conditions >>>>> and b) if these relationships differ between two conditions. To this end, I >>>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>>> the single condition relationships and the condition contrasts, they result >>>>> in a single t-value (and a corresponding p-value), which is based on >>>>> information on both the single subject and the group level (i.e. we perform >>>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>>> of t-values and are wondering if there is a way to apply cluster-based >>>>> tests to correct for multiple comparisons. >>>>> >>>>> The main problem I see is that I only have one multilevel t-value for >>>>> the effect across all subjects, i.e. I don't have single subjects values, >>>>> which I could then e.g. randomize between conditions as normally done in >>>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>>> single subject values but would then loose the advantage of the multi-level >>>>> analysis.) >>>>> >>>>> I found an old thread in the mailinglist archive where it was >>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>> /005375.html). I understand that, in our case, I would do this >>>>> randomly for all voxels in each randomization and then build spatial >>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>> if that is a valid approach based on the null hypothesis that there are no >>>>> significant relations in my single conditions (a) or no significant >>>>> relationship differences in my condition contrasts (b). >>>>> >>>>> For the condition contrasts, I would be able to permute the condition >>>>> labels as normally done in cluster-based permutation tests,I think, but >>>>> would then have to recalculate the linear mixed models for all voxels in >>>>> every permutation. This would result in a very high computational load. >>>>> >>>>> Does anyone have any experience with this kind of analysis? Would the >>>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>>> keep in mind in particular)? Can you think of other ways to combine linear >>>>> mixed models with a multiple comparison correction on the cluster level? >>>>> >>>>> >>>>> Hi Elisabeth, >>>>> >>>>> I’m not an expert on linear mixed modelling, at least not with respect >>>>> to the different ways in which they can be used to deal with correlated >>>>> observations (typically, time series). However, from a theoretical point of >>>>> view, I do not see how these models could be combined with >>>>> permutation-based inference; they are just different statistical >>>>> frameworks. However, it IS possible to answer your questions ("we >>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>> different conditions and wan to test a) if there are significant >>>>> relationships in the single conditions and b) if these relationships differ >>>>> between two conditions.”) within the framework of cluster-based permutation >>>>> tests. Question b) is the most straightforward because it amounts to a >>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>> regression coefficients in each of the two conditions. Answering question >>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>> difference between them using a cluster-based permutation test using the >>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>> implemented it for him). The approach for question b) is actually a variant >>>>> on the general approach for testing interactions using cluster-based >>>>> permutation tests. >>>>> >>>>> Have a look here: >>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>> behavioural_variables >>>>> and >>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>> ction_effect_using_cluster-based_permutation_tests >>>>> >>>>> These tutorials provide all the necessary concepts, although they do >>>>> not answer your question in a recipe-like fashion. >>>>> >>>>> best, >>>>> Eric Maris >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maximilien.chaumon at gmail.com Wed Oct 26 10:42:27 2016 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Wed, 26 Oct 2016 08:42:27 +0000 Subject: [FieldTrip] filtering during artifact detection Message-ID: Dear all, when attempting to detect blinks automatically on a continuous recording without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: cfg = []; cfg.dataset = fullfile(rootdir,f{iD}); cfg.layout = 'neuromag306mag.lay'; cfg.trialdef.eventtype = 'STI101'; cfg.trialdef.eventvalue = {255}; cfg = ft_definetrial(cfg); cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; cfg.channel = 'megmag'; cfg.continuous = 'yes'; data = ft_preprocessing(cfg); cfg.artfctdef.eog = []; cfg.artfctdef.eog.channel = eogchans; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); This opens an interactive window in which the EOG signal is not BPfiltered, and contains in particular slow drifts that make the threshold detection pretty inefficient. I'm surprised because cfg.artfctdef is supposed to bpfilter 1-15Hz the data, isn't it? Is this normal? Thanks, Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Wed Oct 26 11:15:52 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Wed, 26 Oct 2016 11:15:52 +0200 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: Dear Maximilien, You should specify the filter parameters in the cfg: cfg.artfctdef.eog.bpfilter = 'yes' cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details cfg.artfctdef.eog.bpfreq = [1 15] cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see Take a look to the fft_artifact_eog.m documentation. To know more about filtering you might want to take a look here: http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics Best, Diego On 26 October 2016 at 10:42, Maximilien Chaumon < maximilien.chaumon at gmail.com> wrote: > Dear all, > when attempting to detect blinks automatically on a continuous recording > without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not > BPfiltered, and contains in particular slow drifts that make the threshold > detection pretty inefficient. I'm surprised because cfg.artfctdef is > supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maximilien.chaumon at gmail.com Wed Oct 26 14:27:32 2016 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Wed, 26 Oct 2016 12:27:32 +0000 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: Thank you Diego for your quick reply. Whether or not I include those filter parameters explicitly does not change anything. This is what i have now: cfg.artfctdef.eog = []; cfg.artfctdef.eog.bpfilter = 'yes'; cfg.artfctdef.eog.bpfilttype = 'but'; cfg.artfctdef.eog.bpfreq = [1 15]; cfg.artfctdef.eog.bpfiltord = 4; cfg.artfctdef.eog.channel = eogchans; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; cfg.artfctdef.eog.cutoff = 2.5; [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); but the resulting interactive window looks like this: [image: pasted1] Seems like the preprocessing step isn't applied... any clue why that is? Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla < dlozanosoldevilla at gmail.com> a écrit : > Dear Maximilien, > > You should specify the filter parameters in the cfg: > > cfg.artfctdef.eog.bpfilter = 'yes' > cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details > cfg.artfctdef.eog.bpfreq = [1 15] > cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see > > > Take a look to the fft_artifact_eog.m documentation. To know more about > filtering you might want to take a look here: > > http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics > > Best, > > Diego > > On 26 October 2016 at 10:42, Maximilien Chaumon < > maximilien.chaumon at gmail.com> wrote: > > Dear all, > when attempting to detect blinks automatically on a continuous recording > without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not > BPfiltered, and contains in particular slow drifts that make the threshold > detection pretty inefficient. I'm surprised because cfg.artfctdef is > supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Wed Oct 26 14:36:03 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Wed, 26 Oct 2016 21:36:03 +0900 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> Dear all, Note that I encountered the same problem (absence of intended filtering) when using high-level ft_preprocessing function (I talked about it in a a precedent email). I solved the problem by doing the filtering separately, as a first step, and using the low-level ft_preprocbandstopfilter function. Anyway I needed access to the data in an unstructured format (i.e. just a matrix, easy to manipulate), so in the end this low-level function fitted my needs better. All the best, Florian > On 26 Oct, 2016, at 9:27 PM, Maximilien Chaumon wrote: > > Thank you Diego for your quick reply. > Whether or not I include those filter parameters explicitly does not change anything. > This is what i have now: > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.bpfilter = 'yes'; > cfg.artfctdef.eog.bpfilttype = 'but'; > cfg.artfctdef.eog.bpfreq = [1 15]; > cfg.artfctdef.eog.bpfiltord = 4; > > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > cfg.artfctdef.eog.cutoff = 2.5; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > > but the resulting interactive window looks like this: > > > > Seems like the preprocessing step isn't applied... any clue why that is? > > > Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla > a écrit : > Dear Maximilien, > > You should specify the filter parameters in the cfg: > > cfg.artfctdef.eog.bpfilter = 'yes' > cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details > cfg.artfctdef.eog.bpfreq = [1 15] > cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see > > Take a look to the fft_artifact_eog.m documentation. To know more about filtering you might want to take a look here: > http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics > > Best, > > Diego > > On 26 October 2016 at 10:42, Maximilien Chaumon > wrote: > Dear all, > when attempting to detect blinks automatically on a continuous recording without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not BPfiltered, and contains in particular slow drifts that make the threshold detection pretty inefficient. I'm surprised because cfg.artfctdef is supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elinor.tzvi at neuro.uni-luebeck.de Wed Oct 26 14:43:20 2016 From: elinor.tzvi at neuro.uni-luebeck.de (Elinor Tzvi) Date: Wed, 26 Oct 2016 14:43:20 +0200 Subject: [FieldTrip] PHD POSITION IN NON-INVASIVE BRAIN STIMULATION AND IMAGING Message-ID: <810A8E06C75EB447A8CEB73DBFD7BB0EFA6AC0D24E@solaris.neuro.uni-luebeck.de> The Neurology department of the University of Lübeck offers a PhD position (65% E13 TV-L) starting on January 1st, 2017 or later. The candidate will be working on a project using combined non-invasive brain stimulation (tDCS) and MR-imaging to study dynamics of neural connectivity underlying motor skill learning. We offer The department of Neurology is part of the Center for Brain, Behavior and Metabolism (CBBM), which offers an excellent and state-of the-art research environment. The research group "Cognitive Neuroscience" (headed by Prof. Ulrike Krämer) is working on different topics related to cognitive and affective control (anger and aggression, response inhibition, regulation of eating behavior) and motor control. In addition, our researchers use diverse and complex methods to analyze brain-behavior relationships. Thus, we offer an excellent environment for interdisciplinary research. In addition, the group has a number of national and international collaborations. We require The successful candidate will hold an MSc/MA/Dipl. in Biomedical Engineering, Psychology or related fields (cognitive science, biology, medicine, neuroscience or other). Experience in acquisition and analysis of human neuroimaging data (fMRI, EEG, MEG or NIRS) and Programming skills in Matlab (or equivalent) is preferred. Interest and/or experience in the field of cognitive neuroscience are obligatory. We are looking for a motivated, analytic and problem-solving oriented candidate who enjoys interdisciplinary challenges. The candidate will work in the "Cognitive Neuroscience Group" headed by Prof. Dr. Ulrike M. Krämer under the supervision of Dr. Elinor Tzvi-Minker. Applicants with disabilities are preferred if qualification is equal. The University of Lübeck is an equal opportunity employer, aiming to increase the proportion of women in science. Applications by women are particularly welcome. For questions about the details of the assignment please contact Dr. Elinor Tzvi-Minker (elinor.tzvi at neuro.uni-luebeck.de). Please send your application (Letter of motivation, CV, two recommendation letters, relevant certificates) as one single complete PDF file to the Email-address mentioned above. Applications will be considered until the position has been filled. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Wed Oct 26 15:47:08 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Wed, 26 Oct 2016 15:47:08 +0200 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> References: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> Message-ID: Hi Maximilien and Florian, Thank for letting us know. I can reproduce your problem and the problem relies in an unfortunate combination of fieldtrip defaults in some functions. The issue starts with the cfg.artfctdef.eog.fltpadding default which is 0.1. This parameter introduces a 0.1s padding with NaNs (line 301 in ft_artifact_zvalue) and the private function preproc.m does not filter the data because it contains NaNs. For now, set explicitly cfg.artfctdef.eog.fltpadding = 0; to carry on while we fix it: cfg=[]; cfg.artfctdef.eog = []; cfg.artfctdef.eog.bpfilter = 'yes'; cfg.artfctdef.eog.bpfilttype = 'but'; cfg.artfctdef.eog.bpfreq = [8 10]; cfg.artfctdef.eog.bpfiltord = 4; cfg.artfctdef.eog.channel = 'MLF22'; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.fltpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; cfg.artfctdef.eog.cutoff = 2.5; [cfg, artifact] = ft_artifact_eog(cfg,data); You can follow the development of the issue here: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3193 Best, Diego On 26 October 2016 at 14:36, Florian Gerard-Mercier wrote: > Dear all, > > Note that I encountered the same problem (absence of intended filtering) > when using high-level ft_preprocessing function (I talked about it in a a > precedent email). > I solved the problem by doing the filtering separately, as a first step, > and using the low-level ft_preprocbandstopfilter function. > Anyway I needed access to the data in an unstructured format (i.e. just a > matrix, easy to manipulate), so in the end this low-level function fitted > my needs better. > > All the best, > > Florian > > On 26 Oct, 2016, at 9:27 PM, Maximilien Chaumon < > maximilien.chaumon at gmail.com> wrote: > > Thank you Diego for your quick reply. > Whether or not I include those filter parameters explicitly does not > change anything. > This is what i have now: > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.bpfilter = 'yes'; > cfg.artfctdef.eog.bpfilttype = 'but'; > cfg.artfctdef.eog.bpfreq = [1 15]; > cfg.artfctdef.eog.bpfiltord = 4; > > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > cfg.artfctdef.eog.cutoff = 2.5; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > > but the resulting interactive window looks like this: > > > Seems like the preprocessing step isn't applied... any clue why that is? > > > Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla < > dlozanosoldevilla at gmail.com> a écrit : > >> Dear Maximilien, >> >> You should specify the filter parameters in the cfg: >> >> cfg.artfctdef.eog.bpfilter = 'yes' >> cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details >> cfg.artfctdef.eog.bpfreq = [1 15] >> cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see >> >> >> Take a look to the fft_artifact_eog.m documentation. To know more about >> filtering you might want to take a look here: >> http://www.fieldtriptoolbox.org/example/determine_the_ >> filter_characteristics >> >> Best, >> >> Diego >> >> On 26 October 2016 at 10:42, Maximilien Chaumon < >> maximilien.chaumon at gmail.com> wrote: >> >> Dear all, >> when attempting to detect blinks automatically on a continuous recording >> without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: >> >> cfg = []; >> cfg.dataset = fullfile(rootdir,f{iD}); >> cfg.layout = 'neuromag306mag.lay'; >> cfg.trialdef.eventtype = 'STI101'; >> cfg.trialdef.eventvalue = {255}; >> cfg = ft_definetrial(cfg); >> >> cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; >> cfg.channel = 'megmag'; >> cfg.continuous = 'yes'; >> data = ft_preprocessing(cfg); >> >> >> cfg.artfctdef.eog = []; >> cfg.artfctdef.eog.channel = eogchans; >> cfg.artfctdef.eog.trlpadding = 0; >> cfg.artfctdef.eog.interactive = 'yes'; >> >> [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); >> >> This opens an interactive window in which the EOG signal is not >> BPfiltered, and contains in particular slow drifts that make the threshold >> detection pretty inefficient. I'm surprised because cfg.artfctdef is >> supposed to bpfilter 1-15Hz the data, isn't it? >> >> Is this normal? >> Thanks, >> Max >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Wed Oct 26 19:35:03 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Wed, 26 Oct 2016 13:35:03 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe wrote: > I would definitely recommend running some simulations. > > It might be simpler to use bootstrap samples rather than permutations to > generate your null distribution. Bootstrapping in also asymptotically > accurate. > -David > > > > On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: > >> Thanks, that was super interesting! Was not aware of those. >> >> Have been meditating this afternoon on this and related Anderson papers. >> What's interesting is that he appears to think my suggestion below *would* >> be asymptotically acceptable -- *if* one specifically permutes the >> dependent variable (power/ERP observation) rather than permuting each >> column of the independent variables separately (i.e., if one preserves any >> correlational structure that exists between the independent variables). >> That's the Manly (1997) method, and it appears that the only reason it >> breaks down sometimes is if there's an outlier in the independent variable. >> This could presumably be a problem in the ecological sciences, for which >> he's writing, where one can't control things like temperature in a season >> or numbers of eels that swim past a given sensor. In cognitive >> neuroscience, where the predictor/independent variables are usually dummy >> coded properties of the trial, this seems like we might be on firmer >> ground. >> >> Opinion based on reading and reasoning, of course, and not to be trusted >> until and unless I or someone else were to back it up by doing some >> simulated-data experiments... >> >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> wrote: >> >>> Hi Elisabeth and Alik, >>> Permutation methods applied to multiple regression models are not >>> generally guaranteed to be accurate because testing individual terms in >>> such models (e.g., partial correlation coefficients) requires accurate >>> knowledge of other terms in the model (e.g., the slope coefficients for all >>> the other predictors in the multiple regression). Because such parameters >>> have to be estimated from the data, permutation tests are only >>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>> each factor), where permutation methods do guarantee accuracy. >>> In lieu of permutation testing, you might want to try using one of >>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>> permutation testing for detecting a very broadly distributed effect (e.g., >>> a P300-like effect) and it was far more sensitive than cluster-based >>> testing for an effect with a very limited distribution (e.g., an N170-like >>> effect). FDR correction is also very computationally efficient. >>> hope this is helpful, >>> -David >>> >>> >>> Refs: >>> Anderson, M. J. (2001). Permutation tests for univariate or multivariate >>> analysis of variance and regression. *Canadian journal of fisheries and >>> aquatic sciences*, *58*(3), 626-639. >>> >>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>> >>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>> analysis of event‐related brain potentials/fields II: Simulation studies. >>> *Psychophysiology*, *48*(12), 1726-1737. >>> >>> >>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >>> elisabethsusanne.may at gmail.com> wrote: >>> >>>> Dear Eric and Alik, >>>> >>>> thanks a lot for your helpful responses! >>>> >>>> I will have a close look at the faqs, Eric, and test the approaches you >>>> outlined. I am curious, anyway, as to how different results will be for >>>> simple regressions compared to the multilevel results of the linear-mixed >>>> models. >>>> >>>> Like Alik, I am also curious about other people's opinions on the >>>> general question if there are theoretical reasons against a combination of >>>> the approaches like Alik suggested. We also thought about this approach but >>>> haven't fully tested it yet because of the very long calculation times. >>>> >>>> Thanks again and have a nice weekend! >>>> Elisabeth >>>> >>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>> >>>>> Eric, I don't think I understand why you would say "I do not see how >>>>> these models could be combined with permutation-based inference; they are >>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>> a regression, and the beta coefficient for the independent-variable of >>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>> much does the independent variable explain the brain activity?" In that >>>>> framework, it seems to me that one could do the following: >>>>> >>>>> for n=1:1000 >>>>> 1) Permute the condition labels (within subjects) of the individual >>>>> trials >>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>> and corresponding t-map >>>>> 3) Threshold and construct cluster mass statistic as usual >>>>> end >>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>> cluster p-value >>>>> >>>>> >>>>> Now, the main thing that has come up when we've tried to do this is >>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>> over time and space, one could use the output of one GLM as the seed to the >>>>> next, which would speed up convergence.) So it still does not seem like a >>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>> it wouldn't work? >>>>> >>>>> >>>>> Alik Widge, MD, PhD >>>>> Director, Translational NeuroEngineering Laboratory >>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>> awidge at partners.org >>>>> http://scholar.harvard.edu/awidge/ >>>>> 617-643-2580 >>>>> >>>>> Alik Widge >>>>> alik.widge at gmail.com >>>>> (206) 866-5435 >>>>> >>>>> >>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>> e.maris at donders.ru.nl> wrote: >>>>> >>>>>> Note: this is the second time I post this reply, and the reason is >>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>> (shame on me…(-;) >>>>>> >>>>>> *From: *Elisabeth May >>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>> tests on linear mixed models* >>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>> *To: * >>>>>> *Reply-To: *FieldTrip discussion list >>>>>> >>>>>> >>>>>> Dear FieldTripers, >>>>>> >>>>>> I have a question about the potential use of cluster-based >>>>>> permutation tests for results obtained using linear mixed models. >>>>>> >>>>>> We are working with data from a 10 min EEG experiment on source level >>>>>> with the aim to quantify the relationship of brain activity in different >>>>>> frequency bands with continous perceptual ratings across 20 subjects in >>>>>> different experimental conditions. Thus, we have 10 min time courses of >>>>>> brain activity and ratings for each voxel for different conditions and want >>>>>> to test a) if there are significant relationships in the single conditions >>>>>> and b) if these relationships differ between two conditions. To this end, I >>>>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>>>> the single condition relationships and the condition contrasts, they result >>>>>> in a single t-value (and a corresponding p-value), which is based on >>>>>> information on both the single subject and the group level (i.e. we perform >>>>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>>>> of t-values and are wondering if there is a way to apply cluster-based >>>>>> tests to correct for multiple comparisons. >>>>>> >>>>>> The main problem I see is that I only have one multilevel t-value for >>>>>> the effect across all subjects, i.e. I don't have single subjects values, >>>>>> which I could then e.g. randomize between conditions as normally done in >>>>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>>>> single subject values but would then loose the advantage of the multi-level >>>>>> analysis.) >>>>>> >>>>>> I found an old thread in the mailinglist archive where it was >>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>> /005375.html). I understand that, in our case, I would do this >>>>>> randomly for all voxels in each randomization and then build spatial >>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>> significant relations in my single conditions (a) or no significant >>>>>> relationship differences in my condition contrasts (b). >>>>>> >>>>>> For the condition contrasts, I would be able to permute the condition >>>>>> labels as normally done in cluster-based permutation tests,I think, but >>>>>> would then have to recalculate the linear mixed models for all voxels in >>>>>> every permutation. This would result in a very high computational load. >>>>>> >>>>>> Does anyone have any experience with this kind of analysis? Would the >>>>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>>>> keep in mind in particular)? Can you think of other ways to combine linear >>>>>> mixed models with a multiple comparison correction on the cluster level? >>>>>> >>>>>> >>>>>> Hi Elisabeth, >>>>>> >>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>> respect to the different ways in which they can be used to deal with >>>>>> correlated observations (typically, time series). However, from a >>>>>> theoretical point of view, I do not see how these models could be combined >>>>>> with permutation-based inference; they are just different statistical >>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>> different conditions and wan to test a) if there are significant >>>>>> relationships in the single conditions and b) if these relationships differ >>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>> regression coefficients in each of the two conditions. Answering question >>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>> difference between them using a cluster-based permutation test using the >>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>> on the general approach for testing interactions using cluster-based >>>>>> permutation tests. >>>>>> >>>>>> Have a look here: >>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>> behavioural_variables >>>>>> and >>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>> >>>>>> These tutorials provide all the necessary concepts, although they do >>>>>> not answer your question in a recipe-like fashion. >>>>>> >>>>>> best, >>>>>> Eric Maris >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.opie at adelaide.edu.au Wed Oct 26 22:39:38 2016 From: george.opie at adelaide.edu.au (George McKenzie Opie) Date: Wed, 26 Oct 2016 20:39:38 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency Message-ID: Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Oct 26 22:50:40 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 26 Oct 2016 22:50:40 +0200 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency In-Reply-To: References: Message-ID: Dear George, You have a typo in the cfg at cfg.frequency. Hope this helps, Julian Am Mittwoch, 26. Oktober 2016 schrieb George McKenzie Opie : > Hi all, > > > Im trying to run some between-subject cluster-based analyses on some > time-frequency data, but am having some issues getting the analysis to > average over a specified frequency range. For some reason this only happens > with between-subject comparisons and not within-subject. My cfg structure > is shown below. D1 and D2 are grandaverage data from two groups calculated > using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it > averages over all frequencies (5 - 45 Hz), instead of the specified > frequency range (31 - 45 Hz). Any help would be very much appreciated. > > > cfg = []; > cfg.channel = {'all'}; > cfg.minnbchan = 2; > cfg.clusteralpha = 0.01; > cfg.clusterstatistic = 'maxsum'; > cfg.alpha = 0.05; > cfg.latency = [0.025, 0.220]; > cfg.avgoverfreq = 'yes'; > cfg.frequnecy = [31 45]; > cfg.avgovertime = 'yes'; > cfg.avgoverchan = 'no'; > cfg.statistic = 'indepsamplesT'; > cfg.numrandomization = 2000; > cfg.correctm = 'cluster'; > cfg.method = 'montecarlo'; > cfg.tail = 0; > cfg.clustertail = 0; > cfg.neighbours = neighbours; > cfg.parameter = 'powspctrm'; > > design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); > design(1,1:size(D1.powspctrm,1)) = 1; > design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + > size(D2.powspctrm,1)))= 2; > > cfg.design = design; > cfg.ivar = 1; > > [stat] = ft_freqstatistics(cfg, D1, D2); > > > kind regards, > > > George Opie > > ARC Research Associate > Discipline of Physiology > School of Medicine > The University of Adelaide, AUSTRALIA 5005 > Ph : +61 8 8313 4157 > Fax : +61 8 8303 5384 > e-mail: george.opie at adelaide.edu.au > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.opie at adelaide.edu.au Wed Oct 26 22:51:57 2016 From: george.opie at adelaide.edu.au (George McKenzie Opie) Date: Wed, 26 Oct 2016 20:51:57 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency In-Reply-To: References: , Message-ID: Wow, cant believe I missed that! Thanks Julian, much appreciated. George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Julian Keil Sent: Thursday, 27 October 2016 7:20:40 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] between-subject cluster-stats wont average over specified frequency Dear George, You have a typo in the cfg at cfg.frequency. Hope this helps, Julian Am Mittwoch, 26. Oktober 2016 schrieb George McKenzie Opie : Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Wed Oct 26 23:36:32 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Wed, 26 Oct 2016 21:36:32 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency Message-ID: Hi George, There's a typo in cfg.frequency (in the script it reads cfg.frequnecy). This could explain the behaviour. Peter On 27 Oct 2016 07:58, George McKenzie Opie wrote: Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 27 13:57:07 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 27 Oct 2016 11:57:07 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Fri Oct 28 00:48:22 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 27 Oct 2016 22:48:22 +0000 Subject: [FieldTrip] shifting data time Message-ID: Hi: I need a way to “stitch” together a single subject’s data recorded over many hours which were saved in 14 separate files. When stitched together, file 1 end time is the start time of file 2, file 2 end time is the start of file 3, and so on. Unfortunately the recorded files all start at time t = 0 so ft_appenddata() put them into 14 separate trials. I need to shift the time for each file so they will be jointed into a single trial. I didn’t find any ft_ function to do this. Any suggestions? thanks, Mona ************************************************ Mona Wong Web & iPad Application Developer San Diego Supercomputer Center You are the light you wish to see. ************************************************ From anne.hauswald at me.com Fri Oct 28 10:36:31 2016 From: anne.hauswald at me.com (anne Hauswald) Date: Fri, 28 Oct 2016 10:36:31 +0200 Subject: [FieldTrip] shifting data time In-Reply-To: References: Message-ID: Hi Mona, if you do cfg=[]; all=ft_appenddata(cfg, data1, data2, data3, data4); you get among the other fields all= time: {1x4 cell} %assuming each dataset equals one trial, which is what you want to replace. you could try to create a matrix, based on your sampling rate with all the continuous time points, here just for illustration: all_timepoints=[0:0.025:9.975] %adapt to your sampling rate and length of data, be very sure the end of one file is the beginning of the next one. (This is giving you all points from 0 to 9.975 with steps of 0.025) trl_timepoints=mat2cell(all_timepoints, 1, [100 100 100 100]) %here I create 4 cell arrays, corresponding e.g. to 4 trials will result in trl_timepoints = [1x100 double] [1x100 double] [1x100 double] [1x100 double] with continuous time information (trial 1 starts at 0, trial 2 at 2.5, trials 3 at 5, and trial 4 at 7.5) of the same length. this you can then use to replace the original time information: all_data.time_old=all_data.time %if you want to keep the original time information all_data.time=trl_timepoints In general: are you really sure that you need the continuous time information? There are many processing and analyses steps that can be done on the appended time information… There might be more elegant ways to do this. Hope there is no typo and that it helps Best Anne > Am 28.10.2016 um 00:48 schrieb Wong-Barnum, Mona : > > > Hi: > > I need a way to “stitch” together a single subject’s data recorded over many hours which were saved in 14 separate files. When stitched together, file 1 end time is the start time of file 2, file 2 end time is the start of file 3, and so on. Unfortunately the recorded files all start at time t = 0 so ft_appenddata() put them into 14 separate trials. I need to shift the time for each file so they will be jointed into a single trial. I didn’t find any ft_ function to do this. Any suggestions? > > thanks, > Mona > > ************************************************ > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > You are the light you wish to see. > ************************************************ > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayelet.landau at gmail.com Fri Oct 28 10:30:27 2016 From: ayelet.landau at gmail.com (Ayelet Landau) Date: Fri, 28 Oct 2016 11:30:27 +0300 Subject: [FieldTrip] Postdoc/PhD positions - Cognitive Neuroscience @ the Hebrew University of Jerusalem, Israel Message-ID: *Post Doc and PhD positions at the Brain Attention and Time Lab, at the Hebrew University of Jerusalem, Israel* Full-time post doc and PhD positions are available in the Brain Attention and Time Lab of Dr. Ayelet N. Landau at the Hebrew University of Jerusalem. Initial appointment will be for one year with the option to renew annually up to 4 years. Preferred starting date: January 2017 The lab’s core research areas include the guidance of attention and temporal processing and their underlying neural mechanisms. As cognitive neuroscientists we try to construe models of cognition and examine them using both in perception and in physiology. The positions are part of two externally funded projects focused on: (1) Fluctuations in attention and rhythmic attentional sampling. (2) Neural mechanisms of interval timing. Both research programs examine the role of brain rhythms in cognition. In the lab, we measure perception in different modalities (tactile, visual and auditory) together with non-invasive physiology (MEG/EEG) and eye-tracking. You can read about the research and the lab here. We are seeking a highly qualified post doc with a doctorate in a relevant field (e.g., Psychology, Neuroscience, and Cognitive Science) and shared interests in the core research areas described above. The researcher, ideally, should have extensive experience with EEG/MEG methodology and neural oscillations measurement. Experience with other techniques - such as fMRI, computational modeling, etc. - is also welcome but not required. In addition, we are looking for strong candidates for a funded PhD studentship. The Hebrew University offers several training opportunities in different departments. The successful candidate will be competitive for one of the flagship programs (psychology, cognitive science or neuroscience) and will have demonstrated experience in research from their post-bac or BA education (as research assistants or honors students). Knowledge of programming is an advantage. For both positions, a passion and a commitment to science, strong social skills, trouble shooting skills and fast learning abilities are a requirement. Interested candidates should send a CV, a brief statement of research interests, and the names and contact details of two academic references to ayelet.landau at huji.ac.il preferably by December 1st. Applications will be considered until the positions are filled. I look forward to hearing from you! -- Ayelet N. Landau, PhD *Senior Lecturer* *Department of Psychology & Department of Cognitive SciencesThe Hebrew University of JerusalemJerusalem 91905Israel* -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Oct 28 14:36:39 2016 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 28 Oct 2016 08:36:39 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> References: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Message-ID: So, two further questions. 1) Anyone reading this thread have some code for a reasonable ERP generator, especially one that models different ERPs per subject? I'm getting increasingly interested in doing some simulations to test my claims. (I'm thinking to do the 1d case just because it's faster to run. ) However, I'd like to do that on stimulated data that properly models, E.g., inter-subject variability of the precise timing of major peaks. 2) Eric, why are you describing the below as a fixed effects model? If we do a mixed model (with subject as a random intercept) at each time/frequency/sensor point, that seems like it handles the random effect that most people care about. Are you saying that you think each predictor variable would also need to be modeled as a per-subject slope? I guess I'm also thinking here that (to your second point), if the resulting values are used for thresholding to create cluster statistics for inference, inflation in the t/p values should be controlled for because the null distribution created during the permutation will have the same inflation. However, I don't believe I have a formal mathematical backup for that intuition, hence (1) above. On Oct 27, 2016 7:58 AM, "Maris, E.G.G. (Eric)" wrote: > Dear colleagues, > > @alik : > 1. The approach you propose is a so-called fixed-effects approach, of > which the outcome may depend on just a few subjects (provided the number of > trials is high). Some neuroscientists consider a fixed-effects approach > insufficient to support a scientific claim. E.g., the whole neuroimaging > community does so. > 2. Your approach is actually a genuine permutation test, in which the > LLM-derived t-stats are only used for thresholding (and not for inference). > > @david : > 1. There is nothing wrong with using FDR correction, if you think the > false discovery rate is the quantity that one should control. Others may > disagree though, stating the more strict family-wise error rate is the > relevant quantity. > 2. FDR correction assumes that the sample-specific (sample = a > channel-time-frequency triplet) p-values are unbiased. Because the > unbiasedness of these p-values depends on auxiliary assumptions, there may > be good reasons not to trust them. This is supported by the recent Ekstrom > et al paper on the inflated type 1 error rate in neuroimaging studies. > > best, > Eric Maris > > > > > > > > *From: *David Groppe > *Subject: **Re: [FieldTrip] Question about cluster-based permutation > tests on linear mixed models* > *Date: *26 October 2016 at 19:35:03 GMT+2 > *To: *FieldTrip discussion list , < > alik.widge at gmail.com> > *Reply-To: *FieldTrip discussion list > > > P.S. If you want to explore using FDR control to correct for multiple > comparisons, I would not recommend limiting yourself to FieldTrip's FDR > correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR > control procedure, which is guaranteed to control the FDR at or below the > desired level, but tends to be quite overly conservative in practice. The > more popular FDR control algorithm by Benjamini & Hochberg is not always > guaranteed to control the FDR at or below the desired level, but it is > much less conservative and tends to accurately control FDR in practice. > Here is some code for the > Benjamini & Hochberg algorithm: > > https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh > > MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also > implements the > Benjamini & Hochberg algorithm. > > > > On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: > >> I would definitely recommend running some simulations. >> >> It might be simpler to use bootstrap samples rather than permutations to >> generate your null distribution. Bootstrapping in also asymptotically >> accurate. >> -David >> >> >> >> On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: >> >>> Thanks, that was super interesting! Was not aware of those. >>> >>> Have been meditating this afternoon on this and related Anderson papers. >>> What's interesting is that he appears to think my suggestion below *would* >>> be asymptotically acceptable -- *if* one specifically permutes the >>> dependent variable (power/ERP observation) rather than permuting each >>> column of the independent variables separately (i.e., if one preserves any >>> correlational structure that exists between the independent variables). >>> That's the Manly (1997) method, and it appears that the only reason it >>> breaks down sometimes is if there's an outlier in the independent variable. >>> This could presumably be a problem in the ecological sciences, for which >>> he's writing, where one can't control things like temperature in a season >>> or numbers of eels that swim past a given sensor. In cognitive >>> neuroscience, where the predictor/independent variables are usually dummy >>> coded properties of the trial, this seems like we might be on firmer ground. >>> >>> >>> Opinion based on reading and reasoning, of course, and not to be trusted >>> until and unless I or someone else were to back it up by doing some >>> simulated-data experiments... >>> >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> > wrote: >>> >>>> Hi Elisabeth and Alik, >>>> Permutation methods applied to multiple regression models are not >>>> generally guaranteed to be accurate because testing individual terms in >>>> such models (e.g., partial correlation coefficients) requires accurate >>>> knowledge of other terms in the model (e.g., the slope coefficients for all >>>> the other predictors in the multiple regression). Because such parameters >>>> have to be estimated from the data, permutation tests are only >>>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>>> each factor), where permutation methods do guarantee accuracy. >>>> In lieu of permutation testing, you might want to try using one of >>>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>>> permutation testing for detecting a very broadly distributed effect (e.g., >>>> a P300-like effect) and it was far more sensitive than cluster-based >>>> testing for an effect with a very limited distribution (e.g., an N170-like >>>> effect). FDR correction is also very computationally efficient. >>>> hope this is helpful, >>>> -David >>>> >>>> >>>> Refs: >>>> Anderson, M. J. (2001). Permutation tests for univariate or >>>> multivariate analysis of variance and regression. *Canadian journal of >>>> fisheries and aquatic sciences*, *58*(3), 626-639. >>>> >>>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>>> >>>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>>> analysis of event‐related brain potentials/fields II: Simulation studies. >>>> *Psychophysiology*, *48*(12), 1726-1737. >>>> >>>> >>>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May >>> gmail.com> wrote: >>>> >>>>> Dear Eric and Alik, >>>>> >>>>> thanks a lot for your helpful responses! >>>>> >>>>> I will have a close look at the faqs, Eric, and test the approaches >>>>> you outlined. I am curious, anyway, as to how different results will be for >>>>> simple regressions compared to the multilevel results of the linear-mixed >>>>> models. >>>>> >>>>> Like Alik, I am also curious about other people's opinions on the >>>>> general question if there are theoretical reasons against a combination of >>>>> the approaches like Alik suggested. We also thought about this approach but >>>>> haven't fully tested it yet because of the very long calculation times. >>>>> >>>>> Thanks again and have a nice weekend! >>>>> Elisabeth >>>>> >>>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>>> >>>>>> Eric, I don't think I understand why you would say "I do not see how >>>>>> these models could be combined with permutation-based inference; they are >>>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>>> a regression, and the beta coefficient for the independent-variable of >>>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>>> much does the independent variable explain the brain activity?" In that >>>>>> framework, it seems to me that one could do the following: >>>>>> >>>>>> for n=1:1000 >>>>>> 1) Permute the condition labels (within subjects) of the >>>>>> individual trials >>>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>>> and corresponding t-map >>>>>> 3) Threshold and construct cluster mass statistic as usual >>>>>> end >>>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>>> cluster p-value >>>>>> >>>>>> >>>>>> Now, the main thing that has come up when we've tried to do this is >>>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>>> over time and space, one could use the output of one GLM as the seed to the >>>>>> next, which would speed up convergence.) So it still does not seem like a >>>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>>> it wouldn't work? >>>>>> >>>>>> >>>>>> Alik Widge, MD, PhD >>>>>> Director, Translational NeuroEngineering Laboratory >>>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>>> awidge at partners.org >>>>>> http://scholar.harvard.edu/awidge/ >>>>>> 617-643-2580 >>>>>> >>>>>> Alik Widge >>>>>> alik.widge at gmail.com >>>>>> (206) 866-5435 >>>>>> >>>>>> >>>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>>> e.maris at donders.ru.nl> wrote: >>>>>> >>>>>>> Note: this is the second time I post this reply, and the reason is >>>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>>> (shame on me…(-;) >>>>>>> >>>>>>> *From: *Elisabeth May >>>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>>> tests on linear mixed models* >>>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>>> *To: * >>>>>>> *Reply-To: *FieldTrip discussion list >>>>>>> >>>>>>> >>>>>>> Dear FieldTripers, >>>>>>> >>>>>>> I have a question about the potential use of cluster-based >>>>>>> permutation tests for results obtained using linear mixed models. >>>>>>> >>>>>>> We are working with data from a 10 min EEG experiment on source >>>>>>> level with the aim to quantify the relationship of brain activity in >>>>>>> different frequency bands with continous perceptual ratings across 20 >>>>>>> subjects in different experimental conditions. Thus, we have 10 min time >>>>>>> courses of brain activity and ratings for each voxel for different >>>>>>> conditions and want to test a) if there are significant relationships in >>>>>>> the single conditions and b) if these relationships differ between two >>>>>>> conditions. To this end, I have calculated linear mixed models in R using >>>>>>> the lme4 toolbox. For both the single condition relationships and the >>>>>>> condition contrasts, they result in a single t-value (and a corresponding >>>>>>> p-value), which is based on information on both the single subject and the >>>>>>> group level (i.e. we perform a multi-level analysis). However, with more >>>>>>> than 2000 voxels, we have a lot of t-values and are wondering if there is a >>>>>>> way to apply cluster-based tests to correct for multiple comparisons. >>>>>>> >>>>>>> The main problem I see is that I only have one multilevel t-value >>>>>>> for the effect across all subjects, i.e. I don't have single subjects >>>>>>> values, which I could then e.g. randomize between conditions as normally >>>>>>> done in cluster-based permutation tests. (Or rather, I would be able to >>>>>>> extract single subject values but would then loose the advantage of the >>>>>>> multi-level analysis.) >>>>>>> >>>>>>> I found an old thread in the mailinglist archive where it was >>>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>>> /005375.html). I understand that, in our case, I would do this >>>>>>> randomly for all voxels in each randomization and then build spatial >>>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>>> significant relations in my single conditions (a) or no significant >>>>>>> relationship differences in my condition contrasts (b). >>>>>>> >>>>>>> For the condition contrasts, I would be able to permute the >>>>>>> condition labels as normally done in cluster-based permutation tests,I >>>>>>> think, but would then have to recalculate the linear mixed models for all >>>>>>> voxels in every permutation. This would result in a very high computational >>>>>>> load. >>>>>>> >>>>>>> Does anyone have any experience with this kind of analysis? Would >>>>>>> the flipping of t-values be a valid approach (and if yes, is there anything >>>>>>> to keep in mind in particular)? Can you think of other ways to combine >>>>>>> linear mixed models with a multiple comparison correction on the cluster >>>>>>> level? >>>>>>> >>>>>>> >>>>>>> Hi Elisabeth, >>>>>>> >>>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>>> respect to the different ways in which they can be used to deal with >>>>>>> correlated observations (typically, time series). However, from a >>>>>>> theoretical point of view, I do not see how these models could be combined >>>>>>> with permutation-based inference; they are just different statistical >>>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>>> different conditions and wan to test a) if there are significant >>>>>>> relationships in the single conditions and b) if these relationships differ >>>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>>> regression coefficients in each of the two conditions. Answering question >>>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>>> difference between them using a cluster-based permutation test using the >>>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>>> on the general approach for testing interactions using cluster-based >>>>>>> permutation tests. >>>>>>> >>>>>>> Have a look here: >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>>> behavioural_variables >>>>>>> and >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>>> >>>>>>> These tutorials provide all the necessary concepts, although they do >>>>>>> not answer your question in a recipe-like fashion. >>>>>>> >>>>>>> best, >>>>>>> Eric Maris >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From K.Muller at psych.ru.nl Fri Oct 28 15:06:59 2016 From: K.Muller at psych.ru.nl (=?iso-8859-1?B?TfxsbGVyLCBLLiAoS2F0amEp?=) Date: Fri, 28 Oct 2016 13:06:59 +0000 Subject: [FieldTrip] MNE single trial time courses Message-ID: Dear list, What is the current way to go (if there is one) to obtain *single trial* source time courses from source reconstructions from Minimum Norm Estimate? Is there a tutorial? I used the MNE tutorial as a basis, i.e. I have a FreeSurfer based source model. In old mailing list messages there is some information about options like .rawtrial='yes' or .singletrial='yes', but some of them are very old and I am unable to extract which way to go at the moment. E.g. .singletrial is deprecated. Best regards, Katja From mehdy.dousty at gmail.com Fri Oct 28 18:49:03 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Fri, 28 Oct 2016 16:49:03 +0000 Subject: [FieldTrip] Covaraince matrix for MEG resting state Message-ID: Hi all I am using the resting state MEG signal for constructing the inverse problem by eLoreta, and as it is resting state, the covariance matrix needs to be used, so I am going to use HCP R-noise to construct the covariance matrix, but there are two main issues which I need your help. 1- as I am going to use preprocess data for resting state, do I need process the noise as well? if it is so, I can't find the time series of the noise in the raw data after using ft_read_header. 2- do I need to redefine the time series which add the noise time series at the beginning of the signal and then add the resting state time series so I can use the below code for computing the covariance? cfg= [] cfg.covariance = 'yes'; % I dont know how to enter the noise covariance to the data cfg.covariancewindow = [-inf 0]; timelockanalysis = ft_timelockanalysis(cfg, inputdata); I look forward to hearing from you. *Mehdy Dousty* *Hotchkiss Brain Institute* *University of Calgary* *HSC Building, Room 2932B* *3330 Hospital Drive NW* *Calgary, AB T2N 4N1* *Email Mehdy.Dousty at Ucalgary.ca* -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Sat Oct 29 20:20:05 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Sat, 29 Oct 2016 14:20:05 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> References: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Message-ID: @Eric 1. Note the FDR control actually provides "weak" control of the family-wise error rate (FWER). This is exactly the same degree of FWER control provided by cluster-based permutation tests. If you want strong control of FWER you will need to do something like Bonferroni-Holm or max-statistic (i.e., non-cluster) based permutation tests. 2. It's true that FDR assumes that the individual test p-values are accurate. You can derive these p-values though via non-parametric techniques like non-cluster-based permutation tests, thus the underlying statistical assumptions will be the same as if you had done a cluster-based permutation test. Moreover, if you have good reason to make parametric assumptions, FDR will let you exploit them. @Alik 1. I simulated data in that 2011 paper by randomly flipping the polarity of real EEG data to generate 0 mean, realistic ERP noise. The noise was subject-specific, but the simulated ERP effects were exactly the same for all simulated participants. So it couldn't be used to address the question you're after. On Thu, Oct 27, 2016 at 7:57 AM, Maris, E.G.G. (Eric) wrote: > Dear colleagues, > > @alik : > 1. The approach you propose is a so-called fixed-effects approach, of > which the outcome may depend on just a few subjects (provided the number of > trials is high). Some neuroscientists consider a fixed-effects approach > insufficient to support a scientific claim. E.g., the whole neuroimaging > community does so. > 2. Your approach is actually a genuine permutation test, in which the > LLM-derived t-stats are only used for thresholding (and not for inference). > > @david : > 1. There is nothing wrong with using FDR correction, if you think the > false discovery rate is the quantity that one should control. Others may > disagree though, stating the more strict family-wise error rate is the > relevant quantity. > 2. FDR correction assumes that the sample-specific (sample = a > channel-time-frequency triplet) p-values are unbiased. Because the > unbiasedness of these p-values depends on auxiliary assumptions, there may > be good reasons not to trust them. This is supported by the recent Ekstrom > et al paper on the inflated type 1 error rate in neuroimaging studies. > > best, > Eric Maris > > > > > > > > *From: *David Groppe > *Subject: **Re: [FieldTrip] Question about cluster-based permutation > tests on linear mixed models* > *Date: *26 October 2016 at 19:35:03 GMT+2 > *To: *FieldTrip discussion list , < > alik.widge at gmail.com> > *Reply-To: *FieldTrip discussion list > > > P.S. If you want to explore using FDR control to correct for multiple > comparisons, I would not recommend limiting yourself to FieldTrip's FDR > correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR > control procedure, which is guaranteed to control the FDR at or below the > desired level, but tends to be quite overly conservative in practice. The > more popular FDR control algorithm by Benjamini & Hochberg is not always > guaranteed to control the FDR at or below the desired level, but it is > much less conservative and tends to accurately control FDR in practice. > Here is some code for the > Benjamini & Hochberg algorithm: > > https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh > > MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also > implements the > Benjamini & Hochberg algorithm. > > > > On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: > >> I would definitely recommend running some simulations. >> >> It might be simpler to use bootstrap samples rather than permutations to >> generate your null distribution. Bootstrapping in also asymptotically >> accurate. >> -David >> >> >> >> On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: >> >>> Thanks, that was super interesting! Was not aware of those. >>> >>> Have been meditating this afternoon on this and related Anderson papers. >>> What's interesting is that he appears to think my suggestion below *would* >>> be asymptotically acceptable -- *if* one specifically permutes the >>> dependent variable (power/ERP observation) rather than permuting each >>> column of the independent variables separately (i.e., if one preserves any >>> correlational structure that exists between the independent variables). >>> That's the Manly (1997) method, and it appears that the only reason it >>> breaks down sometimes is if there's an outlier in the independent variable. >>> This could presumably be a problem in the ecological sciences, for which >>> he's writing, where one can't control things like temperature in a season >>> or numbers of eels that swim past a given sensor. In cognitive >>> neuroscience, where the predictor/independent variables are usually dummy >>> coded properties of the trial, this seems like we might be on firmer ground. >>> >>> >>> Opinion based on reading and reasoning, of course, and not to be trusted >>> until and unless I or someone else were to back it up by doing some >>> simulated-data experiments... >>> >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> > wrote: >>> >>>> Hi Elisabeth and Alik, >>>> Permutation methods applied to multiple regression models are not >>>> generally guaranteed to be accurate because testing individual terms in >>>> such models (e.g., partial correlation coefficients) requires accurate >>>> knowledge of other terms in the model (e.g., the slope coefficients for all >>>> the other predictors in the multiple regression). Because such parameters >>>> have to be estimated from the data, permutation tests are only >>>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>>> each factor), where permutation methods do guarantee accuracy. >>>> In lieu of permutation testing, you might want to try using one of >>>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>>> permutation testing for detecting a very broadly distributed effect (e.g., >>>> a P300-like effect) and it was far more sensitive than cluster-based >>>> testing for an effect with a very limited distribution (e.g., an N170-like >>>> effect). FDR correction is also very computationally efficient. >>>> hope this is helpful, >>>> -David >>>> >>>> >>>> Refs: >>>> Anderson, M. J. (2001). Permutation tests for univariate or >>>> multivariate analysis of variance and regression. *Canadian journal of >>>> fisheries and aquatic sciences*, *58*(3), 626-639. >>>> >>>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>>> >>>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>>> analysis of event‐related brain potentials/fields II: Simulation studies. >>>> *Psychophysiology*, *48*(12), 1726-1737. >>>> >>>> >>>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >>>> elisabethsusanne.may at gmail.com> wrote: >>>> >>>>> Dear Eric and Alik, >>>>> >>>>> thanks a lot for your helpful responses! >>>>> >>>>> I will have a close look at the faqs, Eric, and test the approaches >>>>> you outlined. I am curious, anyway, as to how different results will be for >>>>> simple regressions compared to the multilevel results of the linear-mixed >>>>> models. >>>>> >>>>> Like Alik, I am also curious about other people's opinions on the >>>>> general question if there are theoretical reasons against a combination of >>>>> the approaches like Alik suggested. We also thought about this approach but >>>>> haven't fully tested it yet because of the very long calculation times. >>>>> >>>>> Thanks again and have a nice weekend! >>>>> Elisabeth >>>>> >>>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>>> >>>>>> Eric, I don't think I understand why you would say "I do not see how >>>>>> these models could be combined with permutation-based inference; they are >>>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>>> a regression, and the beta coefficient for the independent-variable of >>>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>>> much does the independent variable explain the brain activity?" In that >>>>>> framework, it seems to me that one could do the following: >>>>>> >>>>>> for n=1:1000 >>>>>> 1) Permute the condition labels (within subjects) of the >>>>>> individual trials >>>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>>> and corresponding t-map >>>>>> 3) Threshold and construct cluster mass statistic as usual >>>>>> end >>>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>>> cluster p-value >>>>>> >>>>>> >>>>>> Now, the main thing that has come up when we've tried to do this is >>>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>>> over time and space, one could use the output of one GLM as the seed to the >>>>>> next, which would speed up convergence.) So it still does not seem like a >>>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>>> it wouldn't work? >>>>>> >>>>>> >>>>>> Alik Widge, MD, PhD >>>>>> Director, Translational NeuroEngineering Laboratory >>>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>>> awidge at partners.org >>>>>> http://scholar.harvard.edu/awidge/ >>>>>> 617-643-2580 >>>>>> >>>>>> Alik Widge >>>>>> alik.widge at gmail.com >>>>>> (206) 866-5435 >>>>>> >>>>>> >>>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>>> e.maris at donders.ru.nl> wrote: >>>>>> >>>>>>> Note: this is the second time I post this reply, and the reason is >>>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>>> (shame on me…(-;) >>>>>>> >>>>>>> *From: *Elisabeth May >>>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>>> tests on linear mixed models* >>>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>>> *To: * >>>>>>> *Reply-To: *FieldTrip discussion list >>>>>>> >>>>>>> >>>>>>> Dear FieldTripers, >>>>>>> >>>>>>> I have a question about the potential use of cluster-based >>>>>>> permutation tests for results obtained using linear mixed models. >>>>>>> >>>>>>> We are working with data from a 10 min EEG experiment on source >>>>>>> level with the aim to quantify the relationship of brain activity in >>>>>>> different frequency bands with continous perceptual ratings across 20 >>>>>>> subjects in different experimental conditions. Thus, we have 10 min time >>>>>>> courses of brain activity and ratings for each voxel for different >>>>>>> conditions and want to test a) if there are significant relationships in >>>>>>> the single conditions and b) if these relationships differ between two >>>>>>> conditions. To this end, I have calculated linear mixed models in R using >>>>>>> the lme4 toolbox. For both the single condition relationships and the >>>>>>> condition contrasts, they result in a single t-value (and a corresponding >>>>>>> p-value), which is based on information on both the single subject and the >>>>>>> group level (i.e. we perform a multi-level analysis). However, with more >>>>>>> than 2000 voxels, we have a lot of t-values and are wondering if there is a >>>>>>> way to apply cluster-based tests to correct for multiple comparisons. >>>>>>> >>>>>>> The main problem I see is that I only have one multilevel t-value >>>>>>> for the effect across all subjects, i.e. I don't have single subjects >>>>>>> values, which I could then e.g. randomize between conditions as normally >>>>>>> done in cluster-based permutation tests. (Or rather, I would be able to >>>>>>> extract single subject values but would then loose the advantage of the >>>>>>> multi-level analysis.) >>>>>>> >>>>>>> I found an old thread in the mailinglist archive where it was >>>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>>> /005375.html). I understand that, in our case, I would do this >>>>>>> randomly for all voxels in each randomization and then build spatial >>>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>>> significant relations in my single conditions (a) or no significant >>>>>>> relationship differences in my condition contrasts (b). >>>>>>> >>>>>>> For the condition contrasts, I would be able to permute the >>>>>>> condition labels as normally done in cluster-based permutation tests,I >>>>>>> think, but would then have to recalculate the linear mixed models for all >>>>>>> voxels in every permutation. This would result in a very high computational >>>>>>> load. >>>>>>> >>>>>>> Does anyone have any experience with this kind of analysis? Would >>>>>>> the flipping of t-values be a valid approach (and if yes, is there anything >>>>>>> to keep in mind in particular)? Can you think of other ways to combine >>>>>>> linear mixed models with a multiple comparison correction on the cluster >>>>>>> level? >>>>>>> >>>>>>> >>>>>>> Hi Elisabeth, >>>>>>> >>>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>>> respect to the different ways in which they can be used to deal with >>>>>>> correlated observations (typically, time series). However, from a >>>>>>> theoretical point of view, I do not see how these models could be combined >>>>>>> with permutation-based inference; they are just different statistical >>>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>>> different conditions and wan to test a) if there are significant >>>>>>> relationships in the single conditions and b) if these relationships differ >>>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>>> regression coefficients in each of the two conditions. Answering question >>>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>>> difference between them using a cluster-based permutation test using the >>>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>>> on the general approach for testing interactions using cluster-based >>>>>>> permutation tests. >>>>>>> >>>>>>> Have a look here: >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>>> behavioural_variables >>>>>>> and >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>>> >>>>>>> These tutorials provide all the necessary concepts, although they do >>>>>>> not answer your question in a recipe-like fashion. >>>>>>> >>>>>>> best, >>>>>>> Eric Maris >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Mon Oct 31 07:34:03 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Mon, 31 Oct 2016 06:34:03 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <3089E043-217F-49DC-A4D7-F33E00969FDE@donders.ru.nl> Hi Alik, So, two further questions. 1) Anyone reading this thread have some code for a reasonable ERP generator, especially one that models different ERPs per subject? I'm getting increasingly interested in doing some simulations to test my claims. (I'm thinking to do the 1d case just because it's faster to run. ) However, I'd like to do that on stimulated data that properly models, E.g., inter-subject variability of the precise timing of major peaks. 2) Eric, why are you describing the below as a fixed effects model? If we do a mixed model (with subject as a random intercept) at each time/frequency/sensor point, that seems like it handles the random effect that most people care about. Are you saying that you think each predictor variable would also need to be modeled as a per-subject slope? If you are permuting trials across conditions within every subject, this corresponds to the null hypothesis that WITHIN EVERY SUBJECT, there is no association between biological data and the condition labels. This is the permutation-version of a fixed-effects test. Keep in mind that you use your LMM t-stats only for thresholding and not for inference. I’m aware that this may be confusing at first sight. Actually, the topic (fixed versus random effects tests in the permutation framework) have not been described in a paper yet. I’m thinking about writing one, though... I guess I'm also thinking here that (to your second point), if the resulting values are used for thresholding to create cluster statistics for inference, inflation in the t/p values should be controlled for because the null distribution created during the permutation will have the same inflation. However, I don't believe I have a formal mathematical backup for that intuition, hence (1) above. The formal proof of the unbiasedness of the permutation test is in Maris & Oostenveld (2007), section "4.3.3. The permutation test controls the false alarm rate unconditionally”. I’m aware that very few readers go through this section, but it is one of the 2 reasons for the popularity of the method. The other reason is its sensitivity, which is the result of clustering. best, Eric On Oct 27, 2016 7:58 AM, "Maris, E.G.G. (Eric)" > wrote: Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From: Müller, K. (Katja) > Subject: [FieldTrip] MNE single trial time courses Date: 28 October 2016 at 15:06:59 GMT+2 To: "fieldtrip at science.ru.nl" > Reply-To: FieldTrip discussion list > Dear list, What is the current way to go (if there is one) to obtain *single trial* source time courses from source reconstructions from Minimum Norm Estimate? Is there a tutorial? I used the MNE tutorial as a basis, i.e. I have a FreeSurfer based source model. In old mailing list messages there is some information about options like .rawtrial='yes' or .singletrial='yes', but some of them are very old and I am unable to extract which way to go at the moment. E.g. .singletrial is deprecated. Best regards, Katja From: mehdy dousty > Subject: [FieldTrip] Covaraince matrix for MEG resting state Date: 28 October 2016 at 18:49:03 GMT+2 To: "hcp-users at humanconnectome.org" >, > Reply-To: FieldTrip discussion list > Hi all I am using the resting state MEG signal for constructing the inverse problem by eLoreta, and as it is resting state, the covariance matrix needs to be used, so I am going to use HCP R-noise to construct the covariance matrix, but there are two main issues which I need your help. 1- as I am going to use preprocess data for resting state, do I need process the noise as well? if it is so, I can't find the time series of the noise in the raw data after using ft_read_header. 2- do I need to redefine the time series which add the noise time series at the beginning of the signal and then add the resting state time series so I can use the below code for computing the covariance? cfg= [] cfg.covariance = 'yes'; % I dont know how to enter the noise covariance to the data cfg.covariancewindow = [-inf 0]; timelockanalysis = ft_timelockanalysis(cfg, inputdata); I look forward to hearing from you. Mehdy Dousty Hotchkiss Brain Institute University of Calgary HSC Building, Room 2932B 3330 Hospital Drive NW Calgary, AB T2N 4N1 Email Mehdy.Dousty at Ucalgary.ca _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Mon Oct 31 09:05:02 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Mon, 31 Oct 2016 08:05:02 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <739EDB8F-B6F8-4502-998F-4210697B6B0F@donders.ru.nl> Hi David, @Eric 1. Note the FDR control actually provides "weak" control of the family-wise error rate (FWER). This is exactly the same degree of FWER control provided by cluster-based permutation tests. If you want strong control of FWER you will need to do something like Bonferroni-Holm or max-statistic (i.e., non-cluster) based permutation tests. Do you have a pointer to a statistics paper that proves that controlling the FDR (false discovery rate) implies a control of the family-wise error rate (FWER)? I agree that there is difference between strong an weak FWER control, but that is a different issue than FDR-control versus FWER-control. best, Eric 2. It's true that FDR assumes that the individual test p-values are accurate. You can derive these p-values though via non-parametric techniques like non-cluster-based permutation tests, thus the underlying statistical assumptions will be the same as if you had done a cluster-based permutation test. Moreover, if you have good reason to make parametric assumptions, FDR will let you exploit them. @Alik 1. I simulated data in that 2011 paper by randomly flipping the polarity of real EEG data to generate 0 mean, realistic ERP noise. The noise was subject-specific, but the simulated ERP effects were exactly the same for all simulated participants. So it couldn't be used to address the question you're after. On Thu, Oct 27, 2016 at 7:57 AM, Maris, E.G.G. (Eric) > wrote: Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From justinctanner at gmail.com Mon Oct 31 20:15:15 2016 From: justinctanner at gmail.com (Justin Tanner) Date: Mon, 31 Oct 2016 12:15:15 -0700 Subject: [FieldTrip] ft_freqstatistics in a 2 way ANOVA - design and implementation Message-ID: I have a dataset consisting of 6 stimulation locations and 8 stimulation intensities. I am trying to calculate a 2 way (6 by 8) anova with regards to those two variables. Each input structure consists of freq_loc#{intensity#} output of ft_freqanalysis with just the chosen 10 trials of the respective conditions (so for location1 and intensity 1, chosen trial indices are indicated in cfg.trials). - cfg.keeptrials = 'yes' cfg.design = [loc ; int ; tri] 1 1 ... 1 1 ... 1 1 ... 1 1 ... 2 2 ... 2 2 ... 2 2 ... 2 2 ... 6 6 > ... 6 6 > 1 1 ... 1 1 ... 8 8 ... 8 8 ... 1 1 ... 1 1 ... 8 8 ... 8 8 ... 8 8 > ... 8 8 > 1 2 ... 9 10 ... 1 2 ... 9 10 ... 1 2 ... 9 10 ... 1 2 ... 9 10 ...1 2 ... > 9 10 > *OR* - cfg.keeptrials = 'no' cfg.design = [loc ; int] 1 1 ... 1 1 ... 1 1 ... 1 1 ... 2 2 ... 2 2 ... 2 2 ... 2 2 ... 6 6 > ... 6 6 > 1 1 ... 1 1 ... 8 8 ... 8 8 ... 1 1 ... 1 1 ... 8 8 ... 8 8 ... 8 8 > ... 8 8 For ft_freqstatistics: cfg.method = 'montecarlo'; > cfg.numrandomization = 500; cfg.correctm = 'bonferroni' % Going to do 'cluster' once I define my > distance function for neighbors > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.design=design; > cfg.statistic='indepsamplesF'; > cfg.correcttail = 'prob'; > > % Run with LOCATION as independent variable > cfg.ivar=[1]; > [stat_loc] = ft_freqstatistics(cfg, freq_loc0{:}, freq_loc1{:}, > freq_loc2{:}, freq_loc3{:}, freq_loc4{:}, freq_loc5{:}); % Run with INTENSITY as independent variable > cfg.ivar=[2]; [stat_int] = ft_freqstatistics(cfg, freq_loc0{:}, freq_loc1{:}, > freq_loc2{:}, freq_loc3{:}, freq_loc4{:}, freq_loc5{:}); > I want to ensure I am calling this appropriately. If I run it once with cfg.ivar =1 and again with cfg.ivar = 2, is that calculating the main effect of the cfg.design row's variable? First row is location, so running cfg.ivar=1 is giving me a [num_chan X TFR ] stat.stat/prob/mask for location, correct? I feel that I am missing something that would allow for both comparisons in one call of the ft_freqstatistics function, either in cfg properties or in the cfg.design structuring / ft_freqanalysis output structuring. Any clarification would be greatly appreciated. -- Justin C. Tanner Sensory Motor Research Group Arizona State University (360) 607-7544 -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Sat Oct 1 18:34:52 2016 From: russgport at gmail.com (russ port) Date: Sat, 1 Oct 2016 12:34:52 -0400 Subject: [FieldTrip] Failure of LCMV beamformer for Neuromag VectorView planar gradiometers Message-ID: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> Dear Fieldtrippers/Fieldtrippians I was hoping someone could help me with an issue I have come across during my analyses of a preliminary study. In brief, for the study a person was scanned on a CTF 275 channel biomagnetometer and then directly after on a 306 channel Elekta Neuromag VectorView platform. During the scans, the subject listened to a 40Hz amplitude modulated 500Hz tone (to generate a 40Hz Auditory Steady-state Response [ASSR]). In order to get the Elekta-derived data into a workable format, the Elekta-derived was MaxFilter’d for SSS (not tsss). After this, to analyze the datasets in an analogous manner, all datasets (both CTF- and Elekta-derived datasets [planar gradiometers and magnetometers analyzed separately]) were artifact cleaned (artifact rejection for jump/muscle artifact, ICA rejection of EOG/ECG components - OF NOTE FOR ELEKTA DATA THE ICA OUTPUT WAS LIMITED TO THE RANK OF THE DATA [BECAUSE OF SSS NOTED ABOVE]). Then the data was averaged, and a LCMV beamformer (ipsi-lateral channels only) targeted at the subject’s right or left hemisphere Helsch’s Gyrus was used to generate a ASSR time course. Attached (within the powerpoint slide deck) are figures showing the results . For each figure, the left column shows data that is just read with with no artifact correction (incase the ICA routines were improperly deforming the data), and the right column show the results of the methodology described above. The first and second row is the time-locked data from all sensors, both broad band (1st row - and also what is passed to the LCMV beamformer), and band-passed for gamma-band activity (30-58Hz). The third and forth rows are similar, though show the virtual electrodes time course (orientated to the ASSR). Hopefully you would agree that the CTF and Elekta magnetometer virtual electrode time course/results seem very appropriate. On the other hand, the Elekta planar gradiometer time course seem “lack-luster” to say the best. I did try to look into this, and found that during the beamforming, both CTF and Elekta magnetometers are rank sufficient (rank= number of channels for that hemisphere). The planar gradiometers on the other hand are rank deficient, which based on my understanding of the steps of an LCMV beamformer may be quite problematic. Has anyone else experienced this before and/or have suggestions how to circumvent this issue of poor planar gradiometer results from a LCMV beamformer? Best, Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip_LCMV_results.pptx Type: application/vnd.openxmlformats-officedocument.presentationml.presentation Size: 224785 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From rleese12 at berkeley.edu Sat Oct 1 21:42:57 2016 From: rleese12 at berkeley.edu (Nakyung Lee) Date: Sat, 1 Oct 2016 12:42:57 -0700 Subject: [FieldTrip] (no subject) Message-ID: Dear Fieldtrip community, I've been working on recreating one of the works of my predecessor with Fieldtrip. However, there's a discrepancy between high gamma signals that was filtered using Fieldtrip and high gamma signals that was filtered using other MATLAB functions. More specifically, it seems like there's always some lag between those two data and I've not been able to remove the lag entirely even with 'xcorr'. This is my Fieldtrip code (I used 'fir' here but I got the same problem with other filter types): cfg = []; cfg.continuous = 'yes'; cfg.bpfilter = 'yes'; cfg.bpfreq = [freq_low, freq_high]; cfg.bpfilttype = 'fir'; cfg.hilbert = 'yes'; cfg.N = N; signal_HG_fieldtrip = ft_preprocessing(cfg, signal); And this is the MATLAB code: h = fdesign.bandpass('N,Fst1,Fst2,Ast', N, freq_low/(srate/2), freq_high/(srate/2),60); BP = design(h); bp = filter(BP,signal); signal_HG_matlab = abs(hilbert(bp)); And those codes result in these: ​ ​ I've been looking at this for weeks now without coming up with a solution. Is anybody who had a similar problem and managed to fix it? Thank you in advance. Best, Rachel Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: scatter.jpg Type: image/jpeg Size: 43222 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot.jpg Type: image/jpeg Size: 14343 bytes Desc: not available URL: From rleese12 at berkeley.edu Sat Oct 1 21:44:30 2016 From: rleese12 at berkeley.edu (Nakyung Lee) Date: Sat, 1 Oct 2016 12:44:30 -0700 Subject: [FieldTrip] Discrepancies after filtering Message-ID: Dear Fieldtrip community, First, I apologize for duplicate emails. I forgot to add a title. I've been working on recreating one of the works of my predecessor with Fieldtrip. However, there's a discrepancy between high gamma signals that was filtered using Fieldtrip and high gamma signals that was filtered using other MATLAB functions. More specifically, it seems like there's always some lag between those two data and I've not been able to remove the lag entirely even with 'xcorr'. This is my Fieldtrip code (I used 'fir' here but I got the same problem with other filter types): cfg = []; cfg.continuous = 'yes'; cfg.bpfilter = 'yes'; cfg.bpfreq = [freq_low, freq_high]; cfg.bpfilttype = 'fir'; cfg.hilbert = 'yes'; cfg.N = N; signal_HG_fieldtrip = ft_preprocessing(cfg, signal); And this is the MATLAB code: h = fdesign.bandpass('N,Fst1,Fst2,Ast', N, freq_low/(srate/2), freq_high/(srate/2),60); BP = design(h); bp = filter(BP,signal); signal_HG_matlab = abs(hilbert(bp)); And those codes result in these: ​ ​ I've been looking at this for weeks now without coming up with a solution. Is anybody who had a similar problem and managed to fix it? Thank you in advance. Best, Rachel Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot.jpg Type: image/jpeg Size: 14343 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: scatter.jpg Type: image/jpeg Size: 43222 bytes Desc: not available URL: From pooneh.baniasad at gmail.com Sun Oct 2 12:22:55 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Sun, 2 Oct 2016 13:52:55 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix Message-ID: Dear FieldTrip community I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. Since I used the template electrode 'standard_1020.elc', m = 97 according to: chanpos: [97x3 double] chantype: {97x1 cell} chanunit: {97x1 cell} elecpos: [97x3 double] label: {97x1 cell} type: 'eeg1010' unit: 'mm' while the dimension of lead-field matrix is: 2000x122880 I use this function for calculating lead-field matrix: LF = ft_compute_leadfield(DipPos, elec, VolBEM); ​I do not understand why the number of raws are different​! ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ ​I will be so thankful if anyone can help me.​ -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: From mklados at gmail.com Sun Oct 2 20:55:10 2016 From: mklados at gmail.com (Manousos Klados) Date: Sun, 2 Oct 2016 11:55:10 -0700 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) Message-ID: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Mon Oct 3 02:27:05 2016 From: alik.widge at gmail.com (Alik Widge) Date: Sun, 2 Oct 2016 20:27:05 -0400 Subject: [FieldTrip] Postdoctoral opportunity: Human electrophysiology, Harvard/Mass General Message-ID: Fellow FieldTrippers, Our laboratory is hiring! Please see announcement below. We're a mixed-software shop, but I trained in MATLAB and still use FieldTrip, so that skillset is obviously welcome. Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 *Postdoctoral Research Fellowship in Human Invasive Neuroscience and Neural Engineering at MGH/Harvard Medical School * The Translational NeuroEngineering Laboratory (Alik Widge, MD, PhD) in the Division of Neurotherapeutics at Massachusetts General Hospital is seeking applicants for a multi-year, Federally funded postdoctoral fellowship in the areas of invasive human neuroscience and brain stimulation. The fellow will be responsible for collection and analysis of electrophysiologic recordings from patients who are undergoing or have recently undergone neurosurgical procedures. Modalities we currently use include EEG, MEG, intracranial LFP recording (stereo-EEG, ECOG), long-term recordings through implanted devices, and intraoperative single-unit/LFP mapping. Many of these experiments involve psychophysical tasks and/or electrical stimulation in the awake, behaving human. The overall goal is to better understand how brain networks give rise to and regulate emotional experiences, how those networks malfunction in severe psychiatric illness, and how that might lead to neurostimulation treatments for mental illness. The fellow will gain experience in working with rare clinical populations and a unique set of multi-resolution investigations of the human mind. There will be extensive opportunities to learn electrophysiologic techniques, novel statistical approaches, the fundamentals of human brain intervention, and the art of translational neuroscience. Much of the work is related to projects under the United States BRAIN Initiative, and there will be frequent interactions with other BRAIN projects. If desired, the fellow will also have opportunities to be exposed to neurosurgical and other clinical aspects of his/her research. The successful candidate will have a rich dataset and toolbox of skills to launch an independent research program in human cognition or medical device research. Successful applicants should have a PhD, or another doctoral degree with substantial research experience in a relevant discipline. This may include (and is not limited to) engineering, mathematics, psychology, neuroscience, computer science, or physics. For engineering and computer science specifically, we will consider candidates with a terminal masters' degree. Candidates should describe in their cover letter how their specific academic background is relevant to this position. Candidates should have one or more of: • Prior experience in electrophysiologic recordings and analysis in human or animals • Prior work in human cognitive neuroscience and/or a demonstrated understanding of psychophysical task design/executions • Prior conduct of neurostimulation experiments, with an understanding of the strengths and limitations of various designs • Past work in medical device design or research with neurological devices • Strong programming skills, particularly in MATLAB or Python • The psychology and neurobiology of mental illness • Grounding or formal training in signal processing for time-series data in the time and frequency domains We expect to be able to train a successful candidate in several of these areas according to his/her ability and interests. We would particularly welcome applicants with prior experience in neural engineering, brain-computer interfaces, or network/systems-level neuroscience. Please send a cover letter, a CV, and the names of 2-3 references to Dr. Widge at awidge at partners.org . A good cover letter will explain why your skills and interests overlap with our laboratory's goals, what you hope to gain from working with us, and what you think you might uniquely bring to our team. MGH is an equal-opportunity employer and welcomes applicants from any ethnicity, gender, nationality, or background. For this position in particular, visa sponsorship is available for qualified non-citizens, but the need for such sponsorship should be disclosed early in the interview process. -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 10:19:48 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 10:19:48 +0200 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: Dear Susmita, I used your code and could reproduce the same results. The step that goes wrong here is the segmentation step. cfg = []; cfg.output = {'brain','skull','scalp'}; segmentedmri = ft_volumesegment(cfg, mri_aligned); seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','indexed'); cfg = []; cfg.funparameter = 'seg'; cfg.funcolormap = lines(6); % distinct color per tissue cfg.location = 'center'; cfg.atlas = seg_i; % the segmentation can also be used as atlas ft_sourceplot(cfg, seg_i); I segmented additionally to the scalp the brain and the skull tissues as well so that you can clearly see whats going on. You should tweak the cfg for the ft_volumesegment to improve your pipeline. Best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 30 Sep 2016, at 19:16, Susmita Sen wrote: > > I am Susmita Sen, MS research scholar in the dept of Electronics and Electrical Communication Engineering, IIT Kharagpur. > I am currently working on MEG data recorded by yokogawa system. I want to perform source reconstruction on the data. However, I do not have the MRI data along with that. so, I have planned to use the standard MRI provided by fieldtrip (downloaded from https://github.com/fieldtrip/fieldtrip/blob/master/template/headmodel/standard_mri.mat ). > > For preparing the head model I have followed the steps provided in the fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg ). > > %% align the coordinate system > load('standard_mri.mat'); % load mri data > disp(mri) > > cfg = []; > cfg.method = 'interactive'; > cfg.coordsys = 'yokogawa'; > cfg.snapshot = 'yes'; > [mri_aligned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > %% create headmodel > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > load grad % load gradiometer info > vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm > > figure; > ft_plot_sens(grad, 'style', '*b'); > hold on > ft_plot_vol(vol); > > while aligning the coordinate system I have chosen fiducial points (naison, LPA and RPA) using the instruction given by http://neuroimage.usc.edu/brainstorm/CoordinateSystems . > > I am attaching the figures that display the shape of the 'vol' along with the position of the sensors (from different viewing angle). However, I doubt the headmodel is corrected prepared (It dosen't look alike the figure given in the tutorial). It seems I have made some mistakes, but I am not able to detect it. I would be very thankful if you can help me in this regard. > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 10:23:46 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 10:23:46 +0200 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: Dear pooh, Could you provide more information how you constructed your BEM-model? best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 02 Oct 2016, at 12:22, pooneh baniasad wrote: > > Dear FieldTrip community > > I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. > > First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. > Since I used the template electrode 'standard_1020.elc', m = 97 according to: > > chanpos: [97x3 double] > chantype: {97x1 cell} > chanunit: {97x1 cell} > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > while the dimension of lead-field matrix is: 2000x122880 > I use this function for calculating lead-field matrix: > > LF = ft_compute_leadfield(DipPos, elec, VolBEM); > > ​I do not understand why the number of raws are different​! > > ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ > > ​I will be so thankful if anyone can help me.​ > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From pooneh.baniasad at gmail.com Mon Oct 3 13:01:37 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Mon, 3 Oct 2016 14:31:37 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: Dear Simon, I've followed this tutorial: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct the headmodel ('VolBEM') I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for 'DipPos'. Is it clear or should I explain more? 🙂 On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle wrote: > Dear pooh, > > Could you provide more information how you constructed your BEM-model? > > best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 02 Oct 2016, at 12:22, pooneh baniasad > wrote: > > Dear FieldTrip community > > I'm using the forward model to simulating EEG signal although it seems the > dimension of the lead-field matrix is not correct. Here is a review of the > procedure. > > First I constructed a BEM headmodel for EEG source analysis ​and then by > loading the template cortex, I put the dipoles with specific current source > on that. I expect the dimension of the lead-field matrix will be m*n which > m=electrode's number and n=3*dipole's number but 'm' is different. > Since I used the template electrode 'standard_1020.elc', m = 97 according > to: > > chanpos: [97x3 double] > chantype: {97x1 cell} > chanunit: {97x1 cell} > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > while the dimension of lead-field matrix is: 2000x122880 > > I use this function for calculating lead-field matrix: > > LF = ft_compute_leadfield(DipPos, elec, VolBEM); > ​I do not understand why the number of raws are different​! > > ​On the other hand I guess that there is a similarity between the number > of raws in the volume head model and LF matrix due to the dimension of > headmodel matrix is: 2000x8000 double .​ > > ​I will be so thankful if anyone can help me.​ > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 3 14:59:59 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 3 Oct 2016 18:29:59 +0530 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for your response. I am sorry to bother you once again with my doubt. The headmodel that I have constructed, has a flat surface at the bottom. I would like to ask you to explain why that is happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look like this. I am attaching a file comparing these two headmodels. I have circled some part of the figure which actually raises the question of whether I am doing it correctly or not. Is there anything wrong in choosing the fiducial points? Thank you in anticipation. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle wrote: > Dear Susmita, > > I used your code and could reproduce the same results. The step that goes > wrong here is the segmentation step. > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > > seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','i > ndexed'); > > > cfg = []; > cfg.funparameter = 'seg'; > cfg.funcolormap = lines(6); % distinct color per tissue > cfg.location = 'center'; > cfg.atlas = seg_i; % the segmentation can also be used as atlas > ft_sourceplot(cfg, seg_i); > > > I segmented additionally to the scalp the brain and the skull tissues as > well so that you can clearly see whats going on. > > You should tweak the cfg for the ft_volumesegment to improve your pipeline. > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 30 Sep 2016, at 19:16, Susmita Sen wrote: > > I am Susmita Sen, MS research scholar in the dept of Electronics and > Electrical Communication Engineering, IIT Kharagpur. > I am currently working on MEG data recorded by yokogawa system. I > want to perform source reconstruction on the data. However, I do not have > the MRI data along with that. so, I have planned to use the standard MRI > provided by fieldtrip (downloaded from https://github.com/fieldt > rip/fieldtrip/blob/master/template/headmodel/standard_mri.mat). > > For preparing the head model I have followed the steps provided in the > fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg > ). > > %% align the coordinate system > load('standard_mri.mat'); % load mri data > disp(mri) > > cfg = []; > cfg.method = 'interactive'; > cfg.coordsys = 'yokogawa'; > cfg.snapshot = 'yes'; > [mri_aligned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > %% create headmodel > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > load grad % load gradiometer info > vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm > > figure; > ft_plot_sens(grad, 'style', '*b'); > hold on > ft_plot_vol(vol); > > while aligning the coordinate system I have chosen fiducial points > (naison, LPA and RPA) using the instruction given by > http://neuroimage.usc.edu/brainstorm/CoordinateSystems. > > I am attaching the figures that display the shape of the 'vol' along with > the position of the sensors (from different viewing angle). However, I > doubt the headmodel is corrected prepared (It dosen't look alike the figure > given in the tutorial). It seems I have made some mistakes, but I am not > able to detect it. I would be very thankful if you can help me in this > regard. > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > ______________________________ > _________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: headmodels.png Type: image/png Size: 231910 bytes Desc: not available URL: From s.homolle at donders.ru.nl Mon Oct 3 15:18:53 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 15:18:53 +0200 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: References: Message-ID: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> Dear Susmita, I think first all http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is a nice place to go to understand the different coordinate systems. I’m not to well aware about the Yokogawa coordinate system, but my first expectation would be that this coordinate systems is shifted lower than the CTF. After aligning with the different coordinate systems you should look at mri_aligned.coordsys Best regards, Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 03 Oct 2016, at 14:59, Susmita Sen wrote: > > Dear Simon, > > Thank you very much for your response. I am sorry to bother you once again with my doubt. The headmodel that I have constructed, has a flat surface at the bottom. I would like to ask you to explain why that is happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look like this. I am attaching a file comparing these two headmodels. I have circled some part of the figure which actually raises the question of whether I am doing it correctly or not. Is there anything wrong in choosing the fiducial points? Thank you in anticipation. > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > > On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle > wrote: > Dear Susmita, > > I used your code and could reproduce the same results. The step that goes wrong here is the segmentation step. > > cfg = []; > cfg.output = {'brain','skull','scalp'}; > segmentedmri = ft_volumesegment(cfg, mri_aligned); > > seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','indexed'); > > cfg = []; > cfg.funparameter = 'seg'; > cfg.funcolormap = lines(6); % distinct color per tissue > cfg.location = 'center'; > cfg.atlas = seg_i; % the segmentation can also be used as atlas > ft_sourceplot(cfg, seg_i); > > > I segmented additionally to the scalp the brain and the skull tissues as well so that you can clearly see whats going on. > > You should tweak the cfg for the ft_volumesegment to improve your pipeline. > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > >> On 30 Sep 2016, at 19:16, Susmita Sen > wrote: >> >> I am Susmita Sen, MS research scholar in the dept of Electronics and Electrical Communication Engineering, IIT Kharagpur. >> I am currently working on MEG data recorded by yokogawa system. I want to perform source reconstruction on the data. However, I do not have the MRI data along with that. so, I have planned to use the standard MRI provided by fieldtrip (downloaded from https://github.com/fieldtrip/fieldtrip/blob/master/template/headmodel/standard_mri.mat ). >> >> For preparing the head model I have followed the steps provided in the fieldtrip tutorial (http://www.fieldtriptoolbox.org/tutorial/headmodel_meg ). >> >> %% align the coordinate system >> load('standard_mri.mat'); % load mri data >> disp(mri) >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.coordsys = 'yokogawa'; >> cfg.snapshot = 'yes'; >> [mri_aligned] = ft_volumerealign(cfg,mri); >> >> %% SEGMENTATION >> cfg = []; >> cfg.output = 'brain'; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> %% create headmodel >> cfg = []; >> cfg.method='singleshell'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> %% visualize >> load grad % load gradiometer info >> vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm >> >> figure; >> ft_plot_sens(grad, 'style', '*b'); >> hold on >> ft_plot_vol(vol); >> >> while aligning the coordinate system I have chosen fiducial points (naison, LPA and RPA) using the instruction given by http://neuroimage.usc.edu/brainstorm/CoordinateSystems . >> >> I am attaching the figures that display the shape of the 'vol' along with the position of the sensors (from different viewing angle). However, I doubt the headmodel is corrected prepared (It dosen't look alike the figure given in the tutorial). It seems I have made some mistakes, but I am not able to detect it. I would be very thankful if you can help me in this regard. >> >> >> >> Thanks and Regards, >> Susmita Sen >> Research Scholar >> Audio and Bio Signal Processing Lab. >> E & ECE Dept. >> IIT Kharagpur >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.homolle at donders.ru.nl Mon Oct 3 15:27:09 2016 From: s.homolle at donders.ru.nl (Simon Homolle) Date: Mon, 3 Oct 2016 15:27:09 +0200 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: References: Message-ID: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> Dear Pooneh, http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem I relate to this part: When the forward solution is computed, the lead field matrix (= channels X source points matrix) is calculated for each grid point taking into account the head model and the channel positions. So I assume your mesh consists of 2000 grid points? Simon Homölle PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Phone: +31-(0)24-36-65059 > On 03 Oct 2016, at 13:01, pooneh baniasad wrote: > > Dear Simon, > > I've followed this tutorial: > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct the headmodel ('VolBEM') > I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for 'DipPos'. > Is it clear or should I explain more? 🙂 > > On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle > wrote: > Dear pooh, > > Could you provide more information how you constructed your BEM-model? > > best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > >> On 02 Oct 2016, at 12:22, pooneh baniasad > wrote: >> >> Dear FieldTrip community >> >> I'm using the forward model to simulating EEG signal although it seems the dimension of the lead-field matrix is not correct. Here is a review of the procedure. >> >> First I constructed a BEM headmodel for EEG source analysis ​and then by loading the template cortex, I put the dipoles with specific current source on that. I expect the dimension of the lead-field matrix will be m*n which m=electrode's number and n=3*dipole's number but 'm' is different. >> Since I used the template electrode 'standard_1020.elc', m = 97 according to: >> >> chanpos: [97x3 double] >> chantype: {97x1 cell} >> chanunit: {97x1 cell} >> elecpos: [97x3 double] >> label: {97x1 cell} >> type: 'eeg1010' >> unit: 'mm' >> >> while the dimension of lead-field matrix is: 2000x122880 >> I use this function for calculating lead-field matrix: >> >> LF = ft_compute_leadfield(DipPos, elec, VolBEM); >> >> ​I do not understand why the number of raws are different​! >> >> ​On the other hand I guess that there is a similarity between the number of raws in the volume head model and LF matrix due to the dimension of headmodel matrix is: 2000x8000 double .​ >> >> ​I will be so thankful if anyone can help me.​ >> >> -- >> Bests >> >> Pouneh Baniasad >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 3 15:40:12 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 3 Oct 2016 19:10:12 +0530 Subject: [FieldTrip] Regarding headmodel construction In-Reply-To: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> References: <3FB0ADFA-F39E-4A58-A492-2EF02F13DC0C@donders.ru.nl> Message-ID: Dear Simon, Thanks a lot for your suggestion. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Mon, Oct 3, 2016 at 6:48 PM, Simon Homolle wrote: > Dear Susmita, > > I think first all > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined > is a nice place to go to understand the different coordinate systems. > > I’m not to well aware about the Yokogawa coordinate system, but my first > expectation would be that this coordinate systems is shifted lower than the > CTF. After aligning with the different coordinate systems you should look > at mri_aligned.coordsys > > Best regards, > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 03 Oct 2016, at 14:59, Susmita Sen wrote: > > Dear Simon, > > Thank you very much for your response. I am sorry to bother you once > again with my doubt. The headmodel that I have constructed, has a flat > surface at the bottom. I would like to ask you to explain why that is > happening. If I use 'ctf' instead of 'yokogawa', the heamodel does not look > like this. I am attaching a file comparing these two headmodels. I have > circled some part of the figure which actually raises the question of > whether I am doing it correctly or not. Is there anything wrong in choosing > the fiducial points? Thank you in anticipation. > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > > On Mon, Oct 3, 2016 at 1:49 PM, Simon Homolle > wrote: > >> Dear Susmita, >> >> I used your code and could reproduce the same results. The step that goes >> wrong here is the segmentation step. >> >> cfg = []; >> cfg.output = {'brain','skull','scalp'}; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> seg_i = ft_datatype_segmentation(segmentedmri,'segmentationstyle','i >> ndexed'); >> >> cfg = []; >> cfg.funparameter = 'seg'; >> cfg.funcolormap = lines(6); % distinct color per tissue >> cfg.location = 'center'; >> cfg.atlas = seg_i; % the segmentation can also be used as >> atlas >> ft_sourceplot(cfg, seg_i); >> >> >> I segmented additionally to the scalp the brain and the skull tissues as >> well so that you can clearly see whats going on. >> >> You should tweak the cfg for the ft_volumesegment to improve your >> pipeline. >> >> Best regards, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 30 Sep 2016, at 19:16, Susmita Sen wrote: >> >> I am Susmita Sen, MS research scholar in the dept of Electronics and >> Electrical Communication Engineering, IIT Kharagpur. >> I am currently working on MEG data recorded by yokogawa system. I >> want to perform source reconstruction on the data. However, I do not have >> the MRI data along with that. so, I have planned to use the standard MRI >> provided by fieldtrip (downloaded from https://github.com/fieldt >> rip/fieldtrip/blob/master/template/headmodel/standard_mri.mat). >> >> For preparing the head model I have followed the steps provided in the >> fieldtrip tutorial (http://www.fieldtriptoolbox.o >> rg/tutorial/headmodel_meg). >> >> %% align the coordinate system >> load('standard_mri.mat'); % load mri data >> disp(mri) >> >> cfg = []; >> cfg.method = 'interactive'; >> cfg.coordsys = 'yokogawa'; >> cfg.snapshot = 'yes'; >> [mri_aligned] = ft_volumerealign(cfg,mri); >> >> %% SEGMENTATION >> cfg = []; >> cfg.output = 'brain'; >> segmentedmri = ft_volumesegment(cfg, mri_aligned); >> >> %% create headmodel >> cfg = []; >> cfg.method='singleshell'; >> vol = ft_prepare_headmodel(cfg, segmentedmri); >> >> %% visualize >> load grad % load gradiometer info >> vol = ft_convert_units(vol,'cm'); % the gradiometer info is given in cm >> >> figure; >> ft_plot_sens(grad, 'style', '*b'); >> hold on >> ft_plot_vol(vol); >> >> while aligning the coordinate system I have chosen fiducial points >> (naison, LPA and RPA) using the instruction given by >> http://neuroimage.usc.edu/brainstorm/CoordinateSystems. >> >> I am attaching the figures that display the shape of the 'vol' along with >> the position of the sensors (from different viewing angle). However, I >> doubt the headmodel is corrected prepared (It dosen't look alike the figure >> given in the tutorial). It seems I have made some mistakes, but I am not >> able to detect it. I would be very thankful if you can help me in this >> regard. >> >> >> >> Thanks and Regards, >> Susmita Sen >> Research Scholar >> Audio and Bio Signal Processing Lab. >> E & ECE Dept. >> IIT Kharagpur >> ______________________________ >> _________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From singht at musc.edu Mon Oct 3 17:34:18 2016 From: singht at musc.edu (Singh, Tarkeshwar) Date: Mon, 3 Oct 2016 15:34:18 +0000 Subject: [FieldTrip] ft_timelockanalysis outputs average data with different trial lengths Message-ID: Dear All, I am new to Fieldtrip and am trying to compare ERPs between two conditions using the following lines of code. ‘data_iccleaned’ is the processed data structure. The code below is in red and my message in black. cfg=[]; cfg.keeptrials = 'yes'; cfg.vartrllength=1; cfg.trials = find(data_iccleaned.trialinfo(:,1) == 1); erp_pictures = ft_timelockanalysis(cfg, data_iccleaned); cfg=[]; cfg.keeptrials = 'yes'; cfg.vartrllength=1; cfg.trials = find(data_iccleaned.trialinfo(:,1) == 2); erp_abstract = ft_timelockanalysis(cfg, data_iccleaned); %Baseline Correction cfg=[]; cfg.baseline = [twin(1) 0]; erp_pictures_TL = ft_timelockbaseline(cfg, erp_pictures); erp_abstract_TL = ft_timelockbaseline(cfg, erp_abstract); cfgp=[]; cfgp.interactive = 'yes'; cfgp.layout = 'easycapM11.mat'; cfgp.box='yes'; cfgp.showoutline = 'yes'; ft_multiplotER(cfgp, erp_pictures_TL,erp_abstract_TL. When I run the last line of code, I get the following error: [cid:image001.png at 01D21D6A.13970950] I believe the problem is that erp_abstract.time and erp_picture.time are of different lengths (please see the picture below). We have sampled the data at 1000 Hz and each trial is approx. 8 seconds long (trial lengths vary from 7989 to 8012 points). To circumvent the problem, I tried an additional constraint on the accepted trials (accept only those that are exactly 8000 points) but that did not solve the problem. What am I doing wrong? [cid:image002.png at 01D21D6A.13970950] -- Tarkeshwar Singh Postdoctoral Scholar Department of Health Sciences and Research Medical University of South Carolina 77 President Street, Room C305 Charleston, SC 29425 singht at musc.edu ------------------------------------------------------------------------- This message was secured via TLS by MUSC. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 22130 bytes Desc: image001.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 77227 bytes Desc: image002.png URL: From SXM1085 at student.bham.ac.uk Mon Oct 3 18:40:04 2016 From: SXM1085 at student.bham.ac.uk (Sebastian Michelmann) Date: Mon, 3 Oct 2016 16:40:04 +0000 Subject: [FieldTrip] neuralynx problem with repeated timestamps Message-ID: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> Dear Fieldtrippers, when reading Neuralynx ncs data I run into the following problem: %----------------------------------------------------------------------------------% cfg = []; cfg.dataset = [dataset_directory filesep electrode '.ncs']; data_nse = ft_preprocessing(cfg); >> Index exceeds matrix dimensions. Error in ft_read_data (line 1013) dat = ncs.dat(begsample:endsample); Error in ft_preprocessing (line 576) dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat); %----------------------------------------------------------------------------------% The problem seems to be due to repeated timestamps in the data, that are corrected in @read_neuralynx_ncs line: 230 [A,I] = unique(val); % consider only the unique values indx = indx(I); This causes the information about the number of samples in the header and the actual samples to be different. My question is now: How do I deal with this? Especially since I am not entirely sure why fieldtrip handles this dataformat the way it does (e.g. sorting the timestamps at each sampling point) So, can I just comment this out and accept the multiple sampling of some Timestamps? Or should I rather correct the information about the number of samples? Should I even interpolate plausible Timestamps? Any help is highly appreciated! All the best, Sebastian -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Mon Oct 3 18:51:40 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Mon, 03 Oct 2016 17:51:40 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> References: <2D9C9145AF1E4D4799ADDB2C0F996AE8019EF3D725@EX13.adf.bham.ac.uk> Message-ID: <8865e168a6639693d5d9e5106563e21c@cam.ac.uk> Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? Many thanks From lindseyrtate at ou.edu Mon Oct 3 23:23:02 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Mon, 3 Oct 2016 21:23:02 +0000 Subject: [FieldTrip] REPOST: Beamforming, "Inf" during source estimation by subject In-Reply-To: References: , Message-ID: Tate, Lindsey R. has shared a?OneDrive for Business?file with you. To view it, click the link below. [https://r1.res.office365.com/owa/prem/images/dc-generic_20.png] dataFIC4.mat Tate, Lindsey R. has shared a?OneDrive for Business?file with you. To view it, click the link below. [https://r1.res.office365.com/owa/prem/images/dc-generic_20.png] dataFIC4.mat Hello Fieldtrip Community, On Tuesday 6/28, I sent out the original message forwarded below. I received some response but have been unable to resolve my problem. [Attempted to allow lambda to be estimated/not specified, but this didn't eliminate the "Inf" in the pow matrices.] I've been working on beamforming the MEG data collected from 16 subjects during a saccade task. There are 4 conditions, with a maximum of 30 trials each per subject (some trials eliminated due to loss of focus). This is my first time beamforming so I've been heavily relying on the tutorial. I'm having what appears to be two issues: 1) Number of trials per subject may be too low. When I collapse across all subjects or even collapse across two random subjects so as to artificially increase the number of trials per "artificial subject," real numbers are produced by ft_sourceinterpolate in the pow matrix. When I run each subject individually, the pow matrix from ft_sourceinterpolate "Inf" where numbers were for the other runs. Is there a way to resolve this issue, such as a default setting to override? Or do I have too few trials per condition? 2) The pow matrix from ft_sourceinterpolate produces primarily "NaN," with about 90% of the rows being "NaN." This seems problematic. Also, it seems like it may be causing problems with ft_sourcestatistics as the stat.prob and stat.mask matrices always come back empty, even when ft_sourceinterpolate produces pow matrices with real numbers divided by "artificial subjects." Could this prevalence of "NaN" be an indication that the beamforming isn't happening correctly? Could the prevalence be causing the ft_sourcestatistics to produce blank stat.prob and stat.mask matrices? Code and raw dataset attached. Thank you for any assistance or guidance you may offer! Lindsey University of Oklahoma ________________________________ From: Tate, Lindsey R. Sent: Tuesday, June 28, 2016 3:05 AM To: fieldtrip at science.ru.nl Subject: Beamforming, "Inf" during source estimation by subject Hello Fieldtrip Community, I've been working on beamforming the MEG data collected from 16 subjects during a saccade task. This is my first time beamforming so I've been heavily relying on the tutorial. When I collapse trials across subjects and do beamforming, I can get the ft_sourceplot commands to produce something that makes some sense. However, I need to be able to have the data separated by subject for ft_sourcestatistics. I've created structures that should work for this purpose and that look correct. However, the ".pow" from the Neural Activity Index calculation step ends up mostly "NaN" and partly "Inf" when I run the beamforming divided by subject. Is this related to the number of trials per subject somehow (e.g., do I have too few? is there some kind of setting I need to change?)? Why is the ".pow" coming back "Inf" instead of a real number? Does anyone have suggestions for fixing this problem so that I don't get "Inf" anymore? My code and raw data structure are attached. Thank you, Lindsey Tate University of Oklahoma -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BF_trial4.m URL: From lindseyrtate at ou.edu Mon Oct 3 23:23:06 2016 From: lindseyrtate at ou.edu (Tate, Lindsey R.) Date: Mon, 3 Oct 2016 21:23:06 +0000 Subject: [FieldTrip] Tate, Lindsey R. wants to share the file dataFIC4.mat with you Message-ID: To view dataFIC4.mat, sign in or create an account. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at donders.ru.nl Tue Oct 4 04:29:42 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 4 Oct 2016 11:29:42 +0900 Subject: [FieldTrip] Fwd: Job posting: PhD position at MPI-CBS Germany References: <943142109.19332.1475485117729.JavaMail.zimbra@cbs.mpg.de> Message-ID: <95458A7B-907C-4102-B962-326C7434B44B@donders.ru.nl> On behalf of Claudia Männel, please see the attachment for a job opening for a highly motivated and qualified PhD student. -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Maennel_DFGNov2016.pdf Type: application/pdf Size: 85151 bytes Desc: not available URL: -------------- next part -------------- From robert.oostenveld at donders.ru.nl Tue Oct 4 04:30:25 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 4 Oct 2016 11:30:25 +0900 Subject: [FieldTrip] Fwd: Job posting: PhD position at MPI-CBS Germany References: <943142109.19332.1475485117729.JavaMail.zimbra@cbs.mpg.de> Message-ID: <2BFD51EB-660D-4FFF-92C7-1E5767673587@donders.ru.nl> On behalf of Claudia Männel, please see the attachment for a job opening for a highly motivated and qualified PhD student. -------------- next part -------------- A non-text attachment was scrubbed... Name: PhD_Maennel_DFGNov2016.pdf Type: application/pdf Size: 85151 bytes Desc: not available URL: -------------- next part -------------- From ph442 at cam.ac.uk Tue Oct 4 10:45:47 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 09:45:47 +0100 Subject: [FieldTrip] =?utf-8?q?Fwd=3A_plotting_freesurfer_mesh_on_the_mri?= =?utf-8?b?X2FsaWduZWQu?= Message-ID: Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? Many thanks -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From ph442 at cam.ac.uk Tue Oct 4 16:41:27 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 15:41:27 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= Message-ID: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> Dear Fieldtrippers Is there a straightforward pain free method ( I appreciate if you can give me the command) to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? The reason that I ask is that I would like to plot my solution on the MRI image. Unfortunately I do not use dipoles. In EEG, I model the irrotational component of the current as a scalar function and therefore I am doing function estimation. IF you use dipoles, it is straightforward because you follow one of the tutorials. But if you do not use dipoles and model the current as the gradient of the irrotational component of the current in EEG then one can get lost. Any help would be appreciated. Many thanks -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From jan.schoffelen at donders.ru.nl Tue Oct 4 17:29:49 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 4 Oct 2016 15:29:49 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> Message-ID: <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> Hi Parham, It is possible, but certainly not pain free, nor straightforward. I think this is not really a fieldtrip question, but more a general matlab related issue. It should be possible to plot a slice through an MRI volume as a MATLAB patch, where the coordinates of the voxels are expressed in some coordinate system. Then, it is possible to generate and intersection of the freesurfer mesh through the plane of visualization. Best, Jan-Mathijs > On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: > > Dear Fieldtrippers > Is there a straightforward pain free method ( I appreciate if you can give me the command) > to plot arbitrary points such as the vertices of the freesurfer output (mesh) onto the MRI image? > The reason that I ask is that I would like to plot my solution on the MRI image. > Unfortunately I do not use dipoles. In EEG, I model the irrotational component of the current as a scalar function and therefore I am doing function estimation. > IF you use dipoles, it is straightforward because you follow one of the tutorials. > But if you do not use dipoles and model the current as the gradient of the irrotational component of the current in EEG then one can get lost. > Any help would be appreciated. > Many thanks > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ph442 at cam.ac.uk Tue Oct 4 17:59:06 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 16:59:06 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> Message-ID: <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Hi Jan Thank you, my functional data are the function values of some function (irrotational component of the current). From my limited experience of Fieldtrip, your explanation feels (to myself) a bit cryptic at the moment. You see if my inversion strategy was one of the classical ones such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta then the available fieldtrip tutorials are great in showing how to plot functional values on the top of anatomical values. But, since, I work on inversion methods, then I need a hacking strategy to be able to plot functional values of "some function"(estimated) on top of anatomical data MRI. I would appreciate if you would kindly let me know, if there is hack to it such that ft_sourceplot can accept the input. best regards parham On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > It is possible, but certainly not pain free, nor straightforward. > I think this is not really a fieldtrip question, but more a general > matlab related issue. > > It should be possible to plot a slice through an MRI volume as a > MATLAB patch, where the coordinates of the voxels are expressed in > some coordinate system. Then, it is possible to generate and > intersection of the freesurfer mesh through the plane of > visualization. > > Best, > Jan-Mathijs > > > >> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >> >> Dear Fieldtrippers >> Is there a straightforward pain free method ( I appreciate if you can >> give me the command) >> to plot arbitrary points such as the vertices of the freesurfer output >> (mesh) onto the MRI image? >> The reason that I ask is that I would like to plot my solution on the >> MRI image. >> Unfortunately I do not use dipoles. In EEG, I model the irrotational >> component of the current as a scalar function and therefore I am doing >> function estimation. >> IF you use dipoles, it is straightforward because you follow one of >> the tutorials. >> But if you do not use dipoles and model the current as the gradient >> of the irrotational component of the current in EEG then one can get >> lost. >> Any help would be appreciated. >> Many thanks >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From Darren.Price at mrc-cbu.cam.ac.uk Tue Oct 4 18:45:07 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Tue, 4 Oct 2016 16:45:07 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi Parham For a non-linear interpolation onto a regular grid, spm_mesh_to_grid might be ideal (from the spm package of course). I don't have a working example to hand, but I may be able to dig one out if you can't get it working. Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL:  darren.price at mrc-cbu.cam.ac.uk URL:    http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL     +44 (0)1223 355 294 x202 FAX     +44 (0)1223 359 062 MOB     +44 (0)7717822431 ------------------------------------------------------- -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham hashemzadeh Sent: 04 October 2016 16:59 To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Hi Jan Thank you, my functional data are the function values of some function (irrotational component of the current). From my limited experience of Fieldtrip, your explanation feels (to myself) a bit cryptic at the moment. You see if my inversion strategy was one of the classical ones such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta then the available fieldtrip tutorials are great in showing how to plot functional values on the top of anatomical values. But, since, I work on inversion methods, then I need a hacking strategy to be able to plot functional values of "some function"(estimated) on top of anatomical data MRI. I would appreciate if you would kindly let me know, if there is hack to it such that ft_sourceplot can accept the input. best regards parham On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > It is possible, but certainly not pain free, nor straightforward. > I think this is not really a fieldtrip question, but more a general > matlab related issue. > > It should be possible to plot a slice through an MRI volume as a > MATLAB patch, where the coordinates of the voxels are expressed in > some coordinate system. Then, it is possible to generate and > intersection of the freesurfer mesh through the plane of > visualization. > > Best, > Jan-Mathijs > > > >> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >> >> Dear Fieldtrippers >> Is there a straightforward pain free method ( I appreciate if you can >> give me the command) >> to plot arbitrary points such as the vertices of the freesurfer output >> (mesh) onto the MRI image? >> The reason that I ask is that I would like to plot my solution on the >> MRI image. >> Unfortunately I do not use dipoles. In EEG, I model the irrotational >> component of the current as a scalar function and therefore I am doing >> function estimation. >> IF you use dipoles, it is straightforward because you follow one of >> the tutorials. >> But if you do not use dipoles and model the current as the gradient >> of the irrotational component of the current in EEG then one can get >> lost. >> Any help would be appreciated. >> Many thanks >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ph442 at cam.ac.uk Tue Oct 4 19:08:29 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Tue, 04 Oct 2016 18:08:29 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL:  darren.price at mrc-cbu.cam.ac.uk > URL:    http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL     +44 (0)1223 355 294 x202 > FAX     +44 (0)1223 359 062 > MOB     +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From a.donda at hotmail.com Wed Oct 5 00:47:27 2016 From: a.donda at hotmail.com (A. Donda) Date: Tue, 4 Oct 2016 22:47:27 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> , Message-ID: Hi Parham, if you wanna plot it in FieldTrip, these commands worked well for me, but in my case (MEG data) I had to make sure first that these data were on the same coordinate system (co-registration of MRI and MEG sensor-data). If you do not have this issue, then you can simply plot an MRI and a mesh obtained from freesurfer the following way (make sure that both MRI and the mesh are in the same units, e.g. cm or mm): ft_determine_coordsys(mricor_cm, 'interactive', 'no') hold on ft_plot_mesh(sourcespace); Alternatively, if you want to plot the vertices of the mesh as dots, you can use ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); sourcespace has the following structure (in case this is helpful for you): pnt: [8196x3 double] tri: [16384x3 double] area: [16384x1 double] orig: [1x1 struct] unit: 'm' I obtained sourcespace by loading the boundary element model (bem) surface, created with the watershed algorthim of Freesurfer: sourcespace = ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], 'format', 'mne_source'); %in meters Note that I had to transform the sourcespace dataset to the right coordinate system and units. Finally I plotted the mri and mesh in cm To convert units in Fieldtrip, as you know, use X_cm = ft_convert_units(X,'cm'); I hope this is helpful. Best A.Donda ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of parham hashemzadeh Sent: Tuesday, October 4, 2016 6:08 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL: darren.price at mrc-cbu.cam.ac.uk > URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL +44 (0)1223 355 294 x202 > FAX +44 (0)1223 359 062 > MOB +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 5 03:15:07 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 5 Oct 2016 01:15:07 +0000 Subject: [FieldTrip] plotting freesurfer mesh on the mri_aligned. In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi Parham, Sorry for sounding cryptic earlier, I was just reciprocating the crypticity of the question. I think that the suggestion made in the previous e-mail is an excellent one. With the addition that, rather than using ft_determine_coordsys, you could use ft_plot_ortho to visualize an arbitrary cross-cut through your volumetric image. Note however, that the MR and the sourcespace should be in the same coordinate system for this to work. Best, Jan-Mathijs On 05 Oct 2016, at 00:47, A. Donda > wrote: Hi Parham, if you wanna plot it in FieldTrip, these commands worked well for me, but in my case (MEG data) I had to make sure first that these data were on the same coordinate system (co-registration of MRI and MEG sensor-data). If you do not have this issue, then you can simply plot an MRI and a mesh obtained from freesurfer the following way (make sure that both MRI and the mesh are in the same units, e.g. cm or mm): ft_determine_coordsys(mricor_cm, 'interactive', 'no') hold on ft_plot_mesh(sourcespace); Alternatively, if you want to plot the vertices of the mesh as dots, you can use ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); sourcespace has the following structure (in case this is helpful for you): pnt: [8196x3 double] tri: [16384x3 double] area: [16384x1 double] orig: [1x1 struct] unit: 'm' I obtained sourcespace by loading the boundary element model (bem) surface, created with the watershed algorthim of Freesurfer: sourcespace = ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], 'format', 'mne_source'); %in meters Note that I had to transform the sourcespace dataset to the right coordinate system and units. Finally I plotted the mri and mesh in cm To convert units in Fieldtrip, as you know, use X_cm = ft_convert_units(X,'cm'); I hope this is helpful. Best A.Donda ________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of parham hashemzadeh > Sent: Tuesday, October 4, 2016 6:08 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. Dear Darren Thank you very much, and I will try to give it a go. In the event that I can not. You are a life saver if you can help me out. Everything is in place except this incredibly important item. I have noticed that you are in Cambridge, maybe we can meet at some point. I am close by at the mathematics department. Many many thanks best regards parham On 2016-10-04 17:45, Darren Price wrote: > Hi Parham > > For a non-linear interpolation onto a regular grid, spm_mesh_to_grid > might be ideal (from the spm package of course). I don't have a > working example to hand, but I may be able to dig one out if you can't > get it working. > > Darren > > > ------------------------------------------------------- > Dr. Darren Price > Investigator Scientist and Cam-CAN Data Manager > MRC Cognition & Brain Sciences Unit > 15 Chaucer Road > Cambridge, CB2 7EF > England > EMAIL: darren.price at mrc-cbu.cam.ac.uk > URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price > TEL +44 (0)1223 355 294 x202 > FAX +44 (0)1223 359 062 > MOB +44 (0)7717822431 > ------------------------------------------------------- > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham > hashemzadeh > Sent: 04 October 2016 16:59 > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned. > > Hi Jan > Thank you, my functional data are the function values of some > function (irrotational component of the current). From my limited > experience of Fieldtrip, your explanation feels (to myself) a bit > cryptic at the moment. > > You see if my inversion strategy was one of the classical ones > such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta > then the available fieldtrip tutorials are great in showing > how to plot functional values on the top of anatomical values. > But, since, I work on inversion methods, then I need a hacking > strategy to be able to plot functional values of "some > function"(estimated) on top of anatomical data MRI. > > I would appreciate if you would kindly let me know, if there is hack > to it such that > ft_sourceplot can accept the input. > best regards parham > > > > > > On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >> Hi Parham, >> >> It is possible, but certainly not pain free, nor straightforward. >> I think this is not really a fieldtrip question, but more a general >> matlab related issue. >> >> It should be possible to plot a slice through an MRI volume as a >> MATLAB patch, where the coordinates of the voxels are expressed in >> some coordinate system. Then, it is possible to generate and >> intersection of the freesurfer mesh through the plane of >> visualization. >> >> Best, >> Jan-Mathijs >> >> >> >>> On 04 Oct 2016, at 16:41, parham hashemzadeh > wrote: >>> >>> Dear Fieldtrippers >>> Is there a straightforward pain free method ( I appreciate if you can >>> give me the command) >>> to plot arbitrary points such as the vertices of the freesurfer >>> output >>> (mesh) onto the MRI image? >>> The reason that I ask is that I would like to plot my solution on the >>> MRI image. >>> Unfortunately I do not use dipoles. In EEG, I model the irrotational >>> component of the current as a scalar function and therefore I am >>> doing >>> function estimation. >>> IF you use dipoles, it is straightforward because you follow one of >>> the tutorials. >>> But if you do not use dipoles and model the current as the gradient >>> of the irrotational component of the current in EEG then one can get >>> lost. >>> Any help would be appreciated. >>> Many thanks >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From son.ta.dinh at tum.de Wed Oct 5 06:54:31 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Wed, 5 Oct 2016 04:54:31 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Message-ID: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let's say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailtome.2113 at gmail.com Wed Oct 5 07:57:01 2016 From: mailtome.2113 at gmail.com (Arti Abhishek) Date: Wed, 5 Oct 2016 16:57:01 +1100 Subject: [FieldTrip] Plotting confidence intervals in multiplotER In-Reply-To: References: Message-ID: Dear Kousik, Thank you very much for your help. I am not sure how to change the "dat_sem" as you suggested. My grand averaged file has the fields as follows GrandAvg_Target1 = avg: [132x601 double] var: [132x601 double] dof: [132x601 double] time: [1x601 double] label: {132x1 cell} dimord: 'chan_time' cfg: [1x1 struct] I am a beginner in MATLAB and any help would be greatly appreciated. Thanks, Arti On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy wrote: > Hey Arti, > > This is not such a trivial thing to solve. Here's a recipe I used. You > need to find and edit two scripts. If this spurns any more interest, I'll > initiate a 'bug' and try to send in a pull request. This is a dirty fix and > in all probability will be considered blasphemy. ;) > > 1. Find in ft_multiplotER > > : > ft_plot_vector(xval, yval, 'width', width(m), 'height', height(m), 'hpos', > layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', [ymin ymax], 'color > ', color, 'style', cfg.linestyle{i}, 'linewidth', cfg.linewidth, 'axis', > cfg.axes, 'highlight', mask, 'highlightstyle', cfg.maskstyle, 'label', > label, 'box', cfg.box, 'fontsize', cfg.fontsize); > This basically calls a plotting function which in turn does the plotting > for you. You need to send in the extra 'sem' or a 'ci' variable. > Change this to: > ft_plot_vector(xval, yval, 'ysem', ysem, 'width', width(m), 'height', > height(m), 'hpos', layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', > [ymin ymax], 'color', color, 'style', cfg.linestyle{i}, 'linewidth', > cfg.linewidth, 'axis', cfg.axes, 'highlight', mask, 'highlightstyle', > cfg.maskstyle, 'label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); > > 2. Find in ft_plot_vector > > : > You need to first get the sem parameter from your data and setup so FT can > see your sem or CI info. Follow the code here > . > Search for "data_sem" and fix those lines. > Then: > h = plot(hdat, vdat, style, 'LineWidth', linewidth, 'Color', color, ' > markersize', markersize, 'markerfacecolor', markerfacecolor); > Change this to: > [h hp ]= boundedline(hdat, vdat, vdat_sem); > > Boundedline > is > a submission in the MATLAB file exchange. You can use any other thing. > > > Good luck trying! :) > > > -- > Regards, > Kousik Sarathy, S > > > On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek > wrote: > >> Dear fieldtrip community, >> >> I was wondering whether there is a way to plot the confidence intervals >> in the ERP plot? I see that this question was asked multiple times in the >> discussion list before, but I could not find an answer to this. >> >> Thanks, >> Arti >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Wed Oct 5 10:08:53 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Wed, 05 Oct 2016 09:08:53 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: <39b0115d2f09176a1ffada64668e300e@cam.ac.uk> Hi Jan and A.Donda Thank you both very much for your input. I will try what you suggested. Many thanks best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From susmitasen.ece at gmail.com Wed Oct 5 12:41:06 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 5 Oct 2016 16:11:06 +0530 Subject: [FieldTrip] Standard mri dimension and fiducial point Message-ID: Dear FieldTrip community I am using standard mri providded by fieldTrip. The dimension of it is 181 x 217 x 181 [image: Inline image 1] The fiducial points are [image: Inline image 2] It is quite confusing since the coordinate of lpa exceeds the dimension. I would be very thankful if you can help me in this regard. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 6452 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From matt.gerhold at gmail.com Wed Oct 5 13:31:40 2016 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 5 Oct 2016 13:31:40 +0200 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son wrote: > Dear Fieldtrippers, > > > > the general problem we are facing is one of statistics. In particular, we > are trying to test the robustness of a graph measure when reducing the > amount of nodes it is computed with. In our case, we use the EEG electrodes > as nodes. > > > > We are trying to find out whether a graph measure differs significantly > from zero over a group of subjects. The exact calculation of the measure is > rather complicated to explain, suffice it to say that every subject has > exactly one scalar value in the end. Computation of this measure using 64 > electrodes is straightforward and we can easily calculate a p-value and/or > a confidence interval. > > When we calculate based on only 32 electrodes however, we draw 32 > electrodes randomly. Therefore, we need to repeat this computation many > times (let’s say 1000 times). So we then get [1000 x number of subjects] > values, or 1000 p-values/confidence intervals. > > How do we statistically test whether the measure is robustly different > from 0? Is it too naive to simply assume that if the confidence interval > does not contain 0 in at least 950 of the 1000 computations then it is > robustly different from 0? > > > > Any help would be greatly appreciated! > > > > Best regards, > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Wed Oct 5 15:55:26 2016 From: sarathykousik at gmail.com (kousik sarathy) Date: Wed, 5 Oct 2016 15:55:26 +0200 Subject: [FieldTrip] Plotting confidence intervals in multiplotER In-Reply-To: References: Message-ID: Hi Arti, The best I can suggest is a two step process. ft_timelockgrandaverage you should see a keepindividual option. You can collate your subject x chan x time as a single 3-D dataset. Then you can manually make your own fields of mean and sem. -- Regards, Kousik Sarathy, S On Wed, Oct 5, 2016 at 7:57 AM, Arti Abhishek wrote: > Dear Kousik, > > Thank you very much for your help. I am not sure how to change the > "dat_sem" as you suggested. My grand averaged file has the fields as follows > > GrandAvg_Target1 = > > avg: [132x601 double] > var: [132x601 double] > dof: [132x601 double] > time: [1x601 double] > label: {132x1 cell} > dimord: 'chan_time' > cfg: [1x1 struct] > > I am a beginner in MATLAB and any help would be greatly appreciated. > > Thanks, > Arti > > On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy > wrote: > >> Hey Arti, >> >> This is not such a trivial thing to solve. Here's a recipe I used. You >> need to find and edit two scripts. If this spurns any more interest, I'll >> initiate a 'bug' and try to send in a pull request. This is a dirty fix and >> in all probability will be considered blasphemy. ;) >> >> 1. Find in ft_multiplotER >> >> : >> ft_plot_vector(xval, yval, 'width', width(m), 'height', height(m), 'hpos', >> layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', [ymin ymax], ' >> color', color, 'style', cfg.linestyle{i}, 'linewidth', cfg.linewidth, ' >> axis', cfg.axes, 'highlight', mask, 'highlightstyle', cfg.maskstyle, ' >> label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); >> This basically calls a plotting function which in turn does the plotting >> for you. You need to send in the extra 'sem' or a 'ci' variable. >> Change this to: >> ft_plot_vector(xval, yval, 'ysem', ysem, 'width', width(m), 'height', >> height(m), 'hpos', layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', >> [ymin ymax], 'color', color, 'style', cfg.linestyle{i}, 'linewidth', >> cfg.linewidth, 'axis', cfg.axes, 'highlight', mask, 'highlightstyle', >> cfg.maskstyle, 'label', label, 'box', cfg.box, 'fontsize', cfg.fontsize); >> >> 2. Find in ft_plot_vector >> >> : >> You need to first get the sem parameter from your data and setup so FT >> can see your sem or CI info. Follow the code here >> . >> Search for "data_sem" and fix those lines. >> Then: >> h = plot(hdat, vdat, style, 'LineWidth', linewidth, 'Color', color, ' >> markersize', markersize, 'markerfacecolor', markerfacecolor); >> Change this to: >> [h hp ]= boundedline(hdat, vdat, vdat_sem); >> >> Boundedline >> is >> a submission in the MATLAB file exchange. You can use any other thing. >> >> >> Good luck trying! :) >> >> >> -- >> Regards, >> Kousik Sarathy, S >> >> >> On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek >> wrote: >> >>> Dear fieldtrip community, >>> >>> I was wondering whether there is a way to plot the confidence intervals >>> in the ERP plot? I see that this question was asked multiple times in the >>> discussion list before, but I could not find an answer to this. >>> >>> Thanks, >>> Arti >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From belahian at memphis.edu Wed Oct 5 15:59:41 2016 From: belahian at memphis.edu (Bahareh Elahian (belahian)) Date: Wed, 5 Oct 2016 13:59:41 +0000 Subject: [FieldTrip] fieldtrip structure Message-ID: Hi All, I have a ".mat" file which contains: <8x10350000 double> and sampling rate. How should I import this data to field trip? By using [data] = ft_preprocessing( cfg); I am getting an error that the data should be in the format of raw or raw + comp. Any idea? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From belahian at memphis.edu Wed Oct 5 16:10:00 2016 From: belahian at memphis.edu (Bahareh Elahian (belahian)) Date: Wed, 5 Oct 2016 14:10:00 +0000 Subject: [FieldTrip] fieldtrip structure In-Reply-To: References: Message-ID: Sorry for the duplicated email. My mailbox sent it automatically. Please discard this email. Thanks! Bahar ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Bahareh Elahian (belahian) Sent: Wednesday, October 5, 2016 8:59:41 AM To: fieldtrip at science.ru.nl Subject: [FieldTrip] fieldtrip structure Hi All, I have a ".mat" file which contains: <8x10350000 double> and sampling rate. How should I import this data to field trip? By using [data] = ft_preprocessing( cfg); I am getting an error that the data should be in the format of raw or raw + comp. Any idea? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Wed Oct 5 17:21:19 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Wed, 5 Oct 2016 11:21:19 -0400 Subject: [FieldTrip] Neighbors for Elekta Neuromag 306 gradiometers separately? In-Reply-To: References: Message-ID: Dear all, I have the same question. Do we need to separate the two gradiometer sensors at one position when defining the neighbours for interpolating bad sensors? Thanks! Lin On Thu, Sep 17, 2015 at 3:43 AM, Darinka Trübutschek wrote: > Dear Fieldtrip community, > > I am new to MEG/fieldtrip and have a question regarding the neighbor > structure necessary for computing cluster-based statistics. I am currently > analyzing data from a Neuromag 306 system (with 102 Mags and 204 Grads) and > would like to look separately at Mags, Grad1, and Grad2. > I assume that this means that I also need to compute the neighbors > separately for the different channel types. > > My question therefore concerns fieldtrip's standard neighbor templates for > Neuromag. Is there a specific reason (theoretical or methodological), why > there are no separate templates for Grad1 and 2? All that I could find are > separate templates for Mag (neuromag306mag_neighb.mat), the combined planar > gradients (neuromag306cmb_neighb.mat), and the neuromag306planar_neighb.mat > template, which, if I understand correctly, does not combine the Grads, but > still lists sensors of one type as neighbors of sensors of another type > (e.g., for sensor 0713 - a gradiometer measuring the derivative along the > longitudinal component, the neighbors listed include 0432, 0723, but also > sensors that, if I interpret it correctly, should measure the derivative > along the latitudinal component, such as 0433, 0712, etc.) Is there a > specific reason, why sometimes, for a given sensor position, both Grad1 and > Grad2 are included in the neighbors (e.g., 0432 and 0433), but sometimes > only one of the two (e.g., 0742)? > > Many thanks in advance for your help! > > Best, > Darinka > -- > Darinka Trübutschek (PhD Candidate) > > Inserm-CEA Cognitive Neuroimaging Unit > CEA/SAC/DSV/DRM/Neurospin > Bât 145, Point Courier 156 > F-91191 Gif-sur-Yvette > > website: https://sites.google.com/site/dtruebutschek/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mklados at gmail.com Wed Oct 5 20:55:05 2016 From: mklados at gmail.com (Manousos Klados) Date: Wed, 5 Oct 2016 14:55:05 -0400 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) Message-ID: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados -------------- next part -------------- An HTML attachment was scrubbed... URL: From federica.ma at gmail.com Wed Oct 5 21:36:02 2016 From: federica.ma at gmail.com (Federica Mauro) Date: Wed, 5 Oct 2016 21:36:02 +0200 Subject: [FieldTrip] Online Webinar in Brain Networks (hands-on) In-Reply-To: References: Message-ID: Dear Dr Klados, thank you for sharing this event. I'm interested and I would like to ask you if video material will be sent to all the e-participants. I'm in the EEST time zone, but I'll be busy working at the time of the talks. Thank you in advance. Best Regards, Federica Mauro, Ph.D. Psychology Department - Sapienza University of Rome (Italy) Il 5 ott 2016 9:26 PM, "Manousos Klados" ha scritto: Dear colleagues, please, accept my advanced apologies for any multiple cross-postings..., As a part of SAN 2016 conference (http://applied-neuroscience.org/san2016) I am organizing a hands-on workshop in Brain Networks on Thursday 6 OCT. This workshop aims to present some novel processing approaches, as well as different ways for visualizing the human connectome and some real studies. After participating in this workshop you will have the ability: - to analyze connectivity using graph theoretical models - to reduce the dimension and consequently the computation complexity of brain networks - to visualize with different ways the human connectome - to apply all these analyses to your data. Considering the huge amount of emails I received asking me for an online version of the workshop, I made an online webinar which is going to run in parallel with the live workshop. *After the first round of emails, few places are left and I am not planning to perform the same workshop in the near future. * You can reserve your seat as well as find more information about the programme in http://app.webinarsonair.com/register/?uuid=7961a35f44ab4cc2a3596492e7fc1ee1 If you need more information please don't hesitate to come in touch with me. Best wishes Manousos Klados _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 5 22:24:16 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 5 Oct 2016 20:24:16 +0000 Subject: [FieldTrip] fiff_read_tag error Message-ID: I have some old Neuromag MEG/EEG data files that I’m trying to read. One file is giving me a runtime error (the others appears ok): Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle 306 MEG channel locations transformed Reading sleep_DC_s3_13_raw.fif ... Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle Opening raw data file sleep_DC_s3_13_raw.fif... Read a total of 3 projection items: PCA-v1 (1 x 102) idle PCA-v2 (1 x 102) idle PCA-v3 (1 x 102) idle Range : 28800 ... 518399 = 47.753 ... 859.547 secs Ready. Reading 28800 ... 518399 = 47.753 ... 859.547 secs...Error using fiff_read_tag (line 232) Cannot handle other than dense or sparse matrices yet Error in fiff_read_raw_segment (line 152) tag = fiff_read_tag(fid,this.ent.pos); Error in ft_read_data (line 1105) dat = fiff_read_raw_segment(hdr.orig.raw,begsample+hdr.orig.raw.first_samp-1,endsample+hdr.orig.raw.first_samp-1,chanindx); Any suggestions on how to debug/fix/read this file? All help is appreciated as I’m just starting with FieldTrip. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel." --- Maya Angelou ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 5 23:06:18 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 5 Oct 2016 21:06:18 +0000 Subject: [FieldTrip] error with ft_appenddata Message-ID: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From rhancock at email.arizona.edu Thu Oct 6 01:05:46 2016 From: rhancock at email.arizona.edu (Roeland Hancock) Date: Wed, 5 Oct 2016 16:05:46 -0700 Subject: [FieldTrip] Postdoctoral Position at UCSF in California, USA on cognitive neuroscience of language processing Message-ID: The Hoeft Lab (http://brainLENS.org PI: Fumiko Hoeft MD PhD) at the UCSF Dept of Psychiatry and Weill Institute for Neurosciences is looking for an exceptional postdoc in the field of neurolinguistics, with advanced neuroimaging, computational, programming and organizational skills. Training in genetics is a plus. The primary project that the postdoc will be responsible for is the examination of intergenerational neuroimaging using a ‘natural’ cross-fostering design that allows dissociation of genetic, prenatal and postnatal environment on brain networks that are transmitted across generations. Related articles from our lab can be found here - Yamagata et al. J Neurosci 2016 (http://goo.gl/vMK8iy), Ho et al. Trends in Neurosci 2016 (http://goo.gl/SyXLcK), and Scientific American (http://goo.gl/YTiH6D). There are many opportunities to be involved in other projects on the neuroscience of language and literacy. The position can begin immediately. Please email info at brainlens.org with a cover letter and your CV. Please add “[Postdoc job]” and your full name in the Subject of the email. Qualified candidates will be asked to have 3 letters of reference forwarded. Roeland Hancock -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 6 02:21:02 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 6 Oct 2016 00:21:02 +0000 Subject: [FieldTrip] error with ft_appenddata In-Reply-To: References: Message-ID: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won’t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif’; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ph442 at cam.ac.uk Thu Oct 6 11:24:11 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Thu, 06 Oct 2016 10:24:11 +0100 Subject: [FieldTrip] =?utf-8?q?Official_Fieldtrip_Courses/Meetings_in_Euro?= =?utf-8?q?pe_this_year=3F?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear Fieldtrippers I was wondering if there are any official Fieldtrip courses/Meetings in Europe this year or early next year? best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From dlozanosoldevilla at gmail.com Thu Oct 6 11:47:29 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Thu, 6 Oct 2016 11:47:29 +0200 Subject: [FieldTrip] Official Fieldtrip Courses/Meetings in Europe this year? In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Hi, Take a look here: http://www.fieldtriptoolbox.org/workshop There's one in Tuebingen and another in Marseille. Ask the organizers to see if there're available seats best, Diego On 6 October 2016 at 11:24, parham hashemzadeh wrote: > Dear Fieldtrippers > I was wondering if there are any official Fieldtrip courses/Meetings in > Europe this year or early next year? > best regards parham > > On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > >> Hi Parham, >> >> Sorry for sounding cryptic earlier, I was just reciprocating the >> crypticity of the question. >> I think that the suggestion made in the previous e-mail is an >> excellent one. >> With the addition that, rather than using ft_determine_coordsys, you >> could use ft_plot_ortho to visualize an arbitrary cross-cut through >> your volumetric image. >> Note however, that the MR and the sourcespace should be in the same >> coordinate system for this to work. >> >> Best, >> Jan-Mathijs >> >> On 05 Oct 2016, at 00:47, A. Donda wrote: >>> >>> Hi Parham, >>> >>> if you wanna plot it in FieldTrip, these commands worked well for >>> me, but in my case (MEG data) I had to make sure first that these >>> data were on the same coordinate system (co-registration of MRI and >>> MEG sensor-data). If you do not have this issue, then you can simply >>> plot an MRI and a mesh obtained from freesurfer the following way >>> (make sure that both MRI and the mesh are in the same units, e.g. cm >>> or mm): >>> >>> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >>> >>> hold on >>> >>> ft_plot_mesh(sourcespace); >>> >>> Alternatively, if you want to plot the vertices of the mesh as dots, >>> you can use >>> >>> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >>> >>> sourcespace has the following structure (in case this is helpful for >>> you): >>> >>> pnt: [8196x3 double] >>> tri: [16384x3 double] >>> area: [16384x1 double] >>> orig: [1x1 struct] >>> unit: 'm' >>> >>> I obtained sourcespace by loading the boundary element model (bem) >>> surface, created with the watershed algorthim of Freesurfer: >>> >>> sourcespace = >>> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >>> 'format', 'mne_source'); %in meters >>> >>> Note that I had to transform the sourcespace dataset to the right >>> coordinate system and units. >>> >>> Finally I plotted the mri and mesh in cm >>> >>> To convert units in Fieldtrip, as you know, use X_cm = >>> ft_convert_units(X,'cm'); >>> >>> I hope this is helpful. >>> >>> Best >>> >>> A.Donda >>> >>> ------------------------- >>> >>> FROM: fieldtrip-bounces at science.ru.nl >>> on behalf of parham hashemzadeh >>> >>> SENT: Tuesday, October 4, 2016 6:08 PM >>> TO: FieldTrip discussion list >>> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >>> mri_aligned. >>> >>> Dear Darren >>> Thank you very much, and I will try to give it a go. >>> In the event that I can not. You are a life saver if you can help >>> me >>> out. Everything is in place except this incredibly important item. >>> I >>> have noticed that you are in Cambridge, maybe we can meet at some >>> point. >>> I am close by at the mathematics department. >>> Many many thanks >>> best regards parham >>> >>> On 2016-10-04 17:45, Darren Price wrote: >>> >>>> Hi Parham >>>> >>>> For a non-linear interpolation onto a regular grid, >>>> >>> spm_mesh_to_grid >>> >>>> might be ideal (from the spm package of course). I don't have a >>>> working example to hand, but I may be able to dig one out if you >>>> >>> can't >>> >>>> get it working. >>>> >>>> Darren >>>> >>>> >>>> ------------------------------------------------------- >>>> Dr. Darren Price >>>> Investigator Scientist and Cam-CAN Data Manager >>>> MRC Cognition & Brain Sciences Unit >>>> 15 Chaucer Road >>>> Cambridge, CB2 7EF >>>> England >>>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>>> TEL +44 (0)1223 355 294 x202 >>>> FAX +44 (0)1223 359 062 >>>> MOB +44 (0)7717822431 >>>> ------------------------------------------------------- >>>> >>>> >>>> -----Original Message----- >>>> From: fieldtrip-bounces at science.ru.nl >>>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>>> hashemzadeh >>>> Sent: 04 October 2016 16:59 >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >>>> >>> mri_aligned. >>> >>>> >>>> Hi Jan >>>> Thank you, my functional data are the function values of some >>>> function (irrotational component of the current). From my limited >>>> experience of Fieldtrip, your explanation feels (to myself) a bit >>>> cryptic at the moment. >>>> >>>> You see if my inversion strategy was one of the classical ones >>>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >>>> >>> eloreta >>> >>>> then the available fieldtrip tutorials are great in showing >>>> how to plot functional values on the top of anatomical values. >>>> But, since, I work on inversion methods, then I need a hacking >>>> strategy to be able to plot functional values of "some >>>> function"(estimated) on top of anatomical data MRI. >>>> >>>> I would appreciate if you would kindly let me know, if there is >>>> >>> hack >>> >>>> to it such that >>>> ft_sourceplot can accept the input. >>>> best regards parham >>>> >>>> >>>> >>>> >>>> >>>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> >>>>> Hi Parham, >>>>> >>>>> It is possible, but certainly not pain free, nor >>>>> >>>> straightforward. >>> >>>> I think this is not really a fieldtrip question, but more a >>>>> >>>> general >>> >>>> matlab related issue. >>>>> >>>>> It should be possible to plot a slice through an MRI volume as a >>>>> MATLAB patch, where the coordinates of the voxels are expressed >>>>> >>>> in >>> >>>> some coordinate system. Then, it is possible to generate and >>>>> intersection of the freesurfer mesh through the plane of >>>>> visualization. >>>>> >>>>> Best, >>>>> Jan-Mathijs >>>>> >>>>> >>>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >>>>>> >>>>> wrote: >>> >>>> >>>>>> Dear Fieldtrippers >>>>>> Is there a straightforward pain free method ( I appreciate if >>>>>> >>>>> you can >>> >>>> give me the command) >>>>>> to plot arbitrary points such as the vertices of the freesurfer >>>>>> >>>>> >>> output >>>>>> (mesh) onto the MRI image? >>>>>> The reason that I ask is that I would like to plot my solution >>>>>> >>>>> on the >>> >>>> MRI image. >>>>>> Unfortunately I do not use dipoles. In EEG, I model the >>>>>> >>>>> irrotational >>> >>>> component of the current as a scalar function and therefore I >>>>>> >>>>> am >>> >>>> doing >>>>>> function estimation. >>>>>> IF you use dipoles, it is straightforward because you follow >>>>>> >>>>> one of >>> >>>> the tutorials. >>>>>> But if you do not use dipoles and model the current as the >>>>>> >>>>> gradient >>> >>>> of the irrotational component of the current in EEG then one >>>>>> >>>>> can get >>> >>>> lost. >>>>>> Any help would be appreciated. >>>>>> Many thanks >>>>>> >>>>>> -- >>>>>> best regards >>>>>> Parham Hashemzadeh >>>>>> Research Associate >>>>>> Department of Applied Mathematics and Theoretical Physics >>>>>> University of Cambridge, UK. >>>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>>> >>>> >>>> -- >>>> best regards >>>> Parham Hashemzadeh >>>> Research Associate >>>> Department of Applied Mathematics and Theoretical Physics >>>> University of Cambridge, UK. >>>> email: hashemzadeh at damtp.cam.ac.uk >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >> >> >> >> Links: >> ------ >> [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price >> [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > best regards > Parham Hashemzadeh > Research Associate > Department of Applied Mathematics and Theoretical Physics > University of Cambridge, UK. > email: hashemzadeh at damtp.cam.ac.uk > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wanglinsisi at gmail.com Thu Oct 6 15:35:01 2016 From: wanglinsisi at gmail.com (Lin Wang) Date: Thu, 6 Oct 2016 09:35:01 -0400 Subject: [FieldTrip] ICA components for gradiometer sensors Message-ID: Dear all, I applied ICA ('runica' method) to 202 gradiometer sensors (collected with neuromag system) after removing two bad channels and some trials that contained obvious artifacts. I could identify the EOG and ECG components, but the topographic distributions of the components look quite weird to me (i.e., the strips). I attached a screenshot of some components in the email. Could you help me to see whether there is anything wrong with the ICA analysis? Thanks a lot! Best, Lin [image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ICA_GRAD.png Type: image/png Size: 574403 bytes Desc: not available URL: From elizabeth.1.shephard at kcl.ac.uk Thu Oct 6 16:03:01 2016 From: elizabeth.1.shephard at kcl.ac.uk (Shephard, Elizabeth) Date: Thu, 6 Oct 2016 14:03:01 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis Message-ID: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King's College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 6 16:35:39 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 6 Oct 2016 14:35:39 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis In-Reply-To: References: Message-ID: <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> Dear Lizzie, You haven’t done anything wrong, and the output is exactly as expected. You almost solved it yourself, since indeed you would want to need the option cfg.avgoverfreq = ‘yes’, but this should be invoked in another function: cfg = []; cfg.avgoverfreq = ‘yes’; FFThann = ft_freqanalysis(cfg, FFThann); Best wishes, Jan-Mathijs On 06 Oct 2016, at 16:03, Shephard, Elizabeth > wrote: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elizabeth.1.shephard at kcl.ac.uk Thu Oct 6 16:51:45 2016 From: elizabeth.1.shephard at kcl.ac.uk (Shephard, Elizabeth) Date: Thu, 6 Oct 2016 14:51:45 +0000 Subject: [FieldTrip] Outputting average power with ft_freqanalysis In-Reply-To: <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> References: , <54B666B8-A6DA-4B7D-81D2-FD7100DBAA15@donders.ru.nl> Message-ID: Dear Jan-Mathijs Brilliant, thanks for getting back to me. I have it working now with the second step :) Many thanks Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Schoffelen, J.M. (Jan Mathijs) Sent: 06 October 2016 15:35:39 To: FieldTrip discussion list Subject: Re: [FieldTrip] Outputting average power with ft_freqanalysis Dear Lizzie, You haven’t done anything wrong, and the output is exactly as expected. You almost solved it yourself, since indeed you would want to need the option cfg.avgoverfreq = ‘yes’, but this should be invoked in another function: cfg = []; cfg.avgoverfreq = ‘yes’; FFThann = ft_freqanalysis(cfg, FFThann); Best wishes, Jan-Mathijs On 06 Oct 2016, at 16:03, Shephard, Elizabeth > wrote: Dear all I am fairly new to FieldTrip so apologies if this is a very basic question... I am using ft_freqanalysis and wanted to obtain average power values in frequency bands rather than power values at particular frequencies. So, following the documentation online, I specified the following: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foilim = [1 3]; % get power in delta range cfg.keeptrials = 'yes'; cfg.output = 'pow'; FFThann = ft_freqanalysis(cfg, data); But the powspctrm field I get in FFThann gives power values for 0.5 Hz steps across the 1-3 Hz range, rather than a single average power value for the 1-3 Hz range. I was wondering if I have specified something incorrectly? I've also tried adding "cfg.avgoverfreq = 'yes';" but this doesn't change the output. Many thanks in advance Lizzie --------------------------------------------------------------------------- Lizzie Shephard, PhD Postdoctoral researcher 2.21 MRC SGDP Centre Institute of Psychiatry, Psychology, & Neuroscience King’s College London De Crespigny Park London, SE5 8AF 0207 848 5272 elizabeth.1.shephard at kcl.ac.uk _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Fri Oct 7 03:08:15 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Fri, 07 Oct 2016 01:08:15 +0000 Subject: [FieldTrip] inverse problem for HCP Message-ID: Hi all, I am trying to compute the inverse source localization with beamforming in HCP, then the volume segment of provided MRI is one of the first steps, but as the ordsys of the MRI is not available this segmentation is not possible, I would to know what is solution? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From russgport at gmail.com Fri Oct 7 21:40:56 2016 From: russgport at gmail.com (russ port) Date: Fri, 7 Oct 2016 15:40:56 -0400 Subject: [FieldTrip] Failure of LCMV beamformer for Neuromag VectorView planar gradiometers In-Reply-To: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> References: <8ABAE98F-6640-4865-8E07-32F168D19AA2@gmail.com> Message-ID: <0C79E9BD-15C3-40EF-820C-7B676A9D1D7D@gmail.com> Hi, I realize that my previous email was far too long. In short: I'm having some trouble localizing some auditory steady state elekta data using LCMV beamformer in fieldtrip. I'm localizing the magnetometers and gradiometers separately and while the magnetometers are giving good results the gradiometers are not (see attached ppt). I suspect that this is due to the gradiometer data matrix being rank difficient due to running maxFilter. Does anyone have any suggestions on how to run LCMV beamforming on SSS’d elekta gradiometer data? Thanks​ Russ > On Oct 1, 2016, at 12:34 PM, russ port wrote: > > Dear Fieldtrippers/Fieldtrippians > > I was hoping someone could help me with an issue I have come across during my analyses of a preliminary study. In brief, for the study a person was scanned on a CTF 275 channel biomagnetometer and then directly after on a 306 channel Elekta Neuromag VectorView platform. During the scans, the subject listened to a 40Hz amplitude modulated 500Hz tone (to generate a 40Hz Auditory Steady-state Response [ASSR]). In order to get the Elekta-derived data into a workable format, the Elekta-derived was MaxFilter’d for SSS (not tsss). After this, to analyze the datasets in an analogous manner, all datasets (both CTF- and Elekta-derived datasets [planar gradiometers and magnetometers analyzed separately]) were artifact cleaned (artifact rejection for jump/muscle artifact, ICA rejection of EOG/ECG components - OF NOTE FOR ELEKTA DATA THE ICA OUTPUT WAS LIMITED TO THE RANK OF THE DATA [BECAUSE OF SSS NOTED ABOVE]). Then the data was averaged, and a LCMV beamformer (ipsi-lateral channels only) targeted at the subject’s right or left hemisphere Helsch’s Gyrus was used to generate a ASSR time course. Attached (within the powerpoint slide deck) are figures showing the results . For each figure, the left column shows data that is just read with with no artifact correction (incase the ICA routines were improperly deforming the data), and the right column show the results of the methodology described above. The first and second row is the time-locked data from all sensors, both broad band (1st row - and also what is passed to the LCMV beamformer), and band-passed for gamma-band activity (30-58Hz). The third and forth rows are similar, though show the virtual electrodes time course (orientated to the ASSR). Hopefully you would agree that the CTF and Elekta magnetometer virtual electrode time course/results seem very appropriate. On the other hand, the Elekta planar gradiometer time course seem “lack-luster” to say the best. I did try to look into this, and found that during the beamforming, both CTF and Elekta magnetometers are rank sufficient (rank= number of channels for that hemisphere). The planar gradiometers on the other hand are rank deficient, which based on my understanding of the steps of an LCMV beamformer may be quite problematic. Has anyone else experienced this before and/or have suggestions how to circumvent this issue of poor planar gradiometer results from a LCMV beamformer? > > Best, > Russ Port > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pooneh.baniasad at gmail.com Mon Oct 10 13:55:02 2016 From: pooneh.baniasad at gmail.com (pooneh baniasad) Date: Mon, 10 Oct 2016 15:25:02 +0330 Subject: [FieldTrip] Dimension of lead-field Matrix In-Reply-To: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> References: <6FFFC963-7692-41B5-91FC-068C6AD3FB32@donders.ru.nl> Message-ID: Dear Simon Thanks a lot for your attention and sorry for the late response. I've actually found which part of the code makes a problem. I used the ft_prepare_vol_sens's function in a wrong way. Now I have another problem. I change the coordination system from 'ctf' to 'spm' by using this code: cfg = []; [mri] = ft_volumenormalise(cfg, mri); When I segmented 'scalp' separately and prepared mesh from it, the figure was well (1.fig). On the other hand when I changed the segmentation into {'brain', 'skull', 'scalp'}, the scalp can not be computed properly (2.fig). On Mon, Oct 3, 2016 at 4:57 PM, Simon Homolle wrote: > Dear Pooneh, > > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem > > I relate to this part: > > > When the forward solution is computed, the lead field matrix (= channels > X source points matrix) is calculated *for each grid point* taking into > account the head model and the channel positions. > > > So I assume your mesh consists of 2000 grid points? > > Simon Homölle > PhD Candidate > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Phone: +31-(0)24-36-65059 > > On 03 Oct 2016, at 13:01, pooneh baniasad > wrote: > > Dear Simon, > > I've followed this tutorial: > http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem to construct > the headmodel ('VolBEM') > I use 'standard_1020.elc' for 'elec' and 'cortex_20484.surf.gii' for > 'DipPos'. > Is it clear or should I explain more? 🙂 > > On Mon, Oct 3, 2016 at 11:53 AM, Simon Homolle > wrote: > >> Dear pooh, >> >> Could you provide more information how you constructed your BEM-model? >> >> best regards, >> >> Simon Homölle >> PhD Candidate >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Phone: +31-(0)24-36-65059 >> >> On 02 Oct 2016, at 12:22, pooneh baniasad >> wrote: >> >> Dear FieldTrip community >> >> I'm using the forward model to simulating EEG signal although it seems >> the dimension of the lead-field matrix is not correct. Here is a review of >> the procedure. >> >> First I constructed a BEM headmodel for EEG source analysis ​and then by >> loading the template cortex, I put the dipoles with specific current source >> on that. I expect the dimension of the lead-field matrix will be m*n which >> m=electrode's number and n=3*dipole's number but 'm' is different. >> Since I used the template electrode 'standard_1020.elc', m = 97 according >> to: >> >> chanpos: [97x3 double] >> chantype: {97x1 cell} >> chanunit: {97x1 cell} >> elecpos: [97x3 double] >> label: {97x1 cell} >> type: 'eeg1010' >> unit: 'mm' >> >> while the dimension of lead-field matrix is: 2000x122880 >> >> I use this function for calculating lead-field matrix: >> >> LF = ft_compute_leadfield(DipPos, elec, VolBEM); >> ​I do not understand why the number of raws are different​! >> >> ​On the other hand I guess that there is a similarity between the number >> of raws in the volume head model and LF matrix due to the dimension of >> headmodel matrix is: 2000x8000 double .​ >> >> ​I will be so thankful if anyone can help me.​ >> >> -- >> Bests >> >> Pouneh Baniasad >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > -- > Bests > > Pouneh Baniasad > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Bests Pouneh Baniasad -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.jpg Type: image/jpeg Size: 96708 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.jpg Type: image/jpeg Size: 84068 bytes Desc: not available URL: From alexander.whillier at med.uni-goettingen.de Mon Oct 10 19:39:03 2016 From: alexander.whillier at med.uni-goettingen.de (Whillier, Alexander) Date: Mon, 10 Oct 2016 17:39:03 +0000 Subject: [FieldTrip] Help importing and reading data Message-ID: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> Dear Fieldtrip, I have inherited a dataset of EMG and EEG data that was gathered using two different programs. One of my colleagues has taught me the basics of fieldtrip and I only a beginner at Matlab at the moment. I am trying to analyse both data sets using fieldtrip. The first dataset (which works) is .cnt data gathered using EEG Probe. The second dataset (which fieldtrip currently fails to recognise) is .cfs data gathered using Signal. I am able to export the data as .mat files, to read them in Matlab using Fieldtrip. However, in spite of my best efforts to create a header file and header format that the preprocessing code will accept, I am unable to proceed. I get constant errors: Error using ft_read_header (line 2158) unsupported header format (matlab) Error in ft_preprocessing (line 394) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Even though my cfg.hdr section has all of these values, I cannot find a way to get it to run the preprocessing code. Can you help? Kind regards, Alexander Whillier -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.sciences at gmail.com Mon Oct 10 19:58:23 2016 From: peter.sciences at gmail.com (Peter Soros) Date: Mon, 10 Oct 2016 19:58:23 +0200 Subject: [FieldTrip] PhD position in psychiatric neuroimaging (Oldenburg, Germany) Message-ID: Dear All, The University Clinic of Psychiatry and Psychotherapy, University of Oldenburg, Germany (Director: Prof. Dr. Alexandra Philipsen) offers a PhD position (65 % of full time TV-L 13, 3 years) in multimodal psychiatric neuroimaging. The successful PhD student will investigate the neural correlates of attention deficit hyperactivity disorder (ADHD) and borderline personality disorder, using the state-of-the-art infrastructure of the University Clinic and the newly founded Neuroimaging Center, including a Siemens Prisma MRI at 3 Tesla with 64-channel head coil, a 306-channel Elekta Neuromag Triux magnetoencephalography system, EEG and TMS. This position is embedded in an excellent interdisciplinary scientific environment with a strong focus on neurosensory, neurocognitive and psychiatric research. The University Clinic of Psychiatry and Psychotherapy is part of the rapidly growing European Medical School, founded by the Universities of Oldenburg, Germany, and Groningen, The Netherlands. Applicants are expected to hold a master's degree in the field of psychology, neuroscience, physics or a related discipline, or a medical degree. Prior experience with the analysis of MRI, EEG or MEG data is highly desirable. Computer programming and statistical skills are an asset. Oldenburg is an attractive and safe city with a population of 160.000 in Germany's northwest with excellent quality of life. It is close to Bremen, Hamburg and Groningen, and approximately 1 h from the North Sea. The University of Oldenburg is an equal opportunity employer aiming to increase the proportion of female academic members. Therefore, we especially encourage women to apply. Applicants with disabilities will be given preference if equally qualified. Applications should include a cover letter, CV, copy of the master's thesis or other written work, university grades and the contact details of two academic references and should be sent to Prof. Dr. Alexandra Philipsen, Director of the University Clinic of Psychiatry and Psychotherapy, University of Oldenburg, Germany via e-mail (alexandra.philipsen at uni-oldenburg.de ). For additional information, please contact Dr. Peter Soros (phone +49.441.9615.1503; peter.soeroes at uni-oldenburg.de ) Deadline for application: October 31, 2016 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Holding at nottingham.ac.uk Tue Oct 11 18:26:11 2016 From: Martin.Holding at nottingham.ac.uk (Martin Holding) Date: Tue, 11 Oct 2016 16:26:11 +0000 Subject: [FieldTrip] Cluster Based Permutation Stats on Source Spaced Frequency Data Message-ID: <218876b60d2a47b99ad1d80347ff8e8c@frigg-vm0.nus.ihr.mrc.ac.uk> Hello Fieldtrip, This is my first posting so I'll introduce myself. My name is Martin and I'm a PhD student at the Institute of Hearing Research in Nottingham, primarily interested in auditory oscillations associated with tinnitus using EEG and MEG. This problem is from a project I did a while back but I'm just wrapping up now. I'm having a problem with running some cluster based permutation statistics on some frequency and timelocked MEG data I have. The first thing to mention is that the code runs fine. Fieldtrip is happy to run the tests, the problem is that I am getting no significant clusters out of it. This is in spite of some rather large t-values that might suggest otherwise. I suspect this is due to the fact that the frequency and timelocked data I am passing to the relevant stats functions (ft_freqstatistics and ft_timelockstatistics respectively) is analysed in source space, not sensor space. Unfortunately, due to data artefacts it isn't possible for me to do these analyses in sensor space. As such, I think that fieldtrip is telling me I have no clusters because it defines clusters based on neighbouring channels/sensors supplied by a layout template which it no longer has access too because I'm in source space on an MNI grid system. I have 2 questions then: 1. Is this a sensible conclusion for why I'm getting no significant clusters? 2. And if so, is there a way I can make the fieldtrip statistics functions recognise MNI grids and calculate the neighbours on grid points rather than sensors? Many thanks, Martin ============================================================== Martin Holding PhD Student MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115 74) 86938 Email: martin.holding at nottingham.ac.uk ============================================================== Martin Holding PhD Student MRC Institute of Hearing Research University Park Nottingham NG7 2RD Tel: (0115 74) 86938 Email: martin.holding at nottingham.ac.uk This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 12 09:48:31 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 12 Oct 2016 07:48:31 +0000 Subject: [FieldTrip] Help importing and reading data In-Reply-To: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> References: <0C5D14AF545112469A6CAFDF10A3D246712D39@umg-exc-3.ads.local.med.uni-goettingen.de> Message-ID: Hi Alexander, If you have managed to convert the data into a mat-file, in general it is not needed to go through ft_preprocessing to get the data loaded into memory. In general, providing cfg.datafile = ‘somefilename.mat’ will not work. I’d recommend to look here: http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat, and in particular at the ‘circumvent the fieldtrip reading functions’ section. The idea is to create a fieldtrip-style data structure that can serve as an input argument to downstream processing functions. Good luck, Jan-Mathijs On 10 Oct 2016, at 19:39, Whillier, Alexander > wrote: Dear Fieldtrip, I have inherited a dataset of EMG and EEG data that was gathered using two different programs. One of my colleagues has taught me the basics of fieldtrip and I only a beginner at Matlab at the moment. I am trying to analyse both data sets using fieldtrip. The first dataset (which works) is .cnt data gathered using EEG Probe. The second dataset (which fieldtrip currently fails to recognise) is .cfs data gathered using Signal. I am able to export the data as .mat files, to read them in Matlab using Fieldtrip. However, in spite of my best efforts to create a header file and header format that the preprocessing code will accept, I am unable to proceed. I get constant errors: Error using ft_read_header (line 2158) unsupported header format (matlab) Error in ft_preprocessing (line 394) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); Even though my cfg.hdr section has all of these values, I cannot find a way to get it to run the preprocessing code. Can you help? Kind regards, Alexander Whillier _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Oct 12 11:51:34 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 12 Oct 2016 11:51:34 +0200 Subject: [FieldTrip] Post-doctoral position in Cognitive Neuroscience, Charite Berlin Message-ID: The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a Post-doctoral position. A Grant by the German Research Foundation (DFG) will fund the position for a 30-months period. The main objective of the project is to examine multisensory processing in patients with schizophrenia. Recent studies have suggested multisensory processing deficits in patients with schizophrenia, but the neurophysiologic mechanisms underlying these deficits are not well understood. This project comprises of electroencephalography studies using multisensory paradigms for which effects in neural oscillations have been previously established in healthy individuals. Multisensory processing, as reflected in local power, dynamic network patterns, and functional connectivity will be examined in schizophrenia patients and healthy control participants. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Experience in human EEG/MEG studies, Matlab programming skills, as well as German language skills for interacting with patients are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades), as well as information on the earliest possible date to start the position until October 21, 2016, electronically to: Daniel Senkowski, Department of Psychiatry and Psychotherapy, Charité, University Medicine Berlin, 10115 Berlin, Germany, Phone: +49-30-2311-2738, Fax: +49-30-2311-2209, daniel.senkowski at charite.de. Regards, Daniel Senkowski -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From ph442 at cam.ac.uk Wed Oct 12 12:33:36 2016 From: ph442 at cam.ac.uk (parham hashemzadeh) Date: Wed, 12 Oct 2016 11:33:36 +0100 Subject: [FieldTrip] =?utf-8?q?plotting_freesurfer_mesh_on_the_mri=5Falign?= =?utf-8?b?ZWQu?= In-Reply-To: References: <5e87722f3de6b146ba19ed62719a31ba@cam.ac.uk> <8253C7AA-52A3-4876-A21C-BFFAF1C1FF54@donders.ru.nl> <893e91f5a3122cb2cb0f2bd00685d457@cam.ac.uk> Message-ID: Dear All I tried your recommendations and I was unsuccessful. The platform is hardwired for dipole analysis. Any other suggestions, would be appreciated. best regards parham On 2016-10-05 02:15, Schoffelen, J.M. (Jan Mathijs) wrote: > Hi Parham, > > Sorry for sounding cryptic earlier, I was just reciprocating the > crypticity of the question. > I think that the suggestion made in the previous e-mail is an > excellent one. > With the addition that, rather than using ft_determine_coordsys, you > could use ft_plot_ortho to visualize an arbitrary cross-cut through > your volumetric image. > Note however, that the MR and the sourcespace should be in the same > coordinate system for this to work. > > Best, > Jan-Mathijs > >> On 05 Oct 2016, at 00:47, A. Donda wrote: >> >> Hi Parham, >> >> if you wanna plot it in FieldTrip, these commands worked well for >> me, but in my case (MEG data) I had to make sure first that these >> data were on the same coordinate system (co-registration of MRI and >> MEG sensor-data). If you do not have this issue, then you can simply >> plot an MRI and a mesh obtained from freesurfer the following way >> (make sure that both MRI and the mesh are in the same units, e.g. cm >> or mm): >> >> ft_determine_coordsys(mricor_cm, 'interactive', 'no') >> >> hold on >> >> ft_plot_mesh(sourcespace); >> >> Alternatively, if you want to plot the vertices of the mesh as dots, >> you can use >> >> ft_plot_mesh(sourcespace.pnt,'vertexcolor','b'); >> >> sourcespace has the following structure (in case this is helpful for >> you): >> >> pnt: [8196x3 double] >> tri: [16384x3 double] >> area: [16384x1 double] >> orig: [1x1 struct] >> unit: 'm' >> >> I obtained sourcespace by loading the boundary element model (bem) >> surface, created with the watershed algorthim of Freesurfer: >> >> sourcespace = >> ft_read_headshape([subjectname/bem/subjectname-oct-6-src.fif'], >> 'format', 'mne_source'); %in meters >> >> Note that I had to transform the sourcespace dataset to the right >> coordinate system and units. >> >> Finally I plotted the mri and mesh in cm >> >> To convert units in Fieldtrip, as you know, use X_cm = >> ft_convert_units(X,'cm'); >> >> I hope this is helpful. >> >> Best >> >> A.Donda >> >> ------------------------- >> >> FROM: fieldtrip-bounces at science.ru.nl >> on behalf of parham hashemzadeh >> >> SENT: Tuesday, October 4, 2016 6:08 PM >> TO: FieldTrip discussion list >> SUBJECT: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >> >> Dear Darren >> Thank you very much, and I will try to give it a go. >> In the event that I can not. You are a life saver if you can help >> me >> out. Everything is in place except this incredibly important item. >> I >> have noticed that you are in Cambridge, maybe we can meet at some >> point. >> I am close by at the mathematics department. >> Many many thanks >> best regards parham >> >> On 2016-10-04 17:45, Darren Price wrote: >>> Hi Parham >>> >>> For a non-linear interpolation onto a regular grid, >> spm_mesh_to_grid >>> might be ideal (from the spm package of course). I don't have a >>> working example to hand, but I may be able to dig one out if you >> can't >>> get it working. >>> >>> Darren >>> >>> >>> ------------------------------------------------------- >>> Dr. Darren Price >>> Investigator Scientist and Cam-CAN Data Manager >>> MRC Cognition & Brain Sciences Unit >>> 15 Chaucer Road >>> Cambridge, CB2 7EF >>> England >>> EMAIL: darren.price at mrc-cbu.cam.ac.uk >>> URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price [1] >>> TEL +44 (0)1223 355 294 x202 >>> FAX +44 (0)1223 359 062 >>> MOB +44 (0)7717822431 >>> ------------------------------------------------------- >>> >>> >>> -----Original Message----- >>> From: fieldtrip-bounces at science.ru.nl >>> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of parham >>> hashemzadeh >>> Sent: 04 October 2016 16:59 >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting freesurfer mesh on the >> mri_aligned. >>> >>> Hi Jan >>> Thank you, my functional data are the function values of some >>> function (irrotational component of the current). From my limited >>> experience of Fieldtrip, your explanation feels (to myself) a bit >>> cryptic at the moment. >>> >>> You see if my inversion strategy was one of the classical ones >>> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., >> eloreta >>> then the available fieldtrip tutorials are great in showing >>> how to plot functional values on the top of anatomical values. >>> But, since, I work on inversion methods, then I need a hacking >>> strategy to be able to plot functional values of "some >>> function"(estimated) on top of anatomical data MRI. >>> >>> I would appreciate if you would kindly let me know, if there is >> hack >>> to it such that >>> ft_sourceplot can accept the input. >>> best regards parham >>> >>> >>> >>> >>> >>> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote: >>>> Hi Parham, >>>> >>>> It is possible, but certainly not pain free, nor >> straightforward. >>>> I think this is not really a fieldtrip question, but more a >> general >>>> matlab related issue. >>>> >>>> It should be possible to plot a slice through an MRI volume as a >>>> MATLAB patch, where the coordinates of the voxels are expressed >> in >>>> some coordinate system. Then, it is possible to generate and >>>> intersection of the freesurfer mesh through the plane of >>>> visualization. >>>> >>>> Best, >>>> Jan-Mathijs >>>> >>>> >>>> >>>>> On 04 Oct 2016, at 16:41, parham hashemzadeh >> wrote: >>>>> >>>>> Dear Fieldtrippers >>>>> Is there a straightforward pain free method ( I appreciate if >> you can >>>>> give me the command) >>>>> to plot arbitrary points such as the vertices of the freesurfer >> >>>>> output >>>>> (mesh) onto the MRI image? >>>>> The reason that I ask is that I would like to plot my solution >> on the >>>>> MRI image. >>>>> Unfortunately I do not use dipoles. In EEG, I model the >> irrotational >>>>> component of the current as a scalar function and therefore I >> am >>>>> doing >>>>> function estimation. >>>>> IF you use dipoles, it is straightforward because you follow >> one of >>>>> the tutorials. >>>>> But if you do not use dipoles and model the current as the >> gradient >>>>> of the irrotational component of the current in EEG then one >> can get >>>>> lost. >>>>> Any help would be appreciated. >>>>> Many thanks >>>>> >>>>> -- >>>>> best regards >>>>> Parham Hashemzadeh >>>>> Research Associate >>>>> Department of Applied Mathematics and Theoretical Physics >>>>> University of Cambridge, UK. >>>>> email: hashemzadeh at damtp.cam.ac.uk >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> -- >>> best regards >>> Parham Hashemzadeh >>> Research Associate >>> Department of Applied Mathematics and Theoretical Physics >>> University of Cambridge, UK. >>> email: hashemzadeh at damtp.cam.ac.uk >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> >> -- >> best regards >> Parham Hashemzadeh >> Research Associate >> Department of Applied Mathematics and Theoretical Physics >> University of Cambridge, UK. >> email: hashemzadeh at damtp.cam.ac.uk >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip [2] > > > > Links: > ------ > [1] http://www.mrc-cbu.cam.ac.uk/people/darren.price > [2] https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- best regards Parham Hashemzadeh Research Associate Department of Applied Mathematics and Theoretical Physics University of Cambridge, UK. email: hashemzadeh at damtp.cam.ac.uk From sander at mpib-berlin.mpg.de Wed Oct 12 14:46:56 2016 From: sander at mpib-berlin.mpg.de (Sander, Myriam) Date: Wed, 12 Oct 2016 12:46:56 +0000 Subject: [FieldTrip] Post-doctoral position at MPI for Human Development, Berlin Message-ID: Dear Colleagues, We have an open post-doc position for which we are still searching the ideal candidate – a person with a strong background in memory research and experience with advanced statistical analysis (machine-learning techniques like SVM, RSA…). In collaboration with Nikolai Axmacher (Ruhr Universität Bochum), we plan a project on age-differences in memory reactivation that will be conducted at the Center for Lifespan Research of the Max Planck Institut for Human Development in Berlin in the context of the MINERVA research group headed by Dr. Myriam Sander (https://www.mpib-berlin.mpg.de/en/research/lifespan-psychology/projects/cognitive-and-neuronal-dynamics-of-memory) Research of the MINERVA research group (PI: Dr. Myriam Sander) focuses on age-differences in memory representations. We aim to track memory representations across their life-cycles in terms of specific distributed patterns of neural activity. We investigate whether aging changes the quality of the representational patterns and thereby affects memory performance. We want to understand how aging affects the distinctiveness and similarity of memory representations during memory formation, replay, and retrieval. Research of the MINERVA group uses mainly electroencephalography (EEG) with a focus on oscillatory measures to uncover lifespan differences in mechanisms underlying memory performance (see e.g. Sander, et al., Neurosci. Biobehav. Rev., 2012). We also have access to a 3T scanner, TMS and eye tracker. Our research group is located at the Max Planck Institute for Human Development (MPIB) in Berlin with an international working atmosphere. The official deadline for applications has passed already, but we decided to wait for the ideal candidate for this project – so if you know her or him, please let her/him know and encourage her/him to apply! Thanks for spreading the word! With best regards from Berlin, Myriam Sander -- Dr. Myriam C. Sander Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94 14195 Berlin +49 (0)30 82 406 414 sander at mpib-berlin.mpg.de www.mpib-berlin.mpg.de/en/staff/myriam-c-sander -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PostDoc MPIB.pdf Type: application/pdf Size: 56405 bytes Desc: PostDoc MPIB.pdf URL: From son.ta.dinh at tum.de Wed Oct 12 17:06:08 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Wed, 12 Oct 2016 15:06:08 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Wed Oct 12 18:00:59 2016 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Wed, 12 Oct 2016 18:00:59 +0200 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son, Without directly referring to the Achard paper: In one sentence, how do you define the hub disruption index in terms of human brain function? In one sentence, how does the single value represent the definition you have provided in the previous sentence? If you have the right answers to these two simple questions, then the manner in which the null is defined computationally should be intuitive to you. Regards, Matthew On Wed, Oct 12, 2016 at 5:06 PM, Ta Dinh, Son wrote: > Hey Matthew, > > > > Thanks for the answer, but the question is exactly how to actually build a > representative null distribution. As the calculation using all (64) > electrodes is deterministic, it can’t really be used to create a > distribution, it would just be a vector of 1000 x 1 exact same value. > > The graph measure is called hub disruption index and was introduced here: > Achard, S., et al. (2012). "Hubs of brain functional networks are radically > reorganized in comatose patients." PNAS. > > To put it in a nutshell, it compares a subject against a group of > controls, thereby giving a single value for every subject (in comparison to > the control group). > > > > I hope this has cleared up the context a bit. > > > > Best > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > *Von:* Nickel, Moritz > *Gesendet:* Mittwoch, 12. Oktober 2016 16:37 > *An:* Ta Dinh, Son > *Betreff:* Fwd: [FieldTrip] Statistical test of robustness of a graph > measure based on reduced amount of nodes > > > > > > ---------- Forwarded message ---------- > From: *Matt Gerhold* > Date: 2016-10-05 13:31 GMT+02:00 > Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure > based on reduced amount of nodes > To: FieldTrip discussion list > > Hi Son, > > What you are explaining sounds like resampling to build a distribution > under the null hypothesis. You would need to make sure that your random > draws are representative in some way of an instance where the test > statistic (graph theoretic measure) is truly zero, i.e. representative of > the null hypothesis. There is no info on your measure, so one can't comment > any further on how one would achieve this. > > Once you have the bootstrapped distribution you compute the proportion of > values above the test statistic and those below the test statistic--the > test statistic is the measure you got from the actual sample, not the > bootstrapped distribution. > > Then it depends whether you use a two-tail or one-tail test and the > direction of the hypothesized effect: for a one-tail test you could > potentially take the proportion of the distribution above equal to the test > statistic, that would be your p-value. For two tailed-tests take the min > value of the two-proportions as your p-value and remember to divide alpha > by 2 to test for significance. > > That, in a nutshell, is a simple approach; however, there are other ways > to go about this. > > Matthew > > > > On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son wrote: > > Dear Fieldtrippers, > > > > the general problem we are facing is one of statistics. In particular, we > are trying to test the robustness of a graph measure when reducing the > amount of nodes it is computed with. In our case, we use the EEG electrodes > as nodes. > > > > We are trying to find out whether a graph measure differs significantly > from zero over a group of subjects. The exact calculation of the measure is > rather complicated to explain, suffice it to say that every subject has > exactly one scalar value in the end. Computation of this measure using 64 > electrodes is straightforward and we can easily calculate a p-value and/or > a confidence interval. > > When we calculate based on only 32 electrodes however, we draw 32 > electrodes randomly. Therefore, we need to repeat this computation many > times (let’s say 1000 times). So we then get [1000 x number of subjects] > values, or 1000 p-values/confidence intervals. > > How do we statistically test whether the measure is robustly different > from 0? Is it too naive to simply assume that if the confidence interval > does not contain 0 in at least 950 of the 1000 computations then it is > robustly different from 0? > > > > Any help would be greatly appreciated! > > > > Best regards, > > Son > > > > Son Ta Dinh, M.Sc. > > PhD student in Human Pain Research > > Klinikum rechts der Isar > > Technische Universität München > Munich, Germany > Phone: +49 89 4140 7664 > http://www.painlabmunich.de/ > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Darren.Price at mrc-cbu.cam.ac.uk Wed Oct 12 19:00:42 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Wed, 12 Oct 2016 17:00:42 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From son.ta.dinh at tum.de Thu Oct 13 11:25:14 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Thu, 13 Oct 2016 09:25:14 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Darren.Price at mrc-cbu.cam.ac.uk Thu Oct 13 14:15:53 2016 From: Darren.Price at mrc-cbu.cam.ac.uk (Darren Price) Date: Thu, 13 Oct 2016 12:15:53 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Son For who have emailed asking for code, it is pasted below. Son, I see what you mean. In that case creating surrogate data is still necessary, since you need a way to generate a confidence interval for each set of N channels. A rough outline of your pipeline would be: (this is all assuming your measure is not simply a function of the covariance matrix) for si = each surrogate dataset (1:1000): 64chanresult = compute result for 64 chan configuration for chani = each N of channels ranging from 64:32 Nchanresult = compute result for 64 chan configuration change(si, chani) = 64chanresult - Nchanresult end end then you can plot your data as a line graph with confidence intervals. I dug out a script I used a while ago, although you might want to check that it works properly (comparing correlation matrices of input/output). The main caveat is that you need to check that you take care of negative frequencies adequately. Here I have used a method of simply cancelling negative frequencies. The other way is to use the complex conjugate, but I found that less stable, perhaps due to numerical imprecision – I’m not sure. Anyway you should verify for yourself that the correlation matrix of your original data is almost exactly the same as your surrogate data (within reason: differences on the order of <1e-5, although this depends on the length of the data). You should detrend and filter before using this function. function data = randomisePhase(data, equalphase) % data = array: [time, channels] % equalphase boolean: [true | false] (do you want the same phase shift in % each channel? default = true) if nargin == 1 equalphase = true; end L = size(data, 1); data = fft(data)*2; data(L/2+1:end, :) = 0; randphase = exp(1i*randn(1,L)*2*pi)'; % uses the same phase for each channel for ii = 1:size(data,2) if equalphase == false randphase = exp(1i*rand(L,1)*2*pi)’; end data(:,ii) = real(ifft(data(:,ii).*randphase)); end Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 13 October 2016 10:25 To: FieldTrip discussion list Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RossiterH at cardiff.ac.uk Thu Oct 13 15:09:39 2016 From: RossiterH at cardiff.ac.uk (Holly Rossiter) Date: Thu, 13 Oct 2016 13:09:39 +0000 Subject: [FieldTrip] EMG detect Message-ID: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn't seem to recognise the term 'trialfun_emgdetect' - I've tried with the most recent version of fieldtrip and it's still not working. This is the error I'm getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Oct 13 15:24:30 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Thu, 13 Oct 2016 13:24:30 +0000 Subject: [FieldTrip] EMG detect In-Reply-To: References: Message-ID: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> Hi Holly, You should first create this function, by copying and pasting from the example (essentially just take the second block of code on the page you are working from). Then, you may need to adjust a bit of the code for your own purpose (most likely the name of the emg-channel. Good luck, Jan-Mathijs On 13 Oct 2016, at 15:09, Holly Rossiter > wrote: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn’t seem to recognise the term ‘trialfun_emgdetect’ – I’ve tried with the most recent version of fieldtrip and it’s still not working. This is the error I’m getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From RossiterH at cardiff.ac.uk Thu Oct 13 15:29:47 2016 From: RossiterH at cardiff.ac.uk (Holly Rossiter) Date: Thu, 13 Oct 2016 13:29:47 +0000 Subject: [FieldTrip] EMG detect In-Reply-To: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> References: <3B0311FF-6240-4277-A6D7-6C3379C13E0E@donders.ru.nl> Message-ID: Oh I see, thank you. It’s working now. Holly From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Schoffelen, J.M. (Jan Mathijs) Sent: 13 October 2016 14:25 To: FieldTrip discussion list Subject: Re: [FieldTrip] EMG detect Hi Holly, You should first create this function, by copying and pasting from the example (essentially just take the second block of code on the page you are working from). Then, you may need to adjust a bit of the code for your own purpose (most likely the name of the emg-channel. Good luck, Jan-Mathijs On 13 Oct 2016, at 15:09, Holly Rossiter > wrote: Hi there, I am trying to use the muscle activity from an EMG channel to use as a trial definition and have found the tutorial on it but it doesn’t seem to recognise the term ‘trialfun_emgdetect’ – I’ve tried with the most recent version of fieldtrip and it’s still not working. This is the error I’m getting: Undefined function 'func2str' for input arguments of type 'double'. Error in ft_definetrial (line 158) error('the specified trialfun ''%s'' was not found', func2str(cfg.trialfun)); Thanks, Holly _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Fri Oct 14 08:08:09 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Fri, 14 Oct 2016 15:08:09 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering Message-ID: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> Dear community, My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. I am new to Fieldtrip. My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). The recording system is Neuralynx. I have encountered 2 problems which I don’t believe are related. I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. 1) Fsample discrepancy between data and header. When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. 2) 50Hz line noise filtering The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. To give an idea: cfg = []; cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 cfg.bsfreq = [49.9 50.1]; filtDat = ft_preprocessing(cfg, data_lite); cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below changes this into that {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: dat = ft_read_data(dataset_dir); dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); changes this into that Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) Of course, I tried to feed that filtered data into the preprocessing pipeline by doing cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. data_artifact_rejected = ft_preprocessing(cfg, dat_filt); But I get the error that dat_filt is not raw or comp data. I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. So for this point: - how to make the (recommended) 50Hz post processing work? - or more simply, how could I feed prefiltered data to ft_preprocessing? Thank you very much for your consideration and I look forward to your help. All the best, Florian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: data_lite.jpeg Type: image/jpeg Size: 32603 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: filtDat.jpeg Type: image/jpeg Size: 32794 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RawData.jpeg Type: image/jpeg Size: 51182 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RawData_after_filter.jpeg Type: image/jpeg Size: 46294 bytes Desc: not available URL: From knutsenpm at gmail.com Fri Oct 14 10:43:12 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 10:43:12 +0200 Subject: [FieldTrip] Data browser trouble Message-ID: Hi, My calls to ft_databrowser([], data) is failing with: >the input is raw data with 16 channels and 10 trials >detected 0 visual artifacts >Error using zeros >Size inputs must be integers. >Error in convert_event>artifact2artvec (line 179) >artvec = zeros(length(artifact), endsample); >Error in convert_event (line 103) > obj = artifact2artvec(obj,endsample); >Error in ft_databrowser (line 535) >artdata.trial{1} = convert_event(artifact, 'boolvec', 'endsample', datendsample); % every >artifact is a "channel" I am not certain if this is triggered by a lack of artifacts in my data, that my data structure is missing information, or that the code does not allow for "zero artifacts" by design. Here is my data structure: data = hdr: [1x1 struct] fsample: 4800 sampleinfo: [10x2 double] trial: {1x10 cell} time: {1x10 cell} label: {16x1 cell} cfg: [1x1 struct] My data is loaded through a custom reader as the data format I have is not supported natively by fieldtrip. I have succeeded in pre processing the data with ft_redefinetrial() and ft_preprocessing(). Any ideas? *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Fri Oct 14 11:08:44 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 11:08:44 +0200 Subject: [FieldTrip] Data browser trouble In-Reply-To: References: Message-ID: Oops, seems I was too quick to ask for help. I traced the error to my trial definitions which were not specified as integer samples. That led to the "​Size inputs must be integers" error below. Might it be an idea to place a check for integer values in cfg.trl when passed to ft_redefinetrial()? - Per On Fri, Oct 14, 2016 at 10:43 AM, Per Knutsen wrote: > Hi, > My calls to ft_databrowser([], data) is failing with: > > >the input is raw data with 16 channels and 10 trials > >detected 0 visual artifacts > >Error using zeros > > > ​​ > Size inputs must be integers. > >Error in convert_event>artifact2artvec (line 179) > >artvec = zeros(length(artifact), endsample); > >Error in convert_event (line 103) > > obj = artifact2artvec(obj,endsample); > >Error in ft_databrowser (line 535) > >artdata.trial{1} = convert_event(artifact, 'boolvec', 'endsample', > datendsample); % every >artifact is a "channel" > > I am not certain if this is triggered by a lack of artifacts in my data, > that my data structure is missing information, or that the code does not > allow for "zero artifacts" by design. > > Here is my data structure: > > data = > hdr: [1x1 struct] > fsample: 4800 > sampleinfo: [10x2 double] > trial: {1x10 cell} > time: {1x10 cell} > label: {16x1 cell} > cfg: [1x1 struct] > > My data is loaded through a custom reader as the data format I have is not > supported natively by fieldtrip. > > I have succeeded in pre processing the data with ft_redefinetrial() and > ft_preprocessing(). > > Any ideas? > > > *Per M Knutsen* > University of Oslo > Dept. of Molecular Medicine, Physiology Sect. > PB 1103 Blindern, NO-0317 Oslo > +47.45103762 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Fri Oct 14 15:17:23 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Fri, 14 Oct 2016 15:17:23 +0200 Subject: [FieldTrip] Definition of "mid-sagittal point" Message-ID: I am working my way through the mouse EEG tutorial, here: http://www.fieldtriptoolbox.org/tutorial/mouse_eeg In the "Reading and coregistering..." I load the reference MRI data and start realignment to stereotactic coordinates with ft_volumerealign(). I need to select 3 fiducials: lambda, bregma and the midsagittal point. In this context, where should the "midsagittal point" be put in xyz? *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 ​​ -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Sat Oct 15 09:25:38 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Sat, 15 Oct 2016 16:25:38 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> Message-ID: <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Dear all, I am wondering, was my question unclear, or maybe no one is using Neuralynx data? I can think of ways to avoid these two problems, but I would prefer to find a proper solution if possible. Thanks in advance, Florian Gerard-Mercier > On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier wrote: > > Dear community, > > > My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. > > > I am new to Fieldtrip. > My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). > The recording system is Neuralynx. > > I have encountered 2 problems which I don’t believe are related. > I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. > > 1) Fsample discrepancy between data and header. > When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). > This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). > Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). > This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… > Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. > > 2) 50Hz line noise filtering > The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. > To give an idea: > cfg = []; > cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 > cfg.bsfreq = [49.9 50.1]; > filtDat = ft_preprocessing(cfg, data_lite); > > cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; > ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below > > changes this > > > into that > > > > {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} > > This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: > dat = ft_read_data(dataset_dir); > dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); > changes this > > > into that > > > > Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) > > Of course, I tried to feed that filtered data into the preprocessing pipeline by doing > cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. > data_artifact_rejected = ft_preprocessing(cfg, dat_filt); > But I get the error that dat_filt is not raw or comp data. > > I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. > > So for this point: > - how to make the (recommended) 50Hz post processing work? > - or more simply, how could I feed prefiltered data to ft_preprocessing? > > > > > Thank you very much for your consideration and I look forward to your help. > > All the best, > > > Florian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutsenpm at gmail.com Sat Oct 15 14:18:55 2016 From: knutsenpm at gmail.com (Per Knutsen) Date: Sat, 15 Oct 2016 14:18:55 +0200 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Message-ID: Dear Florian, You are not clear about your actual sample rate: > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. Clearly, you should know your own sampling rate from the Neurolynx acquisition software. It would seem this is the primary thing you need to resolve. Regards, Per *Per M Knutsen* University of Oslo Dept. of Molecular Medicine, Physiology Sect. PB 1103 Blindern, NO-0317 Oslo +47.45103762 On Sat, Oct 15, 2016 at 9:25 AM, Florian Gerard-Mercier < florian at brain.riken.jp> wrote: > Dear all, > > I am wondering, was my question unclear, or maybe no one is using > Neuralynx data? > I can think of ways to avoid these two problems, but I would prefer to > find a proper solution if possible. > > Thanks in advance, > > Florian Gerard-Mercier > > > > On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier < > florian at brain.riken.jp> wrote: > > Dear community, > > > My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory > in Riken BSI, Japan. > > > I am new to Fieldtrip. > My goal is to do a simple analysis of ECoG data in response to electrical > stimulation (all in monkey cortex). To this effect I followed the TMS-EEG > tutorial (since the issues are almost identical). > The recording system is Neuralynx. > > I have encountered 2 problems which I don’t believe are related. > I have basically followed the tutorials to the letter so except if I > mention otherwise, the cfg, etc. are standard. > > *1) Fsample discrepancy between data and header.* > When I load Neuralynx data, I get warnings that the sample rate is > actually half that in the header, and is thus being corrected (note, 16129 > instead of 32258Hz). > This is no problem, until I get the final results where I noticed that my > 50Hz noise is now represented as lasting 40ms for each cycle (= twice > longer than it actually is). > Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as > expected, somehow the data outputted by ft_preprocessing has a field > fsample equal to half that number (8064.5). > This later gives many conflicts such as: if I force data.fsample to be > 16129, I have the correct time axis in the end, but now my trial duration > is only half that which I want… > Any idea on how to solve this issue? I haven’t found any previous ticket > on this Fsample discrepancy issue. > I do not know either how much trust I have to put in that warning and > correction of the sampling rate in the first place. > > *2) 50Hz line noise filtering* > The previous point makes it so that if I filter 50Hz, of course nothing > happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back > to 16129), the attenuation is far too small (whether I use padding or not). > I did look up the similar problems that had been submitted to this list in > the past, but didn’t find any satisfactory fix. > To give an idea: > cfg = []; > cfg.Fsample = 1000; % I downsampled the data in the meantime as said in > the tuto > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; % somehow I have an error that the filtering > doesn’t work every time I try to run it with an order >2 > cfg.bsfreq = [49.9 50.1]; > filtDat = ft_preprocessing(cfg, data_lite); > > cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; > ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both > below > > changes this > > > into that > > > > {Note also the issue with Fsample: here I have a time axis that > corresponds to my 50Hz noise, but the duration of the trial is reduced from > [-0.05, 0.45] by a factor of 2.} > > This is in stark contrast to what happens if I use the bandstop filter > directly on the raw data: > dat = ft_read_data(dataset_dir); > dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); > changes this > > > into that > > > > Which should be perfect for my simple purposes. (Here I just did a simple > Matlab plot, so the x axis numbering is not actual time) > > Of course, I tried to feed that filtered data into the preprocessing > pipeline by doing > cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in > the tutorial, it is to reject the electrical stimulation artifacts. The > problem should not stem from here. > data_artifact_rejected = ft_preprocessing(cfg, dat_filt); > But I get the error that dat_filt is not raw or comp data. > > I have read that it is recommended to do the line noise filtering after > the trial segmentation and stimulation artefact removal, but 1) it doesn’t > seem to work well, 2) I don’t really understand why, given that my > artefacts are nowhere near the 50Hz frequency. > > So for this point: > - how to make the (recommended) 50Hz post processing work? > - or more simply, how could I feed prefiltered data to ft_preprocessing? > > > > > Thank you very much for your consideration and I look forward to your help. > > All the best, > > > Florian > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Sun Oct 16 10:02:12 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Sun, 16 Oct 2016 17:02:12 +0900 Subject: [FieldTrip] Sample discrepancy, and 50Hz line noise filtering In-Reply-To: References: <57A729F0-8FAB-4ED8-94AB-A0C2F70975D5@brain.riken.jp> <1B56CB0A-0214-47B4-A455-F447FF419C06@brain.riken.jp> Message-ID: Dear Per, Thank you for your reply. Well if I don’t know how much trust I can have in it, it is because the sampling frequency inputted on my side (in the settings of the Cheetah DAS) is indeed 32kHz, that was the default. Now it is an old system so maybe it is doing something differently, who knows. However, when I filter the raw data with ft_preprocbandstopfilter I get the desired result for a sampling frequency of 16k. So Fieldtrip is probably right about this, and is self-consistent up till then. The problem for me is that within the data outputted by ft_preprocessing you get two different Fsample values: data.hdr.fs = 16k vs data.fsample = 8k. This sounds strange to me, however you look at it. Also, that 8kHz comes out of nowhere, there is no warning and no rationale for it. So, it seems like an intempestive division by two of the sampling rate that happens during the correction fieldtrip does when it reads the data. Also, the second problem is that for which I am most interested in the answer: whether it is possible - and if so, how - to filter the 50Hz line noise before feeding the data into ft_preprocessing. All the best, Florian > On 15 Oct, 2016, at 9:18 PM, Per Knutsen wrote: > > Dear Florian, > You are not clear about your actual sample rate: > > > I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. > > Clearly, you should know your own sampling rate from the Neurolynx acquisition software. > > It would seem this is the primary thing you need to resolve. > > > Regards, > Per > > > > > Per M Knutsen > University of Oslo > Dept. of Molecular Medicine, Physiology Sect. > PB 1103 Blindern, NO-0317 Oslo > +47.45103762 > > On Sat, Oct 15, 2016 at 9:25 AM, Florian Gerard-Mercier > wrote: > Dear all, > > I am wondering, was my question unclear, or maybe no one is using Neuralynx data? > I can think of ways to avoid these two problems, but I would prefer to find a proper solution if possible. > > Thanks in advance, > > Florian Gerard-Mercier > > > >> On 14 Oct, 2016, at 3:08 PM, Florian Gerard-Mercier > wrote: >> >> Dear community, >> >> >> My name is Florian Gerard-Mercier and I work in Keiji Tanaka’s laboratory in Riken BSI, Japan. >> >> >> I am new to Fieldtrip. >> My goal is to do a simple analysis of ECoG data in response to electrical stimulation (all in monkey cortex). To this effect I followed the TMS-EEG tutorial (since the issues are almost identical). >> The recording system is Neuralynx. >> >> I have encountered 2 problems which I don’t believe are related. >> I have basically followed the tutorials to the letter so except if I mention otherwise, the cfg, etc. are standard. >> >> 1) Fsample discrepancy between data and header. >> When I load Neuralynx data, I get warnings that the sample rate is actually half that in the header, and is thus being corrected (note, 16129 instead of 32258Hz). >> This is no problem, until I get the final results where I noticed that my 50Hz noise is now represented as lasting 40ms for each cycle (= twice longer than it actually is). >> Navigating in the workspace, I noticed that even though cfg.Fs is 16129 as expected, somehow the data outputted by ft_preprocessing has a field fsample equal to half that number (8064.5). >> This later gives many conflicts such as: if I force data.fsample to be 16129, I have the correct time axis in the end, but now my trial duration is only half that which I want… >> Any idea on how to solve this issue? I haven’t found any previous ticket on this Fsample discrepancy issue. >> I do not know either how much trust I have to put in that warning and correction of the sampling rate in the first place. >> >> 2) 50Hz line noise filtering >> The previous point makes it so that if I filter 50Hz, of course nothing happens. But even if I filter 25Hz (or 50Hz with the Fsample corrected back to 16129), the attenuation is far too small (whether I use padding or not). I did look up the similar problems that had been submitted to this list in the past, but didn’t find any satisfactory fix. >> To give an idea: >> cfg = []; >> cfg.Fsample = 1000; % I downsampled the data in the meantime as said in the tuto >> cfg.bsfilter = 'yes'; >> cfg.bsfiltord = 2; % somehow I have an error that the filtering doesn’t work every time I try to run it with an order >2 >> cfg.bsfreq = [49.9 50.1]; >> filtDat = ft_preprocessing(cfg, data_lite); >> >> cfgbrowse = []; cfgbrowse.viewmode = 'butterfly'; >> ft_databrowser(cfgbrowse, dat_lite /// filtDat); % screenshots of both below >> >> changes this >> >> >> into that >> >> >> >> {Note also the issue with Fsample: here I have a time axis that corresponds to my 50Hz noise, but the duration of the trial is reduced from [-0.05, 0.45] by a factor of 2.} >> >> This is in stark contrast to what happens if I use the bandstop filter directly on the raw data: >> dat = ft_read_data(dataset_dir); >> dat_filt = ft_preproc_bandstopfilter(dat, 16129, [49.9 50.1], 2); >> changes this >> >> >> into that >> >> >> >> Which should be perfect for my simple purposes. (Here I just did a simple Matlab plot, so the x axis numbering is not actual time) >> >> Of course, I tried to feed that filtered data into the preprocessing pipeline by doing >> cfg = ft_rejectartifact(cfg_artifact); %cfg_artifact is defined as in the tutorial, it is to reject the electrical stimulation artifacts. The problem should not stem from here. >> data_artifact_rejected = ft_preprocessing(cfg, dat_filt); >> But I get the error that dat_filt is not raw or comp data. >> >> I have read that it is recommended to do the line noise filtering after the trial segmentation and stimulation artefact removal, but 1) it doesn’t seem to work well, 2) I don’t really understand why, given that my artefacts are nowhere near the 50Hz frequency. >> >> So for this point: >> - how to make the (recommended) 50Hz post processing work? >> - or more simply, how could I feed prefiltered data to ft_preprocessing? >> >> >> >> >> Thank you very much for your consideration and I look forward to your help. >> >> All the best, >> >> >> Florian >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Mon Oct 17 13:38:37 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Mon, 17 Oct 2016 17:08:37 +0530 Subject: [FieldTrip] Standard mri dimension and fiducial point Message-ID: Dear FieldTrip community I am using standard mri providded by fieldTrip. The dimension of it is 181 x 217 x 181 [image: Inline image 1] The fiducial points are [image: Inline image 2] It is quite confusing since the coordinate of lpa exceeds the dimension. I would be very thankful if you can help me in this regard. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 6452 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From son.ta.dinh at tum.de Mon Oct 17 17:07:03 2016 From: son.ta.dinh at tum.de (Ta Dinh, Son) Date: Mon, 17 Oct 2016 15:07:03 +0000 Subject: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes In-Reply-To: References: Message-ID: Hi Darren, thanks a lot for the code and the detailed explanation! I just noticed a more basic problem with my analysis so I’m going to have to address that first before trying out your solution. I will let you know how it went as soon as I’ve finished solving the other problem! Thanks again for your help. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Donnerstag, 13. Oktober 2016 14:16 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Son For who have emailed asking for code, it is pasted below. Son, I see what you mean. In that case creating surrogate data is still necessary, since you need a way to generate a confidence interval for each set of N channels. A rough outline of your pipeline would be: (this is all assuming your measure is not simply a function of the covariance matrix) for si = each surrogate dataset (1:1000): 64chanresult = compute result for 64 chan configuration for chani = each N of channels ranging from 64:32 Nchanresult = compute result for 64 chan configuration change(si, chani) = 64chanresult - Nchanresult end end then you can plot your data as a line graph with confidence intervals. I dug out a script I used a while ago, although you might want to check that it works properly (comparing correlation matrices of input/output). The main caveat is that you need to check that you take care of negative frequencies adequately. Here I have used a method of simply cancelling negative frequencies. The other way is to use the complex conjugate, but I found that less stable, perhaps due to numerical imprecision – I’m not sure. Anyway you should verify for yourself that the correlation matrix of your original data is almost exactly the same as your surrogate data (within reason: differences on the order of <1e-5, although this depends on the length of the data). You should detrend and filter before using this function. function data = randomisePhase(data, equalphase) % data = array: [time, channels] % equalphase boolean: [true | false] (do you want the same phase shift in % each channel? default = true) if nargin == 1 equalphase = true; end L = size(data, 1); data = fft(data)*2; data(L/2+1:end, :) = 0; randphase = exp(1i*randn(1,L)*2*pi)'; % uses the same phase for each channel for ii = 1:size(data,2) if equalphase == false randphase = exp(1i*rand(L,1)*2*pi)’; end data(:,ii) = real(ifft(data(:,ii).*randphase)); end Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 13 October 2016 10:25 To: FieldTrip discussion list > Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Darren, Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those? The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative one. Do you have any suggestions for this as well? Thanks a lot again. Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Darren Price Gesendet: Mittwoch, 12. Oktober 2016 19:01 An: fieldtrip at science.ru.nl Betreff: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hi Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is. http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951 . If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will send the code over. P.S if you want your results to be reproducible you should always set your random seed at the start of your script. Good luck. Thanks Darren ------------------------------------------------------- Dr. Darren Price Investigator Scientist and Cam-CAN Data Manager MRC Cognition & Brain Sciences Unit 15 Chaucer Road Cambridge, CB2 7EF England EMAIL: darren.price at mrc-cbu.cam.ac.uk URL: http://www.mrc-cbu.cam.ac.uk/people/darren.price TEL +44 (0)1223 355 294 x202 FAX +44 (0)1223 359 062 MOB +44 (0)7717822431 ------------------------------------------------------- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Ta Dinh, Son Sent: 12 October 2016 16:06 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes Hey Matthew, Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value. The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks are radically reorganized in comatose patients." PNAS. To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison to the control group). I hope this has cleared up the context a bit. Best Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ Von: Nickel, Moritz Gesendet: Mittwoch, 12. Oktober 2016 16:37 An: Ta Dinh, Son > Betreff: Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes ---------- Forwarded message ---------- From: Matt Gerhold > Date: 2016-10-05 13:31 GMT+02:00 Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes To: FieldTrip discussion list > Hi Son, What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this. Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from the actual sample, not the bootstrapped distribution. Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance. That, in a nutshell, is a simple approach; however, there are other ways to go about this. Matthew On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son > wrote: Dear Fieldtrippers, the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes it is computed with. In our case, we use the EEG electrodes as nodes. We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval. When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals. How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain 0 in at least 950 of the 1000 computations then it is robustly different from 0? Any help would be greatly appreciated! Best regards, Son Son Ta Dinh, M.Sc. PhD student in Human Pain Research Klinikum rechts der Isar Technische Universität München Munich, Germany Phone: +49 89 4140 7664 http://www.painlabmunich.de/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Tue Oct 18 08:38:14 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Tue, 18 Oct 2016 12:08:14 +0530 Subject: [FieldTrip] Fiducial points of standard mri Message-ID: Dear FieldTrip community, I want to construct a headmodel from the mri data (standard mri providded by fieldTrip). The dimension of the mri is 181 x 217 X 181The coordinate system of the mri is *spm. *I want to change to coordinate system to *yokogawa*. For that purpose, I have used *ft_volumerealign *function. However, I have to provide at least three fiducial points (nsa, lpa and rpa). I noticed that mri structure itself contains the location of the fiducial points (*mri.hdr.fiducial.mri *and *mri.hdr.fiducial.head*). Th fiducial points are like these [image: Inline image 1] Clearly the lpa coordinate exceeds mri dimension and both nas and rpa coordinates do not indicate these two positions. I am quite confused how I can use the given information about the fiducial points. It would be of great help if anyone could help me in this regards. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 9658 bytes Desc: not available URL: From siddharthtalwar0309 at gmail.com Tue Oct 18 11:55:12 2016 From: siddharthtalwar0309 at gmail.com (siddharth talwar) Date: Tue, 18 Oct 2016 15:25:12 +0530 Subject: [FieldTrip] EEG source localization Message-ID: Hello I am trying to localize an ERP obtained via EEG using fieldtrip. There has been no problems in developing the forward model. The doubt i am encountering is, should the peak of the ERP alone be feeded in for ft_sourceanalysis (i.e. timepoint where the highest amplitude is observed) or the whole interval of the ERP. Having tried both, I am getting different results. Any help would be really appreciated. Thank you. Regards, Siddharth Talwar -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 00:45:15 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Tue, 18 Oct 2016 22:45:15 +0000 Subject: [FieldTrip] error with ft_appenddata In-Reply-To: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> References: <1C8F8DBC-5D34-4ADA-B007-1742C8ABF491@donders.ru.nl> Message-ID: Thanks Jan for your help! I ended up doing the following steps: addpath /path/to/fieldtrip ft_defaults cfg1 = []; cfg1.dataset = '1.fif'; data1 = ft_preprocessing ( cfg1 ); cfg2 = []; cfg2.dataset = '2.fif'; data2 = ft_preprocessing ( cfg2 ); cfg3 = []; cfg3.dataset = '3.fif'; data3 = ft_preprocessing ( cfg3 ); cfg=[]; data = ft_appenddata ( cfg, data1, data2, data3 ) save stitched.mat data -v7.3 Which worked. If you see any other problem that I may have missed, please feel free to educate me. Thanks! Mona On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won’t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif’; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I’m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ‘’;” before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 01:17:15 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Tue, 18 Oct 2016 23:17:15 +0000 Subject: [FieldTrip] Separating MEG/EEG data Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* From tzvetan.popov at uni-konstanz.de Wed Oct 19 07:14:27 2016 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Wed, 19 Oct 2016 07:14:27 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D@uni-konstanz.de> Dear Mona, please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting In the section “segment and read MEG data” there is a call to ft_rejectvisual for example where the different MEG sensors are separated. Further down the tutorial deals also with the EEG part of the analysis. Good luck tzvetan Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From stephen.whitmarsh at gmail.com Wed Oct 19 07:22:17 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 19 Oct 2016 07:22:17 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven’t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 08:02:25 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 11:32:25 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. [image: Inline image 1] [image: Inline image 2] Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens1.jpg Type: image/jpeg Size: 51012 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens2.jpg Type: image/jpeg Size: 58687 bytes Desc: not available URL: From jan.schoffelen at donders.ru.nl Wed Oct 19 09:15:34 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 19 Oct 2016 07:15:34 +0000 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition In-Reply-To: References: Message-ID: Dear Susmita, It looks as if there is a discrepancy between the definition of the coordinate system according to fieldtrip (see ft_headcoordinates in fieldtrip/utilities, where it seems that an ALS axis system is imposed), when specifying cfg.coordsys = ‘yokogawa’, and the coordinate system of the sensors in your data file (which is probably RAS). I could not find any documentation about the ‘yokogawa’-convention (which is probably the reason why the yokogawa-entry in the table on http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is empty). Perhaps one of the Yokogawa-users on this list could chime in to enlighten you, or you could check the system’s documentation to find out what the expected. The easy solution would be to register the mri to an RAS-based coordinate system (e.g. use cfg.coordsys = ’neuromag’ for ft_volumerealign), but I would recommend to get to the bottom of this, and provide a principled solution. Once you have found out about the conventional coordinate system for yokogawa systems, it would be great if you could update the table on (http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined). Note, that if it turns out to be that there is no specific convention (e.g. site-specific ALS or RAS or so) it is worth documenting, too. Good luck Jan-Mathijs J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands On 19 Oct 2016, at 08:02, Susmita Sen > wrote: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nicolas.Zink at uniklinikum-dresden.de Wed Oct 19 11:46:25 2016 From: Nicolas.Zink at uniklinikum-dresden.de (Zink, Nicolas) Date: Wed, 19 Oct 2016 09:46:25 +0000 Subject: [FieldTrip] Performing group analysis with whole brain connectivity Message-ID: <2DDD0A108FC1004DA65570D8BA0A267B5C5899@G06EDBN1.med.tu-dresden.de> Dear Fieldtripper community! I am currently working on a pipeline for EEG data to perform network analysis with Fieldtrip (well documented example in http://www.fieldtriptoolbox.org/tutorial/networkanalysis). So far, I have successfully adapted the MEG example for performing EEG network analysis with single subjects, which seems to produce reliable outcomes. However, I want to perform a group analysis where I want to plot the connectivity of networks from group A with group B. Therefore, a prerequisite is to compute group averages from source data. So my question is: Has anyone performed a connectivity and/or network analysis on a group level? Here is what I have tried out that did not work: · Calculating the group mean of the source data with ft_math after using ft_sourcedescriptives, which caused problems for the connectivity (ft_connectivityanalysis) and subsequent network analysis (ft_networkanalysis) · I also tried ft_sourcegrandaverage, which also is not capable to provide enough (single) trial information for the following connectivity analysis steps. At the end I took preprocessed EEG data for each subject in my groups and put them together in one dataset using ft_appenddata, which produces some plausible data. Using this strategy, I tricked the algorithm, so it operates the data thinking it is a single subject. I am concerned whether this could cause methodological issues. Is there another (easier) way to do this? Can anyone give me some advice which strategy would be best to calculate the group mean and why? Cheers and thanks in advance Nicolas Zink wissenschaftlicher Mitarbeiter Universitätsklinikum Carl Gustav Carus Klinik für Kinder- und Jugendpsychiatrie und -psychotherapie Schubertstraße 42 01307 Dresden Tel. +49 (0)351 458-2303 Universitätsklinikum Carl Gustav Carus an der Technischen Universität Dresden Anstalt des öffentlichen Rechts des Freistaates Sachsen Fetscherstraße 74, 01307 Dresden http://www.uniklinikum-dresden.de Vorstand: Prof. Dr. med. D. M. Albrecht (Sprecher), Wilfried E. B. Winzer Vorsitzender des Aufsichtsrates: Prof. Dr. med. Peter C. Scriba USt.-IDNr.: DE 140 135 217, St.-Nr.: 203 145 03113 -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.sowman at mq.edu.au Wed Oct 19 12:31:56 2016 From: paul.sowman at mq.edu.au (Paul Sowman) Date: Wed, 19 Oct 2016 10:31:56 +0000 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition (Susmita Sen) In-Reply-To: References: Message-ID: Dear Susmita, you may check that your sensor positions extracted from the .con file are in the same co-ordinate frame as the MRI. Using the KIT/Yokogawa system software to co-register the sensor locations and the headshape/mri might be a necessary first step as "Unlike other systems, the Yokogawa system software does not automatically analyze its sensorlocations relative to fiducial coils":- http://www.fieldtriptoolbox.org/getting_started/yokogawa The way we deal with it is to first do coregistration in MEG160 - the KIT/Yokogawa software, and then export the sensor locations which are then in headspace. Then coregistration with the MRI brings sensors and MRI into alignment. This may or may not be your problem. Good luck. Paul Paul F Sowman ARC DECRA Fellow Department of Cognitive Science Level 3, Room 3.824 Australian Hearing Hub 16 University Drive Macquarie University, NSW 2109, Australia T: +61 2 9850 6732 | F: +61 2 9850 6059 W: Profile Page W: MQU Stuttering Research Facebook Page [Macquarie University] CRICOS Provider Number 00002J. Think before you print. Please consider the environment before printing this email. This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of Macquarie University. ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of fieldtrip-request at science.ru.nl Sent: Wednesday, 19 October 2016 6:15 PM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 71, Issue 24 Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit https://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Re: error with ft_appenddata (Wong-Barnum, Mona) 2. Separating MEG/EEG data (Wong-Barnum, Mona) 3. Re: Separating MEG/EEG data (Tzvetan Popov) 4. Re: Separating MEG/EEG data (Stephen Whitmarsh) 5. Orientation of headmodel with respect to sensors poisition (Susmita Sen) 6. Re: Orientation of headmodel with respect to sensors poisition (Schoffelen, J.M. (Jan Mathijs)) ---------------------------------------------------------------------- Message: 1 Date: Tue, 18 Oct 2016 22:45:15 +0000 From: "Wong-Barnum, Mona" To: FieldTrip discussion list Subject: Re: [FieldTrip] error with ft_appenddata Message-ID: Content-Type: text/plain; charset="utf-8" Thanks Jan for your help! I ended up doing the following steps: addpath /path/to/fieldtrip ft_defaults cfg1 = []; cfg1.dataset = '1.fif'; data1 = ft_preprocessing ( cfg1 ); cfg2 = []; cfg2.dataset = '2.fif'; data2 = ft_preprocessing ( cfg2 ); cfg3 = []; cfg3.dataset = '3.fif'; data3 = ft_preprocessing ( cfg3 ); cfg=[]; data = ft_appenddata ( cfg, data1, data2, data3 ) save stitched.mat data -v7.3 Which worked. If you see any other problem that I may have missed, please feel free to educate me. Thanks! Mona On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, If you directly use the output of ft_read_data as input into ft_appenddata, it won?t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?: cfg = []; cfg.dataset = ;somefiffile.fif?; data = ft_preprocessing(cfg); Best Jan-Mathijs On 05 Oct 2016, at 23:06, Wong-Barnum, Mona > wrote: I?m getting a runtime error with ft_appenddata: data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 ) Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input. Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 ) Error in run (line 96) evalin('caller', [script ';']); I have Neuromag data and was able to read the files into data# using ft_read_data. In the documentation, it says cfg can be empty so I declared it by "cfg = ??;? before the ft_appenddata call; is that ok? Any help/suggstions/tips regarding the ft_appenddata error would be appreciated. Thanks! Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 18 Oct 2016 23:17:15 +0000 From: "Wong-Barnum, Mona" To: FieldTrip discussion list Subject: [FieldTrip] Separating MEG/EEG data Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A at mail.ucsd.edu> Content-Type: text/plain; charset="utf-8" I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven?t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* ------------------------------ Message: 3 Date: Wed, 19 Oct 2016 07:14:27 +0200 From: Tzvetan Popov To: FieldTrip discussion list Subject: Re: [FieldTrip] Separating MEG/EEG data Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D at uni-konstanz.de> Content-Type: text/plain; charset=windows-1252 Dear Mona, please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting In the section ?segment and read MEG data? there is a call to ft_rejectvisual for example where the different MEG sensors are separated. Further down the tutorial deals also with the EEG part of the analysis. Good luck tzvetan Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------ Message: 4 Date: Wed, 19 Oct 2016 07:22:17 +0200 From: Stephen Whitmarsh To: FieldTrip discussion list Subject: Re: [FieldTrip] Separating MEG/EEG data Message-ID: Content-Type: text/plain; charset="utf-8" Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 5 Date: Wed, 19 Oct 2016 11:32:25 +0530 From: Susmita Sen To: FieldTrip discussion list Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Content-Type: text/plain; charset="utf-8" Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. [image: Inline image 1] [image: Inline image 2] Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens1.jpg Type: image/jpeg Size: 51012 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Headmodel_sens2.jpg Type: image/jpeg Size: 58687 bytes Desc: not available URL: ------------------------------ Message: 6 Date: Wed, 19 Oct 2016 07:15:34 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" To: FieldTrip discussion list Subject: Re: [FieldTrip] Orientation of headmodel with respect to sensors poisition Message-ID: Content-Type: text/plain; charset="utf-8" Dear Susmita, It looks as if there is a discrepancy between the definition of the coordinate system according to fieldtrip (see ft_headcoordinates in fieldtrip/utilities, where it seems that an ALS axis system is imposed), when specifying cfg.coordsys = ?yokogawa?, and the coordinate system of the sensors in your data file (which is probably RAS). I could not find any documentation about the ?yokogawa?-convention (which is probably the reason why the yokogawa-entry in the table on http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is empty). Perhaps one of the Yokogawa-users on this list could chime in to enlighten you, or you could check the system?s documentation to find out what the expected. The easy solution would be to register the mri to an RAS-based coordinate system (e.g. use cfg.coordsys = ?neuromag? for ft_volumerealign), but I would recommend to get to the bottom of this, and provide a principled solution. Once you have found out about the conventional coordinate system for yokogawa systems, it would be great if you could update the table on (http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined). Note, that if it turns out to be that there is no specific convention (e.g. site-specific ALS or RAS or so) it is worth documenting, too. Good luck Jan-Mathijs J.M.Schoffelen Senior Researcher Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands On 19 Oct 2016, at 08:02, Susmita Sen > wrote: Dear FieldTrip community, I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code. load('standard_mri.mat') cfg = []; cfg.coordsys = 'yokogawa'; cfg.viewresult = 'yes'; cfg.snapshot = 'yes'; cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA cfg.fiducial.zpoint = [ 91 109 107]; [mri_realigned] = ft_volumerealign(cfg,mri); %% SEGMENTATION cfg = []; cfg.output = 'brain'; segmentedmri = ft_volumesegment(cfg, mri_realigned); %% create headmodel cfg = []; cfg.method='singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); %% visualize vol = ft_convert_units(vol,'cm'); grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad figure ft_plot_sens(grad, 'style', '*b'); hold on ft_plot_vol(vol); However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 71, Issue 24 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.oostenveld at donders.ru.nl Wed Oct 19 16:40:08 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 19 Oct 2016 16:40:08 +0200 Subject: [FieldTrip] Special research topic: From raw MEG/EEG to publication Message-ID: <50E1B506-1B93-40CB-B3A1-B9896D14CE1A@donders.ru.nl> Dear colleagues, We would like to invite you to contribute to Frontiers in Neuroscience Special Research Topic "From raw MEG/EEG to publication: how to perform MEG/EEG group analysis with free academic software". The idea is to create a collection of well-described group analyses of EEG and MEG data that can be fully reproduced by anyone and ported by researchers to their own data. Furthermore, as the analyses will be endorsed by peer review, any analysis choices will be citeable in future publications. This will hopefully contribute to wider adoption of good practices by the MEG/EEG research community. For you this is an opportunity to create the ultimate reference for those exciting analyses in your papers that everyone keeps asking you about and increase the impact of the methods you developed on the work of others. Furthermore, by investing some time and effort now into preparing your paper, you can save yourself much more time and efforts in the future by using this resource to train junior researchers in your group and those of your collaborators. We are sorry for the long list of requirements for prospective submissions but these are necessary to ensure that your papers are really useful for other researchers and will remain useful for at least the next decade. The requirements should be straightforward to comply with. Finally, we know that the 'Frontiers' brand has attracted some criticism due to their controversial promotion and marketing techniques. However, at present Frontiers and particularly the section on Brain Imaging Methods seems to be the most convenient platform for this project and they are able to provide adequate technical and administrative support for all its stages. As the topic editors we will do everything possible to ensure professional and transparent review for all submissions. We are looking forward to receiving your contributions. With best wishes, The topic editors: Arnaud Delorme Alexandre Gramfort Vladimir Litvak Sri Nagarajan Robert Oostenveld Francois Tadel ----- Please find more information about Research Topics below, including the publishing fees that apply. You can also visit the homepage we have created on the Frontiers website, which defines the focus of the topic, and where all published articles will appear. http://frontiersin.org/Brain_Imaging_Methods/researchtopics/From_raw_MEG_EEG_to_publication_how_to_perform_MEG_EEG_group_analysis_with_free_academic_software_/5158 Please note the submission deadline for this Research Topic: Oct 01, 2017 ABOUT FRONTIERS RESEARCH TOPICS Founded by scientists in 2007, Frontiers is a community-rooted open-access publisher, driving innovations in peer review, article-level metrics and research networking. The "Frontiers in" journal series hosts 54 journals covering more than 350 academic specialties, with a network of over 200,000 leading researchers worldwide. Frontiers is a registered member of the Open Access Scholarly Publishers Association (http://www.oaspa.org/member/Frontiers ) and was recognized by the ALPSP Award for Innovation in Publishing in 2014. The idea behind a Frontiers Research Topic is to create a comprehensive collection of peer-reviewed articles that address a specific theme of research, as well as a forum for discussion and debate. Contributions can be articles describing original research, methods, hypothesis & theory, opinions, and more. Please see the relevant journal for a full list of accepted article types. Frontiers will also compile an e-book, as soon as all contributing articles are published, that can be used as educational material, be sent to foundations that fund your research, to journalists and press agencies, or to your professional network. E-books are free to read and download. Once published, your articles will be free to access for all readers, indexed in relevant repositories, and as an author in Frontiers, you retain the copyright to your own papers and figures. FRONTIERS PUBLISHING FEES Manuscripts accepted for publication are subject to publishing fees, which vary depending on the article type. Research Topic A type articles receive a discount on publishing fees; please see here for a full fee table, and further relevant FAQs: http://www.frontiersin.org/about/PublishingFees . -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:31:35 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:01:35 +0530 Subject: [FieldTrip] function ft_convert_coordsys Message-ID: Dear fieldtrip community, The function *ft_convert_coordsys *does not consider of converting the *yokogawa *coordinate system to another coordinate system. In line number 95 it includes *{'ctf' 'bti' '4d'}*. Can I include yokogawa coordinate system in the similar fashion? Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:39:38 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:09:38 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition (Susmita Sen) In-Reply-To: References: Message-ID: Thanks a lot. I will try that. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Wed, Oct 19, 2016 at 4:01 PM, Paul Sowman wrote: > Dear Susmita, you may check that your sensor positions extracted from the > .con file are in the same co-ordinate frame as the MRI. Using the > KIT/Yokogawa system software to co-register the sensor locations and the > headshape/mri might be a necessary first step as "Unlike other systems, > the Yokogawa system software does not automatically analyze its > sensorlocations relative to fiducial coils":- http://www.fieldtriptoolbox. > org/getting_started/yokogawa > > The way we deal with it is to first do coregistration in MEG160 - the > KIT/Yokogawa software, and then export the sensor locations which are then > in headspace. Then coregistration with the MRI brings sensors and MRI into > alignment. > > This may or may not be your problem. Good luck. > > > Paul > > > *Paul F Sowman* > > ARC DECRA Fellow > > *Department of Cognitive Science * > > Level 3, Room 3.824 > > Australian Hearing Hub > 16 University Drive > Macquarie University, NSW 2109, Australia > > *T:* +61 2 9850 6732* | **F:* +61 2 9850 6059 > *W: Profile Page > * > *W: MQU > Stuttering Research Facebook Page > * > > > > > [image: Macquarie University] > > CRICOS Provider Number 00002J. Think before you print. > Please consider the environment before printing this email. > > This message is intended for the addressee named and may > contain confidential information. If you are not the intended > recipient, please delete it and notify the sender. Views expressed > in this message are those of the individual sender, and are not > necessarily the views of Macquarie University. > > > > ------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of fieldtrip-request at science.ru.nl < > fieldtrip-request at science.ru.nl> > *Sent:* Wednesday, 19 October 2016 6:15 PM > *To:* fieldtrip at science.ru.nl > *Subject:* fieldtrip Digest, Vol 71, Issue 24 > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: error with ft_appenddata (Wong-Barnum, Mona) > 2. Separating MEG/EEG data (Wong-Barnum, Mona) > 3. Re: Separating MEG/EEG data (Tzvetan Popov) > 4. Re: Separating MEG/EEG data (Stephen Whitmarsh) > 5. Orientation of headmodel with respect to sensors poisition > (Susmita Sen) > 6. Re: Orientation of headmodel with respect to sensors > poisition (Schoffelen, J.M. (Jan Mathijs)) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 18 Oct 2016 22:45:15 +0000 > From: "Wong-Barnum, Mona" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] error with ft_appenddata > Message-ID: > Content-Type: text/plain; charset="utf-8" > > > Thanks Jan for your help! > > I ended up doing the following steps: > > addpath /path/to/fieldtrip > ft_defaults > > cfg1 = []; > cfg1.dataset = '1.fif'; > data1 = ft_preprocessing ( cfg1 ); > > cfg2 = []; > cfg2.dataset = '2.fif'; > data2 = ft_preprocessing ( cfg2 ); > > cfg3 = []; > cfg3.dataset = '3.fif'; > data3 = ft_preprocessing ( cfg3 ); > > cfg=[]; > data = ft_appenddata ( cfg, data1, data2, data3 ) > > save stitched.mat data -v7.3 > > > Which worked. > > If you see any other problem that I may have missed, please feel free to > educate me. > > Thanks! > > Mona > > > On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) < > jan.schoffelen at donders.ru.nl> wrote: > > Hi Mona, > > If you directly use the output of ft_read_data as input into > ft_appenddata, it won?t work. The reason is that ft_appenddata expects in > the input (data#) matlab structures that are generated by ft_preprocessing. > Ft_read_data outputs a numeric data matrix, which is only part of the > ft_preprocessing generated output. Have you something like this yet?: > > cfg = []; > cfg.dataset = ;somefiffile.fif?; > data = ft_preprocessing(cfg); > > Best > > Jan-Mathijs > > On 05 Oct 2016, at 23:06, Wong-Barnum, Mona sdsc.edu>> wrote: > > > I?m getting a runtime error with ft_appenddata: > > data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, > data7, data8, data9, data10, data11, data12, data13, data14 ) > > > Error using ft_checkdata (line 468) This function requires raw+comp or raw > data as input. > > Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, > 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no'); > > Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, > data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, > data14, data15, data16, data17, data18, data19, data20 ) > > Error in run (line 96) evalin('caller', [script ';']); > > I have Neuromag data and was able to read the files into data# using > ft_read_data. > > In the documentation, it says cfg can be empty so I declared it by "cfg = > ??;? before the ft_appenddata call; is that ok? > > Any help/suggstions/tips regarding the ft_appenddata error would be > appreciated. Thanks! > > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "To handle yourself, use your head; > to handle others, use your heart." > > -- Eleanor Roosevelt > ********************************************* > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161018/df4b482a/attachment-0001.html> > > ------------------------------ > > Message: 2 > Date: Tue, 18 Oct 2016 23:17:15 +0000 > From: "Wong-Barnum, Mona" > To: FieldTrip discussion list > Subject: [FieldTrip] Separating MEG/EEG data > Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A at mail.ucsd.edu> > Content-Type: text/plain; charset="utf-8" > > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > thanks, > Mona > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "Strive not to be a success, but > rather to be of value." > --- Albert Einstein > ********************************************* > > > > > ------------------------------ > > Message: 3 > Date: Wed, 19 Oct 2016 07:14:27 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Separating MEG/EEG data > Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D at uni-konstanz.de> > Content-Type: text/plain; charset=windows-1252 > > Dear Mona, > > please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/ > dipolefitting > > In the section ?segment and read MEG data? there is a call to > ft_rejectvisual for example where the different MEG sensors are separated. > Further down the tutorial deals also with the EEG part of the analysis. > Good luck > tzvetan > > > Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona : > > > > > I have Elekta Neuromag .fif files which contains MEG and EEG > data. What steps do I need to do to separate the MEG from EEG and the 3 > different MEG sensor data (magnetometer, 2 gradiometer)? > > > > I have been looking through the FieldTrip documentation but > haven?t found what I need. All help is appreciated. > > > > thanks, > > Mona > > > > > > ********************************************* > > Mona Wong > > Web & iPad Application Developer > > San Diego Supercomputer Center > > > > "Strive not to be a success, but > > rather to be of value." > > --- Albert Einstein > > ********************************************* > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------------ > > Message: 4 > Date: Wed, 19 Oct 2016 07:22:17 +0200 > From: Stephen Whitmarsh > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Separating MEG/EEG data > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Mona, > > To add to Tzvetan: > > - You can in many FieldTrip functions specify on which channels you want to > work (cfg.channel), e.g. in ft_preprocessing. > - You can also split the data later using ft_selectdata, e.g.: > > cfg = [] > cfg.channel = 'MEG'; > data_MEG = ft_selectdata(cfg,data_combined); > > cfg = [] > cfg.channel = 'EEG'; > data_EEG = ft_selectdata(cfg,data_combined); > > - To selecting magnetometers or gradiometers you can use: > cfg.channel = 'MEG*1' > cfg.channel = {'MEG*2', 'MEG*3'} > > Cheers, > Stephen > > > On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > > > > > I have Elekta Neuromag .fif files which contains MEG and EEG > > data. What steps do I need to do to separate the MEG from EEG and the 3 > > different MEG sensor data (magnetometer, 2 gradiometer)? > > > > I have been looking through the FieldTrip documentation but > > haven?t found what I need. All help is appreciated. > > > > thanks, > > Mona > > > > > > ********************************************* > > Mona Wong > > Web & iPad Application Developer > > San Diego Supercomputer Center > > > > "Strive not to be a success, but > > rather to be of value." > > --- Albert Einstein > > ********************************************* > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/aebcfda4/attachment-0001.html> > > ------------------------------ > > Message: 5 > Date: Wed, 19 Oct 2016 11:32:25 +0530 > From: Susmita Sen > To: FieldTrip discussion list > Subject: [FieldTrip] Orientation of headmodel with respect to sensors > poisition > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I am > working with is recorded using yokogawa system. I have used the following > code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > [image: Inline image 1] > > [image: Inline image 2] > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/da553626/attachment-0001.html> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Headmodel_sens1.jpg > Type: image/jpeg > Size: 51012 bytes > Desc: not available > URL: attachments/20161019/da553626/attachment-0002.jpg> > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Headmodel_sens2.jpg > Type: image/jpeg > Size: 58687 bytes > Desc: not available > URL: attachments/20161019/da553626/attachment-0003.jpg> > > ------------------------------ > > Message: 6 > Date: Wed, 19 Oct 2016 07:15:34 +0000 > From: "Schoffelen, J.M. (Jan Mathijs)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Orientation of headmodel with respect to > sensors poisition > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Dear Susmita, > > It looks as if there is a discrepancy between the definition of the > coordinate system according to fieldtrip (see ft_headcoordinates in > fieldtrip/utilities, where it seems that an ALS axis system is imposed), > when specifying cfg.coordsys = ?yokogawa?, and the coordinate system of the > sensors in your data file (which is probably RAS). I could not find any > documentation about the ?yokogawa?-convention (which is probably the reason > why the yokogawa-entry in the table on http://www.fieldtriptoolbox. > org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is > empty). Perhaps one of the Yokogawa-users on this list could chime in to > enlighten you, or you could check the system?s documentation to find out > what the expected. > > The easy solution would be to register the mri to an RAS-based coordinate > system (e.g. use cfg.coordsys = ?neuromag? for ft_volumerealign), but I > would recommend to get to the bottom of this, and provide a principled > solution. Once you have found out about the conventional coordinate system > for yokogawa systems, it would be great if you could update the table on ( > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined). Note, that if it turns out to > be that there is no specific convention (e.g. site-specific ALS or RAS or > so) it is worth documenting, too. > > Good luck > > Jan-Mathijs > > J.M.Schoffelen > Senior Researcher > Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands > > > > On 19 Oct 2016, at 08:02, Susmita Sen susmitasen.ece at gmail.com>> wrote: > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I > am working with is recorded using yokogawa system. I have used the > following code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > > > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20161019/e84dd46a/attachment.html> > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 71, Issue 24 > ***************************************** > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From susmitasen.ece at gmail.com Wed Oct 19 17:40:12 2016 From: susmitasen.ece at gmail.com (Susmita Sen) Date: Wed, 19 Oct 2016 21:10:12 +0530 Subject: [FieldTrip] Orientation of headmodel with respect to sensors poisition In-Reply-To: References: Message-ID: Thanks a lot. Thanks and Regards, Susmita Sen Research Scholar Audio and Bio Signal Processing Lab. E & ECE Dept. IIT Kharagpur On Wed, Oct 19, 2016 at 12:45 PM, Schoffelen, J.M. (Jan Mathijs) < jan.schoffelen at donders.ru.nl> wrote: > Dear Susmita, > > It looks as if there is a discrepancy between the definition of the > coordinate system according to fieldtrip (see ft_headcoordinates in > fieldtrip/utilities, where it seems that an ALS axis system is imposed), > when specifying cfg.coordsys = ‘yokogawa’, and the coordinate system of the > sensors in your data file (which is probably RAS). I could not find any > documentation about the ‘yokogawa’-convention (which is probably the reason > why the yokogawa-entry in the table on http://www. > fieldtriptoolbox.org/faq/how_are_the_different_head_and_ > mri_coordinate_systems_defined is empty). Perhaps one of the > Yokogawa-users on this list could chime in to enlighten you, or you could > check the system’s documentation to find out what the expected. > > The easy solution would be to register the mri to an RAS-based coordinate > system (e.g. use cfg.coordsys = ’neuromag’ for ft_volumerealign), but I > would recommend to get to the bottom of this, and provide a principled > solution. Once you have found out about the conventional coordinate system > for yokogawa systems, it would be great if you could update the table on ( > http://www.fieldtriptoolbox.org/faq/how_are_the_different_ > head_and_mri_coordinate_systems_defined). Note, that if it turns out to > be that there is no specific convention (e.g. site-specific ALS or RAS or > so) it is worth documenting, too. > > Good luck > > Jan-Mathijs > > J.M.Schoffelen > Senior Researcher > Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands > > > > > On 19 Oct 2016, at 08:02, Susmita Sen wrote: > > Dear FieldTrip community, > > I am constructing headmodel using standard mri data. The meg data that I > am working with is recorded using yokogawa system. I have used the > following code. > > > load('standard_mri.mat') > > cfg = []; > cfg.coordsys = 'yokogawa'; > cfg.viewresult = 'yes'; > cfg.snapshot = 'yes'; > cfg.fiducial.nas = mri.hdr.fiducial.mri.nas; %position of nasion > cfg.fiducial.lpa = mri.hdr.fiducial.mri.lpa; %position of LPA > cfg.fiducial.rpa = mri.hdr.fiducial.mri.rpa; %position of RPA > cfg.fiducial.zpoint = [ 91 109 107]; > [mri_realigned] = ft_volumerealign(cfg,mri); > > %% SEGMENTATION > > cfg = []; > cfg.output = 'brain'; > segmentedmri = ft_volumesegment(cfg, mri_realigned); > > %% create headmodel > > cfg = []; > cfg.method='singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > %% visualize > > vol = ft_convert_units(vol,'cm'); > grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load > grad > > figure > ft_plot_sens(grad, 'style', '*b'); > > hold on > ft_plot_vol(vol); > > However, I am facing a problem when I plotting headmodel with the sensors. > I noticed that the orienations of headmodel and sensors are not aligned. I > am attaching the figure with this mail. I would be very greatful if any > could kindly give me suggestions how to align these two. > > > > > > > Thanks and Regards, > Susmita Sen > Research Scholar > Audio and Bio Signal Processing Lab. > E & ECE Dept. > IIT Kharagpur > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 18:42:58 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 16:42:58 +0000 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Thanks Stephen, your code was very helpful (: My data has 2 gradiometers but it appears that there is only a single megplanar channel type. Is there a way to further separate the 2 gradiometers? Mona On Oct 18, 2016, at 10:22 PM, Stephen Whitmarsh > wrote: Hi Mona, To add to Tzvetan: - You can in many FieldTrip functions specify on which channels you want to work (cfg.channel), e.g. in ft_preprocessing. - You can also split the data later using ft_selectdata, e.g.: cfg = [] cfg.channel = 'MEG'; data_MEG = ft_selectdata(cfg,data_combined); cfg = [] cfg.channel = 'EEG'; data_EEG = ft_selectdata(cfg,data_combined); - To selecting magnetometers or gradiometers you can use: cfg.channel = 'MEG*1' cfg.channel = {'MEG*2', 'MEG*3'} Cheers, Stephen On 19 October 2016 at 01:17, Wong-Barnum, Mona > wrote: I have Elekta Neuromag .fif files which contains MEG and EEG data. What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)? I have been looking through the FieldTrip documentation but haven’t found what I need. All help is appreciated. thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Strive not to be a success, but rather to be of value." --- Albert Einstein ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "To handle yourself, use your head; to handle others, use your heart." -- Eleanor Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 19:31:44 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 17:31:44 +0000 Subject: [FieldTrip] how to save continuous data Message-ID: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> Hi: I have Neuromag data broken out in 14 files for a single subject. I’ve read each file in using ft_preprocessing() and then combined them using ft_appenddata(). Is there a way I can save this combined data to a file so that on my next session of running FieldTrip, I can read the combined data back without having to repeat the above steps? I have enough memory so that’s not a problem. I’ve tried saving the combined data using matlab save function but was unable to read it back using ft_preprocessing() so that I can do further processing. Is there a trick to save continuous/combined data? thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 20:29:10 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 18:29:10 +0000 Subject: [FieldTrip] how to save continuous data In-Reply-To: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> References: <7AF68915-3F36-45FD-9ADB-E4FE7D9737BB@mail.ucsd.edu> Message-ID: <288CE519-2CB9-4398-B441-A5DF33010604@mail.ucsd.edu> I think I figured out my answer…I need to use matlab’s importdata() to read in my combined data file. Mona On Oct 19, 2016, at 10:31 AM, Wong-Barnum, Mona > wrote: Hi: I have Neuromag data broken out in 14 files for a single subject. I’ve read each file in using ft_preprocessing() and then combined them using ft_appenddata(). Is there a way I can save this combined data to a file so that on my next session of running FieldTrip, I can read the combined data back without having to repeat the above steps? I have enough memory so that’s not a problem. I’ve tried saving the combined data using matlab save function but was unable to read it back using ft_preprocessing() so that I can do further processing. Is there a trick to save continuous/combined data? thanks, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Believe you can and you are half way there." -- Theodore Roosevelt ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Wed Oct 19 21:33:12 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 19:33:12 +0000 Subject: [FieldTrip] ft_appenddata() and trials Message-ID: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> Hi: I have 14 Neuromag .fif files recorded for a single subject; each file contains about 20 minutes of recording for a total of about 4.6 hours of recording. I’d like to concatenate the data together. I used ft_appenddata() but ti seems to have created 14 trials. How can I get all the data to go into a single trial? Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "The two most important days in your life are the day you are born and the day you find out why." -- Mark Twain ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Wed Oct 19 21:48:34 2016 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 19 Oct 2016 21:48:34 +0200 Subject: [FieldTrip] Separating MEG/EEG data In-Reply-To: References: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A@mail.ucsd.edu> Message-ID: Hi Mona, I'm not sure I understand your question but ill give it a go: In Elekta, labels of magnetometers end in 1, (e.g. MEG10*1*), gradiometers in (e.g. MEG22)2 and 3. The latter are the orthogonal 8-shaped coils that are often combined, e.g. using ft_combineplanar. This will reduce the 204 gradiometers in 102 combined gradiometer, that FT assigns labels to, showing you which sensors are combined, e.g. "MEG102+MEG103". If you use ft_selectdata, or a cfg.channel configuration field, you can use * as I mentioned before, or ? and other wildcards such as MEG, and MAG, to select sensortypes. Hope this helps, Stephen On 19 October 2016 at 18:42, Wong-Barnum, Mona wrote: > > Thanks Stephen, your code was very helpful (: > > My data has 2 gradiometers but it appears that there is only a single > megplanar channel type. Is there a way to further separate the 2 > gradiometers? > > Mona > > > On Oct 18, 2016, at 10:22 PM, Stephen Whitmarsh < > stephen.whitmarsh at gmail.com> wrote: > > Hi Mona, > > To add to Tzvetan: > > - You can in many FieldTrip functions specify on which channels you want > to work (cfg.channel), e.g. in ft_preprocessing. > - You can also split the data later using ft_selectdata, e.g.: > > cfg = [] > cfg.channel = 'MEG'; > data_MEG = ft_selectdata(cfg,data_combined); > > cfg = [] > cfg.channel = 'EEG'; > data_EEG = ft_selectdata(cfg,data_combined); > > - To selecting magnetometers or gradiometers you can use: > cfg.channel = 'MEG*1' > cfg.channel = {'MEG*2', 'MEG*3'} > > Cheers, > Stephen > > > On 19 October 2016 at 01:17, Wong-Barnum, Mona wrote: > >> >> I have Elekta Neuromag .fif files which contains MEG and EEG >> data. What steps do I need to do to separate the MEG from EEG and the 3 >> different MEG sensor data (magnetometer, 2 gradiometer)? >> >> I have been looking through the FieldTrip documentation but >> haven’t found what I need. All help is appreciated. >> >> thanks, >> Mona >> >> >> ********************************************* >> Mona Wong >> Web & iPad Application Developer >> San Diego Supercomputer Center >> >> "Strive not to be a success, but >> rather to be of value." >> --- Albert Einstein >> ********************************************* >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > ********************************************* > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > "To handle yourself, use your head; > to handle others, use your heart." > > -- Eleanor Roosevelt > ********************************************* > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Oct 19 22:33:04 2016 From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 19 Oct 2016 20:33:04 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> Message-ID: <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> Hi Mona, I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); data.trial = trial;data.time = time; Best, Jan-Mathijs On 19 Oct 2016, at 21:33, Wong-Barnum, Mona > wrote: Hi: I have 14 Neuromag .fif files recorded for a single subject; each file contains about 20 minutes of recording for a total of about 4.6 hours of recording. I’d like to concatenate the data together. I used ft_appenddata() but ti seems to have created 14 trials. How can I get all the data to go into a single trial? Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "The two most important days in your life are the day you are born and the day you find out why." -- Mark Twain ********************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Thu Oct 20 00:44:35 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Wed, 19 Oct 2016 22:44:35 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> Message-ID: <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Hi Jan-Mathijs: Yes, these should be continuous time recordings, just broken up and saved into separate files, each file represents about 20 minutes of recording so the end of one file should be the beginning of the next file. I tried your suggestion but it seems the cat didn’t work. Do you spot any problem with my steps: >> addpath /path/to/fieldtrip >> ft_defaults >> data = importdata ( ‘appended.mat' ) data = label: {389x1 cell} trial: {1x14 cell} time: {1x14 cell} fsample: 603.1072 cfg: [1x1 struct] >> whos Name Size Bytes Class Attributes data 1x1 29058186864 struct >> trial{1} = cat(2,data.trial{:}); >> time{1} = cat(2,data.time{:}); >> whos Name Size Bytes Class Attributes data 1x1 29058186864 struct time 1x1 74505712 cell trial 1x1 28982678512 cell >> data.trial = trial; >> data.time = time; >> data data = label: {389x1 cell} trial: {[389x9313200 double]} time: {[1x9313200 double]} fsample: 603.1072 cfg: [1x1 struct] >> save continous.mat data -v7.3 Then later, I used ft_databrowser() to view the data imported from the continuous.mat file and it says 15445 segments with time from 0 to 0.998164 seconds. I’m not sure what it means by segment but the time should be over 4 hours. Do you know what I’m doing wrong? Mona On Oct 19, 2016, at 1:33 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: Hi Mona, I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); data.trial = trial;data.time = time; Best, Jan-Mathijs ************************************************ Mona Wong Web & iPad Application Developer San Diego Supercomputer Center You are the light you wish to see. ************************************************ -------------- next part -------------- An HTML attachment was scrubbed... URL: From aborna at sandia.gov Thu Oct 20 02:35:44 2016 From: aborna at sandia.gov (Borna, Amir) Date: Thu, 20 Oct 2016 00:35:44 +0000 Subject: [FieldTrip] magnetic dipoles Message-ID: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> Hi, I have a question regarding source localization of head coils; it seems the fieldtrip's tutorials are directed toward localizing "current dipoles" as opposed to "magnetic dipoles", e.g. head localization coils. So how should I setup the configuration (headmodel, vol, etc.) for source localization (and simulation) of magnetic dipoles? Thank you for your help in advance. Best, Borna. SNL -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 20 06:02:32 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 20 Oct 2016 04:02:32 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 70, Issue 25 In-Reply-To: References: Message-ID: From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From two.frank at gmail.com Thu Oct 20 07:27:36 2016 From: two.frank at gmail.com (Frank Hsieh) Date: Thu, 20 Oct 2016 05:27:36 +0000 Subject: [FieldTrip] Postdoc Position at the Dynamic Memory Lab at UC Davis Message-ID: Postdoctoral Researcher: The Dynamic Memory Lab (C. Ranganath, PI) at the University of California, Davis, now has an open position for a funded postdoctoral researcher. We currently are running studies that involve multimodal imaging (EEG, fMRI, ECoG, Diffusion Imaging, MR Spectroscopy) as well as concurrent transcranial electrical stimulation (tDCS/tACS). The lab is located at the UC Davis Center for Neuroscience, which houses a 3T Siemens Skyra MRI scanner, an MR-compatible tDCS/tACS system, and EEG systems both at the lab and in-scanner. Start date is flexible and can be delayed to accommodate defense and publication of thesis work. In addition to lab funding, candidates might be eligible for funding from the NIA T32 grant on the Neuroscience of Cognitive Aging (collaboration with Charles DeCarli) or from a joint R01 to examine memory in schizophrenia (collaboration with J. Daniel Ragland and Cam Carter). Qualifications: Candidates must have completed a Ph.D. in Psychology, Neuroscience, or a related field and have first-authored publications that reflect familiarity with neuroscience techniques (e.g., EEG, fMRI, tDCS/tACS, TMS, etc.). For this position, successful candidates will need to have strong analytical skills in multivariate analysis of fMRI, EEG, or other neurophysiological data. Strong preference will be given to candidates with research background in learning and memory and expertise in probabalistic tractography, model-based analysis, representational similarity analysis, or pattern classification of fMRI data, time-frequency analysis, cortical source estimation and/or multivariate analysis of EEG or MEG in humans, or corresponding LFP analyses in animal models. Beyond experience, we are looking for someone who is resourceful, collaborative, resilient, productive, honest, and enthusiastic about mentoring junior lab members. Prof. Charan Ranganath will go through applicant information starting Nov. 1st, 2016, until position is filled. Interested individuals please send your CV and names of 3 references to DML Lab Manager Nichole Bouffard (nrbouffard at ucdavis.edu) -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.hauswald at me.com Thu Oct 20 09:30:25 2016 From: anne.hauswald at me.com (anne Hauswald) Date: Thu, 20 Oct 2016 09:30:25 +0200 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: Hi Mona, the default setting in ft_databrowser for continuous data is to show blocksizes of 1 sec. Given your sampling rate, I guess the 0.998164 seconds is the closest time point to that. Then if, you have 15445 segments, each approx. 1 second long, you end up with more than 4 hours of data. However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Hope this helps a bit Anne > Am 20.10.2016 um 00:44 schrieb Wong-Barnum, Mona : > > > Hi Jan-Mathijs: > > Yes, these should be continuous time recordings, just broken up and saved into separate files, each file represents about 20 minutes of recording so the end of one file should be the beginning of the next file. > > I tried your suggestion but it seems the cat didn’t work. Do you spot any problem with my steps: > > >> addpath /path/to/fieldtrip > >> ft_defaults > >> data = importdata ( ‘appended.mat' ) > > data = > > label: {389x1 cell} > trial: {1x14 cell} > time: {1x14 cell} > fsample: 603.1072 > cfg: [1x1 struct] > > >> whos > Name Size Bytes Class Attributes > > data 1x1 29058186864 struct > > >> trial{1} = cat(2,data.trial{:}); > >> time{1} = cat(2,data.time{:}); > >> whos > Name Size Bytes Class Attributes > > data 1x1 29058186864 struct > time 1x1 74505712 cell > trial 1x1 28982678512 cell > > >> data.trial = trial; > >> data.time = time; > >> data > > data = > > label: {389x1 cell} > trial: {[389x9313200 double]} > time: {[1x9313200 double]} > fsample: 603.1072 > cfg: [1x1 struct] > > >> save continous.mat data -v7.3 > > Then later, I used ft_databrowser() to view the data imported from the continuous.mat file and it says 15445 segments with time from 0 to 0.998164 seconds. I’m not sure what it means by segment but the time should be over 4 hours. > > Do you know what I’m doing wrong? > > Mona > > >> On Oct 19, 2016, at 1:33 PM, Schoffelen, J.M. (Jan Mathijs) > wrote: >> >> Hi Mona, >> I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next? >> >> If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:}); >> data.trial = trial;data.time = time; >> >> Best, >> Jan-Mathijs > > ************************************************ > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > You are the light you wish to see. > ************************************************ > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Thu Oct 20 10:15:54 2016 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 20 Oct 2016 08:15:54 +0000 Subject: [FieldTrip] =?windows-1252?q?PhD-Position_in_Multisensory_Integra?= =?windows-1252?q?tion_=28Charit=E9_Berlin=29?= Message-ID: The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A project grant of the Deutsche Forschungsgemeinschaft (DFG), entitled “The influence of local cortical oscillations and distributed connectivity networks on multisensory perception“ will fund the currently open position (duration 36 months). The main objective of this project is to examine neural markers of multisensory perception and to test the dynamic interplay of synchronized neural populationsunderlying multisensory processes. The studies within this program include EEG, ECoG and behavioral experiments. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as basic German language skills for interacting with the study participants are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until October 31, 2016, electronically to: julian.keil at charite.de ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://multisensorymind.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From robert.oostenveld at donders.ru.nl Thu Oct 20 10:48:06 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Thu, 20 Oct 2016 10:48:06 +0200 Subject: [FieldTrip] magnetic dipoles In-Reply-To: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> References: <9fd4bf010d4a4961a01ce5ed0a580274@ES06AMSNLNT.srn.sandia.gov> Message-ID: <417B9C48-4EB1-4565-B97A-C28C74A72C56@donders.ru.nl> Hi Borna, For MEG the FieldTrip forward and inverse functionality will make use of a magnetic dipole if you specify the headmodel (or “vol” structure) as headmodel = []; headmodel.type = ‘infinite’; Important is that the sensor array should be detected as a “meg” sensor array, i.e. it should have coilpos, coilori and tra fields. See http://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described for that. If the sensors describe eeg electrodes, the forward computation with the same headmodel specification will be for an electric dipole in an infinite conductive medium. Hope this helps, Robert PS if would actually be good to document the magnetic dipole on http://www.fieldtriptoolbox.org/faq/what_kind_of_volume_conduction_models_are_implemented Feel free to edit that page and add the information from this mail. > On 20 Oct 2016, at 02:35, Borna, Amir wrote: > > Hi, > > I have a question regarding source localization of head coils; it seems the fieldtrip’s tutorials are directed toward localizing “current dipoles” as opposed to “magnetic dipoles”, e.g. head localization coils. So how should I setup the configuration (headmodel, vol, etc.) for source localization (and simulation) of magnetic dipoles? Thank you for your help in advance. > > > > Best, > > Borna. > > SNL > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 20 12:08:31 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 20 Oct 2016 10:08:31 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models References: Message-ID: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Thu Oct 20 12:49:00 2016 From: alik.widge at gmail.com (Alik Widge) Date: Thu, 20 Oct 2016 06:49:00 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) wrote: > Note: this is the second time I post this reply, and the reason is that I > forgot to add an appropriate Subject (for findability) to my email (shame > on me…(-;) > > *From: *Elisabeth May > *Subject: **[FieldTrip] Question about cluster-based permutation tests on > linear mixed models* > *Date: *27 September 2016 at 14:46:55 GMT+2 > *To: * > *Reply-To: *FieldTrip discussion list > > > Dear FieldTripers, > > I have a question about the potential use of cluster-based permutation > tests for results obtained using linear mixed models. > > We are working with data from a 10 min EEG experiment on source level with > the aim to quantify the relationship of brain activity in different > frequency bands with continous perceptual ratings across 20 subjects in > different experimental conditions. Thus, we have 10 min time courses of > brain activity and ratings for each voxel for different conditions and want > to test a) if there are significant relationships in the single conditions > and b) if these relationships differ between two conditions. To this end, I > have calculated linear mixed models in R using the lme4 toolbox. For both > the single condition relationships and the condition contrasts, they result > in a single t-value (and a corresponding p-value), which is based on > information on both the single subject and the group level (i.e. we perform > a multi-level analysis). However, with more than 2000 voxels, we have a lot > of t-values and are wondering if there is a way to apply cluster-based > tests to correct for multiple comparisons. > > The main problem I see is that I only have one multilevel t-value for the > effect across all subjects, i.e. I don't have single subjects values, which > I could then e.g. randomize between conditions as normally done in > cluster-based permutation tests. (Or rather, I would be able to extract > single subject values but would then loose the advantage of the multi-level > analysis.) > > I found an old thread in the mailinglist archive where it was suggested to > flip the signs of the t-statistic for cluster-level correction ( > https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). > I understand that, in our case, I would do this randomly for all voxels in > each randomization and then build spatial clusters on the resulting (partly > flipped) t-values. However, I am not sure if that is a valid approach based > on the null hypothesis that there are no significant relations in my single > conditions (a) or no significant relationship differences in my condition > contrasts (b). > > For the condition contrasts, I would be able to permute the condition > labels as normally done in cluster-based permutation tests,I think, but > would then have to recalculate the linear mixed models for all voxels in > every permutation. This would result in a very high computational load. > > Does anyone have any experience with this kind of analysis? Would the > flipping of t-values be a valid approach (and if yes, is there anything to > keep in mind in particular)? Can you think of other ways to combine linear > mixed models with a multiple comparison correction on the cluster level? > > > Hi Elisabeth, > > I’m not an expert on linear mixed modelling, at least not with respect to > the different ways in which they can be used to deal with correlated > observations (typically, time series). However, from a theoretical point of > view, I do not see how these models could be combined with > permutation-based inference; they are just different statistical > frameworks. However, it IS possible to answer your questions ("we have 10 > min time courses of brain activity and ratings for each voxel for different > conditions and wan to test a) if there are significant relationships in the > single conditions and b) if these relationships differ between two > conditions.”) within the framework of cluster-based permutation tests. > Question b) is the most straightforward because it amounts to a > cluster-based permutation test using the depsamplesT statfun applied to the > regression coefficients in each of the two conditions. Answering question > a) requires that you bin your ratings in a number of categories, calculate > the trial-averaged EEG data for each of the categoreies, and test the > difference between them using a cluster-based permutation test using the > depsamplesregrT statfun. Both of these approaches have been described > previously on this discussion list, and for the depsamplesregrT statfun > (your question a), it was Vladimir Litvak who used it first (actually, I > implemented it for him). The approach for question b) is actually a variant > on the general approach for testing interactions using cluster-based > permutation tests. > > Have a look here: > http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_ > correlations_between_neuronal_data_and_quantitative_ > stimulus_and_behavioural_variables > and > http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_ > interaction_effect_using_cluster-based_permutation_tests > > These tutorials provide all the necessary concepts, although they do not > answer your question in a recipe-like fashion. > > best, > Eric Maris > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Thu Oct 20 19:39:59 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 20 Oct 2016 17:39:59 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: <96BB27E4-C1B2-4D33-BD20-5076D7A0E31C@mail.ucsd.edu> > However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Ah that might be the case, I will check. Thank you Anne! cheers, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Nothing is impossible, the word itself says 'I'm possible'!" --- Audrey Hepburn ********************************************* From mona at sdsc.edu Thu Oct 20 19:50:08 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 20 Oct 2016 17:50:08 +0000 Subject: [FieldTrip] ft_appenddata() and trials In-Reply-To: References: <356740F6-2FA3-4C95-BE43-AA82E7EBD245@mail.ucsd.edu> <9AF86278-7939-401E-A9A7-9C6B3B8B5369@donders.ru.nl> <8BF1FA8F-22E8-48C5-93FE-4B6D7D4385FC@mail.ucsd.edu> Message-ID: <96BB27E4-C1B2-4D33-BD20-5076D7A0E31C@mail.ucsd.edu> > However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0. Ah that might be the case, I will check. Thank you Anne! cheers, Mona ********************************************* Mona Wong Web & iPad Application Developer San Diego Supercomputer Center "Nothing is impossible, the word itself says 'I'm possible'!" --- Audrey Hepburn ********************************************* From stan.vanpelt at donders.ru.nl Fri Oct 21 13:49:43 2016 From: stan.vanpelt at donders.ru.nl (Pelt, S. van (Stan)) Date: Fri, 21 Oct 2016 11:49:43 +0000 Subject: [FieldTrip] CTF MEG issue In-Reply-To: References: Message-ID: <7CCA2706D7A4DA45931A892DF3C2894C5215EA5B@exprd03.hosting.ru.nl> Dear José, I’ve forwarded your email to the FieldTrip email discussion list, since this is a more appropriate forum for a question like this (more experts=more potential answers). 10-50pT is way too strong to be a brain signal I’m afraid. Typical range would be 10-100 fT for CTF data, so your signal is more than 2 orders of magnitude higher. I think it is most likely noise coming from outside the scanner (room). Regarding the use of ft_databrowser, this is nicely decribed in the following tutorial: http://www.fieldtriptoolbox.org/tutorial/visual_artifact_rejection#use_ft_databrowser_to_mark_the_artifacts_manually Scaling will be done automatically if you only plot the MEG-channels. So you do not need to specify cfg.megscale (or cfg.eogscale, for that matter). Best, Stan From: joseluisblues at gmail.com [mailto:joseluisblues at gmail.com] On Behalf Of José Luis Sent: vrijdag 21 oktober 2016 12:30 To: Pelt, S. van (Stan) Subject: CTF MEG issue Dear Stan Van Pelt, I found your post in the Fieldtrip list and I thought you could help with an issue I have with my CTF MEG data, I have analysed this data for an ERF study with a home-made software a few years ago. Now I am re-analysing this data to investigate oscillatory activity, I usually never pay attention to the range of my raw data since I will always end up with averages values of ERFs around the typical 10-30 fT range. However, looking now to my raw data I find it on the range of 10000 - 50000 fT. My guess is that this should be Ok, since ERFs are always smaller in size relative to the raw data. I would like to check this with someone that has CTF MEG data. Second, since is not in the typical range I have the issue of visualizing my data with ft_databrowser. So the typical setting with: cfg.alim = 1e-12; cfg.megscale = 1; cfg.eogscale = 5e-8; doesn't work for me, I would like to know how do you manage to visualize your data, Many thanks in advance, By the way, the link to your paper "Higher-level processes in the formation and application of associations during action understanding" is not working properly, Jose -- José Luis ULLOA FULGERI, PhD +32477429007 +32492646477 https://sites.google.com/site/joseluisulloafulgeri/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisabethsusanne.may at gmail.com Fri Oct 21 19:38:51 2016 From: elisabethsusanne.may at gmail.com (Elisabeth May) Date: Fri, 21 Oct 2016 19:38:51 +0200 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge : > Eric, I don't think I understand why you would say "I do not see how these > models could be combined with permutation-based inference; they are just > different statistical frameworks". As you somewhat hint, the (G)LMM is a > regression, and the beta coefficient for the independent-variable of > interest at each voxel/vertex/sensor x timepoint can be interpreted as "how > much does the independent variable explain the brain activity?" In that > framework, it seems to me that one could do the following: > > for n=1:1000 > 1) Permute the condition labels (within subjects) of the individual > trials > 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and > corresponding t-map > 3) Threshold and construct cluster mass statistic as usual > end > 4) Identify cluster in the original (unpermuted) analysis and report > cluster p-value > > > Now, the main thing that has come up when we've tried to do this is that > re-fitting a (voxel x time) GLM 1000 times by the standard iterative > maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine > it would require rewriting at least a statfun, maybe other pieces of the > code. (We had an idea that, since the betas likely should vary smoothly > over time and space, one could use the output of one GLM as the seed to the > next, which would speed up convergence.) So it still does not seem like a > good idea, but based on the above, is there actually a *theoretical* reason > it wouldn't work? > > > Alik Widge, MD, PhD > Director, Translational NeuroEngineering Laboratory > Division of Neurotherapeutics, Massachusetts General Hospital > Assistant Professor of Psychiatry, Harvard Medical School > Clinical Fellow, Picower Institute for Learning & Memory (MIT) > awidge at partners.org > http://scholar.harvard.edu/awidge/ > 617-643-2580 > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < > e.maris at donders.ru.nl> wrote: > >> Note: this is the second time I post this reply, and the reason is that I >> forgot to add an appropriate Subject (for findability) to my email (shame >> on me…(-;) >> >> *From: *Elisabeth May >> *Subject: **[FieldTrip] Question about cluster-based permutation tests >> on linear mixed models* >> *Date: *27 September 2016 at 14:46:55 GMT+2 >> *To: * >> *Reply-To: *FieldTrip discussion list >> >> >> Dear FieldTripers, >> >> I have a question about the potential use of cluster-based permutation >> tests for results obtained using linear mixed models. >> >> We are working with data from a 10 min EEG experiment on source level >> with the aim to quantify the relationship of brain activity in different >> frequency bands with continous perceptual ratings across 20 subjects in >> different experimental conditions. Thus, we have 10 min time courses of >> brain activity and ratings for each voxel for different conditions and want >> to test a) if there are significant relationships in the single conditions >> and b) if these relationships differ between two conditions. To this end, I >> have calculated linear mixed models in R using the lme4 toolbox. For both >> the single condition relationships and the condition contrasts, they result >> in a single t-value (and a corresponding p-value), which is based on >> information on both the single subject and the group level (i.e. we perform >> a multi-level analysis). However, with more than 2000 voxels, we have a lot >> of t-values and are wondering if there is a way to apply cluster-based >> tests to correct for multiple comparisons. >> >> The main problem I see is that I only have one multilevel t-value for the >> effect across all subjects, i.e. I don't have single subjects values, which >> I could then e.g. randomize between conditions as normally done in >> cluster-based permutation tests. (Or rather, I would be able to extract >> single subject values but would then loose the advantage of the multi-level >> analysis.) >> >> I found an old thread in the mailinglist archive where it was suggested >> to flip the signs of the t-statistic for cluster-level correction ( >> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >> I understand that, in our case, I would do this randomly for all voxels in >> each randomization and then build spatial clusters on the resulting (partly >> flipped) t-values. However, I am not sure if that is a valid approach based >> on the null hypothesis that there are no significant relations in my single >> conditions (a) or no significant relationship differences in my condition >> contrasts (b). >> >> For the condition contrasts, I would be able to permute the condition >> labels as normally done in cluster-based permutation tests,I think, but >> would then have to recalculate the linear mixed models for all voxels in >> every permutation. This would result in a very high computational load. >> >> Does anyone have any experience with this kind of analysis? Would the >> flipping of t-values be a valid approach (and if yes, is there anything to >> keep in mind in particular)? Can you think of other ways to combine linear >> mixed models with a multiple comparison correction on the cluster level? >> >> >> Hi Elisabeth, >> >> I’m not an expert on linear mixed modelling, at least not with respect to >> the different ways in which they can be used to deal with correlated >> observations (typically, time series). However, from a theoretical point of >> view, I do not see how these models could be combined with >> permutation-based inference; they are just different statistical >> frameworks. However, it IS possible to answer your questions ("we have >> 10 min time courses of brain activity and ratings for each voxel for >> different conditions and wan to test a) if there are significant >> relationships in the single conditions and b) if these relationships differ >> between two conditions.”) within the framework of cluster-based permutation >> tests. Question b) is the most straightforward because it amounts to a >> cluster-based permutation test using the depsamplesT statfun applied to the >> regression coefficients in each of the two conditions. Answering question >> a) requires that you bin your ratings in a number of categories, calculate >> the trial-averaged EEG data for each of the categoreies, and test the >> difference between them using a cluster-based permutation test using the >> depsamplesregrT statfun. Both of these approaches have been described >> previously on this discussion list, and for the depsamplesregrT statfun >> (your question a), it was Vladimir Litvak who used it first (actually, I >> implemented it for him). The approach for question b) is actually a variant >> on the general approach for testing interactions using cluster-based >> permutation tests. >> >> Have a look here: >> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >> lations_between_neuronal_data_and_quantitative_stimulus_and_ >> behavioural_variables >> and >> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >> ction_effect_using_cluster-based_permutation_tests >> >> These tutorials provide all the necessary concepts, although they do not >> answer your question in a recipe-like fashion. >> >> best, >> Eric Maris >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From na.so.ir at gmail.com Mon Oct 24 15:49:14 2016 From: na.so.ir at gmail.com (Narjes Soltani) Date: Mon, 24 Oct 2016 17:19:14 +0330 Subject: [FieldTrip] error in ft_artifact_ecg Message-ID: Dear Sir/Madam Hi, I am running ft_artifact_ecg on some MEG data recorded by Neuromag Elekta device. I just pass the output produced by ft_defineTrial to ft_artifact_ecg, but I encounter the following error: Undefined function or variable "labelmlt". Error in ft_channelselection (line 428) if findmlt, channel = [channel; labelmlt]; end Error in ft_artifact_ecg (line 233) sgn = ft_channelselection(artfctdef.inspect, hdr.label); I guess I should explicitly set the cfg.artfctdef.ecg.channel, but I don't know how should I set this parameter? The set of channel labels in my data are as follows: 'MEG0113' 'MEG0112' 'MEG0111' 'MEG0122' 'MEG0123' 'MEG0121' 'MEG0132' 'MEG0133' 'MEG0131' 'MEG0143' 'MEG0142' 'MEG0141' 'MEG0213' 'MEG0212' 'MEG0211' 'MEG0222' 'MEG0223' 'MEG0221' 'MEG0232' 'MEG0233' 'MEG0231' 'MEG0243' 'MEG0242' 'MEG0241' 'MEG0313' 'MEG0312' 'MEG0311' 'MEG0322' 'MEG0323' 'MEG0321' 'MEG0333' 'MEG0332' 'MEG0331' 'MEG0343' 'MEG0342' 'MEG0341' 'MEG0413' 'MEG0412' 'MEG0411' 'MEG0422' 'MEG0423' 'MEG0421' 'MEG0432' 'MEG0433' 'MEG0431' 'MEG0443' 'MEG0442' 'MEG0441' 'MEG0513' 'MEG0512' 'MEG0511' 'MEG0523' 'MEG0522' 'MEG0521' 'MEG0532' 'MEG0533' 'MEG0531' 'MEG0542' 'MEG0543' 'MEG0541' 'MEG0613' 'MEG0612' 'MEG0611' 'MEG0622' 'MEG0623' 'MEG0621' 'MEG0633' 'MEG0632' 'MEG0631' 'MEG0642' 'MEG0643' 'MEG0641' 'MEG0713' 'MEG0712' 'MEG0711' 'MEG0723' 'MEG0722' 'MEG0721' 'MEG0733' 'MEG0732' 'MEG0731' 'MEG0743' 'MEG0742' 'MEG0741' 'MEG0813' 'MEG0812' 'MEG0811' 'MEG0822' 'MEG0823' 'MEG0821' 'MEG0913' 'MEG0912' 'MEG0911' 'MEG0923' 'MEG0922' 'MEG0921' 'MEG0932' 'MEG0933' 'MEG0931' 'MEG0942' 'MEG0943' 'MEG0941' 'MEG1013' 'MEG1012' 'MEG1011' 'MEG1023' 'MEG1022' 'MEG1021' 'MEG1032' 'MEG1033' 'MEG1031' 'MEG1043' 'MEG1042' 'MEG1041' 'MEG1112' 'MEG1113' 'MEG1111' 'MEG1123' 'MEG1122' 'MEG1121' 'MEG1133' 'MEG1132' 'MEG1131' 'MEG1142' 'MEG1143' 'MEG1141' 'MEG1213' 'MEG1212' 'MEG1211' 'MEG1223' 'MEG1222' 'MEG1221' 'MEG1232' 'MEG1233' 'MEG1231' 'MEG1243' 'MEG1242' 'MEG1241' 'MEG1312' 'MEG1313' 'MEG1311' 'MEG1323' 'MEG1322' 'MEG1321' 'MEG1333' 'MEG1332' 'MEG1331' 'MEG1342' 'MEG1343' 'MEG1341' 'MEG1412' 'MEG1413' 'MEG1411' 'MEG1423' 'MEG1422' 'MEG1421' 'MEG1433' 'MEG1432' 'MEG1431' 'MEG1442' 'MEG1443' 'MEG1441' 'MEG1512' 'MEG1513' 'MEG1511' 'MEG1522' 'MEG1523' 'MEG1521' 'MEG1533' 'MEG1532' 'MEG1531' 'MEG1543' 'MEG1542' 'MEG1541' 'MEG1613' 'MEG1612' 'MEG1611' 'MEG1622' 'MEG1623' 'MEG1621' 'MEG1632' 'MEG1633' 'MEG1631' 'MEG1643' 'MEG1642' 'MEG1641' 'MEG1713' 'MEG1712' 'MEG1711' 'MEG1722' 'MEG1723' 'MEG1721' 'MEG1732' 'MEG1733' 'MEG1731' 'MEG1743' 'MEG1742' 'MEG1741' 'MEG1813' 'MEG1812' 'MEG1811' 'MEG1822' 'MEG1823' 'MEG1821' 'MEG1832' 'MEG1833' 'MEG1831' 'MEG1843' 'MEG1842' 'MEG1841' 'MEG1912' 'MEG1913' 'MEG1911' 'MEG1923' 'MEG1922' 'MEG1921' 'MEG1932' 'MEG1933' 'MEG1931' 'MEG1943' 'MEG1942' 'MEG1941' 'MEG2013' 'MEG2012' 'MEG2011' 'MEG2023' 'MEG2022' 'MEG2021' 'MEG2032' 'MEG2033' 'MEG2031' 'MEG2042' 'MEG2043' 'MEG2041' 'MEG2113' 'MEG2112' 'MEG2111' 'MEG2122' 'MEG2123' 'MEG2121' 'MEG2133' 'MEG2132' 'MEG2131' 'MEG2143' 'MEG2142' 'MEG2141' 'MEG2212' 'MEG2213' 'MEG2211' 'MEG2223' 'MEG2222' 'MEG2221' 'MEG2233' 'MEG2232' 'MEG2231' 'MEG2242' 'MEG2243' 'MEG2241' 'MEG2312' 'MEG2313' 'MEG2311' 'MEG2323' 'MEG2322' 'MEG2321' 'MEG2332' 'MEG2333' 'MEG2331' 'MEG2343' 'MEG2342' 'MEG2341' 'MEG2412' 'MEG2413' 'MEG2411' 'MEG2423' 'MEG2422' 'MEG2421' 'MEG2433' 'MEG2432' 'MEG2431' 'MEG2442' 'MEG2443' 'MEG2441' 'MEG2512' 'MEG2513' 'MEG2511' 'MEG2522' 'MEG2523' 'MEG2521' 'MEG2533' 'MEG2532' 'MEG2531' 'MEG2543' 'MEG2542' 'MEG2541' 'MEG2612' 'MEG2613' 'MEG2611' 'MEG2623' 'MEG2622' 'MEG2621' 'MEG2633' 'MEG2632' 'MEG2631' 'MEG2642' 'MEG2643' 'MEG2641' 'EOG061' 'ECG062' 'STI101' 'STI201' 'STI301' 'MISC201' 'MISC202' 'MISC203' 'MISC204' 'MISC205' 'MISC206' 'MISC301' 'MISC302' 'MISC303' 'MISC304' 'MISC305' 'MISC306' Would you please help me with this problem? Best Regards Narjes -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Mon Oct 24 18:18:46 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Mon, 24 Oct 2016 16:18:46 +0000 Subject: [FieldTrip] eLORETA Message-ID: Hello, Is there any difference between using the eLORETA-KEY software and using ft_sourceanalysis, cfg.method = 'eloreta'. I am going to use eLoreta in MEG resting state. Thanks Mehdy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdy.dousty at gmail.com Mon Oct 24 20:33:46 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Mon, 24 Oct 2016 18:33:46 +0000 Subject: [FieldTrip] eLORETA In-Reply-To: References: Message-ID: Hello, For using the eLORETA in resting state of MEG signals, do I need to compute Timelock analysis? If it is so, as they are resting state, how valid they would be? Thanks On Mon, Oct 24, 2016 at 10:18 AM mehdy dousty wrote: > Hello, > > Is there any difference between using the eLORETA-KEY software and using > ft_sourceanalysis, cfg.method = 'eloreta'. I am going to use eLoreta in MEG > resting state. > > Thanks > Mehdy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarang at cfin.au.dk Tue Oct 25 13:33:24 2016 From: sarang at cfin.au.dk (Sarang S. Dalal) Date: Tue, 25 Oct 2016 11:33:24 +0000 Subject: [FieldTrip] Fwd: [Women in M/EEG]: please fwd to reach female scientist in the field References: <73b2b35a8cc36f97.580f4111@limbe.rz.uni-konstanz.de> Message-ID: <14E0CEED-3A2A-41AF-9C83-DCA5A4FF5952@cfin.au.dk> Hi everyone, I thought this initiative could use some wider distribution. Biaswatchneuro was covered in the New York Times recently ( http://nyti.ms/2bOEPj6 ) and now Biomag and the MEG community is under its watch. :-) See below. Cheers, Sarang > Begin forwarded message: > >> Dear friends and colleagues, >> I hope you are doing great. Probably your are aware of the gender bias in science (e.g. at conferences: https://biaswatchneuro.com). >> There is an initiative which hopefully will help counteracting (see below for details). That is, currently information about female scientist with M/EEG expertise are collected. This will provide material for gender representation to future organizers of Biomag and potentially other conferences. >> >> @ Female scientist in the field: You may want to fill in this link (or one of the links below): https://docs.google.com/spreadsheets/d/1KaqR_ONjH4DShmzDS0SlpWho0hp6NuswWmYrrDC0OSY/edit?usp=sharing >> >> @ All: Please, pass on the link / mail to reach female scientist in the field. >> >> Cheers, >> Anne >> From robert.oostenveld at donders.ru.nl Tue Oct 25 13:39:41 2016 From: robert.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 25 Oct 2016 13:39:41 +0200 Subject: [FieldTrip] gender bias in the M/EEG research community Message-ID: <9ADAB85C-9752-4F54-8035-66FB5F255F73@donders.ru.nl> Dear FieldTrip users, Probably your are aware of the gender bias in science (e.g. at conferences: https://biaswatchneuro.com ). There is an initiative which hopefully will help counteracting (see below for details). That is, currently information about female scientist with M/EEG expertise are collected. This will provide material for gender representation to future organizers of Biomag and potentially other conferences. @ Female scientist in the field: You may want to fill in this link (or one of the links below): https://docs.google.com/spreadsheets/d/1KaqR_ONjH4DShmzDS0SlpWho0hp6NuswWmYrrDC0OSY/edit?usp=sharing @ All: Please, pass on the link / mail to reach female scientist in the field. best regards, Robert PS Biaswatchneuro was covered in the New York Times recently, see http://nyti.ms/2bOEPj6 ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher & MEG Physicist Donders Institute for Brain, Cognition and Behaviour Radboud University, Nijmegen, The Netherlands Visiting Professor NatMEG - the Swedish National MEG facility Karolinska Institute, Stockholm, Sweden tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/donders skype: r.oostenveld ----------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Tue Oct 25 17:30:10 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Tue, 25 Oct 2016 11:30:10 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. *Canadian journal of fisheries and aquatic sciences*, *58*(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. *Psychophysiology*, *48*(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < elisabethsusanne.may at gmail.com> wrote: > Dear Eric and Alik, > > thanks a lot for your helpful responses! > > I will have a close look at the faqs, Eric, and test the approaches you > outlined. I am curious, anyway, as to how different results will be for > simple regressions compared to the multilevel results of the linear-mixed > models. > > Like Alik, I am also curious about other people's opinions on the general > question if there are theoretical reasons against a combination of the > approaches like Alik suggested. We also thought about this approach but > haven't fully tested it yet because of the very long calculation times. > > Thanks again and have a nice weekend! > Elisabeth > > 2016-10-20 12:49 GMT+02:00 Alik Widge : > >> Eric, I don't think I understand why you would say "I do not see how >> these models could be combined with permutation-based inference; they are >> just different statistical frameworks". As you somewhat hint, the (G)LMM is >> a regression, and the beta coefficient for the independent-variable of >> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >> much does the independent variable explain the brain activity?" In that >> framework, it seems to me that one could do the following: >> >> for n=1:1000 >> 1) Permute the condition labels (within subjects) of the individual >> trials >> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >> corresponding t-map >> 3) Threshold and construct cluster mass statistic as usual >> end >> 4) Identify cluster in the original (unpermuted) analysis and report >> cluster p-value >> >> >> Now, the main thing that has come up when we've tried to do this is that >> re-fitting a (voxel x time) GLM 1000 times by the standard iterative >> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >> it would require rewriting at least a statfun, maybe other pieces of the >> code. (We had an idea that, since the betas likely should vary smoothly >> over time and space, one could use the output of one GLM as the seed to the >> next, which would speed up convergence.) So it still does not seem like a >> good idea, but based on the above, is there actually a *theoretical* reason >> it wouldn't work? >> >> >> Alik Widge, MD, PhD >> Director, Translational NeuroEngineering Laboratory >> Division of Neurotherapeutics, Massachusetts General Hospital >> Assistant Professor of Psychiatry, Harvard Medical School >> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >> awidge at partners.org >> http://scholar.harvard.edu/awidge/ >> 617-643-2580 >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >> e.maris at donders.ru.nl> wrote: >> >>> Note: this is the second time I post this reply, and the reason is that >>> I forgot to add an appropriate Subject (for findability) to my email (shame >>> on me…(-;) >>> >>> *From: *Elisabeth May >>> *Subject: **[FieldTrip] Question about cluster-based permutation tests >>> on linear mixed models* >>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>> *To: * >>> *Reply-To: *FieldTrip discussion list >>> >>> >>> Dear FieldTripers, >>> >>> I have a question about the potential use of cluster-based permutation >>> tests for results obtained using linear mixed models. >>> >>> We are working with data from a 10 min EEG experiment on source level >>> with the aim to quantify the relationship of brain activity in different >>> frequency bands with continous perceptual ratings across 20 subjects in >>> different experimental conditions. Thus, we have 10 min time courses of >>> brain activity and ratings for each voxel for different conditions and want >>> to test a) if there are significant relationships in the single conditions >>> and b) if these relationships differ between two conditions. To this end, I >>> have calculated linear mixed models in R using the lme4 toolbox. For both >>> the single condition relationships and the condition contrasts, they result >>> in a single t-value (and a corresponding p-value), which is based on >>> information on both the single subject and the group level (i.e. we perform >>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>> of t-values and are wondering if there is a way to apply cluster-based >>> tests to correct for multiple comparisons. >>> >>> The main problem I see is that I only have one multilevel t-value for >>> the effect across all subjects, i.e. I don't have single subjects values, >>> which I could then e.g. randomize between conditions as normally done in >>> cluster-based permutation tests. (Or rather, I would be able to extract >>> single subject values but would then loose the advantage of the multi-level >>> analysis.) >>> >>> I found an old thread in the mailinglist archive where it was suggested >>> to flip the signs of the t-statistic for cluster-level correction ( >>> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >>> I understand that, in our case, I would do this randomly for all voxels in >>> each randomization and then build spatial clusters on the resulting (partly >>> flipped) t-values. However, I am not sure if that is a valid approach based >>> on the null hypothesis that there are no significant relations in my single >>> conditions (a) or no significant relationship differences in my condition >>> contrasts (b). >>> >>> For the condition contrasts, I would be able to permute the condition >>> labels as normally done in cluster-based permutation tests,I think, but >>> would then have to recalculate the linear mixed models for all voxels in >>> every permutation. This would result in a very high computational load. >>> >>> Does anyone have any experience with this kind of analysis? Would the >>> flipping of t-values be a valid approach (and if yes, is there anything to >>> keep in mind in particular)? Can you think of other ways to combine linear >>> mixed models with a multiple comparison correction on the cluster level? >>> >>> >>> Hi Elisabeth, >>> >>> I’m not an expert on linear mixed modelling, at least not with respect >>> to the different ways in which they can be used to deal with correlated >>> observations (typically, time series). However, from a theoretical point of >>> view, I do not see how these models could be combined with >>> permutation-based inference; they are just different statistical >>> frameworks. However, it IS possible to answer your questions ("we have >>> 10 min time courses of brain activity and ratings for each voxel for >>> different conditions and wan to test a) if there are significant >>> relationships in the single conditions and b) if these relationships differ >>> between two conditions.”) within the framework of cluster-based permutation >>> tests. Question b) is the most straightforward because it amounts to a >>> cluster-based permutation test using the depsamplesT statfun applied to the >>> regression coefficients in each of the two conditions. Answering question >>> a) requires that you bin your ratings in a number of categories, calculate >>> the trial-averaged EEG data for each of the categoreies, and test the >>> difference between them using a cluster-based permutation test using the >>> depsamplesregrT statfun. Both of these approaches have been described >>> previously on this discussion list, and for the depsamplesregrT statfun >>> (your question a), it was Vladimir Litvak who used it first (actually, I >>> implemented it for him). The approach for question b) is actually a variant >>> on the general approach for testing interactions using cluster-based >>> permutation tests. >>> >>> Have a look here: >>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>> behavioural_variables >>> and >>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>> ction_effect_using_cluster-based_permutation_tests >>> >>> These tutorials provide all the necessary concepts, although they do not >>> answer your question in a recipe-like fashion. >>> >>> best, >>> Eric Maris >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Tue Oct 25 19:29:54 2016 From: alik.widge at gmail.com (Alik Widge) Date: Tue, 25 Oct 2016 13:29:54 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe wrote: > Hi Elisabeth and Alik, > Permutation methods applied to multiple regression models are not > generally guaranteed to be accurate because testing individual terms in > such models (e.g., partial correlation coefficients) requires accurate > knowledge of other terms in the model (e.g., the slope coefficients for all > the other predictors in the multiple regression). Because such parameters > have to be estimated from the data, permutation tests are only > ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). > Though there are special cases (e.g., a two factor ANOVA with two levels of > each factor), where permutation methods do guarantee accuracy. > In lieu of permutation testing, you might want to try using one of > Benjamini and colleagues' false discovery rate (FDR) control algorithms to > control for multiple comparisons. In my tests on simulated ERP data (Groppe > et al., 2011), FDR correction was nearly as powerful as cluster-based > permutation testing for detecting a very broadly distributed effect (e.g., > a P300-like effect) and it was far more sensitive than cluster-based > testing for an effect with a very limited distribution (e.g., an N170-like > effect). FDR correction is also very computationally efficient. > hope this is helpful, > -David > > > Refs: > Anderson, M. J. (2001). Permutation tests for univariate or multivariate > analysis of variance and regression. *Canadian journal of fisheries and > aquatic sciences*, *58*(3), 626-639. > > Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of > Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. > > Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis > of event‐related brain potentials/fields II: Simulation studies. > *Psychophysiology*, *48*(12), 1726-1737. > > > On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < > elisabethsusanne.may at gmail.com> wrote: > >> Dear Eric and Alik, >> >> thanks a lot for your helpful responses! >> >> I will have a close look at the faqs, Eric, and test the approaches you >> outlined. I am curious, anyway, as to how different results will be for >> simple regressions compared to the multilevel results of the linear-mixed >> models. >> >> Like Alik, I am also curious about other people's opinions on the general >> question if there are theoretical reasons against a combination of the >> approaches like Alik suggested. We also thought about this approach but >> haven't fully tested it yet because of the very long calculation times. >> >> Thanks again and have a nice weekend! >> Elisabeth >> >> 2016-10-20 12:49 GMT+02:00 Alik Widge : >> >>> Eric, I don't think I understand why you would say "I do not see how >>> these models could be combined with permutation-based inference; they are >>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>> a regression, and the beta coefficient for the independent-variable of >>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>> much does the independent variable explain the brain activity?" In that >>> framework, it seems to me that one could do the following: >>> >>> for n=1:1000 >>> 1) Permute the condition labels (within subjects) of the individual >>> trials >>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >>> corresponding t-map >>> 3) Threshold and construct cluster mass statistic as usual >>> end >>> 4) Identify cluster in the original (unpermuted) analysis and report >>> cluster p-value >>> >>> >>> Now, the main thing that has come up when we've tried to do this is that >>> re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>> it would require rewriting at least a statfun, maybe other pieces of the >>> code. (We had an idea that, since the betas likely should vary smoothly >>> over time and space, one could use the output of one GLM as the seed to the >>> next, which would speed up convergence.) So it still does not seem like a >>> good idea, but based on the above, is there actually a *theoretical* reason >>> it wouldn't work? >>> >>> >>> Alik Widge, MD, PhD >>> Director, Translational NeuroEngineering Laboratory >>> Division of Neurotherapeutics, Massachusetts General Hospital >>> Assistant Professor of Psychiatry, Harvard Medical School >>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>> awidge at partners.org >>> http://scholar.harvard.edu/awidge/ >>> 617-643-2580 >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>> e.maris at donders.ru.nl> wrote: >>> >>>> Note: this is the second time I post this reply, and the reason is that >>>> I forgot to add an appropriate Subject (for findability) to my email (shame >>>> on me…(-;) >>>> >>>> *From: *Elisabeth May >>>> *Subject: **[FieldTrip] Question about cluster-based permutation tests >>>> on linear mixed models* >>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>> *To: * >>>> *Reply-To: *FieldTrip discussion list >>>> >>>> >>>> Dear FieldTripers, >>>> >>>> I have a question about the potential use of cluster-based permutation >>>> tests for results obtained using linear mixed models. >>>> >>>> We are working with data from a 10 min EEG experiment on source level >>>> with the aim to quantify the relationship of brain activity in different >>>> frequency bands with continous perceptual ratings across 20 subjects in >>>> different experimental conditions. Thus, we have 10 min time courses of >>>> brain activity and ratings for each voxel for different conditions and want >>>> to test a) if there are significant relationships in the single conditions >>>> and b) if these relationships differ between two conditions. To this end, I >>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>> the single condition relationships and the condition contrasts, they result >>>> in a single t-value (and a corresponding p-value), which is based on >>>> information on both the single subject and the group level (i.e. we perform >>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>> of t-values and are wondering if there is a way to apply cluster-based >>>> tests to correct for multiple comparisons. >>>> >>>> The main problem I see is that I only have one multilevel t-value for >>>> the effect across all subjects, i.e. I don't have single subjects values, >>>> which I could then e.g. randomize between conditions as normally done in >>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>> single subject values but would then loose the advantage of the multi-level >>>> analysis.) >>>> >>>> I found an old thread in the mailinglist archive where it was suggested >>>> to flip the signs of the t-statistic for cluster-level correction ( >>>> https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). >>>> I understand that, in our case, I would do this randomly for all voxels in >>>> each randomization and then build spatial clusters on the resulting (partly >>>> flipped) t-values. However, I am not sure if that is a valid approach based >>>> on the null hypothesis that there are no significant relations in my single >>>> conditions (a) or no significant relationship differences in my condition >>>> contrasts (b). >>>> >>>> For the condition contrasts, I would be able to permute the condition >>>> labels as normally done in cluster-based permutation tests,I think, but >>>> would then have to recalculate the linear mixed models for all voxels in >>>> every permutation. This would result in a very high computational load. >>>> >>>> Does anyone have any experience with this kind of analysis? Would the >>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>> keep in mind in particular)? Can you think of other ways to combine linear >>>> mixed models with a multiple comparison correction on the cluster level? >>>> >>>> >>>> Hi Elisabeth, >>>> >>>> I’m not an expert on linear mixed modelling, at least not with respect >>>> to the different ways in which they can be used to deal with correlated >>>> observations (typically, time series). However, from a theoretical point of >>>> view, I do not see how these models could be combined with >>>> permutation-based inference; they are just different statistical >>>> frameworks. However, it IS possible to answer your questions ("we have >>>> 10 min time courses of brain activity and ratings for each voxel for >>>> different conditions and wan to test a) if there are significant >>>> relationships in the single conditions and b) if these relationships differ >>>> between two conditions.”) within the framework of cluster-based permutation >>>> tests. Question b) is the most straightforward because it amounts to a >>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>> regression coefficients in each of the two conditions. Answering question >>>> a) requires that you bin your ratings in a number of categories, calculate >>>> the trial-averaged EEG data for each of the categoreies, and test the >>>> difference between them using a cluster-based permutation test using the >>>> depsamplesregrT statfun. Both of these approaches have been described >>>> previously on this discussion list, and for the depsamplesregrT statfun >>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>> implemented it for him). The approach for question b) is actually a variant >>>> on the general approach for testing interactions using cluster-based >>>> permutation tests. >>>> >>>> Have a look here: >>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>> behavioural_variables >>>> and >>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>> ction_effect_using_cluster-based_permutation_tests >>>> >>>> These tutorials provide all the necessary concepts, although they do >>>> not answer your question in a recipe-like fashion. >>>> >>>> best, >>>> Eric Maris >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Tue Oct 25 21:28:55 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Tue, 25 Oct 2016 15:28:55 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: > Thanks, that was super interesting! Was not aware of those. > > Have been meditating this afternoon on this and related Anderson papers. > What's interesting is that he appears to think my suggestion below *would* > be asymptotically acceptable -- *if* one specifically permutes the > dependent variable (power/ERP observation) rather than permuting each > column of the independent variables separately (i.e., if one preserves any > correlational structure that exists between the independent variables). > That's the Manly (1997) method, and it appears that the only reason it > breaks down sometimes is if there's an outlier in the independent variable. > This could presumably be a problem in the ecological sciences, for which > he's writing, where one can't control things like temperature in a season > or numbers of eels that swim past a given sensor. In cognitive > neuroscience, where the predictor/independent variables are usually dummy > coded properties of the trial, this seems like we might be on firmer > ground. > > Opinion based on reading and reasoning, of course, and not to be trusted > until and unless I or someone else were to back it up by doing some > simulated-data experiments... > > > Alik Widge > alik.widge at gmail.com > (206) 866-5435 > > > On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: > >> Hi Elisabeth and Alik, >> Permutation methods applied to multiple regression models are not >> generally guaranteed to be accurate because testing individual terms in >> such models (e.g., partial correlation coefficients) requires accurate >> knowledge of other terms in the model (e.g., the slope coefficients for all >> the other predictors in the multiple regression). Because such parameters >> have to be estimated from the data, permutation tests are only >> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >> Though there are special cases (e.g., a two factor ANOVA with two levels of >> each factor), where permutation methods do guarantee accuracy. >> In lieu of permutation testing, you might want to try using one of >> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >> control for multiple comparisons. In my tests on simulated ERP data (Groppe >> et al., 2011), FDR correction was nearly as powerful as cluster-based >> permutation testing for detecting a very broadly distributed effect (e.g., >> a P300-like effect) and it was far more sensitive than cluster-based >> testing for an effect with a very limited distribution (e.g., an N170-like >> effect). FDR correction is also very computationally efficient. >> hope this is helpful, >> -David >> >> >> Refs: >> Anderson, M. J. (2001). Permutation tests for univariate or multivariate >> analysis of variance and regression. *Canadian journal of fisheries and >> aquatic sciences*, *58*(3), 626-639. >> >> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >> >> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >> analysis of event‐related brain potentials/fields II: Simulation studies. >> *Psychophysiology*, *48*(12), 1726-1737. >> >> >> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >> elisabethsusanne.may at gmail.com> wrote: >> >>> Dear Eric and Alik, >>> >>> thanks a lot for your helpful responses! >>> >>> I will have a close look at the faqs, Eric, and test the approaches you >>> outlined. I am curious, anyway, as to how different results will be for >>> simple regressions compared to the multilevel results of the linear-mixed >>> models. >>> >>> Like Alik, I am also curious about other people's opinions on the >>> general question if there are theoretical reasons against a combination of >>> the approaches like Alik suggested. We also thought about this approach but >>> haven't fully tested it yet because of the very long calculation times. >>> >>> Thanks again and have a nice weekend! >>> Elisabeth >>> >>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>> >>>> Eric, I don't think I understand why you would say "I do not see how >>>> these models could be combined with permutation-based inference; they are >>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>> a regression, and the beta coefficient for the independent-variable of >>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>> much does the independent variable explain the brain activity?" In that >>>> framework, it seems to me that one could do the following: >>>> >>>> for n=1:1000 >>>> 1) Permute the condition labels (within subjects) of the individual >>>> trials >>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and >>>> corresponding t-map >>>> 3) Threshold and construct cluster mass statistic as usual >>>> end >>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>> cluster p-value >>>> >>>> >>>> Now, the main thing that has come up when we've tried to do this is >>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>> it would require rewriting at least a statfun, maybe other pieces of the >>>> code. (We had an idea that, since the betas likely should vary smoothly >>>> over time and space, one could use the output of one GLM as the seed to the >>>> next, which would speed up convergence.) So it still does not seem like a >>>> good idea, but based on the above, is there actually a *theoretical* reason >>>> it wouldn't work? >>>> >>>> >>>> Alik Widge, MD, PhD >>>> Director, Translational NeuroEngineering Laboratory >>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>> Assistant Professor of Psychiatry, Harvard Medical School >>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>> awidge at partners.org >>>> http://scholar.harvard.edu/awidge/ >>>> 617-643-2580 >>>> >>>> Alik Widge >>>> alik.widge at gmail.com >>>> (206) 866-5435 >>>> >>>> >>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>> e.maris at donders.ru.nl> wrote: >>>> >>>>> Note: this is the second time I post this reply, and the reason is >>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>> (shame on me…(-;) >>>>> >>>>> *From: *Elisabeth May >>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>> tests on linear mixed models* >>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>> *To: * >>>>> *Reply-To: *FieldTrip discussion list >>>>> >>>>> >>>>> Dear FieldTripers, >>>>> >>>>> I have a question about the potential use of cluster-based permutation >>>>> tests for results obtained using linear mixed models. >>>>> >>>>> We are working with data from a 10 min EEG experiment on source level >>>>> with the aim to quantify the relationship of brain activity in different >>>>> frequency bands with continous perceptual ratings across 20 subjects in >>>>> different experimental conditions. Thus, we have 10 min time courses of >>>>> brain activity and ratings for each voxel for different conditions and want >>>>> to test a) if there are significant relationships in the single conditions >>>>> and b) if these relationships differ between two conditions. To this end, I >>>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>>> the single condition relationships and the condition contrasts, they result >>>>> in a single t-value (and a corresponding p-value), which is based on >>>>> information on both the single subject and the group level (i.e. we perform >>>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>>> of t-values and are wondering if there is a way to apply cluster-based >>>>> tests to correct for multiple comparisons. >>>>> >>>>> The main problem I see is that I only have one multilevel t-value for >>>>> the effect across all subjects, i.e. I don't have single subjects values, >>>>> which I could then e.g. randomize between conditions as normally done in >>>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>>> single subject values but would then loose the advantage of the multi-level >>>>> analysis.) >>>>> >>>>> I found an old thread in the mailinglist archive where it was >>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>> /005375.html). I understand that, in our case, I would do this >>>>> randomly for all voxels in each randomization and then build spatial >>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>> if that is a valid approach based on the null hypothesis that there are no >>>>> significant relations in my single conditions (a) or no significant >>>>> relationship differences in my condition contrasts (b). >>>>> >>>>> For the condition contrasts, I would be able to permute the condition >>>>> labels as normally done in cluster-based permutation tests,I think, but >>>>> would then have to recalculate the linear mixed models for all voxels in >>>>> every permutation. This would result in a very high computational load. >>>>> >>>>> Does anyone have any experience with this kind of analysis? Would the >>>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>>> keep in mind in particular)? Can you think of other ways to combine linear >>>>> mixed models with a multiple comparison correction on the cluster level? >>>>> >>>>> >>>>> Hi Elisabeth, >>>>> >>>>> I’m not an expert on linear mixed modelling, at least not with respect >>>>> to the different ways in which they can be used to deal with correlated >>>>> observations (typically, time series). However, from a theoretical point of >>>>> view, I do not see how these models could be combined with >>>>> permutation-based inference; they are just different statistical >>>>> frameworks. However, it IS possible to answer your questions ("we >>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>> different conditions and wan to test a) if there are significant >>>>> relationships in the single conditions and b) if these relationships differ >>>>> between two conditions.”) within the framework of cluster-based permutation >>>>> tests. Question b) is the most straightforward because it amounts to a >>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>> regression coefficients in each of the two conditions. Answering question >>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>> difference between them using a cluster-based permutation test using the >>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>> implemented it for him). The approach for question b) is actually a variant >>>>> on the general approach for testing interactions using cluster-based >>>>> permutation tests. >>>>> >>>>> Have a look here: >>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>> behavioural_variables >>>>> and >>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>> ction_effect_using_cluster-based_permutation_tests >>>>> >>>>> These tutorials provide all the necessary concepts, although they do >>>>> not answer your question in a recipe-like fashion. >>>>> >>>>> best, >>>>> Eric Maris >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maximilien.chaumon at gmail.com Wed Oct 26 10:42:27 2016 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Wed, 26 Oct 2016 08:42:27 +0000 Subject: [FieldTrip] filtering during artifact detection Message-ID: Dear all, when attempting to detect blinks automatically on a continuous recording without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: cfg = []; cfg.dataset = fullfile(rootdir,f{iD}); cfg.layout = 'neuromag306mag.lay'; cfg.trialdef.eventtype = 'STI101'; cfg.trialdef.eventvalue = {255}; cfg = ft_definetrial(cfg); cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; cfg.channel = 'megmag'; cfg.continuous = 'yes'; data = ft_preprocessing(cfg); cfg.artfctdef.eog = []; cfg.artfctdef.eog.channel = eogchans; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); This opens an interactive window in which the EOG signal is not BPfiltered, and contains in particular slow drifts that make the threshold detection pretty inefficient. I'm surprised because cfg.artfctdef is supposed to bpfilter 1-15Hz the data, isn't it? Is this normal? Thanks, Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Wed Oct 26 11:15:52 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Wed, 26 Oct 2016 11:15:52 +0200 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: Dear Maximilien, You should specify the filter parameters in the cfg: cfg.artfctdef.eog.bpfilter = 'yes' cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details cfg.artfctdef.eog.bpfreq = [1 15] cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see Take a look to the fft_artifact_eog.m documentation. To know more about filtering you might want to take a look here: http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics Best, Diego On 26 October 2016 at 10:42, Maximilien Chaumon < maximilien.chaumon at gmail.com> wrote: > Dear all, > when attempting to detect blinks automatically on a continuous recording > without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not > BPfiltered, and contains in particular slow drifts that make the threshold > detection pretty inefficient. I'm surprised because cfg.artfctdef is > supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maximilien.chaumon at gmail.com Wed Oct 26 14:27:32 2016 From: maximilien.chaumon at gmail.com (Maximilien Chaumon) Date: Wed, 26 Oct 2016 12:27:32 +0000 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: Thank you Diego for your quick reply. Whether or not I include those filter parameters explicitly does not change anything. This is what i have now: cfg.artfctdef.eog = []; cfg.artfctdef.eog.bpfilter = 'yes'; cfg.artfctdef.eog.bpfilttype = 'but'; cfg.artfctdef.eog.bpfreq = [1 15]; cfg.artfctdef.eog.bpfiltord = 4; cfg.artfctdef.eog.channel = eogchans; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; cfg.artfctdef.eog.cutoff = 2.5; [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); but the resulting interactive window looks like this: [image: pasted1] Seems like the preprocessing step isn't applied... any clue why that is? Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla < dlozanosoldevilla at gmail.com> a écrit : > Dear Maximilien, > > You should specify the filter parameters in the cfg: > > cfg.artfctdef.eog.bpfilter = 'yes' > cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details > cfg.artfctdef.eog.bpfreq = [1 15] > cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see > > > Take a look to the fft_artifact_eog.m documentation. To know more about > filtering you might want to take a look here: > > http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics > > Best, > > Diego > > On 26 October 2016 at 10:42, Maximilien Chaumon < > maximilien.chaumon at gmail.com> wrote: > > Dear all, > when attempting to detect blinks automatically on a continuous recording > without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not > BPfiltered, and contains in particular slow drifts that make the threshold > detection pretty inefficient. I'm surprised because cfg.artfctdef is > supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian at brain.riken.jp Wed Oct 26 14:36:03 2016 From: florian at brain.riken.jp (Florian Gerard-Mercier) Date: Wed, 26 Oct 2016 21:36:03 +0900 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: References: Message-ID: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> Dear all, Note that I encountered the same problem (absence of intended filtering) when using high-level ft_preprocessing function (I talked about it in a a precedent email). I solved the problem by doing the filtering separately, as a first step, and using the low-level ft_preprocbandstopfilter function. Anyway I needed access to the data in an unstructured format (i.e. just a matrix, easy to manipulate), so in the end this low-level function fitted my needs better. All the best, Florian > On 26 Oct, 2016, at 9:27 PM, Maximilien Chaumon wrote: > > Thank you Diego for your quick reply. > Whether or not I include those filter parameters explicitly does not change anything. > This is what i have now: > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.bpfilter = 'yes'; > cfg.artfctdef.eog.bpfilttype = 'but'; > cfg.artfctdef.eog.bpfreq = [1 15]; > cfg.artfctdef.eog.bpfiltord = 4; > > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > cfg.artfctdef.eog.cutoff = 2.5; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > > but the resulting interactive window looks like this: > > > > Seems like the preprocessing step isn't applied... any clue why that is? > > > Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla > a écrit : > Dear Maximilien, > > You should specify the filter parameters in the cfg: > > cfg.artfctdef.eog.bpfilter = 'yes' > cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details > cfg.artfctdef.eog.bpfreq = [1 15] > cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see > > Take a look to the fft_artifact_eog.m documentation. To know more about filtering you might want to take a look here: > http://www.fieldtriptoolbox.org/example/determine_the_filter_characteristics > > Best, > > Diego > > On 26 October 2016 at 10:42, Maximilien Chaumon > wrote: > Dear all, > when attempting to detect blinks automatically on a continuous recording without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: > > cfg = []; > cfg.dataset = fullfile(rootdir,f{iD}); > cfg.layout = 'neuromag306mag.lay'; > cfg.trialdef.eventtype = 'STI101'; > cfg.trialdef.eventvalue = {255}; > cfg = ft_definetrial(cfg); > > cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; > cfg.channel = 'megmag'; > cfg.continuous = 'yes'; > data = ft_preprocessing(cfg); > > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > This opens an interactive window in which the EOG signal is not BPfiltered, and contains in particular slow drifts that make the threshold detection pretty inefficient. I'm surprised because cfg.artfctdef is supposed to bpfilter 1-15Hz the data, isn't it? > > Is this normal? > Thanks, > Max > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elinor.tzvi at neuro.uni-luebeck.de Wed Oct 26 14:43:20 2016 From: elinor.tzvi at neuro.uni-luebeck.de (Elinor Tzvi) Date: Wed, 26 Oct 2016 14:43:20 +0200 Subject: [FieldTrip] PHD POSITION IN NON-INVASIVE BRAIN STIMULATION AND IMAGING Message-ID: <810A8E06C75EB447A8CEB73DBFD7BB0EFA6AC0D24E@solaris.neuro.uni-luebeck.de> The Neurology department of the University of Lübeck offers a PhD position (65% E13 TV-L) starting on January 1st, 2017 or later. The candidate will be working on a project using combined non-invasive brain stimulation (tDCS) and MR-imaging to study dynamics of neural connectivity underlying motor skill learning. We offer The department of Neurology is part of the Center for Brain, Behavior and Metabolism (CBBM), which offers an excellent and state-of the-art research environment. The research group "Cognitive Neuroscience" (headed by Prof. Ulrike Krämer) is working on different topics related to cognitive and affective control (anger and aggression, response inhibition, regulation of eating behavior) and motor control. In addition, our researchers use diverse and complex methods to analyze brain-behavior relationships. Thus, we offer an excellent environment for interdisciplinary research. In addition, the group has a number of national and international collaborations. We require The successful candidate will hold an MSc/MA/Dipl. in Biomedical Engineering, Psychology or related fields (cognitive science, biology, medicine, neuroscience or other). Experience in acquisition and analysis of human neuroimaging data (fMRI, EEG, MEG or NIRS) and Programming skills in Matlab (or equivalent) is preferred. Interest and/or experience in the field of cognitive neuroscience are obligatory. We are looking for a motivated, analytic and problem-solving oriented candidate who enjoys interdisciplinary challenges. The candidate will work in the "Cognitive Neuroscience Group" headed by Prof. Dr. Ulrike M. Krämer under the supervision of Dr. Elinor Tzvi-Minker. Applicants with disabilities are preferred if qualification is equal. The University of Lübeck is an equal opportunity employer, aiming to increase the proportion of women in science. Applications by women are particularly welcome. For questions about the details of the assignment please contact Dr. Elinor Tzvi-Minker (elinor.tzvi at neuro.uni-luebeck.de). Please send your application (Letter of motivation, CV, two recommendation letters, relevant certificates) as one single complete PDF file to the Email-address mentioned above. Applications will be considered until the position has been filled. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlozanosoldevilla at gmail.com Wed Oct 26 15:47:08 2016 From: dlozanosoldevilla at gmail.com (Diego Lozano-Soldevilla) Date: Wed, 26 Oct 2016 15:47:08 +0200 Subject: [FieldTrip] filtering during artifact detection In-Reply-To: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> References: <850ED46B-7534-4D92-B014-9AF1E1EA8420@brain.riken.jp> Message-ID: Hi Maximilien and Florian, Thank for letting us know. I can reproduce your problem and the problem relies in an unfortunate combination of fieldtrip defaults in some functions. The issue starts with the cfg.artfctdef.eog.fltpadding default which is 0.1. This parameter introduces a 0.1s padding with NaNs (line 301 in ft_artifact_zvalue) and the private function preproc.m does not filter the data because it contains NaNs. For now, set explicitly cfg.artfctdef.eog.fltpadding = 0; to carry on while we fix it: cfg=[]; cfg.artfctdef.eog = []; cfg.artfctdef.eog.bpfilter = 'yes'; cfg.artfctdef.eog.bpfilttype = 'but'; cfg.artfctdef.eog.bpfreq = [8 10]; cfg.artfctdef.eog.bpfiltord = 4; cfg.artfctdef.eog.channel = 'MLF22'; cfg.artfctdef.eog.trlpadding = 0; cfg.artfctdef.eog.fltpadding = 0; cfg.artfctdef.eog.interactive = 'yes'; cfg.artfctdef.eog.cutoff = 2.5; [cfg, artifact] = ft_artifact_eog(cfg,data); You can follow the development of the issue here: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3193 Best, Diego On 26 October 2016 at 14:36, Florian Gerard-Mercier wrote: > Dear all, > > Note that I encountered the same problem (absence of intended filtering) > when using high-level ft_preprocessing function (I talked about it in a a > precedent email). > I solved the problem by doing the filtering separately, as a first step, > and using the low-level ft_preprocbandstopfilter function. > Anyway I needed access to the data in an unstructured format (i.e. just a > matrix, easy to manipulate), so in the end this low-level function fitted > my needs better. > > All the best, > > Florian > > On 26 Oct, 2016, at 9:27 PM, Maximilien Chaumon < > maximilien.chaumon at gmail.com> wrote: > > Thank you Diego for your quick reply. > Whether or not I include those filter parameters explicitly does not > change anything. > This is what i have now: > > cfg.artfctdef.eog = []; > cfg.artfctdef.eog.bpfilter = 'yes'; > cfg.artfctdef.eog.bpfilttype = 'but'; > cfg.artfctdef.eog.bpfreq = [1 15]; > cfg.artfctdef.eog.bpfiltord = 4; > > cfg.artfctdef.eog.channel = eogchans; > cfg.artfctdef.eog.trlpadding = 0; > cfg.artfctdef.eog.interactive = 'yes'; > cfg.artfctdef.eog.cutoff = 2.5; > > [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); > > > but the resulting interactive window looks like this: > > > Seems like the preprocessing step isn't applied... any clue why that is? > > > Le mer. 26 oct. 2016 à 11:35, Diego Lozano-Soldevilla < > dlozanosoldevilla at gmail.com> a écrit : > >> Dear Maximilien, >> >> You should specify the filter parameters in the cfg: >> >> cfg.artfctdef.eog.bpfilter = 'yes' >> cfg.artfctdef.eog.bpfilttype = 'but';% or any other filter type you want to use, see help ft_preprocessing for more details >> cfg.artfctdef.eog.bpfreq = [1 15] >> cfg.artfctdef.eog.bpfiltord = 4; % goes hand-by-hand with the filter type; see >> >> >> Take a look to the fft_artifact_eog.m documentation. To know more about >> filtering you might want to take a look here: >> http://www.fieldtriptoolbox.org/example/determine_the_ >> filter_characteristics >> >> Best, >> >> Diego >> >> On 26 October 2016 at 10:42, Maximilien Chaumon < >> maximilien.chaumon at gmail.com> wrote: >> >> Dear all, >> when attempting to detect blinks automatically on a continuous recording >> without EOGs, I use a few frontal sensors and ft_artifact_eog as follows: >> >> cfg = []; >> cfg.dataset = fullfile(rootdir,f{iD}); >> cfg.layout = 'neuromag306mag.lay'; >> cfg.trialdef.eventtype = 'STI101'; >> cfg.trialdef.eventvalue = {255}; >> cfg = ft_definetrial(cfg); >> >> cfg.trl = [cfg.trl(1,1) cfg.trl(end,2) 0]; >> cfg.channel = 'megmag'; >> cfg.continuous = 'yes'; >> data = ft_preprocessing(cfg); >> >> >> cfg.artfctdef.eog = []; >> cfg.artfctdef.eog.channel = eogchans; >> cfg.artfctdef.eog.trlpadding = 0; >> cfg.artfctdef.eog.interactive = 'yes'; >> >> [cfg, artifact{iC,iD}] = ft_artifact_eog(cfg,data); >> >> This opens an interactive window in which the EOG signal is not >> BPfiltered, and contains in particular slow drifts that make the threshold >> detection pretty inefficient. I'm surprised because cfg.artfctdef is >> supposed to bpfilter 1-15Hz the data, isn't it? >> >> Is this normal? >> Thanks, >> Max >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Wed Oct 26 19:35:03 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Wed, 26 Oct 2016 13:35:03 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe wrote: > I would definitely recommend running some simulations. > > It might be simpler to use bootstrap samples rather than permutations to > generate your null distribution. Bootstrapping in also asymptotically > accurate. > -David > > > > On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: > >> Thanks, that was super interesting! Was not aware of those. >> >> Have been meditating this afternoon on this and related Anderson papers. >> What's interesting is that he appears to think my suggestion below *would* >> be asymptotically acceptable -- *if* one specifically permutes the >> dependent variable (power/ERP observation) rather than permuting each >> column of the independent variables separately (i.e., if one preserves any >> correlational structure that exists between the independent variables). >> That's the Manly (1997) method, and it appears that the only reason it >> breaks down sometimes is if there's an outlier in the independent variable. >> This could presumably be a problem in the ecological sciences, for which >> he's writing, where one can't control things like temperature in a season >> or numbers of eels that swim past a given sensor. In cognitive >> neuroscience, where the predictor/independent variables are usually dummy >> coded properties of the trial, this seems like we might be on firmer >> ground. >> >> Opinion based on reading and reasoning, of course, and not to be trusted >> until and unless I or someone else were to back it up by doing some >> simulated-data experiments... >> >> >> Alik Widge >> alik.widge at gmail.com >> (206) 866-5435 >> >> >> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> wrote: >> >>> Hi Elisabeth and Alik, >>> Permutation methods applied to multiple regression models are not >>> generally guaranteed to be accurate because testing individual terms in >>> such models (e.g., partial correlation coefficients) requires accurate >>> knowledge of other terms in the model (e.g., the slope coefficients for all >>> the other predictors in the multiple regression). Because such parameters >>> have to be estimated from the data, permutation tests are only >>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>> each factor), where permutation methods do guarantee accuracy. >>> In lieu of permutation testing, you might want to try using one of >>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>> permutation testing for detecting a very broadly distributed effect (e.g., >>> a P300-like effect) and it was far more sensitive than cluster-based >>> testing for an effect with a very limited distribution (e.g., an N170-like >>> effect). FDR correction is also very computationally efficient. >>> hope this is helpful, >>> -David >>> >>> >>> Refs: >>> Anderson, M. J. (2001). Permutation tests for univariate or multivariate >>> analysis of variance and regression. *Canadian journal of fisheries and >>> aquatic sciences*, *58*(3), 626-639. >>> >>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>> >>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>> analysis of event‐related brain potentials/fields II: Simulation studies. >>> *Psychophysiology*, *48*(12), 1726-1737. >>> >>> >>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >>> elisabethsusanne.may at gmail.com> wrote: >>> >>>> Dear Eric and Alik, >>>> >>>> thanks a lot for your helpful responses! >>>> >>>> I will have a close look at the faqs, Eric, and test the approaches you >>>> outlined. I am curious, anyway, as to how different results will be for >>>> simple regressions compared to the multilevel results of the linear-mixed >>>> models. >>>> >>>> Like Alik, I am also curious about other people's opinions on the >>>> general question if there are theoretical reasons against a combination of >>>> the approaches like Alik suggested. We also thought about this approach but >>>> haven't fully tested it yet because of the very long calculation times. >>>> >>>> Thanks again and have a nice weekend! >>>> Elisabeth >>>> >>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>> >>>>> Eric, I don't think I understand why you would say "I do not see how >>>>> these models could be combined with permutation-based inference; they are >>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>> a regression, and the beta coefficient for the independent-variable of >>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>> much does the independent variable explain the brain activity?" In that >>>>> framework, it seems to me that one could do the following: >>>>> >>>>> for n=1:1000 >>>>> 1) Permute the condition labels (within subjects) of the individual >>>>> trials >>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>> and corresponding t-map >>>>> 3) Threshold and construct cluster mass statistic as usual >>>>> end >>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>> cluster p-value >>>>> >>>>> >>>>> Now, the main thing that has come up when we've tried to do this is >>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>> over time and space, one could use the output of one GLM as the seed to the >>>>> next, which would speed up convergence.) So it still does not seem like a >>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>> it wouldn't work? >>>>> >>>>> >>>>> Alik Widge, MD, PhD >>>>> Director, Translational NeuroEngineering Laboratory >>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>> awidge at partners.org >>>>> http://scholar.harvard.edu/awidge/ >>>>> 617-643-2580 >>>>> >>>>> Alik Widge >>>>> alik.widge at gmail.com >>>>> (206) 866-5435 >>>>> >>>>> >>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>> e.maris at donders.ru.nl> wrote: >>>>> >>>>>> Note: this is the second time I post this reply, and the reason is >>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>> (shame on me…(-;) >>>>>> >>>>>> *From: *Elisabeth May >>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>> tests on linear mixed models* >>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>> *To: * >>>>>> *Reply-To: *FieldTrip discussion list >>>>>> >>>>>> >>>>>> Dear FieldTripers, >>>>>> >>>>>> I have a question about the potential use of cluster-based >>>>>> permutation tests for results obtained using linear mixed models. >>>>>> >>>>>> We are working with data from a 10 min EEG experiment on source level >>>>>> with the aim to quantify the relationship of brain activity in different >>>>>> frequency bands with continous perceptual ratings across 20 subjects in >>>>>> different experimental conditions. Thus, we have 10 min time courses of >>>>>> brain activity and ratings for each voxel for different conditions and want >>>>>> to test a) if there are significant relationships in the single conditions >>>>>> and b) if these relationships differ between two conditions. To this end, I >>>>>> have calculated linear mixed models in R using the lme4 toolbox. For both >>>>>> the single condition relationships and the condition contrasts, they result >>>>>> in a single t-value (and a corresponding p-value), which is based on >>>>>> information on both the single subject and the group level (i.e. we perform >>>>>> a multi-level analysis). However, with more than 2000 voxels, we have a lot >>>>>> of t-values and are wondering if there is a way to apply cluster-based >>>>>> tests to correct for multiple comparisons. >>>>>> >>>>>> The main problem I see is that I only have one multilevel t-value for >>>>>> the effect across all subjects, i.e. I don't have single subjects values, >>>>>> which I could then e.g. randomize between conditions as normally done in >>>>>> cluster-based permutation tests. (Or rather, I would be able to extract >>>>>> single subject values but would then loose the advantage of the multi-level >>>>>> analysis.) >>>>>> >>>>>> I found an old thread in the mailinglist archive where it was >>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>> /005375.html). I understand that, in our case, I would do this >>>>>> randomly for all voxels in each randomization and then build spatial >>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>> significant relations in my single conditions (a) or no significant >>>>>> relationship differences in my condition contrasts (b). >>>>>> >>>>>> For the condition contrasts, I would be able to permute the condition >>>>>> labels as normally done in cluster-based permutation tests,I think, but >>>>>> would then have to recalculate the linear mixed models for all voxels in >>>>>> every permutation. This would result in a very high computational load. >>>>>> >>>>>> Does anyone have any experience with this kind of analysis? Would the >>>>>> flipping of t-values be a valid approach (and if yes, is there anything to >>>>>> keep in mind in particular)? Can you think of other ways to combine linear >>>>>> mixed models with a multiple comparison correction on the cluster level? >>>>>> >>>>>> >>>>>> Hi Elisabeth, >>>>>> >>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>> respect to the different ways in which they can be used to deal with >>>>>> correlated observations (typically, time series). However, from a >>>>>> theoretical point of view, I do not see how these models could be combined >>>>>> with permutation-based inference; they are just different statistical >>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>> different conditions and wan to test a) if there are significant >>>>>> relationships in the single conditions and b) if these relationships differ >>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>> regression coefficients in each of the two conditions. Answering question >>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>> difference between them using a cluster-based permutation test using the >>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>> on the general approach for testing interactions using cluster-based >>>>>> permutation tests. >>>>>> >>>>>> Have a look here: >>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>> behavioural_variables >>>>>> and >>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>> >>>>>> These tutorials provide all the necessary concepts, although they do >>>>>> not answer your question in a recipe-like fashion. >>>>>> >>>>>> best, >>>>>> Eric Maris >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.opie at adelaide.edu.au Wed Oct 26 22:39:38 2016 From: george.opie at adelaide.edu.au (George McKenzie Opie) Date: Wed, 26 Oct 2016 20:39:38 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency Message-ID: Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Oct 26 22:50:40 2016 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 26 Oct 2016 22:50:40 +0200 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency In-Reply-To: References: Message-ID: Dear George, You have a typo in the cfg at cfg.frequency. Hope this helps, Julian Am Mittwoch, 26. Oktober 2016 schrieb George McKenzie Opie : > Hi all, > > > Im trying to run some between-subject cluster-based analyses on some > time-frequency data, but am having some issues getting the analysis to > average over a specified frequency range. For some reason this only happens > with between-subject comparisons and not within-subject. My cfg structure > is shown below. D1 and D2 are grandaverage data from two groups calculated > using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it > averages over all frequencies (5 - 45 Hz), instead of the specified > frequency range (31 - 45 Hz). Any help would be very much appreciated. > > > cfg = []; > cfg.channel = {'all'}; > cfg.minnbchan = 2; > cfg.clusteralpha = 0.01; > cfg.clusterstatistic = 'maxsum'; > cfg.alpha = 0.05; > cfg.latency = [0.025, 0.220]; > cfg.avgoverfreq = 'yes'; > cfg.frequnecy = [31 45]; > cfg.avgovertime = 'yes'; > cfg.avgoverchan = 'no'; > cfg.statistic = 'indepsamplesT'; > cfg.numrandomization = 2000; > cfg.correctm = 'cluster'; > cfg.method = 'montecarlo'; > cfg.tail = 0; > cfg.clustertail = 0; > cfg.neighbours = neighbours; > cfg.parameter = 'powspctrm'; > > design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); > design(1,1:size(D1.powspctrm,1)) = 1; > design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + > size(D2.powspctrm,1)))= 2; > > cfg.design = design; > cfg.ivar = 1; > > [stat] = ft_freqstatistics(cfg, D1, D2); > > > kind regards, > > > George Opie > > ARC Research Associate > Discipline of Physiology > School of Medicine > The University of Adelaide, AUSTRALIA 5005 > Ph : +61 8 8313 4157 > Fax : +61 8 8303 5384 > e-mail: george.opie at adelaide.edu.au > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.opie at adelaide.edu.au Wed Oct 26 22:51:57 2016 From: george.opie at adelaide.edu.au (George McKenzie Opie) Date: Wed, 26 Oct 2016 20:51:57 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency In-Reply-To: References: , Message-ID: Wow, cant believe I missed that! Thanks Julian, much appreciated. George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Julian Keil Sent: Thursday, 27 October 2016 7:20:40 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] between-subject cluster-stats wont average over specified frequency Dear George, You have a typo in the cfg at cfg.frequency. Hope this helps, Julian Am Mittwoch, 26. Oktober 2016 schrieb George McKenzie Opie : Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Wed Oct 26 23:36:32 2016 From: pgoodin at swin.edu.au (Peter Goodin) Date: Wed, 26 Oct 2016 21:36:32 +0000 Subject: [FieldTrip] between-subject cluster-stats wont average over specified frequency Message-ID: Hi George, There's a typo in cfg.frequency (in the script it reads cfg.frequnecy). This could explain the behaviour. Peter On 27 Oct 2016 07:58, George McKenzie Opie wrote: Hi all, Im trying to run some between-subject cluster-based analyses on some time-frequency data, but am having some issues getting the analysis to average over a specified frequency range. For some reason this only happens with between-subject comparisons and not within-subject. My cfg structure is shown below. D1 and D2 are grandaverage data from two groups calculated using ft_freqgrandaverage. When I call ft_freqstatistics with this cfg, it averages over all frequencies (5 - 45 Hz), instead of the specified frequency range (31 - 45 Hz). Any help would be very much appreciated. cfg = []; cfg.channel = {'all'}; cfg.minnbchan = 2; cfg.clusteralpha = 0.01; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.05; cfg.latency = [0.025, 0.220]; cfg.avgoverfreq = 'yes'; cfg.frequnecy = [31 45]; cfg.avgovertime = 'yes'; cfg.avgoverchan = 'no'; cfg.statistic = 'indepsamplesT'; cfg.numrandomization = 2000; cfg.correctm = 'cluster'; cfg.method = 'montecarlo'; cfg.tail = 0; cfg.clustertail = 0; cfg.neighbours = neighbours; cfg.parameter = 'powspctrm'; design = zeros(1,size(D1.powspctrm,1) + size(D2.powspctrm,1)); design(1,1:size(D1.powspctrm,1)) = 1; design(1,(size(D1.powspctrm,1)+1):(size(D1.powspctrm,1) + size(D2.powspctrm,1)))= 2; cfg.design = design; cfg.ivar = 1; [stat] = ft_freqstatistics(cfg, D1, D2); kind regards, George Opie ARC Research Associate Discipline of Physiology School of Medicine The University of Adelaide, AUSTRALIA 5005 Ph : +61 8 8313 4157 Fax : +61 8 8303 5384 e-mail: george.opie at adelaide.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Thu Oct 27 13:57:07 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Thu, 27 Oct 2016 11:57:07 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From mona at sdsc.edu Fri Oct 28 00:48:22 2016 From: mona at sdsc.edu (Wong-Barnum, Mona) Date: Thu, 27 Oct 2016 22:48:22 +0000 Subject: [FieldTrip] shifting data time Message-ID: Hi: I need a way to “stitch” together a single subject’s data recorded over many hours which were saved in 14 separate files. When stitched together, file 1 end time is the start time of file 2, file 2 end time is the start of file 3, and so on. Unfortunately the recorded files all start at time t = 0 so ft_appenddata() put them into 14 separate trials. I need to shift the time for each file so they will be jointed into a single trial. I didn’t find any ft_ function to do this. Any suggestions? thanks, Mona ************************************************ Mona Wong Web & iPad Application Developer San Diego Supercomputer Center You are the light you wish to see. ************************************************ From anne.hauswald at me.com Fri Oct 28 10:36:31 2016 From: anne.hauswald at me.com (anne Hauswald) Date: Fri, 28 Oct 2016 10:36:31 +0200 Subject: [FieldTrip] shifting data time In-Reply-To: References: Message-ID: Hi Mona, if you do cfg=[]; all=ft_appenddata(cfg, data1, data2, data3, data4); you get among the other fields all= time: {1x4 cell} %assuming each dataset equals one trial, which is what you want to replace. you could try to create a matrix, based on your sampling rate with all the continuous time points, here just for illustration: all_timepoints=[0:0.025:9.975] %adapt to your sampling rate and length of data, be very sure the end of one file is the beginning of the next one. (This is giving you all points from 0 to 9.975 with steps of 0.025) trl_timepoints=mat2cell(all_timepoints, 1, [100 100 100 100]) %here I create 4 cell arrays, corresponding e.g. to 4 trials will result in trl_timepoints = [1x100 double] [1x100 double] [1x100 double] [1x100 double] with continuous time information (trial 1 starts at 0, trial 2 at 2.5, trials 3 at 5, and trial 4 at 7.5) of the same length. this you can then use to replace the original time information: all_data.time_old=all_data.time %if you want to keep the original time information all_data.time=trl_timepoints In general: are you really sure that you need the continuous time information? There are many processing and analyses steps that can be done on the appended time information… There might be more elegant ways to do this. Hope there is no typo and that it helps Best Anne > Am 28.10.2016 um 00:48 schrieb Wong-Barnum, Mona : > > > Hi: > > I need a way to “stitch” together a single subject’s data recorded over many hours which were saved in 14 separate files. When stitched together, file 1 end time is the start time of file 2, file 2 end time is the start of file 3, and so on. Unfortunately the recorded files all start at time t = 0 so ft_appenddata() put them into 14 separate trials. I need to shift the time for each file so they will be jointed into a single trial. I didn’t find any ft_ function to do this. Any suggestions? > > thanks, > Mona > > ************************************************ > Mona Wong > Web & iPad Application Developer > San Diego Supercomputer Center > > You are the light you wish to see. > ************************************************ > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayelet.landau at gmail.com Fri Oct 28 10:30:27 2016 From: ayelet.landau at gmail.com (Ayelet Landau) Date: Fri, 28 Oct 2016 11:30:27 +0300 Subject: [FieldTrip] Postdoc/PhD positions - Cognitive Neuroscience @ the Hebrew University of Jerusalem, Israel Message-ID: *Post Doc and PhD positions at the Brain Attention and Time Lab, at the Hebrew University of Jerusalem, Israel* Full-time post doc and PhD positions are available in the Brain Attention and Time Lab of Dr. Ayelet N. Landau at the Hebrew University of Jerusalem. Initial appointment will be for one year with the option to renew annually up to 4 years. Preferred starting date: January 2017 The lab’s core research areas include the guidance of attention and temporal processing and their underlying neural mechanisms. As cognitive neuroscientists we try to construe models of cognition and examine them using both in perception and in physiology. The positions are part of two externally funded projects focused on: (1) Fluctuations in attention and rhythmic attentional sampling. (2) Neural mechanisms of interval timing. Both research programs examine the role of brain rhythms in cognition. In the lab, we measure perception in different modalities (tactile, visual and auditory) together with non-invasive physiology (MEG/EEG) and eye-tracking. You can read about the research and the lab here. We are seeking a highly qualified post doc with a doctorate in a relevant field (e.g., Psychology, Neuroscience, and Cognitive Science) and shared interests in the core research areas described above. The researcher, ideally, should have extensive experience with EEG/MEG methodology and neural oscillations measurement. Experience with other techniques - such as fMRI, computational modeling, etc. - is also welcome but not required. In addition, we are looking for strong candidates for a funded PhD studentship. The Hebrew University offers several training opportunities in different departments. The successful candidate will be competitive for one of the flagship programs (psychology, cognitive science or neuroscience) and will have demonstrated experience in research from their post-bac or BA education (as research assistants or honors students). Knowledge of programming is an advantage. For both positions, a passion and a commitment to science, strong social skills, trouble shooting skills and fast learning abilities are a requirement. Interested candidates should send a CV, a brief statement of research interests, and the names and contact details of two academic references to ayelet.landau at huji.ac.il preferably by December 1st. Applications will be considered until the positions are filled. I look forward to hearing from you! -- Ayelet N. Landau, PhD *Senior Lecturer* *Department of Psychology & Department of Cognitive SciencesThe Hebrew University of JerusalemJerusalem 91905Israel* -------------- next part -------------- An HTML attachment was scrubbed... URL: From alik.widge at gmail.com Fri Oct 28 14:36:39 2016 From: alik.widge at gmail.com (Alik Widge) Date: Fri, 28 Oct 2016 08:36:39 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> References: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Message-ID: So, two further questions. 1) Anyone reading this thread have some code for a reasonable ERP generator, especially one that models different ERPs per subject? I'm getting increasingly interested in doing some simulations to test my claims. (I'm thinking to do the 1d case just because it's faster to run. ) However, I'd like to do that on stimulated data that properly models, E.g., inter-subject variability of the precise timing of major peaks. 2) Eric, why are you describing the below as a fixed effects model? If we do a mixed model (with subject as a random intercept) at each time/frequency/sensor point, that seems like it handles the random effect that most people care about. Are you saying that you think each predictor variable would also need to be modeled as a per-subject slope? I guess I'm also thinking here that (to your second point), if the resulting values are used for thresholding to create cluster statistics for inference, inflation in the t/p values should be controlled for because the null distribution created during the permutation will have the same inflation. However, I don't believe I have a formal mathematical backup for that intuition, hence (1) above. On Oct 27, 2016 7:58 AM, "Maris, E.G.G. (Eric)" wrote: > Dear colleagues, > > @alik : > 1. The approach you propose is a so-called fixed-effects approach, of > which the outcome may depend on just a few subjects (provided the number of > trials is high). Some neuroscientists consider a fixed-effects approach > insufficient to support a scientific claim. E.g., the whole neuroimaging > community does so. > 2. Your approach is actually a genuine permutation test, in which the > LLM-derived t-stats are only used for thresholding (and not for inference). > > @david : > 1. There is nothing wrong with using FDR correction, if you think the > false discovery rate is the quantity that one should control. Others may > disagree though, stating the more strict family-wise error rate is the > relevant quantity. > 2. FDR correction assumes that the sample-specific (sample = a > channel-time-frequency triplet) p-values are unbiased. Because the > unbiasedness of these p-values depends on auxiliary assumptions, there may > be good reasons not to trust them. This is supported by the recent Ekstrom > et al paper on the inflated type 1 error rate in neuroimaging studies. > > best, > Eric Maris > > > > > > > > *From: *David Groppe > *Subject: **Re: [FieldTrip] Question about cluster-based permutation > tests on linear mixed models* > *Date: *26 October 2016 at 19:35:03 GMT+2 > *To: *FieldTrip discussion list , < > alik.widge at gmail.com> > *Reply-To: *FieldTrip discussion list > > > P.S. If you want to explore using FDR control to correct for multiple > comparisons, I would not recommend limiting yourself to FieldTrip's FDR > correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR > control procedure, which is guaranteed to control the FDR at or below the > desired level, but tends to be quite overly conservative in practice. The > more popular FDR control algorithm by Benjamini & Hochberg is not always > guaranteed to control the FDR at or below the desired level, but it is > much less conservative and tends to accurately control FDR in practice. > Here is some code for the > Benjamini & Hochberg algorithm: > > https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh > > MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also > implements the > Benjamini & Hochberg algorithm. > > > > On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: > >> I would definitely recommend running some simulations. >> >> It might be simpler to use bootstrap samples rather than permutations to >> generate your null distribution. Bootstrapping in also asymptotically >> accurate. >> -David >> >> >> >> On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: >> >>> Thanks, that was super interesting! Was not aware of those. >>> >>> Have been meditating this afternoon on this and related Anderson papers. >>> What's interesting is that he appears to think my suggestion below *would* >>> be asymptotically acceptable -- *if* one specifically permutes the >>> dependent variable (power/ERP observation) rather than permuting each >>> column of the independent variables separately (i.e., if one preserves any >>> correlational structure that exists between the independent variables). >>> That's the Manly (1997) method, and it appears that the only reason it >>> breaks down sometimes is if there's an outlier in the independent variable. >>> This could presumably be a problem in the ecological sciences, for which >>> he's writing, where one can't control things like temperature in a season >>> or numbers of eels that swim past a given sensor. In cognitive >>> neuroscience, where the predictor/independent variables are usually dummy >>> coded properties of the trial, this seems like we might be on firmer ground. >>> >>> >>> Opinion based on reading and reasoning, of course, and not to be trusted >>> until and unless I or someone else were to back it up by doing some >>> simulated-data experiments... >>> >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> > wrote: >>> >>>> Hi Elisabeth and Alik, >>>> Permutation methods applied to multiple regression models are not >>>> generally guaranteed to be accurate because testing individual terms in >>>> such models (e.g., partial correlation coefficients) requires accurate >>>> knowledge of other terms in the model (e.g., the slope coefficients for all >>>> the other predictors in the multiple regression). Because such parameters >>>> have to be estimated from the data, permutation tests are only >>>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>>> each factor), where permutation methods do guarantee accuracy. >>>> In lieu of permutation testing, you might want to try using one of >>>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>>> permutation testing for detecting a very broadly distributed effect (e.g., >>>> a P300-like effect) and it was far more sensitive than cluster-based >>>> testing for an effect with a very limited distribution (e.g., an N170-like >>>> effect). FDR correction is also very computationally efficient. >>>> hope this is helpful, >>>> -David >>>> >>>> >>>> Refs: >>>> Anderson, M. J. (2001). Permutation tests for univariate or >>>> multivariate analysis of variance and regression. *Canadian journal of >>>> fisheries and aquatic sciences*, *58*(3), 626-639. >>>> >>>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>>> >>>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>>> analysis of event‐related brain potentials/fields II: Simulation studies. >>>> *Psychophysiology*, *48*(12), 1726-1737. >>>> >>>> >>>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May >>> gmail.com> wrote: >>>> >>>>> Dear Eric and Alik, >>>>> >>>>> thanks a lot for your helpful responses! >>>>> >>>>> I will have a close look at the faqs, Eric, and test the approaches >>>>> you outlined. I am curious, anyway, as to how different results will be for >>>>> simple regressions compared to the multilevel results of the linear-mixed >>>>> models. >>>>> >>>>> Like Alik, I am also curious about other people's opinions on the >>>>> general question if there are theoretical reasons against a combination of >>>>> the approaches like Alik suggested. We also thought about this approach but >>>>> haven't fully tested it yet because of the very long calculation times. >>>>> >>>>> Thanks again and have a nice weekend! >>>>> Elisabeth >>>>> >>>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>>> >>>>>> Eric, I don't think I understand why you would say "I do not see how >>>>>> these models could be combined with permutation-based inference; they are >>>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>>> a regression, and the beta coefficient for the independent-variable of >>>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>>> much does the independent variable explain the brain activity?" In that >>>>>> framework, it seems to me that one could do the following: >>>>>> >>>>>> for n=1:1000 >>>>>> 1) Permute the condition labels (within subjects) of the >>>>>> individual trials >>>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>>> and corresponding t-map >>>>>> 3) Threshold and construct cluster mass statistic as usual >>>>>> end >>>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>>> cluster p-value >>>>>> >>>>>> >>>>>> Now, the main thing that has come up when we've tried to do this is >>>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>>> over time and space, one could use the output of one GLM as the seed to the >>>>>> next, which would speed up convergence.) So it still does not seem like a >>>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>>> it wouldn't work? >>>>>> >>>>>> >>>>>> Alik Widge, MD, PhD >>>>>> Director, Translational NeuroEngineering Laboratory >>>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>>> awidge at partners.org >>>>>> http://scholar.harvard.edu/awidge/ >>>>>> 617-643-2580 >>>>>> >>>>>> Alik Widge >>>>>> alik.widge at gmail.com >>>>>> (206) 866-5435 >>>>>> >>>>>> >>>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>>> e.maris at donders.ru.nl> wrote: >>>>>> >>>>>>> Note: this is the second time I post this reply, and the reason is >>>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>>> (shame on me…(-;) >>>>>>> >>>>>>> *From: *Elisabeth May >>>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>>> tests on linear mixed models* >>>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>>> *To: * >>>>>>> *Reply-To: *FieldTrip discussion list >>>>>>> >>>>>>> >>>>>>> Dear FieldTripers, >>>>>>> >>>>>>> I have a question about the potential use of cluster-based >>>>>>> permutation tests for results obtained using linear mixed models. >>>>>>> >>>>>>> We are working with data from a 10 min EEG experiment on source >>>>>>> level with the aim to quantify the relationship of brain activity in >>>>>>> different frequency bands with continous perceptual ratings across 20 >>>>>>> subjects in different experimental conditions. Thus, we have 10 min time >>>>>>> courses of brain activity and ratings for each voxel for different >>>>>>> conditions and want to test a) if there are significant relationships in >>>>>>> the single conditions and b) if these relationships differ between two >>>>>>> conditions. To this end, I have calculated linear mixed models in R using >>>>>>> the lme4 toolbox. For both the single condition relationships and the >>>>>>> condition contrasts, they result in a single t-value (and a corresponding >>>>>>> p-value), which is based on information on both the single subject and the >>>>>>> group level (i.e. we perform a multi-level analysis). However, with more >>>>>>> than 2000 voxels, we have a lot of t-values and are wondering if there is a >>>>>>> way to apply cluster-based tests to correct for multiple comparisons. >>>>>>> >>>>>>> The main problem I see is that I only have one multilevel t-value >>>>>>> for the effect across all subjects, i.e. I don't have single subjects >>>>>>> values, which I could then e.g. randomize between conditions as normally >>>>>>> done in cluster-based permutation tests. (Or rather, I would be able to >>>>>>> extract single subject values but would then loose the advantage of the >>>>>>> multi-level analysis.) >>>>>>> >>>>>>> I found an old thread in the mailinglist archive where it was >>>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>>> /005375.html). I understand that, in our case, I would do this >>>>>>> randomly for all voxels in each randomization and then build spatial >>>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>>> significant relations in my single conditions (a) or no significant >>>>>>> relationship differences in my condition contrasts (b). >>>>>>> >>>>>>> For the condition contrasts, I would be able to permute the >>>>>>> condition labels as normally done in cluster-based permutation tests,I >>>>>>> think, but would then have to recalculate the linear mixed models for all >>>>>>> voxels in every permutation. This would result in a very high computational >>>>>>> load. >>>>>>> >>>>>>> Does anyone have any experience with this kind of analysis? Would >>>>>>> the flipping of t-values be a valid approach (and if yes, is there anything >>>>>>> to keep in mind in particular)? Can you think of other ways to combine >>>>>>> linear mixed models with a multiple comparison correction on the cluster >>>>>>> level? >>>>>>> >>>>>>> >>>>>>> Hi Elisabeth, >>>>>>> >>>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>>> respect to the different ways in which they can be used to deal with >>>>>>> correlated observations (typically, time series). However, from a >>>>>>> theoretical point of view, I do not see how these models could be combined >>>>>>> with permutation-based inference; they are just different statistical >>>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>>> different conditions and wan to test a) if there are significant >>>>>>> relationships in the single conditions and b) if these relationships differ >>>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>>> regression coefficients in each of the two conditions. Answering question >>>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>>> difference between them using a cluster-based permutation test using the >>>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>>> on the general approach for testing interactions using cluster-based >>>>>>> permutation tests. >>>>>>> >>>>>>> Have a look here: >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>>> behavioural_variables >>>>>>> and >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>>> >>>>>>> These tutorials provide all the necessary concepts, although they do >>>>>>> not answer your question in a recipe-like fashion. >>>>>>> >>>>>>> best, >>>>>>> Eric Maris >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From K.Muller at psych.ru.nl Fri Oct 28 15:06:59 2016 From: K.Muller at psych.ru.nl (=?iso-8859-1?B?TfxsbGVyLCBLLiAoS2F0amEp?=) Date: Fri, 28 Oct 2016 13:06:59 +0000 Subject: [FieldTrip] MNE single trial time courses Message-ID: Dear list, What is the current way to go (if there is one) to obtain *single trial* source time courses from source reconstructions from Minimum Norm Estimate? Is there a tutorial? I used the MNE tutorial as a basis, i.e. I have a FreeSurfer based source model. In old mailing list messages there is some information about options like .rawtrial='yes' or .singletrial='yes', but some of them are very old and I am unable to extract which way to go at the moment. E.g. .singletrial is deprecated. Best regards, Katja From mehdy.dousty at gmail.com Fri Oct 28 18:49:03 2016 From: mehdy.dousty at gmail.com (mehdy dousty) Date: Fri, 28 Oct 2016 16:49:03 +0000 Subject: [FieldTrip] Covaraince matrix for MEG resting state Message-ID: Hi all I am using the resting state MEG signal for constructing the inverse problem by eLoreta, and as it is resting state, the covariance matrix needs to be used, so I am going to use HCP R-noise to construct the covariance matrix, but there are two main issues which I need your help. 1- as I am going to use preprocess data for resting state, do I need process the noise as well? if it is so, I can't find the time series of the noise in the raw data after using ft_read_header. 2- do I need to redefine the time series which add the noise time series at the beginning of the signal and then add the resting state time series so I can use the below code for computing the covariance? cfg= [] cfg.covariance = 'yes'; % I dont know how to enter the noise covariance to the data cfg.covariancewindow = [-inf 0]; timelockanalysis = ft_timelockanalysis(cfg, inputdata); I look forward to hearing from you. *Mehdy Dousty* *Hotchkiss Brain Institute* *University of Calgary* *HSC Building, Room 2932B* *3330 Hospital Drive NW* *Calgary, AB T2N 4N1* *Email Mehdy.Dousty at Ucalgary.ca* -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Sat Oct 29 20:20:05 2016 From: david.m.groppe at gmail.com (David Groppe) Date: Sat, 29 Oct 2016 14:20:05 -0400 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> References: <14E0DE4B-5EC1-4623-A05E-3ACF726BA48C@donders.ru.nl> Message-ID: @Eric 1. Note the FDR control actually provides "weak" control of the family-wise error rate (FWER). This is exactly the same degree of FWER control provided by cluster-based permutation tests. If you want strong control of FWER you will need to do something like Bonferroni-Holm or max-statistic (i.e., non-cluster) based permutation tests. 2. It's true that FDR assumes that the individual test p-values are accurate. You can derive these p-values though via non-parametric techniques like non-cluster-based permutation tests, thus the underlying statistical assumptions will be the same as if you had done a cluster-based permutation test. Moreover, if you have good reason to make parametric assumptions, FDR will let you exploit them. @Alik 1. I simulated data in that 2011 paper by randomly flipping the polarity of real EEG data to generate 0 mean, realistic ERP noise. The noise was subject-specific, but the simulated ERP effects were exactly the same for all simulated participants. So it couldn't be used to address the question you're after. On Thu, Oct 27, 2016 at 7:57 AM, Maris, E.G.G. (Eric) wrote: > Dear colleagues, > > @alik : > 1. The approach you propose is a so-called fixed-effects approach, of > which the outcome may depend on just a few subjects (provided the number of > trials is high). Some neuroscientists consider a fixed-effects approach > insufficient to support a scientific claim. E.g., the whole neuroimaging > community does so. > 2. Your approach is actually a genuine permutation test, in which the > LLM-derived t-stats are only used for thresholding (and not for inference). > > @david : > 1. There is nothing wrong with using FDR correction, if you think the > false discovery rate is the quantity that one should control. Others may > disagree though, stating the more strict family-wise error rate is the > relevant quantity. > 2. FDR correction assumes that the sample-specific (sample = a > channel-time-frequency triplet) p-values are unbiased. Because the > unbiasedness of these p-values depends on auxiliary assumptions, there may > be good reasons not to trust them. This is supported by the recent Ekstrom > et al paper on the inflated type 1 error rate in neuroimaging studies. > > best, > Eric Maris > > > > > > > > *From: *David Groppe > *Subject: **Re: [FieldTrip] Question about cluster-based permutation > tests on linear mixed models* > *Date: *26 October 2016 at 19:35:03 GMT+2 > *To: *FieldTrip discussion list , < > alik.widge at gmail.com> > *Reply-To: *FieldTrip discussion list > > > P.S. If you want to explore using FDR control to correct for multiple > comparisons, I would not recommend limiting yourself to FieldTrip's FDR > correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR > control procedure, which is guaranteed to control the FDR at or below the > desired level, but tends to be quite overly conservative in practice. The > more popular FDR control algorithm by Benjamini & Hochberg is not always > guaranteed to control the FDR at or below the desired level, but it is > much less conservative and tends to accurately control FDR in practice. > Here is some code for the > Benjamini & Hochberg algorithm: > > https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh > > MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also > implements the > Benjamini & Hochberg algorithm. > > > > On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: > >> I would definitely recommend running some simulations. >> >> It might be simpler to use bootstrap samples rather than permutations to >> generate your null distribution. Bootstrapping in also asymptotically >> accurate. >> -David >> >> >> >> On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge wrote: >> >>> Thanks, that was super interesting! Was not aware of those. >>> >>> Have been meditating this afternoon on this and related Anderson papers. >>> What's interesting is that he appears to think my suggestion below *would* >>> be asymptotically acceptable -- *if* one specifically permutes the >>> dependent variable (power/ERP observation) rather than permuting each >>> column of the independent variables separately (i.e., if one preserves any >>> correlational structure that exists between the independent variables). >>> That's the Manly (1997) method, and it appears that the only reason it >>> breaks down sometimes is if there's an outlier in the independent variable. >>> This could presumably be a problem in the ecological sciences, for which >>> he's writing, where one can't control things like temperature in a season >>> or numbers of eels that swim past a given sensor. In cognitive >>> neuroscience, where the predictor/independent variables are usually dummy >>> coded properties of the trial, this seems like we might be on firmer ground. >>> >>> >>> Opinion based on reading and reasoning, of course, and not to be trusted >>> until and unless I or someone else were to back it up by doing some >>> simulated-data experiments... >>> >>> >>> Alik Widge >>> alik.widge at gmail.com >>> (206) 866-5435 >>> >>> >>> On Tue, Oct 25, 2016 at 11:30 AM, David Groppe >> > wrote: >>> >>>> Hi Elisabeth and Alik, >>>> Permutation methods applied to multiple regression models are not >>>> generally guaranteed to be accurate because testing individual terms in >>>> such models (e.g., partial correlation coefficients) requires accurate >>>> knowledge of other terms in the model (e.g., the slope coefficients for all >>>> the other predictors in the multiple regression). Because such parameters >>>> have to be estimated from the data, permutation tests are only >>>> ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). >>>> Though there are special cases (e.g., a two factor ANOVA with two levels of >>>> each factor), where permutation methods do guarantee accuracy. >>>> In lieu of permutation testing, you might want to try using one of >>>> Benjamini and colleagues' false discovery rate (FDR) control algorithms to >>>> control for multiple comparisons. In my tests on simulated ERP data (Groppe >>>> et al., 2011), FDR correction was nearly as powerful as cluster-based >>>> permutation testing for detecting a very broadly distributed effect (e.g., >>>> a P300-like effect) and it was far more sensitive than cluster-based >>>> testing for an effect with a very limited distribution (e.g., an N170-like >>>> effect). FDR correction is also very computationally efficient. >>>> hope this is helpful, >>>> -David >>>> >>>> >>>> Refs: >>>> Anderson, M. J. (2001). Permutation tests for univariate or >>>> multivariate analysis of variance and regression. *Canadian journal of >>>> fisheries and aquatic sciences*, *58*(3), 626-639. >>>> >>>> Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of >>>> Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. >>>> >>>> Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate >>>> analysis of event‐related brain potentials/fields II: Simulation studies. >>>> *Psychophysiology*, *48*(12), 1726-1737. >>>> >>>> >>>> On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May < >>>> elisabethsusanne.may at gmail.com> wrote: >>>> >>>>> Dear Eric and Alik, >>>>> >>>>> thanks a lot for your helpful responses! >>>>> >>>>> I will have a close look at the faqs, Eric, and test the approaches >>>>> you outlined. I am curious, anyway, as to how different results will be for >>>>> simple regressions compared to the multilevel results of the linear-mixed >>>>> models. >>>>> >>>>> Like Alik, I am also curious about other people's opinions on the >>>>> general question if there are theoretical reasons against a combination of >>>>> the approaches like Alik suggested. We also thought about this approach but >>>>> haven't fully tested it yet because of the very long calculation times. >>>>> >>>>> Thanks again and have a nice weekend! >>>>> Elisabeth >>>>> >>>>> 2016-10-20 12:49 GMT+02:00 Alik Widge : >>>>> >>>>>> Eric, I don't think I understand why you would say "I do not see how >>>>>> these models could be combined with permutation-based inference; they are >>>>>> just different statistical frameworks". As you somewhat hint, the (G)LMM is >>>>>> a regression, and the beta coefficient for the independent-variable of >>>>>> interest at each voxel/vertex/sensor x timepoint can be interpreted as "how >>>>>> much does the independent variable explain the brain activity?" In that >>>>>> framework, it seems to me that one could do the following: >>>>>> >>>>>> for n=1:1000 >>>>>> 1) Permute the condition labels (within subjects) of the >>>>>> individual trials >>>>>> 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map >>>>>> and corresponding t-map >>>>>> 3) Threshold and construct cluster mass statistic as usual >>>>>> end >>>>>> 4) Identify cluster in the original (unpermuted) analysis and report >>>>>> cluster p-value >>>>>> >>>>>> >>>>>> Now, the main thing that has come up when we've tried to do this is >>>>>> that re-fitting a (voxel x time) GLM 1000 times by the standard iterative >>>>>> maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine >>>>>> it would require rewriting at least a statfun, maybe other pieces of the >>>>>> code. (We had an idea that, since the betas likely should vary smoothly >>>>>> over time and space, one could use the output of one GLM as the seed to the >>>>>> next, which would speed up convergence.) So it still does not seem like a >>>>>> good idea, but based on the above, is there actually a *theoretical* reason >>>>>> it wouldn't work? >>>>>> >>>>>> >>>>>> Alik Widge, MD, PhD >>>>>> Director, Translational NeuroEngineering Laboratory >>>>>> Division of Neurotherapeutics, Massachusetts General Hospital >>>>>> Assistant Professor of Psychiatry, Harvard Medical School >>>>>> Clinical Fellow, Picower Institute for Learning & Memory (MIT) >>>>>> awidge at partners.org >>>>>> http://scholar.harvard.edu/awidge/ >>>>>> 617-643-2580 >>>>>> >>>>>> Alik Widge >>>>>> alik.widge at gmail.com >>>>>> (206) 866-5435 >>>>>> >>>>>> >>>>>> On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) < >>>>>> e.maris at donders.ru.nl> wrote: >>>>>> >>>>>>> Note: this is the second time I post this reply, and the reason is >>>>>>> that I forgot to add an appropriate Subject (for findability) to my email >>>>>>> (shame on me…(-;) >>>>>>> >>>>>>> *From: *Elisabeth May >>>>>>> *Subject: **[FieldTrip] Question about cluster-based permutation >>>>>>> tests on linear mixed models* >>>>>>> *Date: *27 September 2016 at 14:46:55 GMT+2 >>>>>>> *To: * >>>>>>> *Reply-To: *FieldTrip discussion list >>>>>>> >>>>>>> >>>>>>> Dear FieldTripers, >>>>>>> >>>>>>> I have a question about the potential use of cluster-based >>>>>>> permutation tests for results obtained using linear mixed models. >>>>>>> >>>>>>> We are working with data from a 10 min EEG experiment on source >>>>>>> level with the aim to quantify the relationship of brain activity in >>>>>>> different frequency bands with continous perceptual ratings across 20 >>>>>>> subjects in different experimental conditions. Thus, we have 10 min time >>>>>>> courses of brain activity and ratings for each voxel for different >>>>>>> conditions and want to test a) if there are significant relationships in >>>>>>> the single conditions and b) if these relationships differ between two >>>>>>> conditions. To this end, I have calculated linear mixed models in R using >>>>>>> the lme4 toolbox. For both the single condition relationships and the >>>>>>> condition contrasts, they result in a single t-value (and a corresponding >>>>>>> p-value), which is based on information on both the single subject and the >>>>>>> group level (i.e. we perform a multi-level analysis). However, with more >>>>>>> than 2000 voxels, we have a lot of t-values and are wondering if there is a >>>>>>> way to apply cluster-based tests to correct for multiple comparisons. >>>>>>> >>>>>>> The main problem I see is that I only have one multilevel t-value >>>>>>> for the effect across all subjects, i.e. I don't have single subjects >>>>>>> values, which I could then e.g. randomize between conditions as normally >>>>>>> done in cluster-based permutation tests. (Or rather, I would be able to >>>>>>> extract single subject values but would then loose the advantage of the >>>>>>> multi-level analysis.) >>>>>>> >>>>>>> I found an old thread in the mailinglist archive where it was >>>>>>> suggested to flip the signs of the t-statistic for cluster-level correction >>>>>>> (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July >>>>>>> /005375.html). I understand that, in our case, I would do this >>>>>>> randomly for all voxels in each randomization and then build spatial >>>>>>> clusters on the resulting (partly flipped) t-values. However, I am not sure >>>>>>> if that is a valid approach based on the null hypothesis that there are no >>>>>>> significant relations in my single conditions (a) or no significant >>>>>>> relationship differences in my condition contrasts (b). >>>>>>> >>>>>>> For the condition contrasts, I would be able to permute the >>>>>>> condition labels as normally done in cluster-based permutation tests,I >>>>>>> think, but would then have to recalculate the linear mixed models for all >>>>>>> voxels in every permutation. This would result in a very high computational >>>>>>> load. >>>>>>> >>>>>>> Does anyone have any experience with this kind of analysis? Would >>>>>>> the flipping of t-values be a valid approach (and if yes, is there anything >>>>>>> to keep in mind in particular)? Can you think of other ways to combine >>>>>>> linear mixed models with a multiple comparison correction on the cluster >>>>>>> level? >>>>>>> >>>>>>> >>>>>>> Hi Elisabeth, >>>>>>> >>>>>>> I’m not an expert on linear mixed modelling, at least not with >>>>>>> respect to the different ways in which they can be used to deal with >>>>>>> correlated observations (typically, time series). However, from a >>>>>>> theoretical point of view, I do not see how these models could be combined >>>>>>> with permutation-based inference; they are just different statistical >>>>>>> frameworks. However, it IS possible to answer your questions ("we >>>>>>> have 10 min time courses of brain activity and ratings for each voxel for >>>>>>> different conditions and wan to test a) if there are significant >>>>>>> relationships in the single conditions and b) if these relationships differ >>>>>>> between two conditions.”) within the framework of cluster-based permutation >>>>>>> tests. Question b) is the most straightforward because it amounts to a >>>>>>> cluster-based permutation test using the depsamplesT statfun applied to the >>>>>>> regression coefficients in each of the two conditions. Answering question >>>>>>> a) requires that you bin your ratings in a number of categories, calculate >>>>>>> the trial-averaged EEG data for each of the categoreies, and test the >>>>>>> difference between them using a cluster-based permutation test using the >>>>>>> depsamplesregrT statfun. Both of these approaches have been described >>>>>>> previously on this discussion list, and for the depsamplesregrT statfun >>>>>>> (your question a), it was Vladimir Litvak who used it first (actually, I >>>>>>> implemented it for him). The approach for question b) is actually a variant >>>>>>> on the general approach for testing interactions using cluster-based >>>>>>> permutation tests. >>>>>>> >>>>>>> Have a look here: >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_corre >>>>>>> lations_between_neuronal_data_and_quantitative_stimulus_and_ >>>>>>> behavioural_variables >>>>>>> and >>>>>>> http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_intera >>>>>>> ction_effect_using_cluster-based_permutation_tests >>>>>>> >>>>>>> These tutorials provide all the necessary concepts, although they do >>>>>>> not answer your question in a recipe-like fashion. >>>>>>> >>>>>>> best, >>>>>>> Eric Maris >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Mon Oct 31 07:34:03 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Mon, 31 Oct 2016 06:34:03 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <3089E043-217F-49DC-A4D7-F33E00969FDE@donders.ru.nl> Hi Alik, So, two further questions. 1) Anyone reading this thread have some code for a reasonable ERP generator, especially one that models different ERPs per subject? I'm getting increasingly interested in doing some simulations to test my claims. (I'm thinking to do the 1d case just because it's faster to run. ) However, I'd like to do that on stimulated data that properly models, E.g., inter-subject variability of the precise timing of major peaks. 2) Eric, why are you describing the below as a fixed effects model? If we do a mixed model (with subject as a random intercept) at each time/frequency/sensor point, that seems like it handles the random effect that most people care about. Are you saying that you think each predictor variable would also need to be modeled as a per-subject slope? If you are permuting trials across conditions within every subject, this corresponds to the null hypothesis that WITHIN EVERY SUBJECT, there is no association between biological data and the condition labels. This is the permutation-version of a fixed-effects test. Keep in mind that you use your LMM t-stats only for thresholding and not for inference. I’m aware that this may be confusing at first sight. Actually, the topic (fixed versus random effects tests in the permutation framework) have not been described in a paper yet. I’m thinking about writing one, though... I guess I'm also thinking here that (to your second point), if the resulting values are used for thresholding to create cluster statistics for inference, inflation in the t/p values should be controlled for because the null distribution created during the permutation will have the same inflation. However, I don't believe I have a formal mathematical backup for that intuition, hence (1) above. The formal proof of the unbiasedness of the permutation test is in Maris & Oostenveld (2007), section "4.3.3. The permutation test controls the false alarm rate unconditionally”. I’m aware that very few readers go through this section, but it is one of the 2 reasons for the popularity of the method. The other reason is its sensitivity, which is the result of clustering. best, Eric On Oct 27, 2016 7:58 AM, "Maris, E.G.G. (Eric)" > wrote: Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip From: Müller, K. (Katja) > Subject: [FieldTrip] MNE single trial time courses Date: 28 October 2016 at 15:06:59 GMT+2 To: "fieldtrip at science.ru.nl" > Reply-To: FieldTrip discussion list > Dear list, What is the current way to go (if there is one) to obtain *single trial* source time courses from source reconstructions from Minimum Norm Estimate? Is there a tutorial? I used the MNE tutorial as a basis, i.e. I have a FreeSurfer based source model. In old mailing list messages there is some information about options like .rawtrial='yes' or .singletrial='yes', but some of them are very old and I am unable to extract which way to go at the moment. E.g. .singletrial is deprecated. Best regards, Katja From: mehdy dousty > Subject: [FieldTrip] Covaraince matrix for MEG resting state Date: 28 October 2016 at 18:49:03 GMT+2 To: "hcp-users at humanconnectome.org" >, > Reply-To: FieldTrip discussion list > Hi all I am using the resting state MEG signal for constructing the inverse problem by eLoreta, and as it is resting state, the covariance matrix needs to be used, so I am going to use HCP R-noise to construct the covariance matrix, but there are two main issues which I need your help. 1- as I am going to use preprocess data for resting state, do I need process the noise as well? if it is so, I can't find the time series of the noise in the raw data after using ft_read_header. 2- do I need to redefine the time series which add the noise time series at the beginning of the signal and then add the resting state time series so I can use the below code for computing the covariance? cfg= [] cfg.covariance = 'yes'; % I dont know how to enter the noise covariance to the data cfg.covariancewindow = [-inf 0]; timelockanalysis = ft_timelockanalysis(cfg, inputdata); I look forward to hearing from you. Mehdy Dousty Hotchkiss Brain Institute University of Calgary HSC Building, Room 2932B 3330 Hospital Drive NW Calgary, AB T2N 4N1 Email Mehdy.Dousty at Ucalgary.ca _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at donders.ru.nl Mon Oct 31 09:05:02 2016 From: e.maris at donders.ru.nl (Maris, E.G.G. (Eric)) Date: Mon, 31 Oct 2016 08:05:02 +0000 Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models In-Reply-To: References: Message-ID: <739EDB8F-B6F8-4502-998F-4210697B6B0F@donders.ru.nl> Hi David, @Eric 1. Note the FDR control actually provides "weak" control of the family-wise error rate (FWER). This is exactly the same degree of FWER control provided by cluster-based permutation tests. If you want strong control of FWER you will need to do something like Bonferroni-Holm or max-statistic (i.e., non-cluster) based permutation tests. Do you have a pointer to a statistics paper that proves that controlling the FDR (false discovery rate) implies a control of the family-wise error rate (FWER)? I agree that there is difference between strong an weak FWER control, but that is a different issue than FDR-control versus FWER-control. best, Eric 2. It's true that FDR assumes that the individual test p-values are accurate. You can derive these p-values though via non-parametric techniques like non-cluster-based permutation tests, thus the underlying statistical assumptions will be the same as if you had done a cluster-based permutation test. Moreover, if you have good reason to make parametric assumptions, FDR will let you exploit them. @Alik 1. I simulated data in that 2011 paper by randomly flipping the polarity of real EEG data to generate 0 mean, realistic ERP noise. The noise was subject-specific, but the simulated ERP effects were exactly the same for all simulated participants. So it couldn't be used to address the question you're after. On Thu, Oct 27, 2016 at 7:57 AM, Maris, E.G.G. (Eric) > wrote: Dear colleagues, @alik : 1. The approach you propose is a so-called fixed-effects approach, of which the outcome may depend on just a few subjects (provided the number of trials is high). Some neuroscientists consider a fixed-effects approach insufficient to support a scientific claim. E.g., the whole neuroimaging community does so. 2. Your approach is actually a genuine permutation test, in which the LLM-derived t-stats are only used for thresholding (and not for inference). @david : 1. There is nothing wrong with using FDR correction, if you think the false discovery rate is the quantity that one should control. Others may disagree though, stating the more strict family-wise error rate is the relevant quantity. 2. FDR correction assumes that the sample-specific (sample = a channel-time-frequency triplet) p-values are unbiased. Because the unbiasedness of these p-values depends on auxiliary assumptions, there may be good reasons not to trust them. This is supported by the recent Ekstrom et al paper on the inflated type 1 error rate in neuroimaging studies. best, Eric Maris From: David Groppe > Subject: Re: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 26 October 2016 at 19:35:03 GMT+2 To: FieldTrip discussion list >, > Reply-To: FieldTrip discussion list > P.S. If you want to explore using FDR control to correct for multiple comparisons, I would not recommend limiting yourself to FieldTrip's FDR correction code (fdr.m). It only implements the Benjamini-Yekutieli FDR control procedure, which is guaranteed to control the FDR at or below the desired level, but tends to be quite overly conservative in practice. The more popular FDR control algorithm by Benjamini & Hochberg is not always guaranteed to control the FDR at or below the desired level, but it is much less conservative and tends to accurately control FDR in practice. Here is some code for the Benjamini & Hochberg algorithm: https://www.mathworks.com/matlabcentral/fileexchange/27418-fdr-bh MATLAB's mafdr.m function that is part of the Bioinformatics toolbox also implements the Benjamini & Hochberg algorithm. On Tue, Oct 25, 2016 at 3:28 PM, David Groppe > wrote: I would definitely recommend running some simulations. It might be simpler to use bootstrap samples rather than permutations to generate your null distribution. Bootstrapping in also asymptotically accurate. -David On Tue, Oct 25, 2016 at 1:29 PM, Alik Widge > wrote: Thanks, that was super interesting! Was not aware of those. Have been meditating this afternoon on this and related Anderson papers. What's interesting is that he appears to think my suggestion below *would* be asymptotically acceptable -- *if* one specifically permutes the dependent variable (power/ERP observation) rather than permuting each column of the independent variables separately (i.e., if one preserves any correlational structure that exists between the independent variables). That's the Manly (1997) method, and it appears that the only reason it breaks down sometimes is if there's an outlier in the independent variable. This could presumably be a problem in the ecological sciences, for which he's writing, where one can't control things like temperature in a season or numbers of eels that swim past a given sensor. In cognitive neuroscience, where the predictor/independent variables are usually dummy coded properties of the trial, this seems like we might be on firmer ground. Opinion based on reading and reasoning, of course, and not to be trusted until and unless I or someone else were to back it up by doing some simulated-data experiments... Alik Widge alik.widge at gmail.com (206) 866-5435 On Tue, Oct 25, 2016 at 11:30 AM, David Groppe > wrote: Hi Elisabeth and Alik, Permutation methods applied to multiple regression models are not generally guaranteed to be accurate because testing individual terms in such models (e.g., partial correlation coefficients) requires accurate knowledge of other terms in the model (e.g., the slope coefficients for all the other predictors in the multiple regression). Because such parameters have to be estimated from the data, permutation tests are only ‘‘asymptotically exact’’ for such tests (Anderson, 2001; Good, 2005). Though there are special cases (e.g., a two factor ANOVA with two levels of each factor), where permutation methods do guarantee accuracy. In lieu of permutation testing, you might want to try using one of Benjamini and colleagues' false discovery rate (FDR) control algorithms to control for multiple comparisons. In my tests on simulated ERP data (Groppe et al., 2011), FDR correction was nearly as powerful as cluster-based permutation testing for detecting a very broadly distributed effect (e.g., a P300-like effect) and it was far more sensitive than cluster-based testing for an effect with a very limited distribution (e.g., an N170-like effect). FDR correction is also very computationally efficient. hope this is helpful, -David Refs: Anderson, M. J. (2001). Permutation tests for univariate or multivariate analysis of variance and regression. Canadian journal of fisheries and aquatic sciences, 58(3), 626-639. Good, P. I. (2005). Permutation, Parametric and Bootstrap Tests of Hypotheses: A Practical Guide to Resampling Methods for Testing Hypotheses. Groppe, D. M., Urbach, T. P., & Kutas, M. (2011). Mass univariate analysis of event‐related brain potentials/fields II: Simulation studies. Psychophysiology, 48(12), 1726-1737. On Fri, Oct 21, 2016 at 1:38 PM, Elisabeth May > wrote: Dear Eric and Alik, thanks a lot for your helpful responses! I will have a close look at the faqs, Eric, and test the approaches you outlined. I am curious, anyway, as to how different results will be for simple regressions compared to the multilevel results of the linear-mixed models. Like Alik, I am also curious about other people's opinions on the general question if there are theoretical reasons against a combination of the approaches like Alik suggested. We also thought about this approach but haven't fully tested it yet because of the very long calculation times. Thanks again and have a nice weekend! Elisabeth 2016-10-20 12:49 GMT+02:00 Alik Widge >: Eric, I don't think I understand why you would say "I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks". As you somewhat hint, the (G)LMM is a regression, and the beta coefficient for the independent-variable of interest at each voxel/vertex/sensor x timepoint can be interpreted as "how much does the independent variable explain the brain activity?" In that framework, it seems to me that one could do the following: for n=1:1000 1) Permute the condition labels (within subjects) of the individual trials 2) Re-fit the LMM at each (voxel,timepoint), creating a beta map and corresponding t-map 3) Threshold and construct cluster mass statistic as usual end 4) Identify cluster in the original (unpermuted) analysis and report cluster p-value Now, the main thing that has come up when we've tried to do this is that re-fitting a (voxel x time) GLM 1000 times by the standard iterative maximum-likelihood engines is remarkably slow. In fieldtrip, I can imagine it would require rewriting at least a statfun, maybe other pieces of the code. (We had an idea that, since the betas likely should vary smoothly over time and space, one could use the output of one GLM as the seed to the next, which would speed up convergence.) So it still does not seem like a good idea, but based on the above, is there actually a *theoretical* reason it wouldn't work? Alik Widge, MD, PhD Director, Translational NeuroEngineering Laboratory Division of Neurotherapeutics, Massachusetts General Hospital Assistant Professor of Psychiatry, Harvard Medical School Clinical Fellow, Picower Institute for Learning & Memory (MIT) awidge at partners.org http://scholar.harvard.edu/awidge/ 617-643-2580 Alik Widge alik.widge at gmail.com (206) 866-5435 On Thu, Oct 20, 2016 at 6:08 AM, Maris, E.G.G. (Eric) > wrote: Note: this is the second time I post this reply, and the reason is that I forgot to add an appropriate Subject (for findability) to my email (shame on me…(-;) From: Elisabeth May > Subject: [FieldTrip] Question about cluster-based permutation tests on linear mixed models Date: 27 September 2016 at 14:46:55 GMT+2 To: > Reply-To: FieldTrip discussion list > Dear FieldTripers, I have a question about the potential use of cluster-based permutation tests for results obtained using linear mixed models. We are working with data from a 10 min EEG experiment on source level with the aim to quantify the relationship of brain activity in different frequency bands with continous perceptual ratings across 20 subjects in different experimental conditions. Thus, we have 10 min time courses of brain activity and ratings for each voxel for different conditions and want to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions. To this end, I have calculated linear mixed models in R using the lme4 toolbox. For both the single condition relationships and the condition contrasts, they result in a single t-value (and a corresponding p-value), which is based on information on both the single subject and the group level (i.e. we perform a multi-level analysis). However, with more than 2000 voxels, we have a lot of t-values and are wondering if there is a way to apply cluster-based tests to correct for multiple comparisons. The main problem I see is that I only have one multilevel t-value for the effect across all subjects, i.e. I don't have single subjects values, which I could then e.g. randomize between conditions as normally done in cluster-based permutation tests. (Or rather, I would be able to extract single subject values but would then loose the advantage of the multi-level analysis.) I found an old thread in the mailinglist archive where it was suggested to flip the signs of the t-statistic for cluster-level correction (https://mailman.science.ru.nl/pipermail/fieldtrip/2012-July/005375.html). I understand that, in our case, I would do this randomly for all voxels in each randomization and then build spatial clusters on the resulting (partly flipped) t-values. However, I am not sure if that is a valid approach based on the null hypothesis that there are no significant relations in my single conditions (a) or no significant relationship differences in my condition contrasts (b). For the condition contrasts, I would be able to permute the condition labels as normally done in cluster-based permutation tests,I think, but would then have to recalculate the linear mixed models for all voxels in every permutation. This would result in a very high computational load. Does anyone have any experience with this kind of analysis? Would the flipping of t-values be a valid approach (and if yes, is there anything to keep in mind in particular)? Can you think of other ways to combine linear mixed models with a multiple comparison correction on the cluster level? Hi Elisabeth, I’m not an expert on linear mixed modelling, at least not with respect to the different ways in which they can be used to deal with correlated observations (typically, time series). However, from a theoretical point of view, I do not see how these models could be combined with permutation-based inference; they are just different statistical frameworks. However, it IS possible to answer your questions ("we have 10 min time courses of brain activity and ratings for each voxel for different conditions and wan to test a) if there are significant relationships in the single conditions and b) if these relationships differ between two conditions.”) within the framework of cluster-based permutation tests. Question b) is the most straightforward because it amounts to a cluster-based permutation test using the depsamplesT statfun applied to the regression coefficients in each of the two conditions. Answering question a) requires that you bin your ratings in a number of categories, calculate the trial-averaged EEG data for each of the categoreies, and test the difference between them using a cluster-based permutation test using the depsamplesregrT statfun. Both of these approaches have been described previously on this discussion list, and for the depsamplesregrT statfun (your question a), it was Vladimir Litvak who used it first (actually, I implemented it for him). The approach for question b) is actually a variant on the general approach for testing interactions using cluster-based permutation tests. Have a look here: http://www.fieldtriptoolbox.org/faq/how_can_i_test_for_correlations_between_neuronal_data_and_quantitative_stimulus_and_behavioural_variables and http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests These tutorials provide all the necessary concepts, although they do not answer your question in a recipe-like fashion. best, Eric Maris _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From justinctanner at gmail.com Mon Oct 31 20:15:15 2016 From: justinctanner at gmail.com (Justin Tanner) Date: Mon, 31 Oct 2016 12:15:15 -0700 Subject: [FieldTrip] ft_freqstatistics in a 2 way ANOVA - design and implementation Message-ID: I have a dataset consisting of 6 stimulation locations and 8 stimulation intensities. I am trying to calculate a 2 way (6 by 8) anova with regards to those two variables. Each input structure consists of freq_loc#{intensity#} output of ft_freqanalysis with just the chosen 10 trials of the respective conditions (so for location1 and intensity 1, chosen trial indices are indicated in cfg.trials). - cfg.keeptrials = 'yes' cfg.design = [loc ; int ; tri] 1 1 ... 1 1 ... 1 1 ... 1 1 ... 2 2 ... 2 2 ... 2 2 ... 2 2 ... 6 6 > ... 6 6 > 1 1 ... 1 1 ... 8 8 ... 8 8 ... 1 1 ... 1 1 ... 8 8 ... 8 8 ... 8 8 > ... 8 8 > 1 2 ... 9 10 ... 1 2 ... 9 10 ... 1 2 ... 9 10 ... 1 2 ... 9 10 ...1 2 ... > 9 10 > *OR* - cfg.keeptrials = 'no' cfg.design = [loc ; int] 1 1 ... 1 1 ... 1 1 ... 1 1 ... 2 2 ... 2 2 ... 2 2 ... 2 2 ... 6 6 > ... 6 6 > 1 1 ... 1 1 ... 8 8 ... 8 8 ... 1 1 ... 1 1 ... 8 8 ... 8 8 ... 8 8 > ... 8 8 For ft_freqstatistics: cfg.method = 'montecarlo'; > cfg.numrandomization = 500; cfg.correctm = 'bonferroni' % Going to do 'cluster' once I define my > distance function for neighbors > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.design=design; > cfg.statistic='indepsamplesF'; > cfg.correcttail = 'prob'; > > % Run with LOCATION as independent variable > cfg.ivar=[1]; > [stat_loc] = ft_freqstatistics(cfg, freq_loc0{:}, freq_loc1{:}, > freq_loc2{:}, freq_loc3{:}, freq_loc4{:}, freq_loc5{:}); % Run with INTENSITY as independent variable > cfg.ivar=[2]; [stat_int] = ft_freqstatistics(cfg, freq_loc0{:}, freq_loc1{:}, > freq_loc2{:}, freq_loc3{:}, freq_loc4{:}, freq_loc5{:}); > I want to ensure I am calling this appropriately. If I run it once with cfg.ivar =1 and again with cfg.ivar = 2, is that calculating the main effect of the cfg.design row's variable? First row is location, so running cfg.ivar=1 is giving me a [num_chan X TFR ] stat.stat/prob/mask for location, correct? I feel that I am missing something that would allow for both comparisons in one call of the ft_freqstatistics function, either in cfg properties or in the cfg.design structuring / ft_freqanalysis output structuring. Any clarification would be greatly appreciated. -- Justin C. Tanner Sensory Motor Research Group Arizona State University (360) 607-7544 -------------- next part -------------- An HTML attachment was scrubbed... URL: